Repository navigation
Reach algod through FUNC's own origin so FUNC works behind a reverse proxy - #124
Open
EasyTiger909 wants to merge 16 commits into
Open
EasyTiger909 wants to merge 16 commits into
EasyTiger909 wants to merge 16 commits into
Conversation
fix: linux files owner
restore defly wallet option
fix: dependabot alert
fix: improve Windows service recovery and process handling
feat: external node management
release v5.2.1
Advanced dashboard, Getting Started, docs
Fix password link and override Vite dependency
open graph metadata
docs: integrations
Enhance diagnostics and error handling in node configuration
Add path-based YARP routes (/algod/algorand/... and /algod/voi/...) so the web UI talks to algod through FUNC's own port. Remote access then needs a single open port, and FUNC works behind a reverse proxy. The legacy /v2 and /debug routes and the 3537/3538 listeners are unchanged. - Move the proxy transform into AlgodProxy and add routing tests - Web UI builds algod URLs with algodBaseUrl() instead of host:port - Update remote-access docs, changelog and README dev note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Tell FUNC and the node apart in errors from proxied algod calls: a 502/504 from the proxy now says the node isn't answering, and a call that gets no answer at all names the FUNC service instead of algod. - Set the proxy's algod ports at startup (Node.SyncProxyPort), so /algod/<network> reaches a node on a non-default port before any page has loaded. - Remove the unused port prop from Participation.vue.
This branch has not been deployed
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.
Why
The web UI reaches algod on separate ports: 8081/8082 over HTTP, and 3537/3538 over HTTPS (where YARP picks the network from the port). So remote users must open extra ports, and FUNC can't sit behind a reverse proxy: a page served at
https://func.example.lanstill sends the browser to:3537/:3538, which are FUNC's own listeners with its own self-signed certificate. That also blocks the usual fix for the certificate warning, a reverse proxy with a trusted certificate. The warning matters, because WalletConnect and the copy buttons need a secure context.What
Two new YARP routes put the network in the path, so the UI reaches algod through FUNC's own origin:
appsettings.json:algod-v2andalgod-debugroutes.{network}is constrained toalgorand|voi, so anything else is a 404. The destination host is alwayslocalhost, and the port comes from FUNC's ownSharedvalues.AlgodProxy.cs(new): the existing transform, moved out ofProgram.csso it can be tested. It prefers the route's network and otherwise keeps today's logic (Request.Host.Port == 3538→ Voi). It lower-cases the network because the regex route constraint is case-insensitive.algodBaseUrl(name)(${funcOrigin}/algod/<network>) is used byAlgodFunc,Participation.vueandConfig.vue. It replacesnodeHostname(), which had no callers left. algosdk keeps the base path (covered by a test).remote-access.mdnow needs one port (3537, or 3536) and has a "Behind a reverse proxy" section with a Caddy example. Also a changelog entry, and the README dev note.Additive: the
/v2/*and/debug/*routes, the 3537/3538 listeners and the algod ports all keep working unchanged.Testing
FUNC.Tests/AlgodProxyTests.cs(no new packages): both networks reach the right stub algod, the/algod/<network>prefix is stripped, the query string is kept, unknown networks get a 404, and a legacy/v2/statuswith Host:3538still goes to Voi.algodBaseUrl,AlgodFuncrequest URL plus token header, and error messages naming the proxied endpoint.pnpm typecheckis clean..deb, with Algorand on 8081 and Voi on 8080, both nodes live:https://host:3537from a LAN client: both networks work over the one port, with no connections to 3538. Logs show Voi going to 8080 and Algorand to 8081: status, thewait-for-block-afterlong-poll,blocks?format=msgpack, accounts, ledger, participation, and/debug/settings/config.tls internal,reverse_proxy 127.0.0.1:3536, nothing else): the dashboard works for both networks with no certificate warning, and the copy buttons and WalletConnect pairing work.Notes
Shared.AlgoPort/VoiPortare only refreshed byNode.Get. Right after FUNC starts, before any page has loaded,/algod/voi(and:3538today) goes to the default 8082. On a box where Voi isn't on 8082, that first request gets a 502 until the UI loads. The UI always callsNode.Getfirst, so it isn't affected.Participation.vue'sportprop is now unused.Connection.LocalPortinstead of the Host header, requiring a FUNC session on/algod/*, and an optional bring-your-own certificate for 3537.