- NEVER commit
.envfiles (except.env.example) - ALWAYS use environment variables for secrets
- VERIFY before deploying:
./scripts/verify-env-security.sh - ROTATE secrets every 90-180 days
| File | Purpose | Commit to Git? |
|---|---|---|
.env.example |
Template with empty values | ✅ YES |
.env.local.example |
Local dev template | ✅ YES |
.env.production.example |
Production template | ✅ YES |
.env |
Active configuration | ❌ NO |
.env.local |
Local development | ❌ NO |
.env.production |
Production | ❌ NO |
# Backend
cp backend/.env.local.example backend/.env.local
# Edit backend/.env.local
# Frontend
cp frontend/.env.local.example frontend/.env.local
# Edit frontend/.env.local
# Verify
./scripts/verify-env-security.sh# Backend
cp backend/.env.production.example backend/.env.production
# Edit backend/.env.production
# Frontend
cp frontend/.env.production.example frontend/.env.production
# Edit frontend/.env.production
# Verify
./scripts/verify-env-security.shSTELLAR_RPC_URL=https://soroban-testnet.stellar.org
STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
VAULT_CONTRACT_ID=your-contract-idVITE_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
VITE_STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
VITE_VAULT_CONTRACT_ID=your-contract-idSTELLAR_RPC_URL=https://soroban-testnet.stellar.org
STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015STELLAR_RPC_URL=https://soroban-mainnet.stellar.org
STELLAR_NETWORK_PASSPHRASE=Public Global Stellar Network ; September 2015echo "VAULT_CONTRACT_ID=your-id" >> backend/.env.local
echo "VITE_VAULT_CONTRACT_ID=your-id" >> frontend/.env.localCheck RPC URL and passphrase match (both testnet or both mainnet)
echo "CORS_ALLOWED_ORIGINS=http://localhost:5173" >> backend/.env.localAdd ?sslmode=require for production databases
- Run
./scripts/verify-env-security.sh - Verify no
.envfiles in git:git ls-files | grep "\.env$" - Check network matches (testnet vs mainnet)
- Verify CORS origins are correct
- Confirm all secrets are production-grade
- Test database connectivity
- Verify contract ID is correct for network
- Full Guide: ENVIRONMENT_SETUP_GUIDE.md
- Security Checklist: SECURITY_ENV_CHECKLIST.md
- Quick Start: ENV_SETUP_README.md
- Implementation: ISSUE_38_IMPLEMENTATION_SUMMARY.md
# Run this before every deployment
./scripts/verify-env-security.shWhat it checks:
- ✓ .env files are gitignored
- ✓ No secrets committed
- ✓ No hardcoded secrets in code
- ✓ Proper file structure
- ✓ No secrets in git history
- Immediately rotate the secret
- Revoke the old secret/key
- Update all environments
- Check logs for unauthorized access
- Remove from git history if committed
- Follow full incident response in SECURITY_ENV_CHECKLIST.md
- Check ENV_SETUP_README.md
- Review example files
- Run verification script
- Contact DevOps team
Print this card and keep it handy! 📌