Set Gitea's SSH_DOMAIN and DOMAIN from GITEA_SSH_DOMAIN in .env
Test and deploy / test (push) Successful in 30s
Test and deploy / deploy (push) Successful in 34s

Moving hosts meant hand-editing the live app.ini, which the template
cannot reach once it exists. Gitea's environment-to-ini now writes the
value on every start, so a move is a one-line .env change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-15 17:54:03 +01:00
co-authored by Claude Opus 5.5
parent f5ab1e81be
commit 529e80242f
4 changed files with 14 additions and 4 deletions
+4
View File
@@ -63,6 +63,10 @@ GITEA_INTERNAL_TOKEN=
GITEA_LFS_JWT_SECRET= GITEA_LFS_JWT_SECRET=
GITEA_OAUTH2_JWT_SECRET= GITEA_OAUTH2_JWT_SECRET=
POSTGRES_GITEA_DB=gitea POSTGRES_GITEA_DB=gitea
# The host's Tailscale MagicDNS name (e.g. stpvm.tailf20278.ts.net), shown in
# Gitea's SSH clone URLs. Not the public domain: 2222 is reachable only over
# the tailnet. Becomes Gitea's SSH_DOMAIN and DOMAIN. Blank means localhost.
GITEA_SSH_DOMAIN=
# --- Gitea Actions runner ---------------------------------------------------- # --- Gitea Actions runner ----------------------------------------------------
# The runner is NOT a container; it runs on the Pi via gitea-runner/run.sh. # The runner is NOT a container; it runs on the Pi via gitea-runner/run.sh.
+1 -1
View File
@@ -297,7 +297,7 @@ Setup, once:
that wants the public site. Pushing from another machine still goes that wants the public site. Pushing from another machine still goes
through Cloudflare and its cap; use the host's Tailscale name for that. through Cloudflare and its cap; use the host's Tailscale name for that.
- **Gitea SSH (2222).** Not HTTP, so not tunnelled. Already Tailscale-only: - **Gitea SSH (2222).** Not HTTP, so not tunnelled. Already Tailscale-only:
`SSH_DOMAIN` in `gitea/config/app.ini.template` is the host's MagicDNS name `GITEA_SSH_DOMAIN` in `.env` (Gitea's `SSH_DOMAIN`) is the host's MagicDNS name
and 2222 has never been forwarded. Nothing changes. and 2222 has never been forwarded. Nothing changes.
- **The radio harbor (8001).** Also a raw source protocol, so a DJ client - **The radio harbor (8001).** Also a raw source protocol, so a DJ client
pointed at `<DOMAIN>:8001` stops connecting once the domain resolves to pointed at `<DOMAIN>:8001` stops connecting once the domain resolves to
+6
View File
@@ -646,6 +646,12 @@ services:
- GITEA__server__LFS_JWT_SECRET=${GITEA_LFS_JWT_SECRET} - GITEA__server__LFS_JWT_SECRET=${GITEA_LFS_JWT_SECRET}
- GITEA__security__INTERNAL_TOKEN=${GITEA_INTERNAL_TOKEN} - GITEA__security__INTERNAL_TOKEN=${GITEA_INTERNAL_TOKEN}
- GITEA__oauth2__JWT_SECRET=${GITEA_OAUTH2_JWT_SECRET} - GITEA__oauth2__JWT_SECRET=${GITEA_OAUTH2_JWT_SECRET}
# The host's own name, which Gitea prints in SSH clone URLs. It lives in
# .env, not app.ini, so moving to another host is a one-line change;
# environment-to-ini writes it into the live app.ini on every start.
# localhost suits dev.
- GITEA__server__SSH_DOMAIN=${GITEA_SSH_DOMAIN:-localhost}
- GITEA__server__DOMAIN=${GITEA_SSH_DOMAIN:-localhost}
# Webhooks are refused to private addresses by default ("external"). # Webhooks are refused to private addresses by default ("external").
# The usaco site's push hook targets http://usaco:8080 on the Docker # The usaco site's push hook targets http://usaco:8080 on the Docker
# network, so that one host is allowed by name. # network, so that one host is allowed by name.
+3 -3
View File
@@ -20,7 +20,9 @@
; 22 and cannot use the host's sshd, so Gitea runs its own Go SSH server. ; 22 and cannot use the host's sshd, so Gitea runs its own Go SSH server.
; 2222 is published in docker-compose.yml; the deploy workflow clones over ; 2222 is published in docker-compose.yml; the deploy workflow clones over
; ssh://git@localhost:2222. ; ssh://git@localhost:2222.
; SSH_DOMAIN is the Pi's Tailscale MagicDNS name, not the public domain: SSH ; SSH_DOMAIN and DOMAIN are not set here: they come from GITEA_SSH_DOMAIN in
; ./.env (see docker-compose.yml). The value is the host's Tailscale
; MagicDNS name, not the public domain: SSH
; (22 and 2222) is not forwarded by the router, so the SSH clone URL Gitea ; (22 and 2222) is not forwarded by the router, so the SSH clone URL Gitea
; shows only works from a device on the tailnet. HTTPS clones go through ; shows only works from a device on the tailnet. HTTPS clones go through
; nginx at ROOT_URL and stay public. ; nginx at ROOT_URL and stay public.
@@ -50,7 +52,6 @@ TEMP_PATH = /tmp/gitea/uploads
[server] [server]
APP_DATA_PATH = /var/lib/gitea APP_DATA_PATH = /var/lib/gitea
SSH_DOMAIN = stpvm.tailf20278.ts.net
HTTP_PORT = 3000 HTTP_PORT = 3000
ROOT_URL = https://adam-french.co.uk/gitea/ ROOT_URL = https://adam-french.co.uk/gitea/
DISABLE_SSH = false DISABLE_SSH = false
@@ -60,7 +61,6 @@ SSH_PORT = 2222
SSH_LISTEN_PORT = 2222 SSH_LISTEN_PORT = 2222
BUILTIN_SSH_SERVER_USER = git BUILTIN_SSH_SERVER_USER = git
LFS_START_SERVER = true LFS_START_SERVER = true
DOMAIN = stpvm.tailf20278.ts.net
LFS_JWT_SECRET = LFS_JWT_SECRET =
OFFLINE_MODE = true OFFLINE_MODE = true