From acfa76b2afee14ff4a66c5a4a140258bb512efc0 Mon Sep 17 00:00:00 2001 From: taamarin <71506581+taamarin@users.noreply.github.com> Date: Wed, 13 Aug 2025 07:29:37 +0700 Subject: [PATCH] fix: create `clash_provide_config` file and update subscription settings - Improved comments in settings.ini for better clarity on renew behavior and subscription URL usage. --- box/scripts/box.tool | 3 +++ box/settings.ini | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/box/scripts/box.tool b/box/scripts/box.tool index aefd44d..b3dfb04 100755 --- a/box/scripts/box.tool +++ b/box/scripts/box.tool @@ -391,6 +391,9 @@ upsubs() { log Debug "Downloading ${update_file_name}" if upfile "${update_file_name}" "${subscription_url_clash}"; then log Info "${update_file_name} saved" + # Make sure the folder exists + mkdir -p "$(dirname "$clash_provide_config")" + touch "$clash_provide_config" # If there is a yq command, extract the proxy information from the yml and output it to the clash_provide_config file if [ "${enhanced}" = "true" ]; then if ${yq} 'has("proxies")' "${update_file_name}" | grep -q "true"; then diff --git a/box/settings.ini b/box/settings.ini index 8396871..f32533b 100755 --- a/box/settings.ini +++ b/box/settings.ini @@ -74,12 +74,12 @@ run_crontab="false" # Type "su -c /data/adb/box/scripts/box.tool geox" to update geox update_geo="false" -# If "renew=true" it will update config.yaml not the subscription configuration. Type "su -c /data/adb/box/scripts/box.tool subs" to update subscription -renew=false +# If "renew=true", it will update $name_clash_config; if false, it will only retrieve proxies: [] for proxy-providers: []. +# Type "su -c /data/adb/box/scripts/box.tool subs" to update subscription +renew="true" update_subscription="false" - -# Example: clash subscription URL -subscription_url_clash='https://proxy-list.cloudaccess.host/vless/api?cc=ID,US,JP,SG&cdn=true&tls=true&limit=10&format=clash' # This is just an example. +# Source subscription URL for Clash configuration +subscription_url_clash='http://127.0.0.1:12345/api/file/clash.yaml' # Clash configuration name_clash_config="config.yaml" @@ -90,6 +90,7 @@ name_provide_clash_config="subscription.yaml" clash_provide_config="${box_dir}/clash/provide/${name_provide_clash_config}" # Support rules specified in subscriptions. This is useful when the subscription contains customized rules as well. +# It will fetch rules: [] from the $subscription_url_clash configuration and add them to $name_clash_config; this has no effect if renew=true. custom_rules_subs="false" name_provide_clash_rules="rules.yaml" clash_provide_rules="${box_dir}/clash/provide/${name_provide_clash_rules}"