### Docker Run Command for First Run with Proper Setup Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/activate.md Use this command to run FileBot Docker for the first time with a proper setup, ensuring data persistence and correct user configuration. It also shows how to get system information. ```bash docker run --rm -it -v data:/data -v /path/to/files:/volume1 rednoah/filebot -script fn:sysinfo ``` -------------------------------- ### FileBot Xpra Authentication Examples Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/configuration.md Examples for setting the XPRA_AUTH environment variable for authentication modes. ```bash -e XPRA_AUTH=none # No authentication ``` ```bash -e XPRA_AUTH="password:value=secret123" # Password authentication ``` -------------------------------- ### Welcome Banner Example Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/activate.md This section of the output provides a friendly greeting, a link to the FAQ, and an example command for activating a FileBot license. ```text -------------------------------------------------------------------------------- Hello! Do you need help Getting Started? # FAQ https://www.filebot.net/linux/docker.html # Read License Key from Console docker run --rm -it -v data:/data -e PUID=$(id -u) -e PGID=$(id -g) rednoah/filebot --license -------------------------------------------------------------------------------- ``` -------------------------------- ### FileBot Xpra Options Examples Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/configuration.md Examples for setting the XPRA_OPTS environment variable with additional xpra command-line arguments. ```bash -e XPRA_OPTS="--video-scaling=1 --quality=50" # Lower quality for bandwidth ``` ```bash -e XPRA_OPTS="--min-quality=80 --video-scaling=0" # High quality, no scaling ``` -------------------------------- ### FileBot Base Configuration OPTS Examples Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/configuration.md Examples of additional Java/FileBot command-line arguments for the FILEBOT_OPTS variable. ```bash -Dapplication.deployment=docker -Dnet.filebot.UserFiles.trash=XDG -XX:SharedArchiveFile=/usr/share/filebot/jsa/classes.jsa -Duser.home="$HOME" ``` -------------------------------- ### Home Directory Setup Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/run-as-user.md Shows the commands for creating and setting ownership of the user's home directory. ```bash mkdir -p "$HOME" chown -R "$PUID:$PGID" "$HOME" ``` -------------------------------- ### Read-Only Mount Example Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/volume-mounts.md Example of running FileBot with a read-only archive source and a writable output directory. ```bash docker run \ -v /archive/completed:/volume1:ro \ -v /output:/output \ rednoah/filebot -rename -r /volume1 --output /output ``` -------------------------------- ### Enable and Start Systemd Timer Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Commands to enable the FileBot cleanup timer to start on boot, start it immediately, and check its status. ```bash sudo systemctl enable filebot-cleanup.timer sudo systemctl start filebot-cleanup.timer sudo systemctl status filebot-cleanup.timer ``` -------------------------------- ### Example Custom Environment Variables Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/node-task-executor.md Provides examples of setting custom proxy and Java options for FileBot. These variables can be exported in the environment script. ```bash # Custom proxy settings export HTTP_PROXY=http://proxy.example.com:3128 export HTTPS_PROXY=http://proxy.example.com:3128 # Custom Java settings export FILEBOT_OPTS="-Xmx2g -Dnet.filebot.UserFiles.trash=NO" ``` -------------------------------- ### Environment Display Example Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/activate.md Displays the current user and home directory. This helps verify that privilege separation is working correctly. ```text # env USER=filebot(1000) HOME=/data ``` -------------------------------- ### Multiple File Mounts Example Script Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/volume-mounts.md An example script demonstrating how to mount multiple read-only media sources and a writable output directory for FileBot's AMC script. ```bash docker run \ -v data:/data \ -v /movies:/movies:ro \ -v /tv:/tv:ro \ -v /music:/music:ro \ -v /organized:/output \ rednoah/filebot -script fn:amc \ /movies /tv /music \ --output /output ``` -------------------------------- ### Example Log File Path Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/node-task-executor.md Provides a concrete example of a FileBot task log file path, including a sample task ID. ```bash /data/node/log/task_1234567890.log ``` -------------------------------- ### Get URL Action Parameters Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/connect.html Determines the user's intended action (connect, start, start-desktop, shadow) and extracts relevant parameters like display or start command from the form. Returns a Map containing the action and its associated parameters. ```javascript function get_URL_action() { let start = ""; let display = ""; let action = ""; if (document.getElementById("action_connect").checked) { action = "connect"; display = get_visible_value("display", "select_display"); } else if (document.getElementById("action_start").checked) { action = "start"; start = get_visible_value("start_command", "command_entry"); } else if (document.getElementById("action_start_desktop").checked) { action = "start-desktop"; start = get_visible_value("start_desktop_command", "desktop_entry"); } else if (document.getElementById("action_shadow").checked) { action = "shadow"; display = get_visible_value("shadow_display", "select_shadow_display"); } const url_action = new Map(); if (action) { url_action.set("action", action); } if (start) { url_action.set("start", start); } if (display) { url_action.set("display", display); } return url_action; } ``` -------------------------------- ### Start Basic WebDAV Server Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Starts a FileBot WebDAV server with basic authentication enabled. Mounts a local directory to /volume1 and exposes the server on port 8080. ```bash docker run -e USERNAME=alice -e PASSWORD=secret123 \ -v /path/to/files:/volume1 \ -p 8080:8080 \ rednoah/filebot:webdav ``` -------------------------------- ### Docker ENTRYPOINT Configuration Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/run-as-user.md Example of how the run-as-user script is integrated into a Docker container's ENTRYPOINT for consistent privilege handling. ```dockerfile ENTRYPOINT ["/opt/bin/run-as-user", "/opt/bin/run", "/usr/bin/filebot"] ``` -------------------------------- ### Equivalent Command for Task File Arguments Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/node-task-executor.md Shows the equivalent command-line execution for the arguments provided in the task file example. ```bash filebot -script fn:amc /volume1/input --output /volume1/output \ --action duplicate --conflict auto -non-strict \ --def unsorted=y --def music=y --def artwork=y ``` -------------------------------- ### Example Task Execution Flow Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/endpoints.md Demonstrates a typical workflow for creating, executing, and checking logs for a remote FileBot task. ```bash TASK_ID="task_$(date +%s)" curl "http://localhost:5452/task?id=$TASK_ID" ``` ```bash docker exec filebot-node cat /data/node/log/$TASK_ID.log ``` -------------------------------- ### Standard FileBot Execution Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/run.md Execute FileBot with a standard command to get system information. This example shows the output when a license is missing. ```bash /opt/bin/run /usr/bin/filebot -script fn:sysinfo ``` ```text -------------------------------------------------------------------------------- Hello! Do you need help Getting Started? # FAQ https://www.filebot.net/linux/docker.html # Read License Key from Console docker run --rm -it -v data:/data -e PUID=$(id -u) -e PGID=$(id -g) rednoah/filebot --license -------------------------------------------------------------------------------- # env USER=filebot(1000) HOME=/data ``` -------------------------------- ### Start Apache HTTPD Server Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Starts the Apache HTTPD server in foreground mode. This command is executed as PID 1, allowing for graceful shutdown. ```bash exec /usr/local/apache2/bin/httpd -D FOREGROUND ``` -------------------------------- ### Example User Hash Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Provides an example of a user entry in the Apache Digest authentication password file. ```plaintext alice:WebDAV:5a4c4e1a123456789abcdef0123456789 ``` -------------------------------- ### Start WebDAV Server with Custom Port and Realm Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Starts a FileBot WebDAV server with custom authentication realm and port. Mounts a local directory to /volume1 and exposes the server on port 9090. ```bash docker run -e REALM="MediaServer" -e PORT=9090 \ -e USERNAME=mediauser -e PASSWORD=pass123 \ -v /path/to/files:/volume1 \ -p 9090:9090 \ rednoah/filebot:webdav ``` -------------------------------- ### Start Interactive Shell Session Source: https://github.com/filebot/filebot-docker/blob/master/README.md Use the --entrypoint option to override the default entrypoint and start a bash shell within the container. This allows direct interaction with the FileBot CLI. ```bash docker run --rm -it -v "data:/data" -v "$PWD:/volume1" -e PUID=1000 -e PGID=1000 --entrypoint /opt/bin/run-as-user rednoah/filebot bash ``` -------------------------------- ### Docker Run Volume Syntax Examples Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/volume-mounts.md Illustrates different ways to specify volume mounts in Docker run commands, including bind mounts, named volumes, and read-only mounts. ```bash # Bind mount (host path) -v /host/path:/container/path # Named volume -v volume-name:/container/path # Bind mount, read-only -v /host/path:/container/path:ro # Tmpfs mount --tmpfs /tmp:size=1g ``` -------------------------------- ### Start Docker Compose Stack Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Use this command to start all services defined in your docker-compose.yml file in detached mode. ```bash docker-compose up -d ``` -------------------------------- ### Task Arguments File Structure Example Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/node-task-executor.md Example of the structure for a FileBot task arguments file, where each line represents a single argument. ```plaintext -script fn:amc /volume1/input --output /volume1/output --action duplicate --conflict auto -non-strict --def unsorted=y --def music=y --def artwork=y ``` -------------------------------- ### Start WebDAV Server with Anonymous Access Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Starts a FileBot WebDAV server allowing access without credentials. Mounts a local directory to /volume1 and exposes the server on port 8080. ```bash docker run -e USERNAME=anonymous -e PASSWORD= \ -v /path/to/files:/volume1 \ -p 8080:8080 \ rednoah/filebot:webdav ``` -------------------------------- ### Example File Structure for Task Arguments Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/node-task-executor.md Illustrates a typical directory structure containing various FileBot task argument files. ```bash /data/node/task/task_1234567890.args /data/node/task/my_organization_task.args /data/node/task/weekly_media_sync.args ``` -------------------------------- ### Start Filebot Docker Container for Remote Desktop (Xpra) Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/README.md Starts a Filebot container with Xpra for remote desktop access. This allows you to control the Filebot environment graphically from a remote machine. ```bash # Remote desktop docker run -d -v data:/data -p 5454:5454 rednoah/filebot:xpra ``` -------------------------------- ### Setup FileBot Projector for Web-Based GUI Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Deploy the FileBot Projector container for a modern, responsive web-based FileBot interface accessible from any browser. ```bash docker run -d --name filebot-projector \ -v data:/data \ -v /media:/volume1 \ -p 8887:8887 \ rednoah/filebot:projector ``` -------------------------------- ### Example Password File Entry Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Illustrates the format for a single user entry in the Apache Digest authentication password file. ```plaintext username:realm:hash ``` -------------------------------- ### Configure OpenSubtitles via Environment Variables Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/configuration.md Configure OpenSubtitles credentials using environment variables, which may be supported by some container setups. ```bash docker run --rm -it -v data:/data \ -e OSDB_USER=USERNAME \ -e OSDB_PASS=PASSWORD \ rednoah/filebot -script fn:configure ``` -------------------------------- ### Configure Session Start and Exit Behavior Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html Control how new sessions are started and how the client or its children exit. Useful for managing complex multi-session or automated scenarios. ```javascript client.start_new_session = sns; ``` -------------------------------- ### Install License Key via Command Line Source: https://github.com/filebot/filebot-docker/blob/master/README.md Mount the license file into the container at the expected file path directly via your launch configuration. Ensure the persistent data volume is also mounted. ```docker docker run --rm -it -v "data:/data" -v "$PWD:/volume1" rednoah/filebot --license /volume1/T1000.psm ``` -------------------------------- ### Docker Compose Volume Syntax Examples Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/volume-mounts.md Shows various syntaxes for defining volumes in Docker Compose files, including bind mounts, named volumes, anonymous volumes, and extended syntax. ```yaml volumes: - /host/path:/container/path # Bind mount - volume-name:/container/path # Named volume - /host/path:/container/path:ro # Read-only bind - /container/tmp # Anonymous volume - type: bind # Extended syntax source: /host/path target: /container/path read_only: true ``` -------------------------------- ### Multi-User NAS Setup with Docker Compose Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Deploy FileBot services on a NAS using Docker Compose to share a single instance across multiple users. This setup includes a watcher and a WebDAV server. ```yaml version: '3.9' services: watcher: image: rednoah/filebot:watcher restart: unless-stopped volumes: - /mnt/media/data:/data - /mnt/media/files:/volume1 command: /volume1/incoming --output /volume1/organized webdav: image: rednoah/filebot:webdav restart: unless-stopped volumes: - /mnt/media/files:/volume1 ports: - "8080:8080" environment: - USERNAME=admin - PASSWORD=admin_secure ``` -------------------------------- ### Install License Key via File Mount Source: https://github.com/filebot/filebot-docker/blob/master/README.md Mount the license file directly into the container at the expected path. Ensure the persistent data volume is also mounted. ```docker docker run --rm -it -v "data:/data" -v "/path/to/FileBot_License_P12345678.psm:/data/filebot/license.txt" -v "/path/to/files:/volume1" rednoah/filebot -script fn:sysinfo ``` ```yaml version: '3.3' services: filebot: container_name: filebot image: rednoah/filebot volumes: - data:/data - /path/to/FileBot_License_P12345678.psm:/data/filebot/license.txt - /path/to/files:/volume1 command: -script fn:sysinfo volumes: data: name: filebot-application-data ``` -------------------------------- ### Start Filebot Docker Container for Command-line Processing Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/README.md Use this command to start a Filebot container for batch processing files via the command line. It mounts local directories for data and media, and outputs results to a specified location. ```bash # Command-line processing docker run --rm -it -v data:/data -v /media:/volume1 rednoah/filebot \ -script fn:amc /volume1 --output /volume1/output ``` -------------------------------- ### Run FileBot Projector Container Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/container-variants.md Starts the FileBot Projector container, providing a modern web-based GUI. It maps the default Projector port for browser access. ```bash docker run -d -v data:/data -v /media:/volume1 \ -p 8887:8887 \ rednoah/filebot:projector ``` -------------------------------- ### Build FileBot Projector Web GUI Image Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/build-system.md Builds the JetBrains Projector Docker image for a web-based GUI. It starts the GUI accessible on port 8887 and mounts the data directory. ```bash make filebot-projector ``` -------------------------------- ### Mount Data Volume for FileBot Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/run.md Example of mounting both a named data volume and a host directory for FileBot processing. Ensure the host path exists and has appropriate permissions. ```bash docker run -v data:/data -v /path/to/files:/volume1 rednoah/filebot ``` -------------------------------- ### Overlay Filesystem Warning Example Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/activate.md Warns users if their home directory is mounted on a temporary overlayfs, indicating that data will be lost on container shutdown. It suggests using persistent volume mounts. ```text !!! YOU DID NOT BIND MOUNT $HOME TO A PERSISTENT HOST FOLDER !!! All data stored to the application data folder `$HOME` will be lost on container shutdown, like tears in rain. Please add `-v data:/data` to your `docker` command lest your application data, such as license key, be lost in time. ``` -------------------------------- ### Docker Run Command for Root User Setup Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/activate.md This command demonstrates running FileBot Docker as the root user. The output will include a warning about running as root. ```bash docker run --rm -it -e PUID=0 -v data:/data rednoah/filebot -script fn:sysinfo ``` -------------------------------- ### Import User Environment Script Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/node-task-executor.md Sources a user-defined environment script if it exists. This allows for custom environment variable setup before task execution. ```bash # import user environment if [ -f "$FILEBOT_NODE_DATA/environment.sh" ]; then source "$FILEBOT_NODE_DATA/environment.sh" fi ``` -------------------------------- ### Start Filebot Docker Container for Web-based GUI Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/README.md Launches a Filebot container to provide a web-based graphical user interface. This offers a user-friendly way to interact with Filebot's features through a browser. ```bash # Web-based GUI docker run -d -v data:/data -p 8887:8887 rednoah/filebot:projector ``` -------------------------------- ### Setup FileBot WebDAV for File Sharing Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Deploy the FileBot WebDAV container to share files and mount the volume as a network drive on various client operating systems. ```bash docker run -d --name filebot-webdav \ -v /media:/volume1 \ -p 8080:8080 \ -e USERNAME=alice \ -e PASSWORD=secret123 ``` -------------------------------- ### Setup FileBot Watcher for Automatic Media Organization Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Continuously monitors a folder and automatically organizes new files using the watcher container. Configure SETTLE_DOWN_TIME based on network speed. ```bash docker run -d --name filebot-watcher \ -v data:/data \ -v /media:/volume1 \ -e SETTLE_DOWN_TIME=30 \ -e PUID=1000 -e PGID=1000 \ rednoah/filebot:watcher /volume1/input --output /volume1/output ``` -------------------------------- ### Standard Privilege Drop Example Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/run-as-user.md Executes FileBot as the default unprivileged user (UID/GID 1000:1000) using the run-as-user script. ```bash /opt/bin/run-as-user /opt/bin/run /usr/bin/filebot -script fn:sysinfo ``` -------------------------------- ### Setup FileBot Xpra for Remote Desktop Access Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Deploy the FileBot Xpra container to provide interactive GUI access via remote desktop. Configure XPRA_AUTH for password protection. ```bash docker run -d --name filebot-xpra \ -v data:/data \ -v /media:/volume1 \ -p 5454:5454 \ -e XPRA_AUTH="password:value=secure123" \ rednoah/filebot:xpra ``` -------------------------------- ### Setup FileBot Node for Web Interface and Task Scheduling Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Deploy the FileBot node container to manage tasks via a web UI and execute them remotely. Ensure the correct ports are exposed. ```bash docker run -d --name filebot-node \ -v data:/data \ -v /media:/volume1 \ -p 5452:5452 \ -e PUID=1000 -e PGID=1000 \ rednoah/filebot:node ``` -------------------------------- ### Build FileBot Web Interface Image Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/build-system.md Builds the Node.js-based web interface Docker image. It starts the container with the web server exposed on port 5452 and mounts local directories. ```bash make filebot-node ``` -------------------------------- ### Root User Warning Example Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/activate.md A warning displayed when the container is running as the root user, highlighting security risks and potential issues with license activation and file ownership. ```text !!! YOU ARE RUNNING AS ROOT AND NOT AS NORMAL USER !!! ``` -------------------------------- ### Build FileBot WebDAV Server Image Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/build-system.md Builds an Apache-based WebDAV server Docker image. It starts the server on port 8080 with configurable user credentials and mounts the volume directory. ```bash make filebot-webdav ``` -------------------------------- ### User Account Creation Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/run-as-user.md Demonstrates the standard Unix commands used to create a new user and group if they do not exist. ```bash addgroup "$PGROUP" --gid "$PGID" adduser "$PUSER" --uid "$PUID" --gid "$PGID" --gecos "" --home "$HOME" --disabled-password ``` -------------------------------- ### Initialize Virtual Keyboard Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html Sets up and manages a virtual keyboard using the SimpleKeyboard library. It handles key press and release events, and toggles keyboard visibility. ```javascript function init_keyboard(client) { const Keyboard = window.SimpleKeyboard.default; let kb = new Keyboard({ onKeyPress: (button) => onKeyPress(button), onKeyReleased: (button) => onKeyReleased(button), display: { ".com": "|", "{tab}": "tab", "{lock}": "lock", "{shift}": "shift", "{bksp}": "bksp", "{space}": "space", "{enter}": "return", }, }); window.kb = kb; window.keyboardShifted = false; function onChange(input) { clog("Input changed", input); } function onKeyPress(button) { forward_key(true, button); if (button == "{shift}" || button == "{lock}") { if (window.keyboardShifted) { window.kb.setOptions({ layoutName: "default" }); } else { window.kb.setOptions({ layoutName: "shift" }); } window.keyboardShifted = !window.keyboardShifted; } } function onKeyReleased(button) { forward_key(false, button); } function forward_key(pressed, button) { let key = { "{bksp}": "Backspace", "{enter}": "Return", "{space}": "Space", "{tab}": "Tab", "{lock}": "CapsLock", "{shift}": "Shift", ".com": "|", }[button] || button; let e = { which: 0, keyCode: 0, key: key, code: key, }; client._keyb_process(pressed, e); } const keyboard = getboolparam("keyboard", Utilities.isMobile()); if (!keyboard) { $(".simple-keyboard").hide(); $("#keyboard_button").removeClass("icon-toggled"); } else { $(".simple-keyboard").show(); $("#keyboard_button").addClass("icon-toggled"); } } function toggle_keyboard() { $(".simple-keyboard").toggle(); if ($(".simple-keyboard").is(":visible")) { $("#keyboard_button").addClass("icon-toggled"); } else { $("#keyboard_button").removeClass("icon-toggled"); } } ``` -------------------------------- ### File Download Initiation Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html Hides the menu content and initiates a file download by sending a 'start-command' with 'Client-Download-File' to the server. ```javascript function download_file(event) { $(".menu-content").slideUp(); const command = ["xpra", "send-file"] client.send(["start-command", "Client-Download-File", command, true, true]); } ``` -------------------------------- ### Configure OpenSubtitles Login via Arguments Source: https://github.com/filebot/filebot-docker/blob/master/README.md Pass OpenSubtitles username and password directly as arguments to the configure script. Ensure the persistent data volume is mounted. ```bash docker run --rm -it -v "data:/data" rednoah/filebot -script fn:configure --def osdbUser=USERNAME --def osdbPwd=PASSWORD ``` -------------------------------- ### Docker ENTRYPOINT Configuration Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/run.md Sets up the FileBot Docker container's entrypoint to chain execution through helper scripts before running the main FileBot application. ```dockerfile ENTRYPOINT ["/opt/bin/run-as-user", "/opt/bin/run", "/usr/bin/filebot"] ``` -------------------------------- ### Clean APT Packages to Reduce Image Size Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/build-system.md This command installs packages and then removes APT metadata to save disk space. Ensure DEBIAN_FRONTEND is set to noninteractive for automated installations. ```dockerfile DEBIAN_FRONTEND=noninteractive apt-get install -y package1 package2 \ && rm -rvf /var/lib/apt/lists/* ``` -------------------------------- ### Pre-create Directory with Correct Ownership Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/volume-mounts.md Manually creates a directory on the host and sets its ownership to the expected container user ID (e.g., 1000). ```bash mkdir -p /path/to/output chown 1000:1000 /path/to/output chmod 755 /path/to/output ``` -------------------------------- ### Custom Environment Script Path Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/node-task-executor.md Specifies the path for a custom environment script that can be used for additional setup. ```bash /data/node/environment.sh ``` -------------------------------- ### Restart Container Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Restart the WebDAV container, which includes stopping the current instance, reinitializing data, and starting a new one. ```bash docker restart webdav ``` -------------------------------- ### Initialize Xpra Client and Page Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html Initializes the Xpra client, sets up event listeners for page unload and beforeunload events, and configures client callbacks for connection and visibility changes. This is the main entry point for the web client's functionality. ```javascript let client; function init_page() { clog("initializing page"); const touchaction = getstrparam("touchaction") || "scroll"; touchaction_scroll = touchaction == "scroll"; set_touchaction(); window.cursor_lock = false; init_auth_autosubmit(); client = init_client(); addEventListener( "unload", () => { clog("onunload ()"); client.close(); }, { capture: true } ); addEventListener( "beforeunload", (event) => { const aft = client.active_file_transfers(); clog("beforeunload (", event, ") active_file_transfers()=", aft); if (aft > 0) { //This text is now ignored by all browsers... event.returnValue = "There are file transfers in progress.\nAre you sure you want to leave?"; } return event.returnValue; }, { capture: true } ); client.on_connect = function() { init_float_menu(); if (client.clipboard_enabled) { enable_clipboard_autofocus(); } client.capture_keyboard = true; }; const blocked_hosts = (getstrparam("blocked-hosts") || "").split(","); if (blocked_hosts.indexOf(client.host.toLowerCase()) >= 0) { const sane_host = client.host.replace(/[^A-Za-z0-9\.\:]/g, ""); client.callback_close("connection to host '" + sane_host + "' blocked"); } else { client.connect(); } //from now on, send log and debug to client //which may forward it to the server once connected: clog = function() { if (client) { client.log.apply(client, arguments); } }; cdebug = function() { if (client) { client.debug.apply(client, arguments); } }; clog("initializing subsystems"); init_tablet_input(client); init_clipboard(client); init_file_transfer(client); init_keyboard(client); init_clock(client, getboolparam("clock", true)); init_audio(client); document.addEventListener("visibilitychange", function(e) { const window_ids = Object.keys(client.id_to_window).map(Number); clog("visibilitychange hidden=", document.hidden, "connected=", client.connected); if (client.connected) { if (document.hidden) { client.suspend(); } else { client.resume(); } } }); client.password_prompt_fn = password_prompt_fn; client.keycloak_prompt_fn = keycloak_prompt_fn; $("#fullscreen").on("click", function(e) { toggle_fullscreen(); }); $("#fullscreen_button").on("click", function(e) { toggle_fullscreen(); }); $("#keyboard_button").on("click", function(e) { toggle_keyboard(); }); $("#clipboard_button").on("click", function(e) { client.read_clipboard(e); }); $(".windowinfocus").children("canvas").on("click", function(e) { const isPointerLocked = Boolean(document.pointerLockElement); if (isPointerLocked) { return; } if (window.cursor_lock && !isPointerLocked) { const focusedWindow = document.getElementById(client.topwindow.toString()); focusedWindow.querySelector("canvas").requestPointerLock(); $("#cursor_lock_button").removeClass("icon-paused"); } }); $("#cursor_lock_button").on("click", function(e) { if (!window.cursor_lock) { window.cursor_lock = true; window.alert("You are now in cursor lock mode. Press ESC to temporarily exit, and click on the screen to enter it again."); const focusedWindow = client.id_to_window[client.topwindow]; focusedWindow.canvas.requestPointerLock(); $("#cursor_lock_button").addClass("icon-toggled"); return; } window.cursor_lock = false; document.exitPointerLock(); $("#cursor_lock_button").removeClass("icon-toggled icon-paused"); }); document.addEventListener("pointerlockchange", function(e) { if (!(Boolean(document.pointerLockElement)) && window.cursor_lock) { $("#cursor_lock_button").addClass("icon-paused"); } }); // Configure Xpra tray window list right click behavior. $("#open_windows_list") .siblings("a") .on("mousedown", (e) => { if (e.buttons === 2) { client.toggle_window_preview(); } }); $(document).on("fullscreenchange", function() { const f_el = document.fullscreenElement; clog("fullscreenchange:", f_el); if (f_el == null) { //we're not in fullscreen mode now, so show fullscreen icon again: $("#fullscreen_button").attr("data-icon", "fullscreen"); } }); // disable right click menu: window.oncontextmenu = function(e) { const direction = client.clipboar ``` -------------------------------- ### Configure OpenSubtitles Login via Console Source: https://github.com/filebot/filebot-docker/blob/master/README.md Run the configure script within the container to interactively enter OpenSubtitles credentials. Ensure the persistent data volume is mounted. ```bash docker run --rm -it -v "data:/data" rednoah/filebot -script fn:configure ``` -------------------------------- ### Create and Execute Direct Task File Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/node-task-executor.md Manually create a task arguments file and then execute it using the docker exec command. This allows for complex task configurations for testing or advanced usage. ```bash # Create task arguments file cat > /data/node/task/manual_task.args << 'EOF' -script fn:amc /volume1/input --output /volume1/output --action duplicate --conflict auto EOF # Execute task docker exec filebot-node /opt/filebot-node/task manual_task.args ``` -------------------------------- ### Sample Data Initialization Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/crypto.html Initializes sample data with associated cryptographic hashes. This is used for testing purposes. ```javascript samples.set("9073697a652d636f6e73747261696e74736a89626173652d73697a65c2130489696e6372656d656e74c2060d8767726176697479018c6d696e696d756d2d73697a65c219118669636f6e6963446607", "fc3e3fbd6b2f7c0836e554ad40ed543c008c2be86f12ac0e0f76f7bde1181bbe1b5cad6308a4e6f22f3c5dd1804217d9e3ea56d439a0c49424264d928b6e8a60a20eb810ba0588525673604627d114911d6b97b385a6df078848db2ab5bc978a260e3103ce3af0dcdafa499eae4d88dff9a5d1714d5fd738df3fc4e4cc8aa3f26008fd3ce49992e88c9f2c476b00c441ad0374cba6fea1b4a27dc39c444f52affae4f3640ffe34590935194fb16e147d9c5c0479c5ec5fb3b228006467fe7a1d"); samples.set("c38e73657474696e672d6368616e6765887864672d6d656e7566", "0ff97c8e05b7a6e4a3608801cc105f21c18e3b53115c65af35e76732a4396664"); samples.set("c190737461727475702d636f6d706c657465", "0c1f485983484a0348a3760616ec4c08848f480a8e2831b3035aa067e7769b18"); ``` -------------------------------- ### Error Handling for Key Operations Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/crypto.html Handles errors during AES key derivation and import. This is part of the cryptographic setup process. ```javascript .catch(err => { show("failed to derive AES key: " + err); }); }) .catch(err => { show("failed to import AES key: " + err); }); ``` -------------------------------- ### Document Ready and Initial Page Load Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html Initializes the Xpra web client by logging browser information and loading default settings when the document is ready. ```javascript $(document).ready(function() { clog("document is ready, browser is", navigator.platform, "64-bit:", Utilities.is_64bit()); load_default_settings(); }); ``` -------------------------------- ### httpd.conf Main Configuration Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Key settings for the main Apache HTTPd configuration file. Environment variables are interpolated by the shell before Apache starts. ```apache Listen ${PORT} ServerRoot "/usr/local/apache2" ServerName ${HOST}:${PORT} DocumentRoot "${ROOT}/" ErrorLog /dev/stderr CustomLog /proc/self/fd/1 common ``` -------------------------------- ### FileBot Watcher Docker Entrypoint Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/filebot-watcher.md Specifies the container entrypoint for FileBot Watcher, defining the sequence of commands executed upon container start. ```dockerfile ENTRYPOINT ["/opt/bin/run-as-user", "/opt/bin/run", "/opt/bin/filebot-watcher"] ``` -------------------------------- ### Run-As-User Wrapper for HTTPD Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md The Dockerfile ENTRYPOINT uses 'run-as-user' to launch the httpd process, ensuring privilege dropping for security. ```dockerfile ENTRYPOINT ["/opt/bin/run-as-user", "/opt/bin/httpd"] ``` -------------------------------- ### Scheduled FileBot Processing with Cron Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Automate FileBot batch processing by scheduling a cron job. This example runs every night at 2 AM. ```bash # Every night at 2 AM 0 2 * * * docker run --rm -v data:/data -v /media:/volume1 rednoah/filebot \ -script fn:amc /volume1/input --output /volume1/output --action duplicate ``` -------------------------------- ### Change Port Configuration Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/webdav-httpd.md Modify the port mapping for the WebDAV container to resolve 'Address already in use' errors. This example changes the host port to 9090. ```bash docker run --user 1000:1000 rednoah/filebot:webdav -e PORT=9090 -p 9090:9090 ``` -------------------------------- ### Initialize Audio State Handling Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html Sets up an event listener for audio state changes and handles user clicks on the sound button to control audio playback. It updates UI elements like icons and tooltips based on the audio state. ```javascript function init_audio(client) { client.on_audio_state_change = function(newstate, details) { if (client.audio_state === newstate) { return; } client.audio_state = newstate; let tooltip; let data_icon; const sound_button_element = $("#sound_button"); if (newstate === "disabled") { data_icon = "volume_up"; tooltip = "audio is not available"; sound_button_element.css("color", "#777"); } else if (newstate === "playing") { data_icon = "volume_up"; tooltip = "audio playing,\nclick to stop"; } else if (newstate === "waiting") { data_icon = "volume_up"; tooltip = "audio buffering"; } else { data_icon = "volume_off"; tooltip = "audio off,\nclick to start"; } clog("audio-state:", newstate); sound_button_element.attr("data-icon", data_icon); sound_button_element.attr("title", tooltip); }; $("#sound_button").click(function() { clog("speaker icon clicked, audio_enabled=", client.audio_enabled); if (!client.audio_enabled) { client.audio_state = "disabled"; } else if ( client.audio_state === "playing" || client.audio_state === "waiting" ) { client.on_audio_state_change("stopped", "user action"); client.close_audio(); } else { client.on_audio_state_change("waiting", "user action"); client._audio_start_stream(); client._sound_start_receiving(); } }); } ``` -------------------------------- ### FileBot Node Basic Authentication Example Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/endpoints.md Use this cURL command for Basic Authentication with FileBot Node. Ensure you replace 'filebot_user' and 'password123' with your actual credentials. ```bash # Header format Authorization: Basic base64(username:password) # Example curl -u "filebot_user:password123" http://localhost:5452/task?id=mytask ``` -------------------------------- ### Creating and Configuring XpraClient Instance in JavaScript Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html This code initializes the XpraClient with essential parameters and configures various client-side features. It sets up debugging, remote logging, clipboard handling, file transfer, and other connection-related options based on the previously extracted parameters. ```javascript const client = new XpraClient("screen"); client.debug_categories = debug_categories; client.remote_logging = remote_logging; client.sharing = sharing; client.insecure = insecure; client.clipboard_enabled = clipboard; client.clipboard_poll = clipboard_poll; client.clipboard_preferred_format = clipboard_preferred_format; client.printing = printing; client.file_transfer = file_transfer; client.bandwidth_limit = bandwidth_limit; client.steal = steal; client.reconnect = reconnect; client.swap_keys = swap_keys; client.on_connection_progress = connection_progress; client.scroll_reverse_x = scroll_reverse_x; client.scroll_reverse_y = scroll_reverse_y; client.vrefresh = vrefresh; client.scale = scale; ``` -------------------------------- ### Start Filebot Docker Container for Web Interface Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/README.md Launches a Filebot container in detached mode to provide a web interface. This is useful for interactive management and configuration through a browser. ```bash # Web interface docker run -d -v data:/data -v /media:/volume1 -p 5452:5452 rednoah/filebot:node ``` -------------------------------- ### Initialize Clock Synchronization Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html Sets up a clock display that synchronizes with the server time. It periodically updates the displayed time based on ping latency measurements. ```javascript function init_clock(client, enabled) { $("#clock_menu_entry").hide(); if (!enabled) { return; } function update_clock() { const now = new Date().getTime(); const server_time = client.last_ping_server_time + (now - client.last_ping_local_time) + client.server_ping_latency; const date = new Date(server_time); const clock_text = $("#clock_text"); const width = clock_text.width(); clock_text.text( date.toLocaleDateString() + " " + date.toLocaleTimeString() ); const clock_menu_text = $("#clock_menu_text"); clock_menu_text.text( date.toLocaleDateString() + " " + date.toLocaleTimeString() ); if (width != clock_text.width()) { //trays have been shifted left or right: client.reconfigure_all_trays(); } //try to land at the half-second point, //so that we never miss displaying a second: let delay = (1500 - (server_time % 1000)) % 1000; if (delay < 10) { delay = 1000; } setTimeout(update_clock, delay); } function wait_for_time() { if (client.last_ping_local_time > 0) { $("#clock_menu_entry").show(); update_clock(); } else { //check again soon: //(ideally, we should register a callback on the ping packet) setTimeout(wait_for_time, 1000); } } } ``` -------------------------------- ### Show Session Info Dialog Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/index.html Hides other dialogs, clears session data fields, shows the 'sessioninfo' dialog, and starts a timer to periodically fetch session information. ```javascript function show_sessioninfo(event) { $(".menu-content").slideUp(); $("#about").hide(); $("#sessiondata td").html(""); $("#sessioninfo").show(); client.start_info_timer(); event.stopPropagation(); } function hide_sessioninfo() { $("#sessioninfo").hide(); client.stop_info_timer(); } ``` -------------------------------- ### Initialize Desktop Menu Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/connect.html Initializes the desktop session selection menu. It fetches available desktop sessions and populates a dropdown, attempting to select a default session based on common desktop environment names. ```javascript function init_desktop_menu() { $("#desktop_entry_icon").hide(); json_action( "DesktopMenu", function(xhr, response) { var desktop_sessions = Object.keys(response); desktop_entry.innerText = null; let default_start_desktop = start; if (!default_start_desktop) { const PDE = ["xfce", "xfce session", "openbox", "gnome"]; for (let p in PDE) { let de = PDE[p]; for (let d in desktop_sessions) { let desktop_session = desktop_sessions[d]; if (desktop_session.toLowerCase() == de) { let attributes = response[desktop_session]; default_start_desktop = attributes.TryExec || attributes.Exec; break; } } if (default_start_desktop) { break; } } } for (let d in desktop_sessions) { let desktop_session = desktop_sessions[d]; let attributes = response[desktop_session]; let command_exec = safe_command(attributes.TryExec || attributes.Exec); let selected = ""; if (default_start_desktop && default_start_desktop == command_exec) { selected = ' selected="selected" '; default_start_desktop = null; } $("select#desktop_entry").append( "' + safe_name(desktop_session) + "" ); } desktop_entry_changed(); $("select#desktop_entry").show(); $("#desktop_entry_icon").show(); $("#start_desktop_command").hide(); }, function(error) { $("select#desktop_entry").hide(); $("#start_desktop_command").show(); } ); } ``` -------------------------------- ### Mount WebDAV Share on Client Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/usage-patterns.md Mount a WebDAV share provided by the FileBot NAS setup on a client machine. This allows applications to access organized files as if they were local. ```bash # Mount WebDAV sudo mount -t davfs http://nas.local:8080 /mnt/nas # Access from applications ls /mnt/nas/organized/ # See organized files ``` -------------------------------- ### Activate FileBot License from File Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/configuration.md Activate your FileBot license by providing the path to your license file within the container. The license file can be mounted directly or via a volume. ```bash # Activation from file docker run --rm -it -v data:/data -v /path/to/license.psm:/volume1/license.psm \ rednoah/filebot --license /volume1/license.psm ``` ```bash # Direct volume mount of license file docker run --rm -it \ -v data:/data \ -v "/path/to/FileBot_License_P12345678.psm:/data/license.txt" \ -v /path/to/files:/volume1 \ rednoah/filebot -script fn:sysinfo ``` -------------------------------- ### Main Thread Message Listener Setup Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/mitm.html Sets up the message listener for the main thread after the service worker is registered. It also processes any messages that were queued before the listener was ready. ```javascript if (navigator.serviceWorker) { registerWorker().then(() => { window.onmessage = onMessage; messages.forEach(window.onmessage); }); } else { keepAlive(); } ``` -------------------------------- ### Create WebDAV Directory Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/endpoints.md Use MKCOL to create a new directory in the WebDAV share. Ensure you have the necessary authorization and that the parent directory exists. ```bash # Create directory curl -X MKCOL \ --digest -u "alice:alice_secret" \ http://localhost:8080/media/newdir/ ``` -------------------------------- ### Get URL Properties Source: https://github.com/filebot/filebot-docker/blob/master/xpra/usr/share/xpra/www/connect.html Collects property values from form elements, handling both standard input values and boolean checkboxes. It logs any missing elements as a potential bug. ```javascript function get_URL_props(properties) { Utilities.log("get_URL_props:", properties); const url_props = new Map(); for (let i = 0; i < properties.length; i++) { const prop = properties[i]; const element = document.getElementById(prop); if (!element) { Utilities.log("bug? missing element", prop); continue; } let value = ""; if (BOOLEAN_PROPERTIES.includes(prop)) { value = element.checked; } else { value = element.value; if (value === null || value === "undefined") { value = ""; } } url_props.set(prop, value); } return url_props; } ``` -------------------------------- ### Check Entrypoint Script Permissions Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/build-system.md Inspect the permissions of the entrypoint script within a Docker image. This helps diagnose issues where the image fails to start because the entrypoint script is not executable. ```bash # Check permissions docker run --rm --entrypoint ls rednoah/filebot /opt/bin/ -la ``` ```bash # Verify entrypoint docker run --rm --entrypoint /bin/sh rednoah/filebot -c "test -x /opt/bin/run && echo OK" ``` -------------------------------- ### Run FileBot Node Docker container Source: https://github.com/filebot/filebot-docker/blob/master/README.md Starts the FileBot Node Docker container, exposing port 5452 for web interface access. Mounts data and volume directories. ```bash docker run --rm -it -v "data:/data" -v "$PWD:/volume1" -p 5452:5452 rednoah/filebot:node ``` -------------------------------- ### Temporary Mounts Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/volume-mounts.md Use temporary mounts for processing files from a temporary location that will be cleaned on shutdown. This example shows mounting a host temporary directory and using a tmpfs mount. ```bash -v /tmp/upload:/upload --tmpfs /tmp ``` -------------------------------- ### Get Interactive Shell Access Source: https://github.com/filebot/filebot-docker/blob/master/_autodocs/api-reference/run.md Override the default entrypoint to gain an interactive shell within the FileBot Docker container for debugging purposes. Ensure your data volume is mounted. ```bash docker run --rm -it -v data:/data --entrypoint /bin/bash rednoah/filebot ```