detached 6c74ee7

http: add comment for ignored Atoi error, add request logging to onboarding gate

- handler.go: inline comment explaining ignored strconv.Atoi error
  (invalid explicit port falls through to preserve-as-is branch)
- run.go: add middleware.RequestLogger(log) with no trusted proxy nets
  to directHTTPOnboardingGate so direct HTTP onboarding requests are logged
  using RemoteAddr only
commit
6c74ee76e2a462a896c86a769cb927895be30d1f
author
brice · · 2026-04-01 09:53 UTC
parent
ef180bc
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +2 -0
M internal/adapters/in/http/onboarding/handler.go +1 -0
@@ -60,6 +60,7 @@ func (h *Handler) publicHTTPSURL(r *http.Request) string {
6060 return html.EscapeString("https://" + r.Host + "/")
6161 }
6262
63+ // Ignore error: an invalid explicit port falls through to the preserve-as-is branch.
6364 port, _ := strconv.Atoi(portStr)
6465 if port == h.httpPort {
6566 return html.EscapeString(fmt.Sprintf("https://%s:%d/", host, h.tlsPort))
@@ -60,6 +60,7 @@ func (h *Handler) publicHTTPSURL(r *http.Request) string {
60 return html.EscapeString("https://" + r.Host + "/")60 return html.EscapeString("https://" + r.Host + "/")
61 }61 }
62 62
63+ // Ignore error: an invalid explicit port falls through to the preserve-as-is branch.
63 port, _ := strconv.Atoi(portStr)64 port, _ := strconv.Atoi(portStr)
64 if port == h.httpPort {65 if port == h.httpPort {
65 return html.EscapeString(fmt.Sprintf("https://%s:%d/", host, h.tlsPort))66 return html.EscapeString(fmt.Sprintf("https://%s:%d/", host, h.tlsPort))
M internal/app/run.go +1 -0
@@ -1727,6 +1727,7 @@ func directHTTPOnboardingGate(ob *onboarding.Handler, proxyNets []*net.IPNet, pr
17271727
17281728 onboardingWithMiddleware := middleware.Chain(
17291729 middleware.PanicRecovery(log),
1730+ middleware.RequestLogger(log), // no trusted proxy nets — log RemoteAddr only
17301731 middleware.SecurityHeaders,
17311732 )(onboardingMux)
17321733
@@ -1727,6 +1727,7 @@ func directHTTPOnboardingGate(ob *onboarding.Handler, proxyNets []*net.IPNet, pr
1727 1727
1728 onboardingWithMiddleware := middleware.Chain(1728 onboardingWithMiddleware := middleware.Chain(
1729 middleware.PanicRecovery(log),1729 middleware.PanicRecovery(log),
1730+ middleware.RequestLogger(log), // no trusted proxy nets — log RemoteAddr only
1730 middleware.SecurityHeaders,1731 middleware.SecurityHeaders,
1731 )(onboardingMux)1732 )(onboardingMux)
1732 1733

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close