mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-17 03:44:07 +03:00
feat(init.d/podkop): add secure DNS probe domain configuration
This commit is contained in:
@@ -149,6 +149,7 @@ main() {
|
|||||||
sing_box_dns
|
sing_box_dns
|
||||||
sing_box_dns_rule_fakeip
|
sing_box_dns_rule_fakeip
|
||||||
sing_box_rule_dns
|
sing_box_rule_dns
|
||||||
|
sing_box_add_secure_dns_probe_domain
|
||||||
sing_box_cache_file
|
sing_box_cache_file
|
||||||
process_socks5
|
process_socks5
|
||||||
|
|
||||||
@@ -727,6 +728,37 @@ sing_box_rule_dns() {
|
|||||||
}' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
|
}' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sing_box_add_secure_dns_probe_domain() {
|
||||||
|
local domain="example.com"
|
||||||
|
local override_address="neverssl.com"
|
||||||
|
|
||||||
|
log "Configure DNS probe domain ${domain}"
|
||||||
|
|
||||||
|
jq \
|
||||||
|
--arg domain "$domain" \
|
||||||
|
--arg override "$override_address" \
|
||||||
|
'.dns.rules |= map(
|
||||||
|
if .server == "fakeip-server" then
|
||||||
|
{
|
||||||
|
"server": .server,
|
||||||
|
"domain": $domain,
|
||||||
|
"rule_set": .rule_set
|
||||||
|
}
|
||||||
|
else
|
||||||
|
.
|
||||||
|
end
|
||||||
|
) |
|
||||||
|
.route.rules |= . + [
|
||||||
|
{
|
||||||
|
"domain": $domain,
|
||||||
|
"action": "route-options",
|
||||||
|
"override_address": $override
|
||||||
|
}
|
||||||
|
]' "$SING_BOX_CONFIG" >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json "$SING_BOX_CONFIG"
|
||||||
|
|
||||||
|
log "DNS probe domain ${domain} configured with override to ${override_address}"
|
||||||
|
}
|
||||||
|
|
||||||
sing_box_config_check() {
|
sing_box_config_check() {
|
||||||
if ! sing-box -c $SING_BOX_CONFIG check >/dev/null 2>&1; then
|
if ! sing-box -c $SING_BOX_CONFIG check >/dev/null 2>&1; then
|
||||||
log "Sing-box configuration is invalid"
|
log "Sing-box configuration is invalid"
|
||||||
|
|||||||
Reference in New Issue
Block a user