fix(nginx): add proxy mappings for /agent/ and /anchors to resolve 404s#6828
Conversation
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
qingfeng312
left a comment
There was a problem hiding this comment.
Formal review for bounty #73.
This PR should not close #6693 as-is. The issue reports three separate failures: /agent/* 404s, /anchors 404, and the raw-IP explorer URL failing browser TLS validation. This patch only adds nginx proxy locations for the application routes. It does not change the certificate/default-server behavior for https://50.28.86.131/explorer/, and the checked-in config still only references the rustchain.org certbot certificate in the TLS server block.
Because the PR body says Resolves #6693, merging it would close an issue that still has one of its documented reproduction paths unresolved. Please either narrow the closing text/scope to the route 404s, or add the deployment/certificate/redirect coverage needed for the raw-IP TLS case as well.
…LS validation errors
|
I have added the redirect coverage for the raw-IP TLS case in |
thenaturelover343-jpg
left a comment
There was a problem hiding this comment.
Changes requested
I found one blocker in the nginx mapping added here.
The linked issue only needs the public explorer to read /agent/stats, /agent/jobs, /anchors, and /anchor/list, but this change exposes the whole /agent/ prefix through rustchain.org. In the integrated app that prefix includes multiple mutating POST routes, including /agent/jobs, /agent/jobs/<job_id>/claim, /agent/jobs/<job_id>/deliver, /agent/jobs/<job_id>/accept, /agent/jobs/<job_id>/dispute, and /agent/jobs/<job_id>/cancel from rip302_agent_economy.py.
The new nginx block also advertises POST, GET, OPTIONS and allows X-Admin-Key in CORS for that entire prefix. That is broader than the bug report requires and could unintentionally make Agent Economy write/admin-style endpoints reachable from the public website path.
Suggested fix: split the read-only explorer endpoints from the mutable Agent Economy API. For this PR, proxy only the needed GET routes, for example exact /agent/stats and /agent/jobs, and keep methods/CORS headers read-only unless there is a separate deployment decision to expose all Agent Economy POST routes publicly.
The /anchors and /anchor/ mappings look directionally aligned with the current app routes: the integrated node has /anchors -> /anchor/list, and the anchor module exposes /anchor/status, /anchor/proof/<height>, and /anchor/list.
…oints to prevent write-route exposure
|
I have restricted the agent economy proxy endpoints to GET requests for /agent/stats and /agent/jobs only (with GET and OPTIONS methods), keeping the rest of the /agent/* mutable endpoints secure from public website access. Let me know if everything looks good now! |
✅ Merging — fixes /agent/ routing (read-only, public)Adds nginx proxy mappings for |
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing.
Resolves #6693
This PR resolves the 404 errors for the agent economy endpoints (
/agent/stats,/agent/jobs) and the/anchorspage in the explorer:location /agent/Nginx proxy pass block to forward Agent-to-Agent economy routes (RIP-302) to the Flask backend running on port 8099.location = /anchorsandlocation /anchor/Nginx proxy pass blocks to properly route/redirect Ergo Anchors endpoints.