Merge pull request #188 from itdoginfo/feat/fe-app-podkop

feat: Introduce new fe modular format with minimal scope of refactoring
This commit is contained in:
Kirill Sobakin
2025-10-07 17:38:19 +03:00
committed by GitHub
89 changed files with 10385 additions and 2680 deletions

View File

@@ -1125,15 +1125,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"

View File

@@ -1335,8 +1335,8 @@ sing_box_cm_configure_cache_file() {
# Configure the experimental clash_api section of a sing-box JSON configuration.
# Arguments:
# config: JSON configuration (string)
# external_controller: string, URL or path for the external controller
# external_ui: string, URL or path for the external UI
# external_controller: API listening address; Clash API will be disabled if empty
# external_ui: Optional path to static web resources to serve at http://{{external-controller}}/ui
# Outputs:
# Writes updated JSON configuration to stdout
# Example:
@@ -1352,8 +1352,8 @@ sing_box_cm_configure_clash_api() {
--arg external_ui "$external_ui" \
'.experimental.clash_api = {
external_controller: $external_controller,
external_ui: $external_ui
}'
}
+ (if $external_ui != "" then { external_ui: $external_ui } else {} end)'
}
#######################################