- Introduced a comprehensive configuration template (config-adaptive.toml) for adaptive I/O, enabling improved upload/download dual stack with various performance optimizations, security settings, and network resilience features. - Created a test configuration template (test-config.toml) mirroring the adaptive configuration for testing purposes. - Added a simple test configuration (test-simple-config.toml) for basic adaptive features testing with essential parameters. - Included an empty Jupyter notebook (xep0363_analysis.ipynb) for future analysis related to XEP-0363.
177 lines
6.0 KiB
TOML
177 lines
6.0 KiB
TOML
# Client Multi-Interface Support - Corrected Implementation
|
|
# The server needs to handle clients that switch between network interfaces
|
|
|
|
# This addresses the real requirement: clients with multiple adapters
|
|
# - Mobile devices switching WiFi → LTE
|
|
# - Laptops switching Ethernet → WiFi
|
|
# - IoT devices with WiFi + cellular backup
|
|
|
|
[server]
|
|
listen_address = "8080"
|
|
bind_ip = "0.0.0.0"
|
|
storage_path = "/opt/hmac-file-server/data/uploads"
|
|
metrics_enabled = true
|
|
metrics_path = "/metrics"
|
|
pid_file = "/opt/hmac-file-server/data/hmac-file-server.pid"
|
|
max_upload_size = "1GB"
|
|
max_header_bytes = 1048576
|
|
cleanup_interval = "24h"
|
|
max_file_age = "720h"
|
|
pre_cache = true
|
|
pre_cache_workers = 4
|
|
pre_cache_interval = "1h"
|
|
deduplication_enabled = true
|
|
min_free_bytes = "1GB"
|
|
file_naming = "original"
|
|
force_protocol = "auto"
|
|
enable_dynamic_workers = true
|
|
worker_scale_up_thresh = 40
|
|
worker_scale_down_thresh = 20
|
|
unixsocket = false
|
|
metrics_port = "9090"
|
|
filettl = "168h"
|
|
filettlenabled = true
|
|
autoadjustworkers = true
|
|
networkevents = true
|
|
clean_upon_exit = true
|
|
precaching = true
|
|
|
|
# Client Multi-Interface Support Configuration
|
|
[client_network_support]
|
|
# Session persistence across client IP changes
|
|
session_based_tracking = true # Track by session, not IP
|
|
allow_ip_changes = true # Allow same session from different IPs
|
|
session_migration_timeout = "5m" # Time to wait for reconnection
|
|
max_ip_changes_per_session = 10 # Prevent abuse
|
|
|
|
# Client connection type detection and adaptation
|
|
client_connection_detection = true # Detect client network type
|
|
adapt_to_client_network = true # Optimize based on client connection
|
|
|
|
# Client network type optimizations
|
|
[client_optimizations]
|
|
# Mobile/LTE clients (small chunks, aggressive timeouts)
|
|
mobile_chunk_size = "256KB" # Smaller chunks for mobile
|
|
mobile_timeout_multiplier = 2.0 # Longer timeouts for mobile
|
|
mobile_retry_attempts = 5 # More retries for unstable connections
|
|
|
|
# WiFi clients (medium chunks, standard timeouts)
|
|
wifi_chunk_size = "2MB" # Medium chunks for WiFi
|
|
wifi_timeout_multiplier = 1.0 # Standard timeouts
|
|
wifi_retry_attempts = 3 # Standard retries
|
|
|
|
# Ethernet clients (large chunks, faster timeouts)
|
|
ethernet_chunk_size = "8MB" # Large chunks for stable connections
|
|
ethernet_timeout_multiplier = 0.8 # Faster timeouts for stable connections
|
|
ethernet_retry_attempts = 2 # Fewer retries needed
|
|
|
|
[uploads]
|
|
allowed_extensions = [
|
|
".txt", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx",
|
|
".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".webp", ".svg",
|
|
".mp3", ".wav", ".aac", ".flac", ".ogg", ".wma", ".m4a",
|
|
".mp4", ".mkv", ".avi", ".mov", ".wmv", ".flv", ".webm", ".mpeg",
|
|
".zip", ".rar", ".7z", ".tar", ".gz", ".iso"
|
|
]
|
|
chunkeduploadsenabled = true
|
|
chunksize = "2MB" # Default chunk size
|
|
resumableuploadsenabled = true
|
|
sessiontimeout = "60m"
|
|
maxretries = 3
|
|
|
|
# Client reconnection support
|
|
allow_session_resume = true # Allow resume from different IPs
|
|
session_persistence_duration = "24h" # How long to keep session data
|
|
detect_duplicate_uploads = true # Detect same upload from different IPs
|
|
merge_duplicate_sessions = true # Merge sessions from same client
|
|
|
|
[downloads]
|
|
allowed_extensions = [
|
|
".txt", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx",
|
|
".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".webp", ".svg",
|
|
".mp3", ".wav", ".aac", ".flac", ".ogg", ".wma", ".m4a",
|
|
".mp4", ".mkv", ".avi", ".mov", ".wmv", ".flv", ".webm", ".mpeg",
|
|
".zip", ".rar", ".7z", ".tar", ".gz", ".iso"
|
|
]
|
|
chunkeddownloadsenabled = true
|
|
chunksize = "1MB" # Default download chunk size
|
|
resumable_downloads_enabled = true
|
|
|
|
# Adaptive downloads based on client connection
|
|
adaptive_download_chunks = true # Adjust chunk size per client type
|
|
range_request_optimization = true # Optimize partial downloads
|
|
|
|
# Network resilience for handling client switches
|
|
[network_resilience]
|
|
enabled = true
|
|
# Note: This is for handling CLIENT network changes, not server changes
|
|
client_connection_monitoring = true # Monitor client connection quality
|
|
detect_client_network_changes = true # Detect when client switches networks
|
|
handle_client_reconnections = true # Handle client reconnecting from new IP
|
|
connection_quality_adaptation = true # Adapt to client connection quality
|
|
|
|
# Client reconnection timeouts
|
|
client_reconnection_grace_period = "30s" # Wait time for client to reconnect
|
|
max_reconnection_attempts = 5 # Max times to wait for reconnection
|
|
reconnection_backoff_multiplier = 1.5 # Exponential backoff for reconnections
|
|
|
|
[security]
|
|
secret = "f6g4ldPvQM7O2UTFeBEUUj33VrXypDAcsDt0yqKrLiOr5oQW"
|
|
enablejwt = false
|
|
jwtsecret = "f6g4ldPvQM7O2UTFeBEUUj33VrXypDAcsDt0yqKrLiOr5oQW"
|
|
jwtalgorithm = "HS256"
|
|
jwtexpiration = "24h"
|
|
|
|
[logging]
|
|
level = "info" # Changed from debug for production
|
|
file = "/opt/hmac-file-server/data/logs/hmac-file-server.log"
|
|
max_size = 100
|
|
max_backups = 5
|
|
max_age = 30
|
|
compress = true
|
|
|
|
[deduplication]
|
|
maxsize = "1GB"
|
|
enabled = true
|
|
directory = "/opt/hmac-file-server/data/dedup"
|
|
|
|
[iso]
|
|
enabled = false
|
|
mountpoint = "/mnt/iso"
|
|
size = "1GB"
|
|
charset = "utf-8"
|
|
containerfile = "/mnt/iso/container.iso"
|
|
|
|
[timeouts]
|
|
readtimeout = "300s" # Reduced for better responsiveness
|
|
writetimeout = "300s" # Reduced for better responsiveness
|
|
idletimeout = "60s"
|
|
shutdown = "30s"
|
|
|
|
[versioning]
|
|
enableversioning = false
|
|
backend = "filesystem"
|
|
maxversions = 10
|
|
|
|
[clamav]
|
|
clamavenabled = false
|
|
clamavsocket = "/var/run/clamav/clamd.ctl"
|
|
numscanworkers = 2
|
|
scanfileextensions = [".txt", ".pdf", ".jpg", ".png"]
|
|
|
|
[redis]
|
|
redisenabled = true
|
|
redisdbindex = 0
|
|
redisaddr = "localhost:6379"
|
|
redispassword = ""
|
|
redishealthcheckinterval = "120s"
|
|
|
|
[workers]
|
|
numworkers = 8
|
|
uploadqueuesize = 100
|
|
|
|
[file]
|
|
|
|
[build]
|
|
version = "3.2"
|