fix(localnet): route bare wallet URLs to each role's wallet - #279
Merged
Conversation
Splice's nginx routes by Host header. The bare host URL DevKit
advertises (http://localhost:<UI_PORT>) matches no *.localhost vhost, so
nginx falls through to the first server block on the port:
- app-provider (52343): first block is ans.localhost -> served the
Amulet Name Service instead of the wallet.
- sv (52344): catch-all `server_name localhost _` served a
non-existent static dir (/usr/share/nginx/sv-html) -> HTTP 404.
app-user already worked because its wallet block listed
`server_name localhost wallet.localhost`.
The upstream .conf files live in the content-hash-verified Splice cache
(shared across all instances), so editing them in place risks a hash
mismatch and is not per-instance safe. Instead, ship DevKit-owned copies
as embedded assets and bind-mount them over the upstream templates via a
per-instance compose overlay (WriteNginxVhostOverlay), mirroring the
existing loopback-ports/container-rename overlay pattern.
The DevKit copies add `localhost` to each wallet server block and drop
`localhost` from the sv catch-all. nginx.conf and the includes/ dir are
unchanged upstream, so the overlay keeps those pointed at the cache.
Verified end-to-end against localnet-2: all three bare wallet URLs now
return HTTP 200 and serve the wallet bundle, with ans.localhost,
scan.localhost, and sv.localhost vhosts still routing correctly.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Contributor
Author
|
Fixes issue #235 |
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.
Problem
The wallet URLs DevKit advertises for the app-provider and sv roles don't reach the wallet:
http://localhost:52343) served the Amulet Name Service instead of the wallet.http://localhost:52344) returned HTTP 404.Root cause
Splice's nginx routes by
Hostheader. The bare host URL DevKit advertises (http://localhost:<UI_PORT>) matches no*.localhostvhost, so nginx falls through to the firstserverblock on the port:ans.localhost-> name service.server_name localhost _-> non-existent static dir/usr/share/nginx/sv-html-> 404.app-user already worked because its wallet block listed
server_name localhost wallet.localhost.Fix
The upstream
.conffiles live in the content-hash-verified Splice cache (shared across all 0.6.12 instances), so editing them in place risks a hash mismatch and isn't per-instance safe.Instead:
assets/nginx/*.conf), addinglocalhostto each walletserverblock and droppinglocalhostfrom the sv catch-all.WriteNginxVhostOverlay), mirroring the existing loopback-ports / container-rename overlay pattern (volumes: !override).nginx.confandincludes/are unchanged upstream, so the overlay keeps those pointed at the untouched cache (${LOCALNET_DIR}).The overlay is edit-preserving: an operator who tweaks a materialized
.confkeeps that tweak acrosslocalnet up.Verification
go build ./...+go test ./...(1535 passed). Re-uppedlocalnet-2with the new binary and probed the bare host URLs:localhost:52342(app-user)localhost:52343(app-provider)localhost:52344(sv)No regressions:
ans.localhost:52343,scan.localhost:52344, andsv.localhost:52344vhosts all still return 200. All three bare wallet URLs serve the same wallet bundle (index-V6UCL5Qo.js) confirmed viaHost: wallet.localhostreference.