fix(manage-server): auto-detect gateway hostname on install, warn loudly either way (#956) #27
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
primatekuntech/triton-install!27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/956-gateway-hostname-autodetect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sync of triton#990 (fixed on the source-of-truth repo first, per the
standing installer-scripts-sync rule in triton's CLAUDE.md). Not yet
merged upstream — will merge here once triton#990 lands.
Summary
install.sh's own help text claimed --gateway-hostname "defaults to
current FQDN" if omitted, but nothing actually implemented that: when
the flag wasn't passed, env.template's literal placeholder
manage.example.com was left untouched, with zero fallback and zero
warning. That value gets baked into every agent enrollment bundle and
into the gateway's own TLS certificate, so every downstream agent
enrollment silently failed with a certificate hostname mismatch.
Detect the host's real primary outbound IP at install time via the
kernel's routing table (ip route get / route -n get, run on the bare
host before any container starts, so it correctly sees the host's real
network rather than a container-internal one). Use it as the default
instead of the placeholder, but always print a loud warning telling the
operator to verify it before enrolling any agents.
Applied identically to install.sh and install-airgap.sh.
Test plan
bash -nboth scripts — syntax OKscripts/deploy/manage-server/{install,install-airgap}.sh