ci: kaniko image builds (no docker socket); remove dead SSH deploy #2

Merged
jmz merged 2 commits from ci/kaniko-image-builds into master 2026-10-19 17:47:59 +00:00
Owner

Prepares this repo for the NAS runner hardening (jmz/nas-docker-compose#156). After it, CI jobs can't mount the docker socket.

1. ci.yaml: build-backend / build-frontend use kaniko

Both jobs used docker:cli with /var/run/docker.sock mounted. That mount hands the job the privileged dind daemon, which is root on the NAS, and #156 removes it. They now build and push daemonlessly with kaniko, as in nas-docker-compose .forgejo/workflows/myfava-image.yml / matrix-webhook-image.yml:

  • uses: docker://gcr.io/kaniko-project/executor:v1.23.2@sha256:9e69fd43…ac53f (pinned by tag and digest).
  • Registry auth goes to $GITHUB_WORKSPACE/.docker/config.json, outside both build contexts, via DOCKER_CONFIG.
  • Explicit --context and --dockerfile per image.
  • Same destinations and tags as before: git.mirus-tech.com/public/betting-{backend,frontend}:{<sha7>,latest}. Same needs: and master/main condition.
  • Not copied from the reference: --add-host git.mirus-tech.com:192.168.1.240. The runner drops --add-host, and #156's egress policy blocks 192.168.0.0/16. Inside dind, git.mirus-tech.com resolves via MagicDNS to the allow-listed tailnet ingress.

Before this can go green, two things are already broken (not caused by this PR):

  • The last run (2026-10-09) failed at docker login: Get "https://git.mirus-tech.com/v2/": unauthorized. The REGISTRY_USER/REGISTRY_TOKEN secrets (repo and public org level) are stale. kaniko needs a valid token with write:package on public.
  • lint-backend fails with 3 ruff errors (StrEnum), so build-backend is skipped anyway.

2. deploy.yaml removed (separate commit; drop it if you prefer to keep the file)

  • It never ran. All 42 runs in the Actions history are ci.yaml.
  • It cannot run. DEPLOY_HOST, DEPLOY_USER and DEPLOY_SSH_KEY exist neither as repo nor as org secrets (only the REGISTRY_* pair does).
  • Its target is the NAS itself. cd /opt/docker/betting was the NAS's compose project betting, whose volume betting_betting-data still exists. The directory is gone, and the app now has k3s manifests in jmz/homelab-flux apps/betting (currently replicas: 0, pulling :latest).
  • The egress policy would block it. DEPLOY_HOST would be the NAS on the LAN (192.168.1.x) or the tailnet (100.64.x). #156 blocks both on purpose.
  • No exception, please. An exception would give CI an SSH shell on the NAS, with the key stored in CI secrets.
  • Proposed path: deploy through Flux, either a rollout of :latest or <sha7> tags pinned in homelab-flux and bumped by Renovate or Flux image automation.

No pull_request trigger was added. CI still runs on pushes only, so fork PRs never execute on the homelab runner.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JPMfW8M8fH1ichGauN6DhV

Prepares this repo for the NAS runner hardening (jmz/nas-docker-compose#156). After it, CI jobs can't mount the docker socket. ## 1. `ci.yaml`: build-backend / build-frontend use kaniko Both jobs used `docker:cli` with `/var/run/docker.sock` mounted. That mount hands the job the privileged dind daemon, which is root on the NAS, and #156 removes it. They now build and push daemonlessly with kaniko, as in nas-docker-compose `.forgejo/workflows/myfava-image.yml` / `matrix-webhook-image.yml`: - `uses: docker://gcr.io/kaniko-project/executor:v1.23.2@sha256:9e69fd43…ac53f` (pinned by tag and digest). - Registry auth goes to `$GITHUB_WORKSPACE/.docker/config.json`, outside both build contexts, via `DOCKER_CONFIG`. - Explicit `--context` and `--dockerfile` per image. - Same destinations and tags as before: `git.mirus-tech.com/public/betting-{backend,frontend}:{<sha7>,latest}`. Same `needs:` and master/main condition. - Not copied from the reference: `--add-host git.mirus-tech.com:192.168.1.240`. The runner drops `--add-host`, and #156's egress policy blocks 192.168.0.0/16. Inside dind, git.mirus-tech.com resolves via MagicDNS to the allow-listed tailnet ingress. **Before this can go green, two things are already broken (not caused by this PR):** - The last run (2026-10-09) failed at `docker login`: `Get "https://git.mirus-tech.com/v2/": unauthorized`. The `REGISTRY_USER`/`REGISTRY_TOKEN` secrets (repo and `public` org level) are stale. kaniko needs a valid token with write:package on `public`. - `lint-backend` fails with 3 ruff errors (StrEnum), so `build-backend` is skipped anyway. ## 2. `deploy.yaml` removed (separate commit; drop it if you prefer to keep the file) - **It never ran.** All 42 runs in the Actions history are `ci.yaml`. - **It cannot run.** `DEPLOY_HOST`, `DEPLOY_USER` and `DEPLOY_SSH_KEY` exist neither as repo nor as org secrets (only the REGISTRY_* pair does). - **Its target is the NAS itself.** `cd /opt/docker/betting` was the NAS's compose project `betting`, whose volume `betting_betting-data` still exists. The directory is gone, and the app now has k3s manifests in jmz/homelab-flux `apps/betting` (currently `replicas: 0`, pulling `:latest`). - **The egress policy would block it.** `DEPLOY_HOST` would be the NAS on the LAN (192.168.1.x) or the tailnet (100.64.x). #156 blocks both on purpose. - **No exception, please.** An exception would give CI an SSH shell on the NAS, with the key stored in CI secrets. - **Proposed path:** deploy through Flux, either a rollout of `:latest` or `<sha7>` tags pinned in homelab-flux and bumped by Renovate or Flux image automation. No `pull_request` trigger was added. CI still runs on pushes only, so fork PRs never execute on the homelab runner. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JPMfW8M8fH1ichGauN6DhV
The NAS runner hardening (jmz/nas-docker-compose#156) stops jobs from
mounting the docker-in-docker socket. A socket mount hands the job the
privileged daemon, which is root on the NAS. build-backend and
build-frontend used exactly that (docker:cli + /var/run/docker.sock).

Both jobs now build and push with the daemonless kaniko executor, as in
nas-docker-compose's myfava-image.yml:
- executor pinned by tag and digest
- registry auth in $GITHUB_WORKSPACE/.docker, outside the build context
- explicit --dockerfile per context
- same tags as before: <sha7> and latest

The old `--add-host git.mirus-tech.com:192.168.1.240` from the
reference pattern is left out. The runner drops it, and the egress
policy in #156 blocks 192.168.0.0/16. git.mirus-tech.com resolves via
MagicDNS to the allow-listed tailnet ingress.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JPMfW8M8fH1ichGauN6DhV
ci: remove the dead SSH deploy workflow
Some checks failed
CI / lint-backend (push) Failing after 24s
CI / test-backend (push) Successful in 1m39s
CI / lint-frontend (push) Successful in 1m4s
CI / build-backend (push) Has been skipped
CI / build-frontend (push) Failing after 8s
ebcf7c3671
deploy.yaml has never run. All 42 runs in the repo's Actions history
are ci.yaml. It also could not run:
- DEPLOY_HOST, DEPLOY_USER and DEPLOY_SSH_KEY exist neither as repo
  secrets nor as `public` org secrets (only REGISTRY_USER and
  REGISTRY_TOKEN do).
- Its target, `cd /opt/docker/betting`, was the NAS's docker compose
  project `betting`. That directory no longer exists. The app now has
  k3s manifests in jmz/homelab-flux apps/betting, which pull :latest.

If it were revived, it would SSH from a CI job to the NAS on the LAN or
tailnet. The runner egress policy in jmz/nas-docker-compose#156 blocks
that on purpose, and an exception would give CI a shell on the NAS.
Deploy through Flux instead: roll out :latest, or pin <sha7> tags and
let Renovate or Flux image automation bump them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JPMfW8M8fH1ichGauN6DhV
jmz merged commit ebcf7c3671 into master 2026-10-19 17:47:59 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/office-betting!2
No description provided.