fix(agentgit): make git push over SSH work on :2222

Three things stood between a member and `git push` over SSH to
git.profullstack.com, all in setup.sh §9d:

- app.ini is written once and never set BUILTIN_SSH_SERVER_USER, so the
  built-in server only accepted user "forgejo" and refused git@ with
  "Invalid SSH username git". The template now sets it, and every run
  converges the SSH keys of [server] in the EXISTING app.ini (with a
  numbered app.bak-NNN.ini backup the first time), so the live box gets it.
- The Forgejo upgrade curl'd straight onto /usr/local/bin/forgejo while it
  ran, which fails with ETXTBSY. Every deploy logged "forgejo download
  failed" and prod stayed on 11.0.1 against an 11.0.15 pin. Download to
  forgejo.new, check --version, then rename (same as deploy/git-chovy).
- `ufw allow 2222/tcp ... || true` hid any failure. It now warns, and the
  run logs whether :2222 is listening (ss) and the ufw rule, because the
  box has no shell and the deploy log is the only place to see it.

The deploy workflow gains a report-only step that probes 2222, 563 and
6697 from the runner. A DigitalOcean Cloud Firewall drops what it does not
list even when ufw allows it (docs/irc.md already notes this for 6697), and
only an outside probe can see that layer. The closing reminder in setup.sh
now lists every public port the cloud firewall needs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-10-01 10:21:07 +00:00
parent 2537977711
commit e55a881c0b
2 changed files with 102 additions and 5 deletions

View file

@ -168,3 +168,24 @@ jobs:
echo "::error::nothing is serving SSH on ${DEPLOY_HOST}:22 — agentbbs may be down"
exit 1
fi
- name: Probe public service ports from outside (report only)
if: always()
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
# setup.sh opens these in ufw and logs that the listener is up, but a
# DigitalOcean Cloud Firewall in front of the droplet drops anything it
# does not list, and from inside the box that is invisible. Probing from
# the runner is the only check that sees the edge. It never fails the
# job: a missing cloud-firewall rule is an operator action, not a
# deploy failure. Timed out = dropped at the edge (or by ufw);
# refused = reached the host but nothing listens.
for p in 2222:git-ssh 563:nntps 6697:ircs; do
port=${p%%:*} name=${p#*:}
if out=$(timeout 8 bash -c "exec 3<>/dev/tcp/${DEPLOY_HOST}/${port}" 2>&1); then
echo "::notice::${name} :${port} reachable from outside"
else
echo "::warning::${name} :${port} NOT reachable from outside (${out:-timed out}) — if setup.sh logged it as listening with a ufw ALLOW, add ${port}/tcp to the DigitalOcean Cloud Firewall"
fi
done