feat: enable Clash API with YACD or online mode in podkop configuration

This commit is contained in:
Andrey Petelin
2025-10-06 15:41:40 +05:00
committed by divocat
parent 31b09cc3d2
commit 5418187dd3
2 changed files with 8 additions and 5 deletions

View File

@@ -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
}

View File

@@ -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"