mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 11:36:50 +03:00
Some fixes
This commit is contained in:
@@ -81,11 +81,11 @@ Luci: Services/podkop
|
||||
Этот раздел не означает задачи, которые нужно брать и делать. Это общий список хотелок. Если вы хотите помочь, пожалуйста, спросите сначала в телеграмме.
|
||||
|
||||
- [ ] Проверка, что версия в makefile совпадает с тегом
|
||||
- [ ] Диагностика: Proxy check completed successfully предположительно не показывает IP, если вернулся это IPv6.
|
||||
- [ ] Сделать галку запрещающую подкопу редачить dhcp. Допилить в исключение вместе с пустыми полями proxy и vpn
|
||||
- [ ] Обработка ошибки `sing-box[9345]: FATAL[0000] start service: initialize DNS rule[2]: rule-set not found: main`. Когда не задана строка\интерфейс
|
||||
- [ ] Проверка `/etc/resolv.conf` на наличие DNS-серверов
|
||||
- [ ] Отслеживание интерфейса wan в sing-box
|
||||
- [x] Обработка ошибки `sing-box[9345]: FATAL[0000] start service: initialize DNS rule[2]: rule-set not found: main`. Когда не задана строка\интерфейс
|
||||
- [x] Проверка `/etc/resolv.conf` на наличие DNS-серверов
|
||||
- [x] Отслеживание интерфейса wan в sing-box
|
||||
- [ ] Рестарт сервиса без рестарта dnsmasq
|
||||
|
||||
Низкий приоритет
|
||||
- [ ] Галочка, которая режет доступ к doh серверам
|
||||
|
||||
@@ -6,6 +6,7 @@ USE_PROCD=1
|
||||
script=$(readlink "$initscript")
|
||||
NAME="$(basename ${script:-$initscript})"
|
||||
config_load "$NAME"
|
||||
resolv_conf="/etc/resolv.conf"
|
||||
|
||||
start_service() {
|
||||
echo "Start podkop"
|
||||
@@ -31,6 +32,10 @@ start_service() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q "search lan" "$resolv_conf" || ! grep -q "nameserver 127.0.0.1" "$resolv_conf"; then
|
||||
echo "/etc/resolv.conf does not contain 'search lan' or 'nameserver 127.0.0.1' entries"
|
||||
fi
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /bin/sh -c "/usr/bin/podkop start"
|
||||
procd_set_param stdout 1
|
||||
|
||||
@@ -442,11 +442,12 @@ remove_cron_job() {
|
||||
|
||||
prepare_custom_ruleset() {
|
||||
config_get custom_download_domains_list_enabled "$section" "custom_download_domains_list_enabled"
|
||||
config_get custom_download_domains_list_enabled "$section" "custom_download_subnets_list_enabled"
|
||||
config_get custom_download_subnets_list_enabled "$section" "custom_download_subnets_list_enabled"
|
||||
if [ "$custom_download_domains_list_enabled" -eq 1 ] || [ "$custom_download_subnets_list_enabled" -eq 1 ]; then
|
||||
local file="/tmp/podkop/$section-custom-domains-subnets.json"
|
||||
local tag="custom-$section"
|
||||
rm -f $file
|
||||
|
||||
jq -n '
|
||||
{
|
||||
"version": 3,
|
||||
@@ -529,8 +530,11 @@ sing_box_uci() {
|
||||
-e "s/option enabled '0'/option enabled '1'/" \
|
||||
-e "s/option user 'sing-box'/option user 'root'/" $config
|
||||
log "Change sing-box UCI config"
|
||||
else
|
||||
log "Sing-box UCI config OK"
|
||||
fi
|
||||
|
||||
if grep -q '#\s*list ifaces' "$config"; then
|
||||
sed -i '/ifaces/s/#//g' $config
|
||||
log "Uncommented list ifaces"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -759,6 +763,12 @@ sing_box_outdound() {
|
||||
log "VPN mode"
|
||||
log "You are using VPN mode, make sure you have installed all the necessary packages and configured."
|
||||
config_get interface "$section" "interface"
|
||||
|
||||
if [ -z "$interface" ]; then
|
||||
log "VPN interface is not set. Exit"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sing_box_outbound_interface $section $interface
|
||||
;;
|
||||
"proxy")
|
||||
@@ -781,8 +791,8 @@ sing_box_outdound() {
|
||||
active_proxy_string=$(echo "$proxy_string" | grep -v "^[[:space:]]*\/\/" | head -n 1)
|
||||
|
||||
if [ -z "$active_proxy_string" ]; then
|
||||
log "No active proxy configuration found"
|
||||
return
|
||||
log "Proxy string is not set. Exit"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$active_proxy_string" =~ ^ss:// ]]; then
|
||||
@@ -1191,7 +1201,7 @@ sing_box_ruleset_domains_json() {
|
||||
.rules[0].domain_suffix += if .rules[0].domain_suffix | index($domain) then [] else [$domain] end
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
|
||||
log "$domain added to custom-domains-subnets.json"
|
||||
log "$domain added to $section-custom-domains-subnets.json"
|
||||
}
|
||||
|
||||
sing_box_ruleset_subnets_json() {
|
||||
@@ -1204,7 +1214,7 @@ sing_box_ruleset_subnets_json() {
|
||||
.rules[0].ip_cidr += if .rules[0].ip_cidr | index($subnet) then [] else [$subnet] end
|
||||
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||
|
||||
log "$subnet added to '$section'-custom-domains-subnets.json"
|
||||
log "$subnet added to $section-custom-domains-subnets.json"
|
||||
}
|
||||
|
||||
process_domains_for_section() {
|
||||
@@ -1417,7 +1427,7 @@ list_custom_url_domains_create() {
|
||||
wget -q -O "/tmp/podkop/${filename}" "$URL"
|
||||
|
||||
while IFS= read -r domain; do
|
||||
log "From local file: $domain"
|
||||
log "From downloaded file: $domain"
|
||||
sing_box_ruleset_domains_json $domain $section
|
||||
done <"/tmp/podkop/$filename"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user