From 5418187dd3d825ebd3554061059dd04757c1b2e3 Mon Sep 17 00:00:00 2001 From: Andrey Petelin Date: Mon, 6 Oct 2025 15:41:40 +0500 Subject: [PATCH] feat: enable Clash API with YACD or online mode in podkop configuration --- podkop/files/usr/bin/podkop | 11 ++++++----- podkop/files/usr/lib/constants.sh | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/podkop/files/usr/bin/podkop b/podkop/files/usr/bin/podkop index 7682190..462e303 100755 --- a/podkop/files/usr/bin/podkop +++ b/podkop/files/usr/bin/podkop @@ -1123,15 +1123,16 @@ sing_box_configure_experimental() { config_get cache_file "main" "cache_path" "/tmp/sing-box/cache.db" config=$(sing_box_cm_configure_cache_file "$config" true "$cache_file" true) - local yacd_enabled + local yacd_enabled external_controller_ui config_get_bool yacd_enabled "main" "yacd" 0 + log "Configuring Clash API" if [ "$yacd_enabled" -eq 1 ]; then - log "Configuring Clash API (yacd)" - local external_controller="0.0.0.0:9090" + log "YACD is enabled, enabling Clash API with downloadable YACD" "debug" local external_controller_ui="ui" - config=$(sing_box_cm_configure_clash_api "$config" "$external_controller" "$external_controller_ui") + config=$(sing_box_cm_configure_clash_api "$config" "$SB_CLASH_API_CONTROLLER" "$external_controller_ui") else - log "Clash API (yacd) is disabled, skipping configuration." + log "YACD is disabled, enabling Clash API in online mode" "debug" + config=$(sing_box_cm_configure_clash_api "$config" "$SB_CLASH_API_CONTROLLER") fi } diff --git a/podkop/files/usr/lib/constants.sh b/podkop/files/usr/lib/constants.sh index 3710e6d..4745434 100644 --- a/podkop/files/usr/lib/constants.sh +++ b/podkop/files/usr/lib/constants.sh @@ -48,6 +48,8 @@ SB_DIRECT_OUTBOUND_TAG="direct-out" SB_MAIN_OUTBOUND_TAG="main-out" # Route SB_REJECT_RULE_TAG="reject-rule-tag" +# Experimental +SB_CLASH_API_CONTROLLER="0.0.0.0:9090" ## Lists GITHUB_RAW_URL="https://raw.githubusercontent.com/itdoginfo/allow-domains/main"