mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2025-12-13 23:16:51 +03:00
config: luci: Add support new hostlist file "zapret-hosts-google.txt"
This commit is contained in:
@@ -234,6 +234,18 @@ return view.extend({
|
|||||||
tabname = 'blacklist_tab';
|
tabname = 'blacklist_tab';
|
||||||
s.tab(tabname, _('Blacklist settings'));
|
s.tab(tabname, _('Blacklist settings'));
|
||||||
|
|
||||||
|
o = s.taboption(tabname, form.Button, '_google_entries_btn', _('Google hostname entries'));
|
||||||
|
o.inputtitle = _('Edit');
|
||||||
|
o.inputstyle = 'edit btn';
|
||||||
|
o.description = tools.hostsGoogleFN;
|
||||||
|
o.onclick = () => new tools.fileEditDialog(
|
||||||
|
tools.hostsGoogleFN,
|
||||||
|
_('Google hostname entries'),
|
||||||
|
_('One hostname per line.<br />Examples:'),
|
||||||
|
'<code>youtube.com<br />googlevideo.com</code>',
|
||||||
|
15
|
||||||
|
).show();
|
||||||
|
|
||||||
o = s.taboption(tabname, form.Button, '_user_entries_btn', _('User hostname entries'));
|
o = s.taboption(tabname, form.Button, '_user_entries_btn', _('User hostname entries'));
|
||||||
o.inputtitle = _('Edit');
|
o.inputtitle = _('Edit');
|
||||||
o.inputstyle = 'edit btn';
|
o.inputstyle = 'edit btn';
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ return baseclass.extend({
|
|||||||
syncCfgPath : '/opt/zapret/sync_config.sh',
|
syncCfgPath : '/opt/zapret/sync_config.sh',
|
||||||
defaultCfgPath : '/opt/zapret/uci-def-cfg.sh',
|
defaultCfgPath : '/opt/zapret/uci-def-cfg.sh',
|
||||||
|
|
||||||
|
hostsGoogleFN : '/opt/zapret/ipset/zapret-hosts-google.txt',
|
||||||
hostsUserFN : '/opt/zapret/ipset/zapret-hosts-user.txt',
|
hostsUserFN : '/opt/zapret/ipset/zapret-hosts-user.txt',
|
||||||
hostsUserExcludeFN: '/opt/zapret/ipset/zapret-hosts-user-exclude.txt',
|
hostsUserExcludeFN: '/opt/zapret/ipset/zapret-hosts-user-exclude.txt',
|
||||||
iplstExcludeFN : '/opt/zapret/ipset/zapret-ip-exclude.txt',
|
iplstExcludeFN : '/opt/zapret/ipset/zapret-ip-exclude.txt',
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ define Package/$(PKG_NAME)/install
|
|||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/openwrt/zapret $(1)/etc/init.d/zapret
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/openwrt/zapret $(1)/etc/init.d/zapret
|
||||||
$(INSTALL_CONF) ./config.default $(1)/opt/zapret/config.default
|
$(INSTALL_CONF) ./config.default $(1)/opt/zapret/config.default
|
||||||
$(INSTALL_CONF) ./ipset/zapret-hosts-user.txt $(1)/opt/zapret/ipset/zapret-hosts-user.txt
|
$(INSTALL_CONF) ./ipset/zapret-hosts-google.txt $(1)/opt/zapret/ipset/zapret-hosts-google.txt
|
||||||
$(INSTALL_CONF) ./ipset/zapret-hosts-user-exclude.txt $(1)/opt/zapret/ipset/zapret-hosts-user-exclude.txt
|
$(INSTALL_CONF) ./ipset/zapret-hosts-user-exclude.txt $(1)/opt/zapret/ipset/zapret-hosts-user-exclude.txt
|
||||||
$(INSTALL_CONF) ./ipset/zapret-ip-exclude.txt $(1)/opt/zapret/ipset/zapret-ip-exclude.txt
|
$(INSTALL_CONF) ./ipset/zapret-ip-exclude.txt $(1)/opt/zapret/ipset/zapret-ip-exclude.txt
|
||||||
$(INSTALL_BIN) ./sync_config.sh $(1)/opt/zapret/sync_config.sh
|
$(INSTALL_BIN) ./sync_config.sh $(1)/opt/zapret/sync_config.sh
|
||||||
@@ -126,7 +126,9 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
|
|||||||
cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}"
|
cp -f "$${ZAPRET_CONFIG_DEF}" "$${ZAPRET_CONFIG}"
|
||||||
fi
|
fi
|
||||||
# create empty txt files into ipset directory
|
# create empty txt files into ipset directory
|
||||||
|
[ ! -f "/opt/zapret/ipset/zapret-hosts-google.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-google.txt"
|
||||||
#[ ! -f "/opt/zapret/ipset/zapret-hosts-auto.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-auto.txt"
|
#[ ! -f "/opt/zapret/ipset/zapret-hosts-auto.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-auto.txt"
|
||||||
|
[ ! -f "/opt/zapret/ipset/zapret-hosts-user.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-user.txt"
|
||||||
[ ! -f "/opt/zapret/ipset/zapret-hosts-user-ipban.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-user-ipban.txt"
|
[ ! -f "/opt/zapret/ipset/zapret-hosts-user-ipban.txt" ] && touch "/opt/zapret/ipset/zapret-hosts-user-ipban.txt"
|
||||||
#[ ! -f "/opt/zapret/ipset/zapret-ip.txt" ] && touch "/opt/zapret/ipset/zapret-ip.txt"
|
#[ ! -f "/opt/zapret/ipset/zapret-ip.txt" ] && touch "/opt/zapret/ipset/zapret-ip.txt"
|
||||||
[ ! -f "/opt/zapret/ipset/zapret-ip-user.txt" ] && touch "/opt/zapret/ipset/zapret-ip-user.txt"
|
[ ! -f "/opt/zapret/ipset/zapret-ip-user.txt" ] && touch "/opt/zapret/ipset/zapret-ip-user.txt"
|
||||||
|
|||||||
Reference in New Issue
Block a user