-
Notifications
You must be signed in to change notification settings - Fork 0
Production build and deployment infrastructure for CASTQUEST V3 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
130762f
Initial plan
Copilot c23ced9
Add production build and deployment infrastructure
Copilot 36de0e8
Add validation, tests, and documentation
Copilot 6e65e96
Fix code review issues
Copilot 2bbf937
Address code review feedback - fix critical issues
Copilot 8a04db3
Apply PR fixes per review: separate IAM role, add root path, update c…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| # ======================================== | ||
| # CASTQUEST V3 - Production Environment Template | ||
| # ======================================== | ||
| # Copy this file to .env.production and fill in actual values | ||
| # NEVER commit .env.production with real secrets! | ||
|
|
||
| # ======================================== | ||
| # Blockchain RPC Endpoints | ||
| # ======================================== | ||
| # Ethereum Mainnet | ||
| RPC_URL_MAINNET=https://eth-mainnet.alchemyapi.io/v2/YOUR_ALCHEMY_KEY | ||
| # Base Mainnet | ||
| RPC_URL_BASE=https://base-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY | ||
| # Arbitrum One | ||
| RPC_URL_ARBITRUM=https://arb-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY | ||
| # Optimism Mainnet | ||
| RPC_URL_OPTIMISM=https://opt-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY | ||
| # Polygon Mainnet | ||
| RPC_URL_POLYGON=https://polygon-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY | ||
| # Solana Mainnet | ||
| RPC_URL_SOLANA=https://api.mainnet-beta.solana.com | ||
|
|
||
| # ======================================== | ||
| # Contract Deployment | ||
| # ======================================== | ||
| # CRITICAL: Keep this secure! Use hardware wallet or KMS in production | ||
| PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000 | ||
| DEPLOYER_ADDRESS=0x0000000000000000000000000000000000000000 | ||
|
|
||
| # Chain IDs | ||
| CHAIN_ID_MAINNET=1 | ||
| CHAIN_ID_BASE=8453 | ||
| CHAIN_ID_ARBITRUM=42161 | ||
| CHAIN_ID_OPTIMISM=10 | ||
| CHAIN_ID_POLYGON=137 | ||
|
|
||
| # ======================================== | ||
| # Database | ||
| # ======================================== | ||
| DATABASE_URL=postgresql://username:password@localhost:5432/castquest_prod | ||
| DATABASE_POOL_SIZE=20 | ||
| DATABASE_SSL=true | ||
|
|
||
| # Redis | ||
| REDIS_URL=redis://localhost:6379 | ||
| REDIS_TLS_ENABLED=true | ||
|
|
||
| # ======================================== | ||
| # Next.js Public Variables | ||
| # ======================================== | ||
| NEXT_PUBLIC_APP_URL=https://castquest.io | ||
| NEXT_PUBLIC_API_URL=https://api.castquest.io | ||
| NEXT_PUBLIC_WS_URL=wss://ws.castquest.io | ||
|
|
||
| # Contract Addresses (update after deployment) | ||
| NEXT_PUBLIC_CAST_TOKEN_ADDRESS= | ||
| NEXT_PUBLIC_QUEST_TOKEN_ADDRESS= | ||
| NEXT_PUBLIC_MARKETPLACE_ADDRESS= | ||
| NEXT_PUBLIC_AUCTION_HOUSE_ADDRESS= | ||
|
|
||
| # Network Configuration | ||
| NEXT_PUBLIC_DEFAULT_CHAIN_ID=8453 | ||
| NEXT_PUBLIC_SUPPORTED_CHAINS=1,8453,42161,10,137 | ||
|
|
||
| # ======================================== | ||
| # AI Provider Keys | ||
| # ======================================== | ||
| # OpenAI | ||
| OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| OPENAI_ORG_ID=org-xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
|
||
| # Anthropic Claude | ||
| ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
|
||
| # Hugging Face (for local models) | ||
| HUGGINGFACE_API_KEY=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
|
||
| # ======================================== | ||
| # Storage & CDN | ||
| # ======================================== | ||
| # AWS S3 | ||
| AWS_REGION=us-east-1 | ||
| AWS_ACCESS_KEY_ID=AKIAXXXXXXXXXXXX | ||
| AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| AWS_S3_BUCKET_NAME=castquest-prod-assets | ||
| AWS_CLOUDFRONT_DISTRIBUTION_ID=E1234567890ABC | ||
|
|
||
| # IPFS/Pinata | ||
| PINATA_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx | ||
| PINATA_SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| IPFS_GATEWAY_URL=https://gateway.pinata.cloud | ||
|
|
||
| # ======================================== | ||
| # Authentication & Security | ||
| # ======================================== | ||
| # NextAuth | ||
| NEXTAUTH_URL=https://castquest.io | ||
| NEXTAUTH_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
|
||
| # JWT | ||
| JWT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| JWT_EXPIRY=7d | ||
|
|
||
| # Rate Limiting | ||
| RATE_LIMIT_MAX_REQUESTS=100 | ||
| RATE_LIMIT_WINDOW_MS=900000 | ||
|
|
||
| # ======================================== | ||
| # External APIs | ||
| # ======================================== | ||
| # Farcaster | ||
| FARCASTER_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| FARCASTER_HUB_URL=https://hub.farcaster.xyz | ||
|
|
||
| # Wallet Connect | ||
| WALLETCONNECT_PROJECT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
|
||
| # Alchemy | ||
| ALCHEMY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
|
||
| # Etherscan (for verification) | ||
| ETHERSCAN_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| BASESCAN_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| ARBISCAN_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
|
||
| # ======================================== | ||
| # Monitoring & Telemetry | ||
| # ======================================== | ||
| # Sentry | ||
| SENTRY_DSN=https://xxxxxxxxxxxxxxxxxxxxxxxxxxxx@sentry.io/1234567 | ||
| SENTRY_ENV=production | ||
| SENTRY_TRACES_SAMPLE_RATE=0.1 | ||
|
|
||
| # Datadog | ||
| DD_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| DD_APP_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| DD_SITE=datadoghq.com | ||
|
|
||
| # Prometheus/Grafana | ||
| METRICS_ENABLED=true | ||
| METRICS_PORT=9090 | ||
|
|
||
| # ======================================== | ||
| # Email & Notifications | ||
| # ======================================== | ||
| SMTP_HOST=smtp.sendgrid.net | ||
| SMTP_PORT=587 | ||
| SMTP_USER=apikey | ||
| SMTP_PASSWORD=SG.xxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| EMAIL_FROM=noreply@castquest.io | ||
|
|
||
| # Slack Webhooks (for alerts) | ||
| SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx/yyy/zzz | ||
|
|
||
| # ======================================== | ||
| # Feature Flags | ||
| # ======================================== | ||
| ENABLE_L3_FEATURES=true | ||
| ENABLE_SOLANA_INTEGRATION=true | ||
| ENABLE_AUCTION_HOUSE=true | ||
| ENABLE_SOCIAL_AUTOMATION=true | ||
|
|
||
| # ======================================== | ||
| # Performance & Scaling | ||
| # ======================================== | ||
| NODE_ENV=production | ||
| LOG_LEVEL=info | ||
| MAX_WORKERS=4 | ||
| CACHE_TTL=3600 | ||
|
|
||
| # ======================================== | ||
| # Infrastructure | ||
| # ======================================== | ||
| # Kubernetes | ||
| K8S_NAMESPACE=castquest-prod | ||
| K8S_CLUSTER_NAME=castquest-prod-cluster | ||
|
|
||
| # Docker Registry | ||
| DOCKER_REGISTRY=ghcr.io/castquest | ||
| DOCKER_IMAGE_TAG=latest | ||
|
|
||
| # Terraform State | ||
| TF_STATE_BUCKET=castquest-terraform-state | ||
| TF_STATE_KEY=prod/terraform.tfstate | ||
| TF_STATE_REGION=us-east-1 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { | ||
| "extends": ["eslint:recommended"], | ||
| "env": { | ||
| "node": true, | ||
| "es2020": true | ||
| }, | ||
| "parserOptions": { | ||
| "ecmaVersion": 2020, | ||
| "sourceType": "module" | ||
| }, | ||
| "plugins": ["security"], | ||
| "rules": { | ||
| "security/detect-object-injection": "warn", | ||
| "security/detect-non-literal-regexp": "warn", | ||
| "security/detect-non-literal-require": "warn", | ||
| "security/detect-unsafe-regex": "error", | ||
| "security/detect-buffer-noassert": "error", | ||
| "security/detect-child-process": "warn", | ||
| "security/detect-disable-mustache-escape": "error", | ||
| "security/detect-eval-with-expression": "error", | ||
| "security/detect-no-csrf-before-method-override": "error", | ||
| "security/detect-non-literal-fs-filename": "warn", | ||
| "security/detect-pseudoRandomBytes": "error", | ||
| "security/detect-possible-timing-attacks": "warn", | ||
| "no-eval": "error", | ||
| "no-implied-eval": "error", | ||
| "no-new-func": "error" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PRIVATE_KEY in the template is all zeros (0x00...00), which is actually a valid private key format that could theoretically be used. For a template, use a more obviously invalid placeholder like 'your-private-key-here' or add a validation check to prevent deployment with this key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 2bbf937. Changed PRIVATE_KEY placeholder from all zeros to
your-private-key-hereto make it obviously invalid and prevent accidental use.