# Bandwidth Monitor configuration
# This file should be chmod 0600 and owned by root
# Packages use /etc/bandwidth-monitor/env.
# Standalone installs use /opt/bandwidth-monitor/.env.

## Core

# Web server binding (host:port). Use :8080 to bind all interfaces.
LISTEN=:8080

# Choose web server protocol: http or https.
# HTTP example (default):
LISTEN_PROTOCOL=http

# Enable promiscuous mode for packet capture (true/false).
# PROMISCUOUS=true

# Log every HTTP request (method, path+query, remote addr, status, response
# size in bytes, duration) to stdout. Opt-in and noisy — useful for debugging
# client request patterns.
# DEBUG_HTTP_LOG=true

# Interface statistics polling interval. Increase this on CPU-constrained routers.
# Values below 100ms are rejected.
# COLLECTOR_INTERVAL=1s

# HTTPS example:
# LISTEN=:8443
# LISTEN_PROTOCOL=https
# TLS certificate and private key are required when LISTEN_PROTOCOL=https.
# TLS_CERT_FILE=/etc/bandwidth-monitor/server.crt
# TLS_KEY_FILE=/etc/bandwidth-monitor/server.key

## Interface Selection

# Comma-separated list of interfaces to monitor and display.
# Controls both the web UI and packet capture (top talkers).
# If not set, all interfaces (except loopback) are used.
# INTERFACES=eth0,ppp0,wg0,br-lan

# Explicitly mark interface(s) as WAN uplink.
# Useful for double-NAT setups where the WAN interface has a private IP.
# If not set, WAN is auto-detected (public IPv4, PPP type, or default route).
# WAN_INTERFACE=eth0

## GeoIP

# GeoIP MMDB paths (relative to WorkingDirectory)
# City DB includes country, city, and coordinates for map visualization.
# Falls back to Country DB if City is unavailable.
# GEO_CITY=GeoLite2-City.mmdb
# GEO_ASN=GeoLite2-ASN.mmdb

## DNS Provider (choose one)

# AdGuard Home
# ADGUARD_URL=http://adguard.example.local
# ADGUARD_USER=your_username
# ADGUARD_PASS=your_password

# NextDNS (alternative to AdGuard Home)
# NEXTDNS_PROFILE=abc123
# NEXTDNS_API_KEY=your_api_key

# Pi-hole v6 (alternative to AdGuard Home / NextDNS)
# PIHOLE_URL=http://pi.hole
# PIHOLE_PASSWORD=your_password

## WiFi Provider (choose one)

# UniFi controller (mutually exclusive with Omada)
# UNIFI_URL=https://unifi.example.local:8443
# UNIFI_USER=your_username
# UNIFI_PASS=your_password
# UNIFI_SITE=default

# TP-Link Omada controller (mutually exclusive with UniFi)
# OMADA_URL=https://omada.example.local
# OMADA_USER=your_username
# OMADA_PASS=your_password
# OMADA_SITE=Default

## Network And VPN

# VPN routing status files: comma-separated iface=path pairs
# The 99-vpn-status hotplug script reads this to create/remove sentinel files
# when WireGuard interfaces go up/down on OpenWRT.
# VPN_STATUS_FILES=wg0=/run/wg0-active,wg1=/run/wg1-active

# Local networks for RX/TX direction detection (auto-discovered if not set)
# Override for SPAN ports or dynamic ISP prefixes
# LOCAL_NETS=192.0.2.0/24,2001:db8::/48

# SPAN/mirror port: override RX/TX direction on this interface using pcap.
# Requires LOCAL_NETS to be set. Other interfaces keep normal /proc/net/dev stats.
# SPAN_DEVICE=eth1

## Diagnostics

# Speed test target server
# SPEEDTEST_SERVER=https://speed.ffmuc.net

# Set to false to completely disable latency monitoring and its outbound probes.
# LATENCY_MONITORING=false
#
# Comma-separated hostnames/IPs to probe via ICMP + HTTPS.
# Defaults to anycast01.ffmuc.net, anycast02.ffmuc.net, dns.quad9.net, dns3.digitalcourage.de if not set.
# LATENCY_TARGETS=anycast01.ffmuc.net,anycast02.ffmuc.net,dns.quad9.net,dns3.digitalcourage.de

## iOS Live Activity push (optional, advanced — most people don't need this)

# By default, the iOS app's Lock Screen / Dynamic Island Live Activity is kept updating while the
# app is closed via a shared relay gateway (see apnsgateway/), not by this server — nothing here
# needs to be configured for that. This section is only for operators who'd rather hold their own
# APNs key and push directly, independent of any relay. Enabled only when APNS_KEY_FILE is set.
# The server needs outbound HTTPS to Apple's APNs (api.push.apple.com:443).
#
# APNS_KEY_FILE: path to the APNs auth key (.p8) created at developer.apple.com (Keys → enable
# Apple Push Notification service). Keep it chmod 0600.
# APNS_KEY_FILE=/etc/bandwidth-monitor/AuthKey_XXXXXXXXXX.p8
# APNS_KEY_ID=XXXXXXXXXX
# APNS_TEAM_ID=<your Apple Developer team ID>
# APNS_BUNDLE_ID=<your app's bundle ID>
# APNS_ENV: production (TestFlight/App Store builds, default) or sandbox (builds run from Xcode).
# APNS_ENV=production
# APNS_PUSH_INTERVAL=10s
