diff --git a/.gitea/workflows/container.yml b/.gitea/workflows/container.yml index afec235c..b2229ac5 100644 --- a/.gitea/workflows/container.yml +++ b/.gitea/workflows/container.yml @@ -34,6 +34,8 @@ jobs: load: true tags: dune:verify - name: Verify isolated storage and HTTP behavior + env: + DUNE_VERIFY_NETWORK: ${{ job.container.network }} run: node tools/verify-container.mjs dune:verify - name: Configure container registry if: github.ref == 'refs/heads/main' diff --git a/deploy/truenas.compose.yaml b/deploy/truenas.compose.yaml index d2ece2da..dc94fdfd 100644 --- a/deploy/truenas.compose.yaml +++ b/deploy/truenas.compose.yaml @@ -1,6 +1,6 @@ services: dune: - image: ghcr.io/quintine/dune:checkpoint + image: git.juiced.computer/admin/dune:checkpoint init: true restart: unless-stopped environment: diff --git a/docs/TRUENAS.md b/docs/TRUENAS.md index 47f1121e..45549a04 100644 --- a/docs/TRUENAS.md +++ b/docs/TRUENAS.md @@ -17,15 +17,15 @@ the `CONTAINER_REGISTRY_TOKEN` Actions secret. The default image name is `git.juiced.computer/admin/dune`. Registry access and image visibility depend on the actual Gitea package settings; do not assume anonymous pulls work. -An `ubuntu-latest` Gitea runner is configured. On 29 October 2026, run #83 +The instance-wide `truenas-general` runner serves `ubuntu-latest` jobs. +On 29 October 2026, run #83 verified and published commit `b18a7674702b92b6988b00cbde6212fa3b66b74a`. The registry shows its immutable `sha-b18a7674702b92b6988b00cbde6212fa3b66b74a` tag and `checkpoint` with the same digest. Run #85 failed before publication, so a source push still does not by itself establish a verified image or a deployment. For each checkpoint, verify the relevant workflow run and its -published revision before considering a manual NAS update. The existing TrueNAS -deployment and Compose configuration continue to reference the GHCR image; a -Gitea publication does not migrate them. +published revision before considering a manual NAS update. TrueNAS and the Compose configuration +use `git.juiced.computer/admin/dune:checkpoint`, which supports anonymous pulls. The previous GitHub workflow, `.github/workflows/container.yml`, builds a production image using the lockfile on GitHub pushes. Types, lint and offline @@ -36,8 +36,8 @@ and rejected HTTP origins, verifies saved-seat restoration through restart and container replacement, then runs the HTTP integration suite. Only a passing GitHub image is pushed to `ghcr.io/quintine/dune:checkpoint`, -alongside `ghcr.io/quintine/dune:sha-`. TrueNAS currently pulls -that image. Failed checks leave the previous update tag untouched. This +alongside `ghcr.io/quintine/dune:sha-`. Failed checks leave the +previous update tag untouched. This workflow targets Linux AMD64, the architecture of ordinary x86 TrueNAS systems. The user selected the existing GHCR image as **public**, matching the public @@ -112,11 +112,9 @@ See [NGINX WebSocket forwarding](https://nginx.org/en/docs/http/websocket.html). ### Applying an update -1. Wait for the checkpoint workflow for the configured image registry to - succeed and confirm the intended revision was published. A Gitea source - push alone is insufficient, and the GHCR Compose image does not automatically - switch registries. Check for image updates in TrueNAS and apply the update - manually at a safe point between decisions. +1. Wait for the Gitea checkpoint workflow to succeed and confirm the intended + revision was published. Check for image updates in TrueNAS and apply the + update manually at a safe point between decisions. 2. Before updating, stop the app and back up or snapshot its persistent storage. Include the named volume in the Apps backup procedure; a dedicated host dataset provides a more explicit ZFS snapshot boundary. diff --git a/tools/verify-container.mjs b/tools/verify-container.mjs index cc1b49c0..ea848cc1 100644 --- a/tools/verify-container.mjs +++ b/tools/verify-container.mjs @@ -13,6 +13,11 @@ if (!image) throw new Error('Usage: node tools/verify-container.mjs IMAGE'); const name = `dune-verify-${randomUUID()}`; const volume = `${name}-data`; const docker = (...args) => execFileSync('docker', args, { encoding: 'utf8' }).trim(); +const jobNetwork = process.env.DUNE_VERIFY_NETWORK; +const useJobNetwork = jobNetwork && jobNetwork !== 'host'; +const endpoint = () => useJobNetwork + ? `http://${name}:3000` + : `http://${docker('port', name, '3000/tcp')}`; let base; const adminFiles = mkdtempSync(joinPath(tmpdir(), 'dune-admin-container-')); let adminCookie; @@ -34,11 +39,12 @@ async function ready() { throw new Error('Container did not become ready'); } function start(publicOrigin = '') { + const networkArgs = useJobNetwork ? ['--network', jobNetwork] : ['-p', '127.0.0.1::3000']; docker('run', '-d', '--name', name, '--init', '--cap-drop=ALL', '--security-opt=no-new-privileges:true', - '-p', '127.0.0.1::3000', '-v', `${volume}:/data`, + ...networkArgs, '-v', `${volume}:/data`, '-e', `DUNE_PUBLIC_ORIGIN=${publicOrigin}`, image); - base = `http://${docker('port', name, '3000/tcp')}`; + base = endpoint(); } const bootstrapKeys = (logs) => logs.match(/dune-admin\.[0-9a-f-]{36}\.[0-9a-f]{64}/g) || []; function checkBootstrap(count) { @@ -95,7 +101,7 @@ try { stage = 'container restart and saved witnesses'; docker('restart', '--time', '60', name); // Docker may assign a different ephemeral host port after a restart. - base = `http://${docker('port', name, '3000/tcp')}`; + base = endpoint(); await ready(); assert.equal(checkBootstrap(1), bootstrapKey, 'Restart must not replace the owner key'); await restored();