# ==================== BOT SERVER CONFIG ==================== # Server Port PORT=3000 # WhatsApp Configuration # Format: nomor Indonesia tanpa +, contoh: 628123456789 RECIPIENT_NUMBER=628123456789 # Group Chat ID (optional, untuk alert ke group) # Format: @g.us atau kosongkan untuk disable GROUP_JID= # Message text saat sensor tersentuh MESSAGE_TEXT=Sensor tersentuh! # ==================== SECURITY ==================== # API Key untuk protect sensitive endpoints (/logout, /relogin) # Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" # Format: Bearer API_KEY=your_secure_api_key_here_change_this # Allowed IPs untuk WebSocket (ESP32 connection) # CIDR format, comma-separated # Contoh: 192.168.1.100,192.168.1.0/24,172.17.0.0/16 ALLOWED_IPS=127.0.0.1,172.20.0.0/16 # ==================== CLOUDFLARE TUNNEL ==================== # Cloudflare Tunnel Token # Get token: cloudflared tunnel create bot-server # Atau lihat di: https://dash.cloudflare.com/?to=/:account/resources/list/tunnels CLOUDFLARE_TOKEN= # Tunnel URL (optional, for reference) # Format: https://bot-.cfargotunnel.com TUNNEL_URL= # ==================== DOCKER & DEPLOYMENT ==================== # Environment (production/development) NODE_ENV=production # Container restart policy (unless-stopped, always, no, on-failure) RESTART_POLICY=unless-stopped # ==================== LOGGING ==================== # Log level (trace, debug, info, warn, error) LOG_LEVEL=info # ==================== NOTES ==================== # Buat Cloudflare Tunnel: # 1. Install cloudflared: https://developers.cloudflare.com/cloudflare-one/connections/connect-applications/install-and-setup/installation/ # 2. Login: cloudflared tunnel login # 3. Create: cloudflared tunnel create bot-server # 4. Copy token ke CLOUDFLARE_TOKEN di file ini # 5. Run: docker-compose up -d # Generate API Key (bash): # node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" # Generate API Key (Python): # python3 -c "import secrets; print(secrets.token_hex(32))"