ActiveDebianSync: standalone basic setup
The initial configuration is performed using a JSON file.
-
Create a
/etc/ActiveDebianSync/config.jsonfile
{
"sync_interval": 360,
"sync_packages": true,
"repository_path": "/var/lib/ActiveDebianSync/mirror",
"debian_mirror": "http://deb.debian.org/debian",
"debian_releases": ["bookworm"],
"debian_architectures": ["amd64"],
"debian_components": ["main"],
"http_enabled": true,
"http_port": 8080,
"https_enabled": false,
"api_enabled": true,
"api_port": 9090,
"api_listen_addr": "127.0.0.1",
"max_disk_usage_percent": 90,
"log_path": "/var/log/ActiveDebianSync/sync.log",
"access_log_path": "/var/log/ActiveDebianSync/access.log"
}
Synchronization:
sync_interval: Sync interval (minutes)repository_path: Local mirror pathdebian_mirror: Source mirror URLdebian_releases: ["bookworm", "trixie"]debian_architectures: ["amd64", "arm64"]debian_components: ["main", "contrib", ...]max_concurrent_downloads: Parallel workers (default: 4)download_bandwidth_limit: Bandwidth limit (bytes/s)block_clients_during_sync: Return HTTP 503 during syncsync_allowed_hours_enabled: Enable time windowsync_allowed_hours_start: Start time (e.g. "02:00")sync_allowed_hours_end: End time (e.g. "06:00")
HTTP/HTTPS server:
Acts as a web service that publishes updates to other Debian servers via the APT client.
http_enabled: Enable HTTPhttp_port: HTTP port (8080)https_enabled: Enable HTTPShttps_port: HTTPS port (8443)tls_cert_file: TLS certificate filetls_key_file: TLS private key file
REST API:
Allows you to control the daemon through web requests.
api_enabled: Enable REST APIapi_port: API port (9090)api_listen_addr: Listen address (127.0.0.1)api_allowed_ips: List of allowed IPs ( example: ["192.168.1.0/24", "10.0.0.5", "172.16.0.0/16"])
Security:
run_as_user: System user (e.g. debian-sync)run_as_group: System group (e.g. debian-sync)
System:
max_disk_usage_percent: Disk usage threshold (90%)log_path: Sync log fileaccess_log_path: Access log filepid_file: PID path
Advanced features
{
"max_concurrent_downloads": 4, // Parallel downloads
"download_bandwidth_limit": 10485760, // Bandwidth limit (bytes/s)
"block_clients_during_sync": true, // Return HTTP 503 during sync
"sync_allowed_hours_enabled": true, // Time window enabled
"sync_allowed_hours_start": "02:00", // Window start time
"sync_allowed_hours_end": "06:00", // Window end time
"api_allowed_ips": ["192.168.1.0/24"] // Allowed IP ranges for the API
}
About: download_bandwidth_limit
Controls the maximum download speed to prevent saturating the network connection.
Configuration
{
"download_bandwidth_limit": 5000
}
The value is expressed in KB/s (kilobytes per second):
0= Unlimited (default)1000= 1 MB/s (~8 Mbps)5000= 5 MB/s (~40 Mbps)10000= 10 MB/s (~80 Mbps)
How to calculate the limit
To convert your available bandwidth:
Bandwidth (Mbps) ÷ 8 = MB/s
MB/s × 1024 = KB/s (value to configure)
Example: 100 Mbps connection, limited to 50%:
100 Mbps × 50% = 50 Mbps
50 ÷ 8 = 6.25 MB/s
6.25 × 1024 = 6400 KB/s
The rate limiter applies per downloaded file.
When multiple downloads run in parallel, the limit is enforced individually for each download.
Example:
{
"max_concurrent_downloads": 4,
"download_bandwidth_limit": 1000
}
- Each download: max 1 MB/s
- Theoretical total: 4 MB/s (4 downloads × 1 MB/s)
Default configuration
{
"sync_interval": 60,
"repository_path": "/var/lib/ActiveDebianSync/mirror",
"debian_mirror": "http://deb.debian.org/debian",
"debian_releases": ["bookworm", "trixie"],
"debian_architectures": ["amd64"],
"debian_components": ["main", "contrib", "non-free", "non-free-firmware"],
"max_concurrent_downloads": 4,
"download_bandwidth_limit": 0,
"block_clients_during_sync": true,
"sync_allowed_hours_enabled": false,
"sync_allowed_hours_start": "02:00",
"sync_allowed_hours_end": "06:00",
"http_enabled": true,
"http_port": 8080,
"https_enabled": false,
"https_port": 8443,
"tls_cert_file": "/etc/ActiveDebianSync/server.crt",
"tls_key_file": "/etc/ActiveDebianSync/server.key",
"api_enabled": true,
"api_port": 9090,
"api_listen_addr": "127.0.0.1",
"api_allowed_ips": [],
"max_disk_usage_percent": 90,
"log_path": "/var/log/ActiveDebianSync/sync.log",
"access_log_path": "/var/log/ActiveDebianSync/access.log",
"pid_file": "/var/run/activedebiansync.pid",
"run_as_user": "",
"run_as_group": ""
}