- Introduced fast detection and quality monitoring for network changes. - Added predictive switching to proactively handle network failures. - Updated configuration examples and README for mobile network resilience. - Enhanced network resilience settings in Podman configuration. - Created a new configuration file for optimized mobile network resilience.
75 lines
3.5 KiB
TOML
75 lines
3.5 KiB
TOML
# HMAC File Server - Enhanced Network Resilience Configuration
|
|
# Optimized for mobile devices and network switching scenarios
|
|
|
|
[server]
|
|
listen_address = "8080"
|
|
storage_path = "/opt/hmac-file-server/data/uploads"
|
|
networkevents = true # REQUIRED: Enable network monitoring
|
|
|
|
[uploads]
|
|
allowed_extensions = [".zip", ".rar", ".7z", ".tar.gz", ".tgz", ".gpg", ".enc", ".pgp", ".txt", ".pdf", ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".svg", ".webp", ".wav", ".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".webm", ".mpeg", ".mpg", ".m4v", ".3gp", ".3g2", ".mp3", ".ogg", ".doc", ".docx"]
|
|
chunked_uploads_enabled = true
|
|
chunk_size = "32MB" # Optimized chunk size for mobile
|
|
resumable_uploads_enabled = true
|
|
max_resumable_age = "72h" # Extended for mobile scenarios
|
|
sessiontimeout = "90m" # Longer sessions for mobile
|
|
maxretries = 5 # More retries for mobile networks
|
|
|
|
# Enhanced upload resilience settings for mobile
|
|
session_persistence = true
|
|
session_recovery_timeout = "600s" # 10 minutes for mobile switches
|
|
client_reconnect_window = "300s" # 5 minutes reconnect window
|
|
upload_slot_ttl = "7200s" # 2 hours slot validity
|
|
retry_failed_uploads = true
|
|
max_upload_retries = 8 # More retries for cellular
|
|
|
|
[timeouts]
|
|
readtimeout = "600s" # 10 minutes for mobile networks
|
|
writetimeout = "600s" # Extended for cellular uploads
|
|
idletimeout = "1200s" # 20 minutes idle tolerance
|
|
shutdown = "300s"
|
|
|
|
# NEW: Enhanced Network Resilience Configuration
|
|
[network_resilience]
|
|
fast_detection = true # Enable 1-second network change detection
|
|
quality_monitoring = true # Monitor connection quality (RTT, packet loss)
|
|
predictive_switching = true # Switch proactively before network fails
|
|
mobile_optimizations = true # Mobile-friendly thresholds and timeouts
|
|
|
|
# Timing configuration
|
|
detection_interval = "1s" # Fast detection interval
|
|
quality_check_interval = "5s" # How often to check connection quality
|
|
max_detection_interval = "10s" # Maximum interval during stable periods
|
|
|
|
[security]
|
|
secret = "f6g4ldPvQM7O2UTFeBEUUj33VrXypDAcsDt0yqKrLiOr5oQW"
|
|
|
|
[logging]
|
|
level = "info" # Set to "debug" to see network resilience details
|
|
file = "/opt/hmac-file-server/data/logs/hmac-file-server.log"
|
|
max_size = 100
|
|
max_backups = 7
|
|
max_age = 30
|
|
compress = true
|
|
|
|
[deduplication]
|
|
enabled = true
|
|
directory = "/opt/hmac-file-server/data/deduplication"
|
|
maxsize = "1GB"
|
|
|
|
# Configuration Notes:
|
|
# 1. Set networkevents = true in [server] section to enable network monitoring
|
|
# 2. fast_detection = true enables 1-second polling instead of 5-second polling
|
|
# 3. quality_monitoring = true adds RTT and packet loss monitoring
|
|
# 4. predictive_switching = true switches networks proactively before complete failure
|
|
# 5. mobile_optimizations = true uses mobile-friendly thresholds (higher RTT tolerance, etc.)
|
|
# 6. Extended timeouts and retry counts help with mobile network instability
|
|
# 7. Longer session persistence accommodates network switching delays
|
|
|
|
# Mobile Network Switching Benefits:
|
|
# • WLAN ↔ 5G IPv6 switching: Fast detection (1s) + predictive switching
|
|
# • Dual connectivity (Wired + WiFi): Quality monitoring selects best interface
|
|
# • Cellular optimization: Higher RTT/packet loss tolerance + more retries
|
|
# • Session mobility: 10-minute recovery window for IP address changes
|
|
# • Proactive switching: Network degradation detected before complete failure
|