feat(gitops): auto-deploy asus when its config changes on main #22

Open
Lauria wants to merge 2 commits from feat/asus-gitops-deploy into main
Collaborator

Same one-shot root pattern as the server: the runner SSHes forgejo-deploy@asus and starts nixos-deploy.service, which pulls main and runs nixos-rebuild switch --flake ref=main#asus.

  • flake.nix: import sops-nix for asus
  • devices/asus: services.nixos-deploy (ref=main#asus, ntfy homelab), dedicated forgejo-deploy SSH user (polkit-restricted to the unit)
  • devices/server: sops secret asus_deploy_key readable by the runner
  • workflows: deploy-asus.yml (push to main, paths devices/asus/**), build-asus job in check.yml
  • docs/deployment.md: asus section

REQUIRES before merge: add deploy_ssh_key: to secrets/secrets.yaml with the private key at ~/workspace/tmp/asus_deploy_key (via sops). The asus sops manifest build intentionally fails until then — the build-asus job being red is the guard working.

Order: merge #21 (monerod) first, then add the secret, then merge this one.

Same one-shot root pattern as the server: the runner SSHes `forgejo-deploy@asus` and starts `nixos-deploy.service`, which pulls `main` and runs `nixos-rebuild switch --flake ref=main#asus`. - **flake.nix**: import sops-nix for asus - **devices/asus**: `services.nixos-deploy` (ref=main#asus, ntfy `homelab`), dedicated `forgejo-deploy` SSH user (polkit-restricted to the unit) - **devices/server**: sops secret `asus_deploy_key` readable by the runner - **workflows**: `deploy-asus.yml` (push to main, paths `devices/asus/**`), `build-asus` job in check.yml - **docs/deployment.md**: asus section **REQUIRES before merge:** add `deploy_ssh_key:` to `secrets/secrets.yaml` with the private key at `~/workspace/tmp/asus_deploy_key` (via `sops`). The asus sops manifest build intentionally fails until then — the `build-asus` job being red is the guard working. Order: merge #21 (monerod) first, then add the secret, then merge this one.
fix(monerod): expose only the restricted RPC — admin methods out of reach
All checks were successful
check / build-server (pull_request) Successful in 54s
a8fe997492
Unrestricted monerod RPC (18081) was proxied publicly via
monero.polensky.me: anyone on the internet could call stop_daemon,
start_mining, set_limits, flush the txpool, or ban peers.

- asus: bind unrestricted RPC to 127.0.0.1 (p2pool and the
  json-exporter are local), add a restricted RPC listener on
  0.0.0.0:18089, drop 18081 from the firewall
- server: point both Caddy vhosts and monero-wallet-monitor
  (view-only wallet) at asus:18089

Closes #8
feat(gitops): auto-deploy asus when its config changes on main
Some checks failed
check / build-server (pull_request) Failing after 44s
check / build-asus (pull_request) Failing after 33s
0ab5273d0c
Same one-shot root pattern as the server: the runner SSHes
forgejo-deploy@asus and starts nixos-deploy.service, which pulls main
and runs nixos-rebuild switch --flake ref=main#asus.

- flake.nix: import sops-nix for asus (deploy_ssh_key + future secrets)
- devices/asus: services.nixos-deploy (ref=main#asus, ntfy homelab),
  dedicated forgejo-deploy SSH user (polkit-restricted to the unit)
- devices/server: sops secret asus_deploy_key readable by the runner
- workflows: deploy-asus.yml (push to main, paths devices/asus/**),
  build-asus job in check.yml for PR eval/build validation
- docs/deployment.md: asus section

REQUIRES (before merge): add 'deploy_ssh_key:' to secrets/secrets.yaml
with the private key at ~/workspace/tmp/asus_deploy_key (Charles, via
sops). The asus sops manifest build fails until then — intentional.
Some checks failed
check / build-server (pull_request) Failing after 44s
check / build-asus (pull_request) Failing after 33s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/asus-gitops-deploy:feat/asus-gitops-deploy
git switch feat/asus-gitops-deploy

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/asus-gitops-deploy
git switch feat/asus-gitops-deploy
git rebase main
git switch main
git merge --ff-only feat/asus-gitops-deploy
git switch feat/asus-gitops-deploy
git rebase main
git switch main
git merge --no-ff feat/asus-gitops-deploy
git switch main
git merge --squash feat/asus-gitops-deploy
git switch main
git merge --ff-only feat/asus-gitops-deploy
git switch main
git merge feat/asus-gitops-deploy
git push origin main
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
polen/nixos!22
No description provided.