mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 03:26:51 +03:00
refactor: remove legacy migration logic; make migration() a no-op
This commit is contained in:
@@ -194,79 +194,7 @@ restart() {
|
||||
|
||||
# Migrations and validation funcs
|
||||
migration() {
|
||||
# list migrate
|
||||
local CONFIG="/etc/config/podkop"
|
||||
|
||||
if grep -q "ru_inside" $CONFIG; then
|
||||
log "Deprecated list found: ru_inside"
|
||||
sed -i '/ru_inside/d' $CONFIG
|
||||
fi
|
||||
|
||||
if grep -q "list domain_list 'ru_outside'" $CONFIG; then
|
||||
log "Deprecated list found: sru_outside"
|
||||
sed -i '/ru_outside/d' $CONFIG
|
||||
fi
|
||||
|
||||
if grep -q "list domain_list 'ua'" $CONFIG; then
|
||||
log "Deprecated list found: ua"
|
||||
sed -i '/ua/d' $CONFIG
|
||||
fi
|
||||
|
||||
# Subnet list
|
||||
if grep -q "list subnets" $CONFIG; then
|
||||
log "Deprecated second section found"
|
||||
sed -i '/list subnets/d' $CONFIG
|
||||
fi
|
||||
|
||||
# second remove
|
||||
if grep -q "config second 'second'" $CONFIG; then
|
||||
log "Deprecated second section found"
|
||||
sed -i '/second/d' $CONFIG
|
||||
fi
|
||||
|
||||
# cron update
|
||||
if grep -qE "^\s*option update_interval '[0-9*/,-]+( [0-9*/,-]+){4}'" $CONFIG; then
|
||||
log "Deprecated update_interval"
|
||||
sed -i "s|^\(\s*option update_interval\) '[0-9*/,-]\+\( [0-9*/,-]\+\)\{4\}'|\1 '1d'|" $CONFIG
|
||||
fi
|
||||
|
||||
# dnsmasq https
|
||||
if grep -q "^filter-rr=HTTPS" "/etc/dnsmasq.conf"; then
|
||||
log "Found and removed filter-rr=HTTPS in dnsmasq config"
|
||||
sed -i '/^filter-rr=HTTPS/d' "/etc/dnsmasq.conf"
|
||||
fi
|
||||
|
||||
# dhcp use-application-dns.net
|
||||
if grep -q "use-application-dns.net" "/etc/config/dhcp"; then
|
||||
log "Found and removed use-application-dns.net in dhcp config"
|
||||
sed -i '/use-application-dns/d' "/etc/config/dhcp"
|
||||
fi
|
||||
|
||||
# corntab init.d
|
||||
(crontab -l | grep -v "/etc/init.d/podkop list_update") | crontab -
|
||||
|
||||
migration_rename_config_key "$CONFIG" "option" "domain_list_enabled" "community_lists_enabled"
|
||||
migration_rename_config_key "$CONFIG" "list" "domain_list" "community_lists"
|
||||
|
||||
migration_rename_config_key "$CONFIG" "option" "custom_domains_list_type" "user_domain_list_type"
|
||||
migration_rename_config_key "$CONFIG" "option" "custom_domains_text" "user_domains_text"
|
||||
migration_rename_config_key "$CONFIG" "list" "custom_domains" "user_domains"
|
||||
|
||||
migration_rename_config_key "$CONFIG" "option" "custom_subnets_list_enabled" "user_subnet_list_type"
|
||||
migration_rename_config_key "$CONFIG" "option" "custom_subnets_text" "user_subnets_text"
|
||||
migration_rename_config_key "$CONFIG" "list" "custom_subnets" "user_subnets"
|
||||
|
||||
migration_rename_config_key "$CONFIG" "option" "custom_local_domains_list_enabled" "local_domain_lists_enabled"
|
||||
migration_rename_config_key "$CONFIG" "list" "custom_local_domains" "local_domain_lists"
|
||||
|
||||
migration_rename_config_key "$CONFIG" "option" "custom_download_domains_list_enabled" "remote_domain_lists_enabled"
|
||||
migration_rename_config_key "$CONFIG" "list" "custom_download_domains" "remote_domain_lists"
|
||||
|
||||
migration_rename_config_key "$CONFIG" "option" "custom_download_subnets_list_enabled" "remote_subnet_lists_enabled"
|
||||
migration_rename_config_key "$CONFIG" "list" "custom_download_subnets" "remote_subnet_lists"
|
||||
|
||||
migration_rename_config_key "$CONFIG" "option" "cache_file" "cache_path"
|
||||
migration_add_new_option "podkop" "main" "config_path" "/etc/sing-box/config.json" && config_load "$PODKOP_CONFIG"
|
||||
:
|
||||
}
|
||||
|
||||
validate_service() {
|
||||
|
||||
Reference in New Issue
Block a user