update 2026-10-08 20:05:36

This commit is contained in:
action committed 2026-10-08 20:05:36 +08:00
1 parent 4d8fedd7c6
commit 2f8de8b88d
228 files changed
+37327 -7

No files matched your search

View File
Whitespace-only changes.
+23
View File
@@ -0,0 +1,23 @@
# dns.dae
dns {
bind: 'tcp+udp://[::]:53530'
client_subnet: auto
#ipversion_prefer: 4
upstream {
local: 'udp://127.0.0.1:53' -> direct
remote: 'tcp+udp://one.one.one.one:53'
}
routing {
request {
qtype(https) -> reject
qname(geosite: gfw) -> remote
fallback: local
}
response {
upstream(remote) -> accept
qname(geosite: private) -> accept
ip(geoip: cn) -> accept
fallback: remote
}
}
}
+35
View File
@@ -0,0 +1,35 @@
# node.dae
node {
node1: 'xxx'
node2: 'xxx'
}
subscription {
# 短形式:默认 86400s 刷新一次
sub: 'http://sub'
# 短形式 + UA:仍然只能默认 86400s
sub_ua: 'http://sub'(honk/1.0 like)
# 块形式:可以自定义定时刷新周期
sub2: {
url: 'http://sub'
ua: 'honk/1.0'
interval: '10000s' # 每 10000 秒刷新一次
}
# 禁用定期刷新
sub3: {
url: 'http://sub'
interval: 0
}
}
group {
proxy {
filter: subtag(sub) && !name(keyword: 'ExpireAt:')
filter: name(node1, node2)
policy: score
}
}
+27
View File
@@ -0,0 +1,27 @@
# route.dae
routing {
pname(dnsmasq, zerotier-one) -> direct(must)
dip(224.0.0.0/3, 'ff00::/8', geoip: private) -> direct
domain(geosite: category-bank-cn, geosite: boc@!cn, geosite: synology) -> direct
# block quic, if u node has poor quic support, enable this line
# l4proto(udp) && dport(443) -> block
domain(geosite: spotify) -> proxy
domain(geosite: category-doh) -> proxy
domain(geosite: tiktok) -> proxy
domain(geosite: category-ai-!cn, geosite: github) -> proxy
domain(geosite: gfw) -> proxy
dip(geoip: telegram) -> proxy
dip(geoip: cn) -> direct
# geoip:cn always using chiness asn, can use domain rule to override
# domain(geosite: cn) -> direct
# using proxy for ssh, http, https, and common ports, avoid (bt, or other p2p)
# dport(22, 80, 443, 8080, 6443, 9090) -> proxy
# fallback: direct
fallback: proxy
}
+30
View File
@@ -0,0 +1,30 @@
# config.dae
# Load all honk files placed in ./config.d/.
include {
config.d/*.dae
}
global {
log_level: warn
check_interval: 600s
check_tolerance: 30ms
lan_interface: br-lan
wan_interface: auto
auto_config_kernel_parameter: true
data_dir: '/etc/honk'
log_file: '/var/log/honk/honk.log'
store_subscribe: true
# if u not using dns bind, set dial_mode to domain++ prefer
dial_mode: domain
bootstrap_resolver: '223.5.5.5:53'
tcp_check_url: 'https://www.gstatic.com/generate_204'
tcp_check_http_method: HEAD
udp_check_dns: 'dns.google.com:53', '8.8.8.8', '2001:4860:4860::8888'
}
assets {
geodata {
geosite: 'https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/release/geosite.dat'
geoip: 'https://raw.githubusercontent.com/QiuSimons/geoip-moedove/refs/heads/main/geoip.dat'
}
}
+7
View File
@@ -0,0 +1,7 @@
config honk 'config'
option enabled '0'
option advanced '0'
option dashboard 'none'
option config_file '/etc/honk/config.dae'
+122
View File
@@ -0,0 +1,122 @@
#!/bin/sh /etc/rc.common
USE_PROCD=1
START=96
STOP=10
extra_command "hot_reload" "Hot-reload service"
CONF="honk"
PROG="/usr/bin/honk-core"
# honk-core hardcodes dae-compatible datapath names (dae0/dae0peer + daens);
# these are the real interface/netns names, not leftover dae config.
HONK_HOST_IFACE="dae0"
HONK_PEER_IFACE="dae0peer"
HONK_NETNS_NAME="daens"
HONK_NETNS_PATH="/run/netns/$HONK_NETNS_NAME"
RESOLV_HONK="/tmp/resolv.conf.honk"
set_chmod_640() {
mkdir -p /etc/honk/config.d /etc/honk/state /var/log/honk
chmod -R u=rwX,go= /etc/honk 2>/dev/null || true
chmod 700 /etc/honk /etc/honk/config.d /etc/honk/state 2>/dev/null || true
}
cleanup_netns() {
ip netns del "$HONK_NETNS_NAME" 2>/dev/null || true
umount "$HONK_NETNS_PATH" 2>/dev/null || true
rm -f "$HONK_NETNS_PATH" 2>/dev/null || true
ip link del "$HONK_HOST_IFACE" 2>/dev/null || true
ip link del "$HONK_PEER_IFACE" 2>/dev/null || true
}
hijack_resolv_conf() {
grep -q ' /tmp/resolv\.conf ' /proc/mounts && return 0
local dns_list WANS
. /lib/functions/network.sh
unset -v __NETWORK_CACHE
__network_ifstatus WANS "" "[@.route[@.target='0.0.0.0' && !@.table]].interface" 2>/dev/null
set -- $WANS
if [ $# -eq 1 ]; then
dns_list=$(ubus call "network.interface.$1" status 2>/dev/null | \
jsonfilter -e '@["dns-server"][*]' 2>/dev/null)
if [ -z "$dns_list" ] && [ -f "/tmp/resolv.conf.d/resolv.conf.auto" ]; then
dns_list=$(awk '/^nameserver/{print $2}' "/tmp/resolv.conf.d/resolv.conf.auto")
fi
fi
[ -z "$dns_list" ] && dns_list="119.29.29.29 223.5.5.5"
[ -f /tmp/resolv.conf ] || touch /tmp/resolv.conf
grep -E '^(search|domain) ' /tmp/resolv.conf > "$RESOLV_HONK" 2>/dev/null
for dns in $dns_list; do
echo "nameserver $dns" >> "$RESOLV_HONK"
done
mount --bind "$RESOLV_HONK" /tmp/resolv.conf
mount -o remount,ro,bind /tmp/resolv.conf
}
restore_resolv_conf() {
while grep -q ' /tmp/resolv\.conf ' /proc/mounts; do
mount -o remount,rw,bind /tmp/resolv.conf 2>/dev/null
umount /tmp/resolv.conf 2>/dev/null || break
done
rm -f "$RESOLV_HONK"
}
start_service() {
local enabled config_file
config_load "$CONF"
config_get_bool enabled "config" "enabled" "0"
[ "$enabled" -eq "1" ] || return 1
config_get config_file "config" "config_file" "/etc/honk/config.dae"
if [ ! -x "$PROG" ]; then
logger -t honk "not starting: $PROG is missing or not executable"
return 1
fi
set_chmod_640
cleanup_netns
hijack_resolv_conf
procd_open_instance "$CONF"
procd_set_param env DAE_LOCATION_ASSET="/usr/share/v2ray"
procd_set_param command "$PROG" --config "$config_file"
procd_set_param netdev "$HONK_HOST_IFACE" "$HONK_PEER_IFACE"
procd_set_param limits core="unlimited"
procd_set_param limits nofile="1000000 1000000"
procd_set_param term_timeout 8
procd_set_param respawn 3600 5 5
procd_set_param stderr 1
procd_close_instance
}
service_stopped() {
restore_resolv_conf
cleanup_netns
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "$CONF"
}
hot_reload() {
set_chmod_640
if /etc/init.d/honk running; then
"$PROG" reload
else
start
fi
}