chore: fix my perfect English

This commit is contained in:
Andrey Petelin
2025-09-05 16:49:05 +05:00
parent da89c5c7df
commit d03167f49d
2 changed files with 73 additions and 74 deletions

View File

@@ -234,18 +234,17 @@ function createConfigSection(section, map, network) {
return true; return true;
}; };
o = s.taboption('basic', form.Flag, 'community_list_enabled', _('Community Lists')); o = s.taboption('basic', form.Flag, 'community_lists_enabled', _('Community Lists'));
o.default = '0'; o.default = '0';
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o = s.taboption('basic', form.DynamicList, 'community_list', _('Service List'), _('Select predefined service for routing') + ' <a href="https://github.com/itdoginfo/allow-domains" target="_blank">github.com/itdoginfo/allow-domains</a>'); o = s.taboption('basic', form.DynamicList, 'community_lists', _('Service List'), _('Select predefined service for routing') + ' <a href="https://github.com/itdoginfo/allow-domains" target="_blank">github.com/itdoginfo/allow-domains</a>');
o.placeholder = 'Service list'; o.placeholder = 'Service list';
Object.entries(constants.DOMAIN_LIST_OPTIONS).forEach(([key, label]) => { Object.entries(constants.DOMAIN_LIST_OPTIONS).forEach(([key, label]) => {
o.value(key, _(label)); o.value(key, _(label));
}); });
o.depends('community_lists_enabled', '1');
o.depends('community_list_enabled', '1');
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
@@ -302,7 +301,7 @@ function createConfigSection(section, map, network) {
} }
}; };
o = s.taboption('basic', form.ListValue, 'user_domains_list_type', _('User Domain List Type'), _('Select how to add your custom domains')); o = s.taboption('basic', form.ListValue, 'user_domain_list_type', _('User Domain List Type'), _('Select how to add your custom domains'));
o.value('disabled', _('Disabled')); o.value('disabled', _('Disabled'));
o.value('dynamic', _('Dynamic List')); o.value('dynamic', _('Dynamic List'));
o.value('text', _('Text List')); o.value('text', _('Text List'));
@@ -312,7 +311,7 @@ function createConfigSection(section, map, network) {
o = s.taboption('basic', form.DynamicList, 'user_domains', _('User Domains'), _('Enter domain names without protocols (example: sub.example.com or example.com)')); o = s.taboption('basic', form.DynamicList, 'user_domains', _('User Domains'), _('Enter domain names without protocols (example: sub.example.com or example.com)'));
o.placeholder = 'Domains list'; o.placeholder = 'Domains list';
o.depends('user_domains_list_type', 'dynamic'); o.depends('user_domain_list_type', 'dynamic');
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o.validate = function (section_id, value) { o.validate = function (section_id, value) {
@@ -327,7 +326,7 @@ function createConfigSection(section, map, network) {
// TODO: Is it possible to save not as an option (but as a split list)? // TODO: Is it possible to save not as an option (but as a split list)?
o = s.taboption('basic', form.TextValue, 'user_domains_text', _('User Domains List'), _('Enter domain names separated by comma, space or newline. You can add comments after //')); o = s.taboption('basic', form.TextValue, 'user_domains_text', _('User Domains List'), _('Enter domain names separated by comma, space or newline. You can add comments after //'));
o.placeholder = 'example.com, sub.example.com\n// Social networks\ndomain.com test.com // personal domains'; o.placeholder = 'example.com, sub.example.com\n// Social networks\ndomain.com test.com // personal domains';
o.depends('user_domains_list_type', 'text'); o.depends('user_domain_list_type', 'text');
o.rows = 8; o.rows = 8;
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
@@ -366,14 +365,14 @@ function createConfigSection(section, map, network) {
return true; return true;
}; };
o = s.taboption('basic', form.Flag, 'local_domains_list_enabled', _('Local Domain Lists'), _('Use the list from the router filesystem')); o = s.taboption('basic', form.Flag, 'local_domain_lists_enabled', _('Local Domain Lists'), _('Use the list from the router filesystem'));
o.default = '0'; o.default = '0';
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o = s.taboption('basic', form.DynamicList, 'local_domains_list', _('Local Domain Lists Path'), _('Enter the list file path')); o = s.taboption('basic', form.DynamicList, 'local_domain_lists', _('Local Domain Lists Path'), _('Enter the list file path'));
o.placeholder = '/path/file.lst'; o.placeholder = '/path/file.lst';
o.depends('local_domains_list_enabled', '1'); o.depends('local_domain_lists_enabled', '1');
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o.validate = function (section_id, value) { o.validate = function (section_id, value) {
@@ -385,14 +384,14 @@ function createConfigSection(section, map, network) {
return true; return true;
}; };
o = s.taboption('basic', form.Flag, 'remote_domains_list_enabled', _('Remote Domain Lists'), _('Download and use domain lists from remote URLs')); o = s.taboption('basic', form.Flag, 'remote_domain_lists_enabled', _('Remote Domain Lists'), _('Download and use domain lists from remote URLs'));
o.default = '0'; o.default = '0';
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o = s.taboption('basic', form.DynamicList, 'remote_domains_list', _('Remote Domain URLs'), _('Enter full URLs starting with http:// or https://')); o = s.taboption('basic', form.DynamicList, 'remote_domain_lists', _('Remote Domain URLs'), _('Enter full URLs starting with http:// or https://'));
o.placeholder = 'URL'; o.placeholder = 'URL';
o.depends('remote_domains_list_enabled', '1'); o.depends('remote_domain_lists_enabled', '1');
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o.validate = function (section_id, value) { o.validate = function (section_id, value) {
@@ -400,7 +399,7 @@ function createConfigSection(section, map, network) {
return validateUrl(value); return validateUrl(value);
}; };
o = s.taboption('basic', form.ListValue, 'user_subnets_list_type', _('User Subnet List Type'), _('Select how to add your custom subnets')); o = s.taboption('basic', form.ListValue, 'user_subnet_list_type', _('User Subnet List Type'), _('Select how to add your custom subnets'));
o.value('disabled', _('Disabled')); o.value('disabled', _('Disabled'));
o.value('dynamic', _('Dynamic List')); o.value('dynamic', _('Dynamic List'));
o.value('text', _('Text List (comma/space/newline separated)')); o.value('text', _('Text List (comma/space/newline separated)'));
@@ -410,7 +409,7 @@ function createConfigSection(section, map, network) {
o = s.taboption('basic', form.DynamicList, 'user_subnets', _('User Subnets'), _('Enter subnets in CIDR notation (example: 103.21.244.0/22) or single IP addresses')); o = s.taboption('basic', form.DynamicList, 'user_subnets', _('User Subnets'), _('Enter subnets in CIDR notation (example: 103.21.244.0/22) or single IP addresses'));
o.placeholder = 'IP or subnet'; o.placeholder = 'IP or subnet';
o.depends('user_subnets_list_type', 'dynamic'); o.depends('user_subnet_list_type', 'dynamic');
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o.validate = function (section_id, value) { o.validate = function (section_id, value) {
@@ -436,7 +435,7 @@ function createConfigSection(section, map, network) {
// TODO: Is it possible to save not as an option (but as a split list)? // TODO: Is it possible to save not as an option (but as a split list)?
o = s.taboption('basic', form.TextValue, 'user_subnets_text', _('User Subnets List'), _('Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline. You can add comments after //')); o = s.taboption('basic', form.TextValue, 'user_subnets_text', _('User Subnets List'), _('Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline. You can add comments after //'));
o.placeholder = '103.21.244.0/22\n// Google DNS\n8.8.8.8\n1.1.1.1/32, 9.9.9.9 // Cloudflare and Quad9'; o.placeholder = '103.21.244.0/22\n// Google DNS\n8.8.8.8\n1.1.1.1/32, 9.9.9.9 // Cloudflare and Quad9';
o.depends('user_subnets_list_type', 'text'); o.depends('user_subnet_list_type', 'text');
o.rows = 10; o.rows = 10;
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
@@ -491,14 +490,14 @@ function createConfigSection(section, map, network) {
return true; return true;
}; };
o = s.taboption('basic', form.Flag, 'remote_subnets_list_enabled', _('Remote Subnet Lists'), _('Download and use subnet lists from remote URLs')); o = s.taboption('basic', form.Flag, 'remote_subnet_lists_enabled', _('Remote Subnet Lists'), _('Download and use subnet lists from remote URLs'));
o.default = '0'; o.default = '0';
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o = s.taboption('basic', form.DynamicList, 'remote_subnets_list', _('Remote Subnet URLs'), _('Enter full URLs starting with http:// or https://')); o = s.taboption('basic', form.DynamicList, 'remote_subnet_lists', _('Remote Subnet URLs'), _('Enter full URLs starting with http:// or https://'));
o.placeholder = 'URL'; o.placeholder = 'URL';
o.depends('remote_subnets_list_enabled', '1'); o.depends('remote_subnet_lists_enabled', '1');
o.rmempty = false; o.rmempty = false;
o.ucisection = s.section; o.ucisection = s.section;
o.validate = function (section_id, value) { o.validate = function (section_id, value) {

View File

@@ -224,35 +224,35 @@ migration() {
local CONFIG="/etc/config/podkop" local CONFIG="/etc/config/podkop"
if grep -q "ru_inside" $CONFIG; then if grep -q "ru_inside" $CONFIG; then
log "Depricated list found: ru_inside" log "Deprecated list found: ru_inside"
sed -i '/ru_inside/d' $CONFIG sed -i '/ru_inside/d' $CONFIG
fi fi
if grep -q "list domain_list 'ru_outside'" $CONFIG; then if grep -q "list domain_list 'ru_outside'" $CONFIG; then
log "Depricated list found: sru_outside" log "Deprecated list found: sru_outside"
sed -i '/ru_outside/d' $CONFIG sed -i '/ru_outside/d' $CONFIG
fi fi
if grep -q "list domain_list 'ua'" $CONFIG; then if grep -q "list domain_list 'ua'" $CONFIG; then
log "Depricated list found: ua" log "Deprecated list found: ua"
sed -i '/ua/d' $CONFIG sed -i '/ua/d' $CONFIG
fi fi
# Subnet list # Subnet list
if grep -q "list subnets" $CONFIG; then if grep -q "list subnets" $CONFIG; then
log "Depricated second section found" log "Deprecated second section found"
sed -i '/list subnets/d' $CONFIG sed -i '/list subnets/d' $CONFIG
fi fi
# second remove # second remove
if grep -q "config second 'second'" $CONFIG; then if grep -q "config second 'second'" $CONFIG; then
log "Depricated second section found" log "Deprecated second section found"
sed -i '/second/d' $CONFIG sed -i '/second/d' $CONFIG
fi fi
# cron update # cron update
if grep -qE "^\s*option update_interval '[0-9*/,-]+( [0-9*/,-]+){4}'" $CONFIG; then if grep -qE "^\s*option update_interval '[0-9*/,-]+( [0-9*/,-]+){4}'" $CONFIG; then
log "Depricated update_interval" log "Deprecated update_interval"
sed -i "s|^\(\s*option update_interval\) '[0-9*/,-]\+\( [0-9*/,-]\+\)\{4\}'|\1 '1d'|" $CONFIG sed -i "s|^\(\s*option update_interval\) '[0-9*/,-]\+\( [0-9*/,-]\+\)\{4\}'|\1 '1d'|" $CONFIG
fi fi
@@ -271,25 +271,25 @@ migration() {
# corntab init.d # corntab init.d
(crontab -l | grep -v "/etc/init.d/podkop list_update") | crontab - (crontab -l | grep -v "/etc/init.d/podkop list_update") | crontab -
migrate_config_key "$CONFIG" "option" "domain_list_enabled" "community_list_enabled" migrate_config_key "$CONFIG" "option" "domain_list_enabled" "community_lists_enabled"
migrate_config_key "$CONFIG" "list" "domain_list" "community_list" migrate_config_key "$CONFIG" "list" "domain_list" "community_lists"
migrate_config_key "$CONFIG" "option" "custom_domains_list_type" "user_domains_list_type" migrate_config_key "$CONFIG" "option" "custom_domains_list_type" "user_domain_list_type"
migrate_config_key "$CONFIG" "option" "custom_domains_text" "user_domains_text" migrate_config_key "$CONFIG" "option" "custom_domains_text" "user_domains_text"
migrate_config_key "$CONFIG" "list" "custom_domains" "user_domains" migrate_config_key "$CONFIG" "list" "custom_domains" "user_domains"
migrate_config_key "$CONFIG" "option" "custom_subnets_list_enabled" "user_subnets_list_type" migrate_config_key "$CONFIG" "option" "custom_subnets_list_enabled" "user_subnet_list_type"
migrate_config_key "$CONFIG" "option" "custom_subnets_text" "user_subnets_text" migrate_config_key "$CONFIG" "option" "custom_subnets_text" "user_subnets_text"
migrate_config_key "$CONFIG" "list" "custom_subnets" "user_subnets" migrate_config_key "$CONFIG" "list" "custom_subnets" "user_subnets"
migrate_config_key "$CONFIG" "option" "custom_local_domains_list_enabled" "local_domains_list_enabled" migrate_config_key "$CONFIG" "option" "custom_local_domains_list_enabled" "local_domain_lists_enabled"
migrate_config_key "$CONFIG" "list" "custom_local_domains" "local_domains_list" migrate_config_key "$CONFIG" "list" "custom_local_domains" "local_domain_lists"
migrate_config_key "$CONFIG" "option" "custom_download_domains_list_enabled" "remote_domains_list_enabled" migrate_config_key "$CONFIG" "option" "custom_download_domains_list_enabled" "remote_domain_lists_enabled"
migrate_config_key "$CONFIG" "list" "custom_download_domains" "remote_domains_list" migrate_config_key "$CONFIG" "list" "custom_download_domains" "remote_domain_lists"
migrate_config_key "$CONFIG" "option" "custom_download_subnets_list_enabled" "remote_subnets_list_enabled" migrate_config_key "$CONFIG" "option" "custom_download_subnets_list_enabled" "remote_subnet_lists_enabled"
migrate_config_key "$CONFIG" "list" "custom_download_subnets" "remote_subnets_list" migrate_config_key "$CONFIG" "list" "custom_download_subnets" "remote_subnet_lists"
} }
validate_service() { validate_service() {
@@ -497,10 +497,10 @@ dnsmasq_restore() {
add_cron_job() { add_cron_job() {
## Future: make a check so that it doesn't recreate many times ## Future: make a check so that it doesn't recreate many times
local community_list_enabled remote_domains_list_enabled remote_subnets_list_enabled update_interval local community_lists_enabled remote_domain_lists_enabled remote_subnet_lists_enabled update_interval
config_get community_list_enabled "$section" "community_list_enabled" config_get community_lists_enabled "$section" "community_lists_enabled"
config_get remote_domains_list_enabled "$section" "remote_domains_list_enabled" config_get remote_domain_lists_enabled "$section" "remote_domain_lists_enabled"
config_get remote_subnets_list_enabled "$section" "remote_subnets_list_enabled" config_get remote_subnet_lists_enabled "$section" "remote_subnet_lists_enabled"
config_get update_interval "main" "update_interval" config_get update_interval "main" "update_interval"
case "$update_interval" in case "$update_interval" in
@@ -525,9 +525,9 @@ add_cron_job() {
;; ;;
esac esac
if [ "$community_list_enabled" -eq 1 ] || \ if [ "$community_lists_enabled" -eq 1 ] || \
[ "$remote_domains_list_enabled" -eq 1 ] || \ [ "$remote_domain_lists_enabled" -eq 1 ] || \
[ "$remote_subnets_list_enabled" -eq 1 ]; then [ "$remote_subnet_lists_enabled" -eq 1 ]; then
remove_cron_job remove_cron_job
crontab -l | { crontab -l | {
cat cat
@@ -870,21 +870,21 @@ exclude_source_ip_from_routing_handler() {
configure_routing_for_section_lists() { configure_routing_for_section_lists() {
local section="$1" local section="$1"
local community_list_enabled local_domains_list_enabled remote_domains_list_enabled remote_subnets_list_enabled local community_lists_enabled local_domain_lists_enabled remote_domain_lists_enabled remote_subnet_lists_enabled
local user_domains_list_type user_subnets_list_type route_rule_tag local user_domain_list_type user_subnet_list_type route_rule_tag
config_get_bool community_list_enabled "$section" "community_list_enabled" 0 config_get_bool community_lists_enabled "$section" "community_lists_enabled" 0
config_get user_domains_list_type "$section" "user_domains_list_type" "disabled" config_get user_domain_list_type "$section" "user_domain_list_type" "disabled"
config_get_bool local_domains_list_enabled "$section" "local_domains_list_enabled" 0 config_get_bool local_domain_lists_enabled "$section" "local_domain_lists_enabled" 0
config_get_bool remote_domains_list_enabled "$section" "remote_domains_list_enabled" 0 config_get_bool remote_domain_lists_enabled "$section" "remote_domain_lists_enabled" 0
config_get user_subnets_list_type "$section" "user_subnets_list_type" "disabled" config_get user_subnet_list_type "$section" "user_subnet_list_type" "disabled"
config_get_bool remote_subnets_list_enabled "$section" "remote_subnets_list_enabled" 0 config_get_bool remote_subnet_lists_enabled "$section" "remote_subnet_lists_enabled" 0
if [ "$community_list_enabled" -eq 0 ] && \ if [ "$community_lists_enabled" -eq 0 ] && \
[ "$user_domains_list_type" == "disabled" ] && \ [ "$user_domain_list_type" == "disabled" ] && \
[ "$local_domains_list_enabled" -eq 0 ] && \ [ "$local_domain_lists_enabled" -eq 0 ] && \
[ "$remote_domains_list_enabled" -eq 0 ] && \ [ "$remote_domain_lists_enabled" -eq 0 ] && \
[ "$user_subnets_list_type" == "disabled" ] && \ [ "$user_subnet_list_type" == "disabled" ] && \
[ "$remote_subnets_list_enabled" == 0 ] ; then [ "$remote_subnet_lists_enabled" == 0 ] ; then
log "Section $section does not have any enabled list, skipping..." "warn" log "Section $section does not have any enabled list, skipping..." "warn"
return 0 return 0
fi fi
@@ -893,37 +893,37 @@ configure_routing_for_section_lists() {
outbound_tag=$(get_outbound_tag_by_section "$section") outbound_tag=$(get_outbound_tag_by_section "$section")
config=$(sing_box_cm_add_route_rule "$config" "$route_rule_tag" "$SB_TPROXY_INBOUND_TAG" "$outbound_tag") config=$(sing_box_cm_add_route_rule "$config" "$route_rule_tag" "$SB_TPROXY_INBOUND_TAG" "$outbound_tag")
if [ "$community_list_enabled" -eq 1 ]; then if [ "$community_lists_enabled" -eq 1 ]; then
log "Processing community list routing rules for $section section" log "Processing community list routing rules for $section section"
config_list_foreach "$section" "community_list" configure_community_list_handler "$section" "$route_rule_tag" config_list_foreach "$section" "community_lists" configure_community_list_handler "$section" "$route_rule_tag"
fi fi
if [ "$user_domains_list_type" != "disabled" ]; then if [ "$user_domain_list_type" != "disabled" ]; then
log "Processing user domains routing rules for $section section" log "Processing user domains routing rules for $section section"
# TODO(ampetelin): it is necessary to implement # TODO(ampetelin): it is necessary to implement
# configure_user_domains_list_handler # configure_user_domain_list_handler
fi fi
if [ "$local_domains_list_enabled" -eq 1 ]; then if [ "$local_domain_lists_enabled" -eq 1 ]; then
log "Processing local domains routing rules for $section section" log "Processing local domains routing rules for $section section"
configure_local_domains_lists "$section" "$route_rule_tag" configure_local_domain_lists "$section" "$route_rule_tag"
fi fi
if [ "$remote_domains_list_enabled" -eq 1 ]; then if [ "$remote_domain_lists_enabled" -eq 1 ]; then
log "Processing remote domains routing rules for $section section" log "Processing remote domains routing rules for $section section"
config_list_foreach "$section" "remote_domains_list" configure_remote_domains_or_subnets_list_handler \ config_list_foreach "$section" "remote_domain_lists" configure_remote_domain_or_subnet_list_handler \
"domains" "$section" "$route_rule_tag" "domains" "$section" "$route_rule_tag"
fi fi
if [ "$user_subnets_list_type" != "disabled" ]; then if [ "$user_subnet_list_type" != "disabled" ]; then
log "Processing user subnets routing rules for $section section" log "Processing user subnets routing rules for $section section"
# TODO(ampetelin): it is necessary to implement # TODO(ampetelin): it is necessary to implement
# configure_user_subnets_list_handler # configure_user_subnet_list_handler
fi fi
if [ "$remote_subnets_list_enabled" -eq 1 ]; then if [ "$remote_subnet_lists_enabled" -eq 1 ]; then
log "Processing remote subnets routing rules for $section section" log "Processing remote subnets routing rules for $section section"
config_list_foreach "$section" "remote_subnets_list" configure_remote_domains_or_subnets_list_handler \ config_list_foreach "$section" "remote_subnet_lists" configure_remote_domain_or_subnet_list_handler \
"subnets" "$section" "$route_rule_tag" "subnets" "$section" "$route_rule_tag"
fi fi
} }
@@ -945,12 +945,12 @@ configure_community_list_handler() {
config=$(sing_box_cm_patch_route_rule "$config" "$route_rule_tag" "rule_set" "$ruleset_tag") config=$(sing_box_cm_patch_route_rule "$config" "$route_rule_tag" "rule_set" "$ruleset_tag")
} }
configure_user_domains_list_handler() { configure_user_domain_list_handler() {
local section="$1" local section="$1"
# TODO(ampetelin): it is necessary to implement # TODO(ampetelin): it is necessary to implement
} }
configure_local_domains_lists() { configure_local_domain_lists() {
local section="$1" local section="$1"
local route_rule_tag="$2" local route_rule_tag="$2"
@@ -964,10 +964,10 @@ configure_local_domains_lists() {
config=$(sing_box_cm_patch_route_rule "$config" "$route_rule_tag" "rule_set" "$ruleset_tag") config=$(sing_box_cm_patch_route_rule "$config" "$route_rule_tag" "rule_set" "$ruleset_tag")
_add_ruleset_to_dns_rules "$ruleset_tag" "$route_rule_tag" _add_ruleset_to_dns_rules "$ruleset_tag" "$route_rule_tag"
config_list_foreach "$section" "local_domains_list" import_local_domains_ruleset "$section" "$ruleset_filepath" config_list_foreach "$section" "local_domains_list" import_local_domain_list_to_ruleset "$section" "$ruleset_filepath"
} }
import_local_domains_ruleset() { import_local_domain_list_to_ruleset() {
local filepath="$1" local filepath="$1"
local section="$2" local section="$2"
local ruleset_filepath="$3" local ruleset_filepath="$3"
@@ -1004,7 +1004,7 @@ import_local_domains_ruleset() {
sing_box_cm_patch_local_source_ruleset_rules "$ruleset_filepath" "domain_suffix" "$domains" sing_box_cm_patch_local_source_ruleset_rules "$ruleset_filepath" "domain_suffix" "$domains"
} }
configure_remote_domains_or_subnets_list_handler() { configure_remote_domain_or_subnet_list_handler() {
local url="$1" local url="$1"
local type="$2" local type="$2"
local section="$3" local section="$3"
@@ -1038,7 +1038,7 @@ configure_remote_domains_or_subnets_list_handler() {
esac esac
} }
configure_user_subnets_list_handler() { configure_user_subnet_list_handler() {
local section="$1" local section="$1"
# TODO(ampetelin): it is necessary to implement # TODO(ampetelin): it is necessary to implement
} }