Artica Wiki

ActiveDebianSync: standalone basic setup

The initial configuration is performed using a JSON file.

{
    "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:

HTTP/HTTPS server:
Acts as a web service that publishes updates to other Debian servers via the APT client.

REST API:
Allows you to control the daemon through web requests.

Security:

System:

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):

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
  }  

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": ""
}