fix(ftp): show the node's real host in the FTP connect hint#25
Merged
Conversation
…aceholder
The FTP-access card printed `ftp://<user>@<server-host>` — a literal
placeholder the client had to guess at. Resolve the actual reachable host
per hosting instead:
* hosting on the master node → the host the operator reached the panel on
(Host header → cached public IP), which on a single-node box IS the FTP
host;
* hosting on an enrolled worker → that worker's public_ip (its label, then
the panel host, as fallbacks), because FTP connects straight to the
owning box, not the master.
New `panel_host()` (bare-host sibling of `derive_master_url`, with a
`host_without_port` helper that keeps IPv6 brackets) + `ftp_host_for()` that
picks node vs master. Populated on the detail page; unused on the create
path (the "new password" block never renders there).
clippy -D warnings clean; host_without_port unit test + hyperion-web suite
(templates compile) green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
The FTP-access card showed the literal placeholder:
<server-host>is useless to whoever's configuring an FTP client — they have to guess the address. (Reported: "Nechceš tam rovnou psát dynamicky IP adresu podle té node, na které to je?")Fix
Resolve the real reachable host for the hosting's node:
Hostheader → cached public IP). On a single-node box that's exactly the FTP host.public_ip(enrollmentlabel, then panel host, as fallbacks) — FTP connects straight to the owning box, not the master. Printing the panel host there would point the client at the wrong machine.New
panel_host()— a bare-host (no scheme/port) sibling ofderive_master_url, with ahost_without_porthelper that strips:portwhile keeping IPv6 brackets. Newftp_host_for()picks node-vs-master. The value is only rendered inside the "new FTP password" block, so the create path passes an empty string.Result
ftp://hyperion_nechodom_cz@s4.digitalka.czftp://user@<worker-public-ip>Hostor a failed node lookup degrade gracefully (public IP / master host), never error.Test
clippy -D warningsclean;host_without_portunit test (IPv4/hostname/bracketed+bare IPv6) + full hyperion-web suite green — the suite compiles the Askama templates, so the new{{ ftp_host }}binding is verified.🤖 Generated with Claude Code