From 2abca3d27ddf257d6a99609bbe10e34d656620f8 Mon Sep 17 00:00:00 2001 From: gSpot Date: Fri, 6 May 2022 03:27:08 +0300 Subject: [PATCH] Fixed typos --- .../resources/view/ruantiblock/settings.js | 6 ++--- ruantiblock/files/etc/config/ruantiblock | 2 +- .../files/etc/ruantiblock/ruantiblock.conf | 4 ++-- .../etc/ruantiblock/scripts/config_script | 2 +- .../files/etc/ruantiblock/scripts/info_output | 2 +- .../etc/ruantiblock/scripts/ipt_functions | 6 ++--- ruantiblock/files/usr/bin/ruantiblock | 22 +++++++++---------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js index 20f2302..ef35231 100644 --- a/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js +++ b/luci-app-ruantiblock/htdocs/luci-static/resources/view/ruantiblock/settings.js @@ -129,8 +129,8 @@ return view.extend({ o.description = _('Reduces RAM consumption during update'); o.rmempty = false; - // ALOWED_HOSTS_MODE - o = s.taboption('main_settings', form.ListValue, 'alowed_hosts_mode', + // ALLOWED_HOSTS_MODE + o = s.taboption('main_settings', form.ListValue, 'allowed_hosts_mode', _('Host filter')); o.value('0', _('Disabled')); o.value('1', _('Only listed hosts')); @@ -138,7 +138,7 @@ return view.extend({ o.description = _('Restriction of hosts that are allowed to bypass blocking'); // ALOWED_HOSTS_LIST - o = s.taboption('main_settings', form.DynamicList, 'alowed_hosts_list', + o = s.taboption('main_settings', form.DynamicList, 'allowed_hosts_list', _('IP addresses of hosts')); o.datatype = "ip4addr"; diff --git a/ruantiblock/files/etc/config/ruantiblock b/ruantiblock/files/etc/config/ruantiblock index 24786b3..3a5b59e 100644 --- a/ruantiblock/files/etc/config/ruantiblock +++ b/ruantiblock/files/etc/config/ruantiblock @@ -3,7 +3,7 @@ config main 'config' option proxy_mode '1' option proxy_local_clients '1' option ipset_clear_sets '1' - option alowed_hosts_mode '0' + option allowed_hosts_mode '0' option if_vpn 'tun0' option tor_trans_port '9040' option tor_allow_udp '1' diff --git a/ruantiblock/files/etc/ruantiblock/ruantiblock.conf b/ruantiblock/files/etc/ruantiblock/ruantiblock.conf index 14b353b..2a14850 100644 --- a/ruantiblock/files/etc/ruantiblock/ruantiblock.conf +++ b/ruantiblock/files/etc/ruantiblock/ruantiblock.conf @@ -17,9 +17,9 @@ PROXY_LOCAL_CLIENTS=1 ### Удаление записей из основных сетов перед началом заполнения временных сетов при обновлении (для освобождения оперативной памяти перед заполнением сетов) (0 - off, 1 - on) IPSET_CLEAR_SETS=0 ### Режим фильтра хостов которым разрешено обходить блокировки (0 - выкл., 1 - только адреса из списка, 2 - любые адреса кроме присутствующих в списке) -export ALOWED_HOSTS_MODE=0 +export ALLOWED_HOSTS_MODE=0 ### Список IP адресов хостов для фильтра, через пробел (прим.: 192.168.0.10 192.168.0.15) -export ALOWED_HOSTS_LIST="" +export ALLOWED_HOSTS_LIST="" ### VPN интерфейс для правил маршрутизации IF_VPN="tun0" ### Порт транспарентного proxy Tor (параметр TransPort в torrc) diff --git a/ruantiblock/files/etc/ruantiblock/scripts/config_script b/ruantiblock/files/etc/ruantiblock/scripts/config_script index 8ea8bff..18baf01 100644 --- a/ruantiblock/files/etc/ruantiblock/scripts/config_script +++ b/ruantiblock/files/etc/ruantiblock/scripts/config_script @@ -1,6 +1,6 @@ AWK_CMD="awk" UCI_SECTION="ruantiblock.config" -UCI_VARS="proxy_mode proxy_local_clients ipset_clear_sets alowed_hosts_mode alowed_hosts_list if_vpn tor_trans_port tor_allow_udp onion_dns_addr add_user_entries user_entries_dns enable_logging bllist_module bllist_preset bllist_ip_limit bllist_gr_excluded_nets bllist_summarize_ip bllist_summarize_cidr bllist_ip_filter bllist_sd_limit bllist_gr_excluded_sld bllist_fqdn_filter bllist_enable_idn bllist_alt_nslookup bllist_alt_dns_addr" +UCI_VARS="proxy_mode proxy_local_clients ipset_clear_sets allowed_hosts_mode allowed_hosts_list if_vpn tor_trans_port tor_allow_udp onion_dns_addr add_user_entries user_entries_dns enable_logging bllist_module bllist_preset bllist_ip_limit bllist_gr_excluded_nets bllist_summarize_ip bllist_summarize_cidr bllist_ip_filter bllist_sd_limit bllist_gr_excluded_sld bllist_fqdn_filter bllist_enable_idn bllist_alt_nslookup bllist_alt_dns_addr" eval `uci show "$UCI_SECTION" | $AWK_CMD -F "=" -v UCI_VARS="$UCI_VARS" ' BEGIN { diff --git a/ruantiblock/files/etc/ruantiblock/scripts/info_output b/ruantiblock/files/etc/ruantiblock/scripts/info_output index d72e6f7..dc51e9f 100644 --- a/ruantiblock/files/etc/ruantiblock/scripts/info_output +++ b/ruantiblock/files/etc/ruantiblock/scripts/info_output @@ -25,7 +25,7 @@ Info() { printf "\"_dummy\":false},"; }' printf "\"ipset\":{"; - for _set in "$IPSET_ALOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" + for _set in "$IPSET_ALLOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" do $IPSET_CMD list "$_set" -terse | $AWK_CMD -F ": " ' { diff --git a/ruantiblock/files/etc/ruantiblock/scripts/ipt_functions b/ruantiblock/files/etc/ruantiblock/scripts/ipt_functions index cf5a495..9937c8b 100644 --- a/ruantiblock/files/etc/ruantiblock/scripts/ipt_functions +++ b/ruantiblock/files/etc/ruantiblock/scripts/ipt_functions @@ -7,12 +7,12 @@ IPT_ACTION_CHAIN="${NAME}_action" IPT_FIRST_CHAIN="PREROUTING" VPN_ROUTE_TABLE_ID=99 -case "$ALOWED_HOSTS_MODE" in +case "$ALLOWED_HOSTS_MODE" in "1") - IPT_ALLOWED_HOSTS_RULE="-m set --match-set ${IPSET_ALOWED_HOSTS} src -j ${IPT_BLLIST_CHAIN}" + IPT_ALLOWED_HOSTS_RULE="-m set --match-set ${IPSET_ALLOWED_HOSTS} src -j ${IPT_BLLIST_CHAIN}" ;; "2") - IPT_ALLOWED_HOSTS_RULE="-m set ! --match-set ${IPSET_ALOWED_HOSTS} src -j ${IPT_BLLIST_CHAIN}" + IPT_ALLOWED_HOSTS_RULE="-m set ! --match-set ${IPSET_ALLOWED_HOSTS} src -j ${IPT_BLLIST_CHAIN}" ;; *) IPT_ALLOWED_HOSTS_RULE="-j ${IPT_BLLIST_CHAIN}" diff --git a/ruantiblock/files/usr/bin/ruantiblock b/ruantiblock/files/usr/bin/ruantiblock index 62b177b..bed10b3 100755 --- a/ruantiblock/files/usr/bin/ruantiblock +++ b/ruantiblock/files/usr/bin/ruantiblock @@ -32,9 +32,9 @@ export PROXY_LOCAL_CLIENTS=1 ### Удаление записей из основных сетов перед началом заполнения временных сетов при обновлении (для освобождения оперативной памяти перед заполнением сетов) (0 - off, 1 - on) export IPSET_CLEAR_SETS=0 ### Режим фильтра хостов которым разрешено обходить блокировки (0 - выкл., 1 - только адреса из списка, 2 - любые адреса кроме присутствующих в списке) -export ALOWED_HOSTS_MODE=0 +export ALLOWED_HOSTS_MODE=0 ### Список IP адресов хостов для фильтра, через пробел (прим.: 192.168.0.10 192.168.0.15) -export ALOWED_HOSTS_LIST="" +export ALLOWED_HOSTS_LIST="" ### VPN интерфейс для правил iptables export IF_VPN="tun0" ### Порт транспарентного proxy Tor (параметр TransPort в torrc) @@ -185,7 +185,7 @@ fi LOGGER_PARAMS="-t `basename $0` -p user.notice" export DNSMASQ_DATA_FILE="${DATA_DIR}/${NAME}.dnsmasq" export IP_DATA_FILE="${DATA_DIR}/${NAME}.ip" -export IPSET_ALOWED_HOSTS="${NAME}_alowed_ip" +export IPSET_ALLOWED_HOSTS="${NAME}_allowed_ip" export IPSET_IP="${NAME}_ip" export IPSET_IP_TMP="${IPSET_IP}_tmp" export IPSET_CIDR="${NAME}_cidr" @@ -274,9 +274,9 @@ DestroyIpsets() { FillAllowedHostsSet() { local _entry - for _entry in $ALOWED_HOSTS_LIST + for _entry in $ALLOWED_HOSTS_LIST do - $IPSET_CMD add "$IPSET_ALOWED_HOSTS" "$_entry" + $IPSET_CMD add "$IPSET_ALLOWED_HOSTS" "$_entry" done } @@ -288,7 +288,7 @@ AddIptRules() { } DelIptRules() { - IptLocalClientsDel + IptLocalClientsDel IptMainDel } @@ -299,7 +299,7 @@ SetNetConfig() { do IsIpsetExists "$_set" || $IPSET_CMD create "$_set" hash:net maxelem $IPSET_MAXELEM done - for _set in "$IPSET_ALOWED_HOSTS" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_ONION" + for _set in "$IPSET_ALLOWED_HOSTS" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_ONION" do IsIpsetExists "$_set" || $IPSET_CMD create "$_set" hash:ip maxelem $IPSET_MAXELEM done @@ -309,7 +309,7 @@ SetNetConfig() { DropNetConfig() { DelIptRules - FlushIpSets "$IPSET_ALOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" + FlushIpSets "$IPSET_ALLOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" } FillIpsets() { @@ -341,7 +341,7 @@ ClearDataFiles() { CheckStatus() { local _set _ipset_return=0 _return_code=1 if [ "$1" = "ipsets" ]; then - for _set in "$IPSET_ALOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" + for _set in "$IPSET_ALLOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" do IsIpsetExists "$_set" _ipset_return=$? @@ -578,7 +578,7 @@ Status() { }; }' printf " \033[4mIp sets\033[m:\n\n" - for _set in "$IPSET_ALOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" + for _set in "$IPSET_ALLOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" do $IPSET_CMD list "$_set" -terse | $AWK_CMD -F ":" ' { @@ -628,7 +628,7 @@ case "$1" in ;; destroy) Stop "$1" &> /dev/null - DestroyIpsets "$IPSET_ALOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" + DestroyIpsets "$IPSET_ALLOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" ClearDataFiles return_code=$? rm -f "$UPDATE_PID_FILE" "$START_PID_FILE"