External SSH port #215
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#215
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The external SSH port should be something that can be setup in the setup section.
This is what it looks like right now:
The port needs to be 12222 externally, but internally it is still 2222.
Fixed by PR #222 (branch fix/issue-215): new
server.ssh.external_portsetup key (0 = listen port) advertised asssh_clone_url; clone menu SSH tab shows the external port (verified live in Chromium:ssh://git@host:12222/…, zero console errors).Review of PR #222 (fix/issue-215, +
4bc4279doc fix) — verified in scratch worktree, main untouched.Verdict: ready to merge (one doc gap found and fixed by me, pushed to the branch).
Review dimensions:
ssh://git@host/…, implicit :22). New code advertises the listen port when no external override is set. The only behavior change vs old is listen-non-22-without-override (was broken — cloned against :22 — now works). Listen :22 omits the port (identical to old); SSH-disabled advertises nothing and the UI falls back to the old port-less derivation (identical).internal/config/validate.go:59,internal/api/refs.go:64. Nit: PR blurb 'unset behavior is identical' is slightly overstated — it is identical except the previously-broken case, which is the fix direction. Not a blocker.sshCloneURLderives the host frombaseURL(refs.go:38), the exact source the httpsclone_urluses. No new spoofing surface — Host-header input was already trusted for display-only clone URLs.net.JoinHostPortbrackets v6 when a port is shown; the :22-omission path manually brackets a colon-containing host (refs.go:79-84). Host comes fromurl.Hostname()(brackets already stripped), so no double-bracketing.checkSSHrejects out-of-range ports (validate.go:48);AdvertisedSSHPortclamps invalid to 0 = omit advertisement. Setup save 422s on bad input (covered byTestSetupSSHExternalPortRoundTrip).setup_api.go:561-562); advertisement reads boot-loaded config per request, so restart is genuinely needed. Test asserts the key is listed.WALHUB__SERVER__SSH__EXTERNAL_PORT=12222applies via the generic path (throwaway test passed, then removed).FIELDSex12222covered by the 'every example validates' loop; server/setup/testaccepts 12222/2222 and 422s 70000/-1/many (round-trip test). UImin:1/max:65535rejects0; empty = unset = listen port, consistent with the note.sshCloneUrlFromprefers advertisement verbatim, falls back to the old hostname derivation (clone.js:49-53). EmptyRepoGuide uses the same helper — consistent.ssh_clone_url?although writeCreateJSON emits it and its comment claims all fields are enumerated there (+4bc4279).Test results (scratch worktree):
go test -raceconfig/api/server all pass;node --test web/test/unit/*.test.js428 pass / 0 fail / 3 skipped (smoke skips — needs a live server; note: an ambient :8080 on this box makes smoke run live and its undici keep-alive hangs the runner, environmental, unrelated); gofmt/vet clean. Two environmental scaffolds used for the run only (copied built web/dist + public/concepts gifs, symlinked main node_modules); none committed.Resolution: doc fix pushed to
origin/fix/issue-215. No code changes needed. Do NOT merge from my side per instructions — over to you.Fixed by PR #222 incl. review doc fix (advertised port with correct defaults; 95.4/95.3/95.6% + 428 node tests), merged. Closing.