Files
SatsFaucet/backend/.env.example
Michilis 5d02d1396f Admin API key auth, account_too_new fixes, clear-all-users cache
- Add ADMIN_API_KEY to config; accept via X-Admin-Key or Bearer (constant-time compare)
- Never serve cached null for nostr_first_seen_at; admin clear-cache and override-age
- Add clearAllUsersCache() and POST /admin/users/clear-cache for all users
- Update .env.example with admin API key and pubkeys comments

Made-with: Cursor
2026-03-16 19:53:05 +00:00

66 lines
1.8 KiB
Plaintext

# Server
PORT=3001
TRUST_PROXY=false
# Comma-separated origins for CORS (default allows 5173 and 5174)
# ALLOWED_ORIGINS=http://localhost:5173,http://localhost:5174
# Database: omit for SQLite (default); set for Postgres
# DATABASE_URL=postgresql://user:pass@localhost:5432/faucet
# SQLITE_PATH=./data/faucet.db
# Security (required)
HMAC_IP_SECRET=your-secret-key-min-32-chars
JWT_SECRET=your-jwt-secret-min-32-chars
JWT_EXPIRES_IN_SECONDS=604800
NIP98_MAX_SKEW_SECONDS=300
NONCE_TTL_SECONDS=600
# Faucet economics
FAUCET_ENABLED=true
EMERGENCY_STOP=false
# Payout: random amount between FAUCET_MIN_SATS and FAUCET_MAX_SATS (inclusive)
FAUCET_MIN_SATS=10
FAUCET_MAX_SATS=100
DAILY_BUDGET_SATS=10000
MAX_CLAIMS_PER_DAY=100
MIN_WALLET_BALANCE_SATS=1000
# Eligibility
MIN_ACCOUNT_AGE_DAYS=14
MIN_ACTIVITY_SCORE=30
MIN_NOTES_COUNT=5
MIN_FOLLOWING_COUNT=10
MIN_FOLLOWERS_COUNT=0
ACTIVITY_LOOKBACK_DAYS=90
# Cooldowns
COOLDOWN_DAYS=7
IP_COOLDOWN_DAYS=7
MAX_CLAIMS_PER_IP_PER_PERIOD=1
# Nostr
NOSTR_RELAYS=wss://relay.damus.io,wss://relay.nostr.band
RELAY_TIMEOUT_MS=5000
MAX_EVENTS_FETCH=500
METADATA_CACHE_HOURS=24
# LNbits
LNBITS_BASE_URL=https://azzamo.online
LNBITS_ADMIN_KEY=your-admin-key
LNBITS_WALLET_ID=your-wallet-id
DEPOSIT_LIGHTNING_ADDRESS=faucet@yourdomain.com
DEPOSIT_LNURLP=https://yourdomain.com/.well-known/lnurlp/faucet
# Cashu redeem (optional; default: https://cashu-redeem.azzamo.net)
# CASHU_REDEEM_API_URL=https://cashu-redeem.azzamo.net
# Sponsors
BASE_SPONSOR_PRICE_PER_DAY=200
SPONSOR_MAX_ACTIVE_PER_USER=5
SPONSOR_MAX_VISIBLE=6
# Admin API: shared secret or Nostr pubkeys
# ADMIN_API_KEY=your-secure-random-key-min-32-chars
# ADMIN_PUBKEYS=abc123...,def456...
# Public API URL for LNbits webhook (e.g. https://api.example.com)
# PUBLIC_API_URL=https://api.example.com