Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/reference/agent-lessons/codex-prod-siwe-domain-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Agent Lessons: codex-prod-siwe-domain-config

Task: Fix production SIWE domain configuration and prevent www/apex drift.
Status: Active

## Push Review

## Lessons

### Lesson: SIWE app URL must match the browser origin exactly

- Domain: prod-config
- Severity: warning
- Trigger: Production MetaMask login showed an asset-risk warning because the Gateway SIWE challenge used `https://www.synapse-network.ai` while the user-facing origin was `https://synapse-network.ai`.
- Root cause: Cloud Run runtime drift and deploy defaults mixed `www` and apex production hosts.
- Fix: Update production runtime immediately, change the prod deploy default to the apex host, and document `PUBLIC_APP_BASE_URL=https://synapse-network.ai` in prod examples.
- Rule: Wallet login challenge domain, SIWE URI host, and browser origin must be identical per environment.
- Upgrade: agents-memory
2 changes: 1 addition & 1 deletion scripts/deploy/gcp_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ synapse_load_gcp_env() {
export ADMIN_FRONT_HOST="${ADMIN_FRONT_HOST:-admin.synapse-network.ai}"
export ADMIN_API_HOST="${ADMIN_API_HOST:-admin-api.synapse-network.ai}"
export DOCS_HOST="${DOCS_HOST:-docs.synapse-network.ai}"
export USER_FRONT_HOST="${USER_FRONT_HOST:-www.synapse-network.ai}"
export USER_FRONT_HOST="${USER_FRONT_HOST:-synapse-network.ai}"
export TX_EXPLORER_BASE_URL="${TX_EXPLORER_BASE_URL:-https://arbiscan.io}"
export PUBLIC_RPC_URL="${PUBLIC_RPC_URL:-https://arb1.arbitrum.io/rpc}"
export USER_FRONT_CONTRACT_CONFIG_SOURCE="${USER_FRONT_CONTRACT_CONFIG_SOURCE:-src/contract-config.arbitrum-one.prod.json}"
Expand Down
7 changes: 7 additions & 0 deletions services/gateway/.env.prod.example
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ GMAIL_SMTP_USERNAME=alerts@synapse.example
GMAIL_SMTP_APP_PASSWORD=replace-with-google-app-password
EMAIL_FROM="Synapse Network <alerts@synapse.example>"
EMAIL_REPLY_TO=support@synapse.example

# Public URLs used in emails, receipts, and SIWE login challenges.
# Keep PUBLIC_APP_BASE_URL host identical to the browser origin. Do not use
# https://www.synapse-network.ai unless the user-facing app is also served from
# that exact host, or wallets may show a domain-mismatch security warning.
PUBLIC_GATEWAY_BASE_URL=https://api.synapse-network.ai
PUBLIC_APP_BASE_URL=https://synapse-network.ai
EMAIL_SEND_TIMEOUT_SEC=10
EMAIL_WORKER_BATCH_SIZE=50
EMAIL_OUTBOX_MAX_ATTEMPTS=8
Expand Down
1 change: 1 addition & 0 deletions services/user-front/.env.prod.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ NEXT_PUBLIC_ANALYTICS_ENDPOINT=https://gateway.your-domain.example/api/v1/events
NEXT_PUBLIC_SERVICE_LIST_CACHE_TTL_MS=20000
NEXT_PUBLIC_APP_ENV=prod
NEXT_PUBLIC_DOCS_BASE_URL=https://docs.synapse-network.ai
NEXT_PUBLIC_CONSOLE_BASE_URL=https://synapse-network.ai/dashboard/overview
NEXT_PUBLIC_TX_EXPLORER_BASE_URL=https://arbiscan.io
NEXT_PUBLIC_SUPPORT_EMAIL=support@your-domain.example
NEXT_PUBLIC_SUPPORT_PORTAL_URL=
Expand Down
Loading