fix(frontend): keep the public wallet config in the repo, not in deployment secrets - #53
Merged
Merged
Conversation
…oyment secrets The guard delegation section needs a Citrea RPC URL and a WalletConnect project id. Both are public by nature: they are baked into the browser bundle and visible to anyone who opens the dashboard. Wiring them through repository secrets was therefore the wrong mechanism — it implied they were sensitive, and it made the delegate button depend on deployment configuration that a local or fork build cannot have. They are now Dockerfile defaults, exactly like VITE_API_BASE_URL above them, and both workflows stop passing them. A plain `docker build` now produces a working delegate button, and a deployment that wants a different endpoint or project can still override either with --build-arg. The RPC default is the same public endpoint the backend uses; it answers browser requests directly (access-control-allow-origin: *), so it needs no proxy. Verified by building the image without any build-arg and confirming both values are present in the emitted bundle.
… baked RPC URL The delegate action builds its chain from the chain id the backend reports, while the RPC URL is now a fixed default in this image. Repointing the backend at another network without overriding the build-arg in the same breath leaves the wallet transport pointed at Citrea while the declared chain id says otherwise, and that combination builds silently. Naming the coupling where the override lives is cheaper than a runtime cross-check and does not add a mechanism whose own failure modes would need reviewing.
Contributor
Author
|
Two review passes (conformity and behaviour), both clean. The behaviour pass raised one latent hazard worth naming rather than mechanising: the delegate action derives its chain from the chain id the backend reports, while the RPC URL is now a fixed default, so repointing the backend at another network without overriding the build-arg would leave the two disagreeing. That coupling is now stated in the Dockerfile next to the override it concerns. |
TaprootFreak
marked this pull request as ready for review
July 28, 2026 06:19
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.
Summary
#49 wired the guard delegation section's two configuration values — a Citrea RPC URL and a WalletConnect
project id — through repository secrets. That was the wrong mechanism. Both are public by nature: they
are baked into the browser bundle at build time and visible to anyone who opens the dashboard. Treating them
as secrets implied a sensitivity they do not have, and it made the delegate button depend on deployment
configuration that a local build or a fork cannot supply.
They are now defaults in
frontend/Dockerfile, directly alongsideVITE_API_BASE_URL, which already workedthis way. Both frontend workflows stop passing them.
Effect
VITE_DEPLOYMENT_ENVproduces a working delegate button. (That one still has no default and is stillchecked fail-loud in
frontend/src/constants.ts, deliberately — it must be exactlyprdordev. This PRdoes not change it.)
--build-arg.from the backend
GET /guardendpoint and never needed these values.The RPC default
https://rpc.citreascan.com— the same public endpoint the backend already uses. Verified that it answersbrowser requests directly, so the bundle needs no proxy:
0x1012is 4114, matchingBLOCKCHAIN_ID.Verification
Built the image with no build-arg for either value and confirmed both are present in the emitted bundle,
which is what proves the defaults take effect:
actionlintclean on both workflows, and both parse as valid YAML with theirbuildanddeployjobsintact.
frontend/.env.examplenow says what these values actually are — public, defaulted in the image, neededlocally only for the dev server — instead of describing them as required secrets.