-
Notifications
You must be signed in to change notification settings - Fork 217
Expand file tree
/
Copy path.env.example
More file actions
124 lines (99 loc) · 6.09 KB
/
Copy path.env.example
File metadata and controls
124 lines (99 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#Mock data of the original .env file for development purposes. Do not use in production.
# ── Required ─────────────────────────────────────────────────────────────────
# These must be set or the app will fail at startup with a validation error.
# Supabase — required for metadata service
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=YOUR-SUPERBASE-SERVICE-ROLE
# JWT — for SIWS-issued tokens (min 32 characters)
JWT_SECRET=RANDOM-STRINGS-OFCHARACTERS
# Admin dashboard — bearer token for /admin/* endpoints (required)
ADMIN_TOKEN=long-random-strings-of character
# Admin IP allowlist — comma-separated CIDRs/IPs; empty string allows all IPs
ADMIN_IP_ALLOWLIST=
# ── Optional (with defaults) ─────────────────────────────────────────────────
# Server
PORT=3001
MAINTENANCE_MODE=false
# Stellar — testnet (default) or mainnet; drives Horizon / contract defaults and indexer URL if INDEXER_URL is unset
STELLAR_NETWORK=testnet
# Optional overrides (otherwise derived from STELLAR_NETWORK)
# STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
# STELLAR_CONTRACT_ID=C...
# Indexer — tikka-indexer internal API (omit to use the default URL for STELLAR_NETWORK)
INDEXER_URL=http://localhost:3002
INDEXER_TIMEOUT_MS=5000
# JWT expiry
JWT_EXPIRES_IN=7d
# SIWS — domain shown in sign-in message
SIWS_DOMAIN=tikka.io
# Push Notifications (FCM)
# Enable only when FCM service account is configured.
FCM_ENABLED=false
# JSON text of Firebase service account credentials (use in CI) or leave empty for unset.
FCM_SERVICE_ACCOUNT_JSON=
# Path to local service account key (e.g. /var/run/secrets/fcm-service-account.json).
FCM_SERVICE_ACCOUNT_PATH=
# Frontend origin allowed by CORS
VITE_FRONTEND_URL=http://localhost:5173
# Public-facing site URL for OG pre-render meta tags (falls back to VITE_FRONTEND_URL)
# Production: https://tikka.io
SITE_URL=http://localhost:5173
# ── Geolocation ──────────────────────────────────────────────────────────────
# Provider base URL for IP-to-country lookups.
# Default uses ip-api.com free tier (HTTP, 45 req/min, no key needed).
# For production, use a paid HTTPS endpoint (ip-api.com pro, ipinfo.io, etc.)
GEO_PROVIDER_URL=http://ip-api.com/json
GEO_TIMEOUT_MS=3000
# ── Rate Limiting ────────────────────────────────────────────────────────────
# Limits are per IP address. TTL values are in seconds.
# All values have sensible defaults — only set these to override.
# Default tier — applies to all public API endpoints
THROTTLE_DEFAULT_LIMIT=100 # max requests per window
THROTTLE_DEFAULT_TTL=60 # window size in seconds
# Auth tier — POST /auth/verify (brute-force protection)
# 5 attempts per 15 minutes prevents signature/nonce guessing attacks.
# Raise only if legitimate users are being blocked (e.g. automated wallet flows).
THROTTLE_AUTH_LIMIT=5
THROTTLE_AUTH_TTL=900
# Nonce tier — GET /auth/nonce
# 10 req/min prevents nonce-exhaustion and enumeration attacks.
# Normal sign-in flows require at most 1–2 nonce requests per session.
THROTTLE_NONCE_LIMIT=10
THROTTLE_NONCE_TTL=60
# ── Raffle metadata cache (Redis) ────────────────────────────────────────────
# When REDIS_URL is set, GET metadata reads use a cache-aside pattern with TTL below.
# Leave empty to always read from Supabase (no Redis required for local dev).
REDIS_URL=
# TTL for cached raffle_metadata rows (seconds). Default 600 = 10 minutes.
METADATA_CACHE_TTL_SECONDS=600
# Raffle creation tier — POST /raffles/*
# Limits are bucketed per authenticated wallet address (not per IP).
RAFFLE_CREATE_RATE_LIMIT=5
RAFFLE_CREATE_RATE_WINDOW_SECONDS=600
# Ticket purchase — POST /raffles/:id/purchase (disabled until blockchain integration is ready)
FEATURE_RAFFLE_TICKET_PURCHASE=false
# ── Backfill Service ─────────────────────────────────────────────────────────
# Maximum ledger range allowed per backfill run (default: 10000)
BACKFILL_MAX_RANGE=10000
# Per-ledger retry attempts on transient Horizon errors (default: 3)
BACKFILL_RETRY_COUNT=3
# Fixed delay between retries in milliseconds (default: 1000)
BACKFILL_RETRY_DELAY_MS=1000
# Horizon request timeout in milliseconds (default: 10000)
BACKFILL_HORIZON_TIMEOUT_MS=10000
# ── Sentry ───────────────────────────────────────────────────────────────────
# Error monitoring via sentry.io. Omitting SENTRY_DSN disables Sentry entirely
# — the app starts normally and logs a warning at startup.
# SENTRY_DSN=https://examplePublicKey@o0.ingest.sentry.io/0 # Sentry project DSN (leave unset to disable)
SENTRY_TRACES_SAMPLE_RATE=0.1 # Fraction of transactions to trace [0–1]; default 0.1
# ── Backup ────────────────────────────────────────────────────────────────────
# Used by scripts/backup.sh and the GitHub Actions backup workflow.
# Supabase connection URI (Settings -> Database -> Connection string -> URI)
SUPABASE_DB_URL=postgresql://postgres:<password>@db.<project-ref>.supabase.co:5432/postgres
# Cloudflare R2 (S3-compatible) — required for cloud backup upload
R2_BUCKET_NAME=tikka-backups
R2_ACCESS_KEY_ID=your-r2-access-key
R2_SECRET_ACCESS_KEY=your-r2-secret-key
R2_ENDPOINT_URL=https://<account-id>.r2.cloudflarestorage.com
# Pinata - for IPFS metadata pinning
PINATA_JWT=your_pinata_jwt_here