diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e6b867..e565b46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,19 @@ jobs: node .github/scripts/changelog.mjs "$GITHUB_REF_NAME" > dist/release-notes.md cat dist/release-notes.md + # Gitea doesn't let the workflow's own token push packages, so the image + # needs a personal access token. Checked here so a missing secret fails + # before the long build, not after the release is published. + - name: Check the registry secrets are set + env: + REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + run: | + if [ -z "$REGISTRY_USER" ] || [ -z "$REGISTRY_TOKEN" ]; then + echo "::error::Set the REGISTRY_USER (your Gitea username) and REGISTRY_TOKEN (a token with package read and write) secrets under the repo's Settings → Actions → Secrets, then re-run." + exit 1 + fi + - name: Build the UI run: | npm --prefix ui ci @@ -103,12 +116,11 @@ jobs: echo "$HOME/.local/bin" >> "$GITHUB_PATH" # Pushes //jellymove:, plus :latest unless the - # tag is a pre-release. The workflow's own token is tried first; if Gitea - # refuses it, add REGISTRY_USER and REGISTRY_TOKEN (write:package) secrets. + # tag is a pre-release. - name: Publish the Docker image env: - REGISTRY_USER: ${{ secrets.REGISTRY_USER || github.actor }} - REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN || secrets.GITHUB_TOKEN }} + REGISTRY_USER: ${{ secrets.REGISTRY_USER }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} run: | registry="${GITHUB_SERVER_URL#*://}" registry="${registry%%/*}" diff --git a/README.md b/README.md index 2c08410..5a8865d 100644 --- a/README.md +++ b/README.md @@ -50,11 +50,22 @@ cargo run -p jm-server --example demo Install one agent per server. **Mount media at the same paths as the Jellyfin container**, so the paths Jellyfin reports are the paths jellymove sees. +With Docker, copy [deploy/docker-compose.yml](deploy/docker-compose.yml), +fill in the `environment:` section, fix the volumes and `user:`, then: + ```sh -cp config.example.toml jellymove.toml # edit: node_name, jellyfin.api_key, peer.url, peer.token -docker compose -f deploy/docker-compose.yml up -d +mkdir jellymove-data && sudo chown 1000:1000 jellymove-data # same IDs as user: +docker compose run --rm jellymove check-config # prints the settings, secrets hidden +docker compose up -d ``` +Every setting in [config.example.toml](config.example.toml) can be set as +`JELLYMOVE_`, with `__` between a section and its key +(`[peer] token` → `JELLYMOVE_PEER__TOKEN`). There's no config file in this +setup, so the "config file not found; using environment only" warning at +start-up is expected. If you'd rather use a file, mount it at +`/config/jellymove.toml`. Environment variables still override it. + Each release publishes an image (x86_64) to the Gitea container registry: `git.malgra.com/ixianpixel/jellymove:`, and `:latest` for anything that isn't a pre-release. It's the same static binary as the systemd tarball, @@ -77,7 +88,8 @@ To upgrade, run `docker compose pull && docker compose up -d`. the roadmap. - Run the container as the same user as Jellyfin (`user: "1000:1000"`) so moved files keep the right ownership. -- Set a UI password (`[ui]`) unless the port is only reachable privately. +- Set a UI password (`[ui]`, or `JELLYMOVE_UI__USERNAME`/`__PASSWORD`) + unless the port is only reachable privately. - The **Status** tab checks that every library folder is visible and writable. ### Without Docker (systemd) @@ -117,8 +129,10 @@ git tag v0.1.1 && git push origin v0.1.1 The workflow runs the tests, builds the UI and binary, attaches the tarball and its `.sha256` to a Gitea release for that tag, then pushes the Docker image. It builds the image with `crane`, so the runner needs no Docker -socket. It pushes with the workflow's own token; if Gitea refuses that, add -`REGISTRY_USER` and `REGISTRY_TOKEN` (`write:package`) secrets. The release notes +socket. Gitea won't let the workflow's own token push packages, so the repo +needs two Actions secrets: `REGISTRY_USER` (your Gitea username) and +`REGISTRY_TOKEN` (a personal access token with only package read and write). +The workflow stops straight away if either is missing. The release notes are that version's section of `CHANGELOG.md`; the workflow stops straight away if there isn't one. Re-running it replaces the files and refreshes the notes. Tags with a `-` (`v0.2.0-rc1`) are marked pre-release. diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index e23542d..21ff552 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -14,12 +14,29 @@ services: ports: - "8097:8097" volumes: - - ./jellymove.toml:/config/jellymove.toml:ro - ./jellymove-data:/data # must be writable by `user:` above - /srv/media/movies:/media/movies # ← match your jellyfin service - /srv/media/tv:/media/tv + # Every setting in config.example.toml works here as JELLYMOVE_, with + # "__" between a section and its key. A value made only of digits needs + # inner quotes ('"123456"'), or it's read as a number. To keep secrets out + # of this file, put them in a .env file next to it and write ${NAME} here. environment: - # Secrets can come from the environment instead of the file: - # JELLYMOVE_JELLYFIN__API_KEY: ... - # JELLYMOVE_PEER__TOKEN: ... + JELLYMOVE_NODE_NAME: home + JELLYMOVE_DATA_DIR: /data # the jellymove-data volume above + JELLYMOVE_JELLYFIN__URL: http://jellyfin:8096 + # Jellyfin → Dashboard → API Keys. Needs an admin key. + JELLYMOVE_JELLYFIN__API_KEY: replace-me + # The other agent. Both sides use the same token (openssl rand -hex 32). + JELLYMOVE_PEER__URL: https://cloud.example.com + JELLYMOVE_PEER__TOKEN: replace-me + # Protect the web UI unless the port is only reachable privately. + JELLYMOVE_UI__USERNAME: admin + JELLYMOVE_UI__PASSWORD: replace-me JELLYMOVE_LOG: info + # Optional. Incoming cap in megabits per second (0 = unlimited): + # JELLYMOVE_TRANSFER__BANDWIDTH_LIMIT_MBPS: 200 + # Optional. File items from the peer's "TV Shows" library into "Series": + # JELLYMOVE_INCOMING_LIBRARIES: '{"TV Shows"="Series"}' + # Optional. Only if jellymove sees media at different paths from Jellyfin: + # JELLYMOVE_PATH_MAP: '[{jellyfin="/media",local="/mnt/user/media"}]'