Compare commits

...

8 Commits
0.7.12 ... main

Author SHA1 Message Date
Kirill Sobakin
0379cf5966 Merge pull request #304 from itdoginfo/fix/diagnostic-singbox-config
feat(diagnostic): stringify sb config json
2026-01-24 12:45:33 +03:00
divocatt
cfee6cec9a feat(diagnostic): stringify sb config json 2026-01-23 16:06:54 +02:00
Kirill Sobakin
ad760a78bf Merge pull request #303 from itdoginfo/fix/minor-fixes
Fix/minor fixes
2026-01-23 15:57:24 +03:00
Andrey Petelin
d854caa4cc fix: Disable dnsmasq noresolv when restoring or using default resolvfile; ensure resolvfile is applied 2026-01-23 17:42:05 +05:00
Andrey Petelin
b44274d7f2 fix: mask selector_proxy_links in podkop redaction to hide sensitive proxy selectors 2026-01-23 16:00:34 +05:00
Andrey Petelin
12d8537d90 fix: only print colored timestamp and message when stdout is a terminal 2026-01-23 15:59:26 +05:00
Kirill Sobakin
8e18426a53 Merge pull request #302 from itdoginfo/fix/log_level
fix: set default log_level to "warn" when missing in settings
2026-01-22 19:23:06 +03:00
Andrey Petelin
41a4f67fd0 fix: set default log_level to "warn" when missing in settings 2026-01-22 21:02:15 +05:00
4 changed files with 18 additions and 6 deletions

View File

@@ -288,7 +288,10 @@ async function handleShowSingBoxConfig() {
if (showSingBoxConfig.success) {
ui.showModal(
_('Show sing-box config'),
renderModal(showSingBoxConfig.data as string, 'show_sing_box_config'),
renderModal(
JSON.stringify(showSingBoxConfig.data, null, 2),
'show_sing_box_config',
),
);
} else {
logger.error(

View File

@@ -4164,7 +4164,10 @@ async function handleShowSingBoxConfig() {
if (showSingBoxConfig.success) {
ui.showModal(
_("Show sing-box config"),
renderModal(showSingBoxConfig.data, "show_sing_box_config")
renderModal(
JSON.stringify(showSingBoxConfig.data, null, 2),
"show_sing_box_config"
)
);
} else {
logger.error(

View File

@@ -253,7 +253,7 @@ br_netfilter_disable() {
route_table_rule_mark() {
grep -q "105 $RT_TABLE_NAME" /etc/iproute2/rt_tables || echo "105 $RT_TABLE_NAME" >> /etc/iproute2/rt_tables
if ! ip route list table "$RT_TABLE_NAME" 2>/dev/null | grep -q "local default dev lo scope host"; then
if ! ip route list table "$RT_TABLE_NAME" 2> /dev/null | grep -q "local default dev lo scope host"; then
log "Added route for tproxy" "debug"
ip route add local 0.0.0.0/0 dev lo table "$RT_TABLE_NAME"
else
@@ -400,7 +400,6 @@ dnsmasq_restore() {
log "Restoring noresolv" "debug"
noresolv="$(uci_get "dhcp" "@dnsmasq[0]" "podkop_noresolv")"
if [ -z "$noresolv" ]; then
uci_remove "dhcp" "@dnsmasq[0]" "noresolv"
uci_set "dhcp" "@dnsmasq[0]" "noresolv" 0
else
uci_set "dhcp" "@dnsmasq[0]" "noresolv" "$noresolv"
@@ -419,6 +418,10 @@ dnsmasq_restore() {
elif file_exists "$resolvfile"; then
log "Backup DNS servers not found, using default resolvfile" "debug"
uci_set "dhcp" "@dnsmasq[0]" "resolvfile" "$resolvfile"
if [ -n "$noresolv" ] && [ "$noresolv" -eq 1 ]; then
log "Disabling noresolv option to use system resolvfile" "debug"
uci_set "dhcp" "@dnsmasq[0]" "noresolv" 0
fi
else
log "Backup DNS servers and default resolvfile not found, possible resolving issues" "warn"
fi
@@ -591,7 +594,7 @@ sing_box_configure_log() {
log "Configure the log section of a sing-box JSON configuration"
local log_level
config_get log_level "settings" "log_level"
config_get log_level "settings" "log_level" "warn"
config=$(sing_box_cm_configure_log "$config" false "$log_level" false)
}
@@ -1831,6 +1834,7 @@ show_config() {
sed -e 's/\(option proxy_string\).*/\1 '\''MASKED'\''/g' \
-e '/option outbound_json/,/^}/c\ option outbound_json '\''MASKED'\''' \
-e 's/\(list urltest_proxy_links\).*/\1 '\''MASKED'\''/g' \
-e 's/\(list selector_proxy_links\).*/\1 '\''MASKED'\''/g' \
-e "s@\\(option dns_server '[^/]*\\)/[^']*'@\\1/MASKED'@g" \
-e "s@\\(option domain_resolver_dns_server '[^/]*\\)/[^']*'@\\1/MASKED'@g" \
-e 's/\(option yacd_secret_key\).*/\1 '\''MASKED'\''/g' \

View File

@@ -18,7 +18,9 @@ nolog() {
local timestamp
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
if [ -t 1 ]; then
echo -e "${COLOR_CYAN}[$timestamp]${COLOR_RESET} ${COLOR_GREEN}$message${COLOR_RESET}"
fi
}
echolog() {