update 2026-09-07 01:57:13

This commit is contained in:
action
2026-09-07 01:57:13 +08:00
parent 7b5d12b8ec
commit 4a4dfac1a2
27 changed files with 796 additions and 102 deletions
+2 -1
View File
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dae
PKG_VERSION:=2026.08.28
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE:=dae-src-2026.08.28-d6aca8a10b35.tar.gz
PKG_SOURCE_URL:=https://github.com/kenzok8/openwrt-daede/releases/download/dae-src
@@ -127,6 +127,7 @@ define Package/dae/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dae $(1)/usr/bin/dae
$(INSTALL_BIN) $(CURDIR)/files/dae-guard $(1)/usr/bin/dae-guard
$(INSTALL_DIR) $(1)/etc/dae
$(INSTALL_CONF) $(PKG_BUILD_DIR)/example.dae $(1)/etc/dae/example.dae
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
STATE="/var/run/daede-dae.ready"
LOG="/var/log/dae/dae.log"
READY="Total startup time:"
PID="$$"
watcher_pid=
mark_state() {
local value="$1" tmp="${STATE}.${PID}"
printf '%s %s\n' "$PID" "$value" > "$tmp" && mv -f "$tmp" "$STATE"
}
watch_ready() {
local offset size
offset="$(wc -c < "$LOG" 2>/dev/null || echo 0)"
mark_state starting
(
while kill -0 "$PID" 2>/dev/null; do
size="$(wc -c < "$LOG" 2>/dev/null || echo 0)"
[ "$size" -lt "$offset" ] && offset=0
if [ -r "$LOG" ] && tail -c "+$((offset + 1))" "$LOG" 2>/dev/null | grep -Fq "$READY"; then
# Check before and after the atomic publish. If dae exits during this
# window, remove the ready marker rather than leaving a false positive.
[ "$(cat "$STATE" 2>/dev/null)" = "$PID starting" ] || exit 1
kill -0 "$PID" 2>/dev/null || exit 1
mark_state ready || exit 1
kill -0 "$PID" 2>/dev/null || { rm -f "$STATE" "$STATE".*; exit 1; }
[ "$(cat "$STATE" 2>/dev/null)" = "$PID ready" ] || exit 1
exit 0
fi
sleep 1
done
) >/dev/null 2>&1 &
watcher_pid=$!
}
watch_ready
exec /usr/bin/dae "$@"
+4 -4
View File
@@ -7,7 +7,7 @@ START=99
extra_command "hot_reload" "Hot-reload service"
CONF="dae"
PROG="/usr/bin/dae"
PROG="/usr/bin/dae-guard"
LOG_DIR="/var/log/dae"
start_service() {
@@ -20,12 +20,11 @@ start_service() {
local config_file
config_get config_file "config" "config_file" "/etc/dae/config.dae"
"$PROG" validate -c "$config_file" || return 1
/usr/bin/dae validate -c "$config_file" || return 1
local log_maxbackups log_maxsize
config_get log_maxbackups "config" "log_maxbackups" "1"
config_get log_maxsize "config" "log_maxsize" "1"
procd_open_instance "$CONF"
procd_set_param env DAE_LOCATION_ASSET="/usr/share/v2ray" TZ="$(uci -q get system.@system[0].zonename)"
procd_set_param command "$PROG" run
@@ -58,6 +57,7 @@ stop_service() {
fi
# clean orphaned dae0
ip link del dae0 2>/dev/null || true
rm -f /var/run/daede-dae.ready /var/run/daede-dae.ready.*
}
service_triggers() {
@@ -65,5 +65,5 @@ service_triggers() {
}
hot_reload() {
/etc/init.d/dae running && "$PROG" reload "$(cat /var/run/dae.pid)"
/etc/init.d/dae running && /usr/bin/dae reload "$(cat /var/run/dae.pid)"
}