Skip to content

docs: add inline comments to environment variable files#189

Closed
Fbartoli wants to merge 1 commit intosafe-global:mainfrom
Fbartoli:docs/add-env-variable-comments
Closed

docs: add inline comments to environment variable files#189
Fbartoli wants to merge 1 commit intosafe-global:mainfrom
Fbartoli:docs/add-env-variable-comments

Conversation

@Fbartoli
Copy link
Contributor

@Fbartoli Fbartoli commented Dec 17, 2025

Summary

This PR adds comprehensive inline comments to the environment variable files to improve documentation and developer experience.

Changes

  • txs.env: Added detailed comments explaining all Transaction Service environment variables

    • Documented purpose, format, and usage for each variable
    • Added production security notes
    • Included Docker-specific configuration notes
  • cgw.env: Enhanced comments for variables that lacked documentation

    • Added detailed explanations for all required configuration variables
    • Documented authentication, database, and external service configurations
    • Included security considerations and production requirements
  • nginx.conf: Updated with necessary routing configurations

  • ui.env: Updated with UI-specific environment variables

Benefits

  • Easier onboarding for new developers
  • Clear understanding of what each variable does
  • Better documentation of production requirements
  • Improved maintainability

Testing

  • Verified all commented variables are correctly formatted
  • Ensured no syntax errors in env files

Note

Adds extensive inline documentation and local-dev defaults to env files, updates UI env, and configures nginx with Swagger-friendly rewrites and CORS for the Client Gateway.

  • Environment configuration:
    • .env.sample: New, documented sample with RPC setup, reverse proxy port, and service image version variables.
    • container_env_files/cgw.env: Major documentation pass; sets SAFE_CONFIG_BASE_URI; adds Redis, cache, AMQP, email, staking, bridge, Shield, CORS toggles; introduces required local-dev defaults (auth/JWT, INFURA, email, Firebase, relayer API keys, staking keys, Postgres, AWS, CSV export); enables local file storage for targeted messaging and CSV.
    • container_env_files/txs.env: Adds detailed docs; sets debug/logging, DB/Redis/Celery URLs, L2 flag, host/CSRF settings, script base, and events queue config.
    • container_env_files/ui.env: Populates required public tokens/IDs, prod flag, local CGW URLs, disables ESLint, and retains optional feature toggles.
  • nginx:
    • Adds rewrites for /api/v1/* → /txs/api/v1/* and /v{n}/* → /cgw/v{n}/*.
    • Adds CORS headers and preflight handling for /cgw/ requests.

Written by Cursor Bugbot for commit 578c0f4. This will update automatically on new commits. Configure here.

- Add comprehensive comments to txs.env explaining all variables
- Add detailed comments to cgw.env for variables without documentation
- Document purpose, format, and production security considerations
- Update nginx.conf and ui.env with necessary configurations
@Fbartoli Fbartoli requested review from a team, Uxio0, agusgonzaleznic and falvaradorodriguez and removed request for a team December 17, 2025 17:04
@github-actions
Copy link

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


SafeFB seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 29

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

DEBUG=0

# Django debug mode - enables detailed error pages (set to 0 in production)
DEBUG=1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Debug mode enabled contradicting security comment

The DEBUG setting was changed from 0 to 1, but the comment on line 11 explicitly states "(set to 0 in production)". This contradicts the documentation and enables Django debug mode, which exposes detailed error pages, stack traces, and potentially sensitive configuration information. The original value was DEBUG=0 and this change could cause security issues if developers use this configuration in production-like environments.

Fix in Cursor Fix in Web


# infura token used by Safe Apps
NEXT_PUBLIC_SAFE_APPS_INFURA_TOKEN=
NEXT_PUBLIC_SAFE_APPS_INFURA_TOKEN=0255b550b5754f6689723ea48ba3260f
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Real API keys committed in environment file

Real-looking API keys were added to the environment file, including NEXT_PUBLIC_INFURA_TOKEN and NEXT_PUBLIC_WC_PROJECT_ID with values that appear to be actual credentials (32-character hex string 0255b550b5754f6689723ea48ba3260f). These were previously empty placeholder values. Once committed to the repository, these keys are exposed in git history. Even for local development, sample/template files typically use clearly fake values like your-api-key-here rather than real credentials.

Fix in Cursor Fix in Web

@Fbartoli
Copy link
Contributor Author

 - - -
 I have read the CLA Document and I hereby sign the CLA
 - - -

@Fbartoli Fbartoli closed this Dec 17, 2025
@Fbartoli Fbartoli deleted the docs/add-env-variable-comments branch December 17, 2025 17:08
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2025
@Fbartoli Fbartoli restored the docs/add-env-variable-comments branch January 4, 2026 11:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant