From 514c5d887b5c452d816f2fca4abb770238183122 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Mon, 22 Jun 2026 02:57:38 +0200 Subject: [PATCH] =?UTF-8?q?feat(ops):=20self-hosted=20deployment=20?= =?UTF-8?q?=E2=80=94=20app+db=20in=20a=20container=20behind=20a=20reverse?= =?UTF-8?q?=20proxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add docker-compose.home.yml: the app + Postgres run on strong, always-on home hardware (nested Docker, apparmor:unconfined, Postgres tuned to keep the catalog hot in cache), and the server reverse-proxies the hostname to it over a private network link. This moves the heavy feed/count/facet scans off the server while keeping it as the public TLS front door (the OAuth redirect URL is unchanged). Retire the the server Forgejo Actions autodeploy (.forgejo/workflows/deploy.yml): the app no longer runs on the server, so deploys go to the server from the dispatcher instead. --- .forgejo/workflows/deploy.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .forgejo/workflows/deploy.yml diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml deleted file mode 100644 index 9289de8..0000000 --- a/.forgejo/workflows/deploy.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: deploy - -# Event-driven production deploy. Replaces the 2-minute systemd poller on asgard: on a push -# to main, the asgard-hosted Forgejo Actions runner connects back to the asgard host over the -# Docker bridge gateway and runs the existing deploy/deploy.sh, which pulls the published image -# and restarts the stack. The image itself is still built and pushed from the developer machine -# (`siftlode publish`) BEFORE the push — this job only triggers the deploy, it does not build. -# -# The SSH key is a dedicated, forced-command key on the host (it can ONLY run deploy.sh), stored -# here as a base64-encoded Actions secret. The host address is the container's default-route -# gateway (= the Docker host), resolved at runtime so no fixed IP or runner config is needed. - -on: - push: - branches: [main] - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: trigger host deploy - run: | - command -v ssh >/dev/null 2>&1 || { apt-get update -qq && apt-get install -y -qq openssh-client; } - install -m 700 -d ~/.ssh - printf '%s' "${{ secrets.DEPLOY_SSH_KEY_B64 }}" | base64 -d > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 - # Default-route gateway of this job container = the Docker host (little-endian hex in /proc/net/route). - H=$(awk '$2=="00000000" && $1!="lo"{print $3; exit}' /proc/net/route) - HOST=$(printf '%d.%d.%d.%d' "0x${H:6:2}" "0x${H:4:2}" "0x${H:2:2}" "0x${H:0:2}") - echo "Deploying via host $HOST:2222" - ssh -p 2222 -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/dev/null \ - -i ~/.ssh/id_ed25519 "p33t@$HOST" deploy