fix(web): advertise a reachable URL when --host binds all interfaces - #90
Merged
Conversation
Go serves a 0.0.0.0 bind from a dual-stack socket, so ln.Addr() reads back as "[::]:7777". That address was printed as the dashboard URL and, with auth on, as the base of the /token/<t> magic link — neither of which any browser can open. The bind and the Host-header guard were already correct; only the banner was unusable, which reads as "--host 0.0.0.0 is not working". Substitute the machine's own interface address for the wildcard, and name the one hop csdd cannot do for the user: the host and cloud provider firewalls. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QxSUgxkG2hwDuRxGdFKLLP
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesWildcard URL Advertisement
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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.
Problema
csdd web --host 0.0.0.0parecia não expor o dashboard. O bind sempre esteve correto — o que estava quebrado era a URL impressa.Go serve um bind
0.0.0.0a partir de um socket dual-stack, entãoln.Addr()volta como[::]:7777. Esse endereço era usado como a URL do dashboard e, com auth ligada, como base do magic link/token/<t>:Nenhum browser abre isso, e o link que carrega o token é justamente o que o usuário clica.
Correção
advertisedURLsubstitui o wildcard pelo endereço da própria interface (IPv4 preferido, o formato que se digita no browser), com fallback paralocalhostquando não há NIC roteável. Um bind explícito continua sendo reportado verbatim. Uma linha adicional nomeia o único elo que o csdd não controla — os firewalls do host e do provedor:Em VPS atrás de NAT o endereço é o privado em vez do público — ainda assim bem mais útil que o wildcard que substitui.
Nada muda no bind, no
requireHost(que já abre em"*"para wildcard) nem na auth.Validação
Além de
make check, o servidor foi exercitado num VPS pelo IP público:GET /+/assets/index-*.{js,css}/token/<t>/api/{overview,tree,plans}sem token/api/graphgraph build, 200 gzip depois/api/events(SSE)event: changeimediatoHost: dominio-externoDois testes novos fixam o comportamento: wildcard reescrito para um host abrível na porta correta, e bind explícito preservado.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QxSUgxkG2hwDuRxGdFKLLP
Summary by CodeRabbit