fix(forgejo): set SSH_DOMAIN so the UI's clone URL is actually usable

Forgejo's displayed SSH clone URL comes from SSH_DOMAIN, which defaults
to "localhost" (not DOMAIN) when unset — completely unusable, and
DOMAIN itself would've been wrong anyway since it resolves through
Caddy's wildcard CNAME, which SSH can't traverse. Point it at the
dedicated forgejo.home.brianpooe.com A record instead.
This commit is contained in:
Brian Pooe 2026-07-19 15:17:25 +02:00
parent fc116653f7
commit 1c2f4a1c81
2 changed files with 11 additions and 0 deletions

View file

@ -13,6 +13,11 @@ FORGEJO_MEM_LIMIT=1G
FORGEJO_ROOT_URL=https://git.home.example.com FORGEJO_ROOT_URL=https://git.home.example.com
FORGEJO_DOMAIN=git.home.example.com FORGEJO_DOMAIN=git.home.example.com
# Hostname shown in the web UI's SSH clone URL. Must resolve directly to
# this LXC (not through Caddy — SSH can't be proxied), so it needs its own
# DNS A record rather than reusing FORGEJO_DOMAIN's wildcard CNAME to Caddy.
FORGEJO_SSH_DOMAIN=forgejo.home.example.com
# Generate with: openssl rand -base64 32 # Generate with: openssl rand -base64 32
FORGEJO_DB_PASSWORD=<random-secret> FORGEJO_DB_PASSWORD=<random-secret>

View file

@ -67,6 +67,12 @@ services:
FORGEJO__database__PASSWD: "{{FORGEJO_DB_PASSWORD}}" FORGEJO__database__PASSWD: "{{FORGEJO_DB_PASSWORD}}"
FORGEJO__server__ROOT_URL: "{{FORGEJO_ROOT_URL}}" FORGEJO__server__ROOT_URL: "{{FORGEJO_ROOT_URL}}"
FORGEJO__server__DOMAIN: "{{FORGEJO_DOMAIN}}" FORGEJO__server__DOMAIN: "{{FORGEJO_DOMAIN}}"
# SSH_DOMAIN drives the SSH clone URL shown in the web UI. It defaults
# to "localhost" (not DOMAIN), which is unusable here regardless: SSH
# can't be proxied through Caddy, so FORGEJO_DOMAIN's wildcard CNAME
# to the Caddy host would be wrong too. Point it at a dedicated DNS
# record resolving directly to this LXC instead (see README).
FORGEJO__server__SSH_DOMAIN: "{{FORGEJO_SSH_DOMAIN}}"
FORGEJO__server__SSH_PORT: "{{FORGEJO_SSH_PORT:-2222}}" FORGEJO__server__SSH_PORT: "{{FORGEJO_SSH_PORT:-2222}}"
# LANDING_PAGE controls what anonymous visitors see at "/" — set to # LANDING_PAGE controls what anonymous visitors see at "/" — set to
# login so they land on sign-in instead of the marketing homepage. # login so they land on sign-in instead of the marketing homepage.