mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-27 04:40:37 +03:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0379cf5966 | ||
|
|
cfee6cec9a | ||
|
|
ad760a78bf | ||
|
|
d854caa4cc | ||
|
|
b44274d7f2 | ||
|
|
12d8537d90 | ||
|
|
8e18426a53 | ||
|
|
41a4f67fd0 | ||
|
|
c30160d8d3 | ||
|
|
42f75c3374 |
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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' \
|
||||
|
||||
@@ -20,8 +20,8 @@ NFT_LOCALV4_SET_NAME="localv4"
|
||||
NFT_COMMON_SET_NAME="podkop_subnets"
|
||||
NFT_DISCORD_SET_NAME="podkop_discord_subnets"
|
||||
NFT_INTERFACE_SET_NAME="interfaces"
|
||||
NFT_FAKEIP_MARK="0x80000"
|
||||
NFT_OUTBOUND_MARK="0x90000"
|
||||
NFT_FAKEIP_MARK="0x00100000"
|
||||
NFT_OUTBOUND_MARK="0x00200000"
|
||||
|
||||
## sing-box
|
||||
SB_REQUIRED_VERSION="1.12.0"
|
||||
|
||||
@@ -18,7 +18,9 @@ nolog() {
|
||||
local timestamp
|
||||
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
|
||||
|
||||
echo -e "${COLOR_CYAN}[$timestamp]${COLOR_RESET} ${COLOR_GREEN}$message${COLOR_RESET}"
|
||||
if [ -t 1 ]; then
|
||||
echo -e "${COLOR_CYAN}[$timestamp]${COLOR_RESET} ${COLOR_GREEN}$message${COLOR_RESET}"
|
||||
fi
|
||||
}
|
||||
|
||||
echolog() {
|
||||
|
||||
Reference in New Issue
Block a user