From 352d10a0470bd10768a995c248a1e021f5ee5c13 Mon Sep 17 00:00:00 2001 From: Kirill Sobakin Date: Tue, 25 Nov 2025 11:32:28 +0300 Subject: [PATCH 1/5] Fix: HY2 links --- String-example.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/String-example.md b/String-example.md index 49ab3e7..7af9d8e 100644 --- a/String-example.md +++ b/String-example.md @@ -87,13 +87,9 @@ trojan://VEetltxLtw@127.0.0.1:59072?type=xhttp&path=%2Fxhttppath&host=google.com hysteria2:// ``` -# Basic (no authentication) -hysteria2://127.0.0.1:443/#hysteria2-basic -hysteria2://127.0.0.1:443/?insecure=1#hysteria2-basic-insecure - # With password hysteria2://password@example.com:443/#hysteria2-password -hysteria2://password@example.com:443/?insecure=0#hysteria2-password-insecure +hysteria2://password@example.com:443/?insecure=1#hysteria2-password-insecure # With SNI hysteria2://password@example.com:443/?sni=example.com#hysteria2-password-sni @@ -102,18 +98,14 @@ hysteria2://password@example.com:443/?sni=example.com#hysteria2-password-sni hysteria2://password@example.com:443/?obfs=salamander&obfs-password=obfspassword#hysteria2-obfs # All parameters combined -hysteria2://mypassword@example.com:8443/?sni=example.com&obfs=salamander&obfs-password=obfspass&insecure=0#hysteria2-all-params +hysteria2://mypassword@example.com:8443/?sni=example.com&obfs=salamander&obfs-password=obfspass&insecure=1#hysteria2-all-params ``` hy2:// ``` -# Basic (no authentication) -hy2://127.0.0.1:443/#hysteria2-basic -hy2://127.0.0.1:443/?insecure=1#hysteria2-basic-insecure - # With password hy2://password@example.com:443/#hysteria2-password -hy2://password@example.com:443/?insecure=0#hysteria2-password-insecure +hy2://password@example.com:443/?insecure=1#hysteria2-password-insecure # With SNI hy2://password@example.com:443/?sni=example.com#hysteria2-password-sni @@ -122,5 +114,5 @@ hy2://password@example.com:443/?sni=example.com#hysteria2-password-sni hy2://password@example.com:443/?obfs=salamander&obfs-password=obfspassword#hysteria2-obfs # All parameters combined -hy2://mypassword@example.com:8443/?sni=example.com&obfs=salamander&obfs-password=obfspass&insecure=0#hysteria2-all-params +hy2://mypassword@example.com:8443/?sni=example.com&obfs=salamander&obfs-password=obfspass&insecure=1#hysteria2-all-params ``` \ No newline at end of file From 576e58fd17f3b3fc59238dddf39bcd9b90b06437 Mon Sep 17 00:00:00 2001 From: Andrey Petelin Date: Wed, 26 Nov 2025 13:56:10 +0500 Subject: [PATCH 2/5] chore: restore start_main and stop_main; have reload call them instead of full start/stop --- podkop/files/usr/bin/podkop | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/podkop/files/usr/bin/podkop b/podkop/files/usr/bin/podkop index 66581a6..59dfa1a 100755 --- a/podkop/files/usr/bin/podkop +++ b/podkop/files/usr/bin/podkop @@ -104,7 +104,7 @@ has_outbound_section() { return $section_exists } -start() { +start_main() { log "Starting podkop" check_requirements @@ -137,10 +137,6 @@ start() { exit 1 fi - config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0 - if [ "$dont_touch_dhcp" -eq 0 ]; then - dnsmasq_configure - fi uci_set "podkop" "settings" "shutdown_correctly" 0 uci commit "podkop" && config_load "$PODKOP_CONFIG" @@ -149,7 +145,7 @@ start() { echo $! > /var/run/podkop_list_update.pid } -stop() { +stop_main() { log "Stopping the podkop" if [ -f /var/run/podkop_list_update.pid ]; then @@ -180,12 +176,6 @@ stop() { ip route flush table podkop fi - local dont_touch_dhcp - config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0 - if [ "$dont_touch_dhcp" -eq 0 ]; then - dnsmasq_restore - fi - log "Stop sing-box" /etc/init.d/sing-box stop @@ -193,10 +183,27 @@ stop() { uci commit "podkop" && config_load "$PODKOP_CONFIG" } +start() { + start_main + config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0 + if [ "$dont_touch_dhcp" -eq 0 ]; then + dnsmasq_configure + fi +} + +stop() { + local dont_touch_dhcp + config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0 + if [ "$dont_touch_dhcp" -eq 0 ]; then + dnsmasq_restore + fi + stop_main +} + reload() { log "Podkop reload" - stop - start + stop_main + start_main } restart() { From ff43f477e92db4b08ccac46777dd465c570c815d Mon Sep 17 00:00:00 2001 From: Andrey Petelin Date: Wed, 26 Nov 2025 14:14:27 +0500 Subject: [PATCH 3/5] chore: restore shutdown_correctly logic --- podkop/files/usr/bin/podkop | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/podkop/files/usr/bin/podkop b/podkop/files/usr/bin/podkop index 59dfa1a..a7c2779 100755 --- a/podkop/files/usr/bin/podkop +++ b/podkop/files/usr/bin/podkop @@ -137,9 +137,6 @@ start_main() { exit 1 fi - uci_set "podkop" "settings" "shutdown_correctly" 0 - uci commit "podkop" && config_load "$PODKOP_CONFIG" - log "Nice" list_update & echo $! > /var/run/podkop_list_update.pid @@ -178,17 +175,18 @@ stop_main() { log "Stop sing-box" /etc/init.d/sing-box stop - - uci_set "podkop" "settings" "shutdown_correctly" 1 - uci commit "podkop" && config_load "$PODKOP_CONFIG" } start() { start_main + config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0 if [ "$dont_touch_dhcp" -eq 0 ]; then dnsmasq_configure fi + + uci_set "podkop" "settings" "shutdown_correctly" 0 + uci commit "podkop" && config_load "$PODKOP_CONFIG" } stop() { @@ -197,7 +195,11 @@ stop() { if [ "$dont_touch_dhcp" -eq 0 ]; then dnsmasq_restore fi + stop_main + + uci_set "podkop" "settings" "shutdown_correctly" 1 + uci commit "podkop" && config_load "$PODKOP_CONFIG" } reload() { From 14f704fcb867f039c23cd0665cd8f8b09c36b63c Mon Sep 17 00:00:00 2001 From: Andrey Petelin Date: Wed, 26 Nov 2025 15:47:12 +0500 Subject: [PATCH 4/5] fix: use echolog for sing-box start failure --- podkop/files/usr/bin/podkop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/podkop/files/usr/bin/podkop b/podkop/files/usr/bin/podkop index a7c2779..6b70c14 100755 --- a/podkop/files/usr/bin/podkop +++ b/podkop/files/usr/bin/podkop @@ -133,7 +133,7 @@ start_main() { config_foreach add_cron_job "section" /etc/init.d/sing-box start if [ $? -ne 0 ]; then - echo "Failed to start sing-box service" + echolog "Failed to start sing-box service" exit 1 fi From 6a48a060e1cc538e37f63fd3c1ee447418e8a604 Mon Sep 17 00:00:00 2001 From: Andrey Petelin Date: Wed, 26 Nov 2025 16:01:41 +0500 Subject: [PATCH 5/5] refactor: remove sing-box start exit check --- podkop/files/usr/bin/podkop | 4 ---- 1 file changed, 4 deletions(-) diff --git a/podkop/files/usr/bin/podkop b/podkop/files/usr/bin/podkop index 6b70c14..6cd1f90 100755 --- a/podkop/files/usr/bin/podkop +++ b/podkop/files/usr/bin/podkop @@ -132,10 +132,6 @@ start_main() { sing_box_init_config config_foreach add_cron_job "section" /etc/init.d/sing-box start - if [ $? -ne 0 ]; then - echolog "Failed to start sing-box service" - exit 1 - fi log "Nice" list_update &