Implements Meshname DNS for Yggdrasil mesh networks with gossip-based service discovery and dnsmasq integration. New packages: - secubox-app-meshname-dns: Core service with meshnamectl CLI - luci-app-meshname-dns: LuCI dashboard for service management Features: - Services announce .ygg domains via gossip protocol (meshname_announce) - dnsmasq integration via /tmp/hosts/meshname dynamic hosts file - Cross-node resolution through gossip message propagation - RPCD handler with 8 methods for LuCI integration CLI commands: announce, revoke, resolve, list, sync, status, daemon Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
47 lines
837 B
Bash
47 lines
837 B
Bash
#!/bin/sh /etc/rc.common
|
|
# SPDX-License-Identifier: MIT
|
|
# Meshname DNS init script
|
|
|
|
START=95
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
PROG=/usr/sbin/meshnamectl
|
|
NAME=meshname-dns
|
|
|
|
start_service() {
|
|
local enabled
|
|
config_load meshname-dns
|
|
config_get enabled main enabled 0
|
|
|
|
[ "$enabled" = "1" ] || return 0
|
|
|
|
# Create state directory
|
|
mkdir -p /var/lib/meshname-dns
|
|
mkdir -p /tmp/hosts
|
|
touch /tmp/hosts/meshname
|
|
|
|
# Start background sync daemon
|
|
procd_open_instance
|
|
procd_set_param command "$PROG" daemon
|
|
procd_set_param respawn
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
|
|
logger -t meshname-dns "Meshname DNS started"
|
|
}
|
|
|
|
stop_service() {
|
|
logger -t meshname-dns "Meshname DNS stopped"
|
|
}
|
|
|
|
reload_service() {
|
|
# Re-announce local services
|
|
"$PROG" sync
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger "meshname-dns"
|
|
}
|