Files
route-switcher/route-switcher.service
Michal Humpula 940a86ff8c api
2026-02-16 07:23:36 +01:00

52 lines
1.3 KiB
Desktop File

[Unit]
Description=Route-Switcher - Automatic network failover service
Documentation=https://git.hudrydum.cz/michal.humpula/route-switcher
After=network.target network-online.target
Wants=network-online.target
ConditionPathExists=/usr/local/sbin/route-switcher
[Service]
Type=simple
ExecStart=/usr/local/sbin/route-switcher
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
# Environment variables (customize these for your network)
Environment=RUST_LOG=info
Environment=PRIMARY_INTERFACE=eth0
Environment=SECONDARY_INTERFACE=eth1
Environment=PRIMARY_GATEWAY=192.168.1.1
Environment=SECONDARY_GATEWAY=192.168.2.1
Environment=PING_TARGET=8.8.8.8
# API Configuration
Environment=API_ENABLED=true
Environment=API_BIND_ADDRESS=0.0.0.0
Environment=API_PORT=8080
Environment=API_USERNAME=admin
Environment=API_PASSWORD_HASH=$2b$12$placeholder_hash_replace_with_actual_bcrypt_hash
User=root
Group=root
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW
NoNewPrivileges=true
# Resource limits
LimitNOFILE=65536
LimitNPROC=4096
# Process isolation
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/log
PrivateTmp=true
ProtectKernelTunables=true
ProtectControlGroups=true
RestrictRealtime=true
[Install]
WantedBy=multi-user.target