feat: add direct DNS updates to Go agent

This commit is contained in:
benya
2026-07-21 04:03:49 +03:00
parent c31e52a90c
commit 6e9b5a99c2
20 changed files with 442 additions and 16 deletions

View File

@@ -3,6 +3,10 @@ config agent 'main'
option server_url 'https://rmm.example.com'
option interval_seconds '30'
option check_targets '1.1.1.1 8.8.8.8'
option direct_dns_enabled '0'
option dns_update_interval_seconds '300'
option public_ipv4_url 'https://api.ipify.org'
option public_ipv6_url 'https://api6.ipify.org'
option tunnel_identity_file '/etc/rmm-agent/tunnel_key'
option allow_insecure_http '0'
option reset_identity '0'

View File

@@ -2,6 +2,10 @@ SERVER_URL="https://rmm.example.com"
ENROLLMENT_TOKEN=""
INTERVAL_SECONDS="30"
CHECK_TARGETS="1.1.1.1 8.8.8.8"
DIRECT_DNS_ENABLED="false"
DNS_UPDATE_INTERVAL_SECONDS="300"
PUBLIC_IPV4_URL="https://api.ipify.org"
PUBLIC_IPV6_URL="https://api6.ipify.org"
TUNNEL_IDENTITY_FILE="/etc/rmm-agent/tunnel_key"
DEVICE_ID=""
DEVICE_TOKEN=""

View File

@@ -60,6 +60,10 @@ temporary="${SHELL_CONFIG}.tmp"
printf 'ENROLLMENT_TOKEN="%s"\n' "$(escape_value "$enrollment_token")"
printf 'INTERVAL_SECONDS="%s"\n' "$(escape_value "$(uci_get interval_seconds)")"
printf 'CHECK_TARGETS="%s"\n' "$(escape_value "$(uci_get check_targets)")"
printf 'DIRECT_DNS_ENABLED="%s"\n' "$(escape_value "$(uci_get direct_dns_enabled)")"
printf 'DNS_UPDATE_INTERVAL_SECONDS="%s"\n' "$(escape_value "$(uci_get dns_update_interval_seconds)")"
printf 'PUBLIC_IPV4_URL="%s"\n' "$(escape_value "$(uci_get public_ipv4_url)")"
printf 'PUBLIC_IPV6_URL="%s"\n' "$(escape_value "$(uci_get public_ipv6_url)")"
printf 'TUNNEL_IDENTITY_FILE="%s"\n' "$(escape_value "$(uci_get tunnel_identity_file)")"
printf 'DEVICE_ID="%s"\n' "$(escape_value "$device_id")"
printf 'DEVICE_TOKEN="%s"\n' "$(escape_value "$device_token")"