Fix uci-defaults

This commit is contained in:
Vadim Vetrov 2024-09-13 21:55:18 +03:00
parent 6725e22de7
commit 9dacead2ee
No known key found for this signature in database
GPG Key ID: E8A308689D7A73A5
4 changed files with 16 additions and 9 deletions

View File

@ -50,13 +50,13 @@ define Package/youtubeUnblock/install
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/youtubeUnblock $(1)/etc/init.d/youtubeUnblock $(INSTALL_BIN) ./files/etc/init.d/youtubeUnblock $(1)/etc/init.d/youtubeUnblock
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/uci-defaults/99-youtubeUnblock $(1)/etc/uci-defaults/99-youtubeUnblock $(INSTALL_BIN) ./files/etc/uci-defaults/99-youtubeUnblock.sh $(1)/etc/uci-defaults/99-youtubeUnblock.sh
$(INSTALL_DIR) $(1)/usr/share/nftables.d/ruleset-post/ $(INSTALL_DIR) $(1)/usr/share/nftables.d/ruleset-post/
$(CP) ./files/nftables.d/537-youtubeUnblock.nft $(1)/usr/share/nftables.d/ruleset-post/537-youtubeUnblock.nft $(INSTALL_DATA) ./files/nftables.d/537-youtubeUnblock.nft $(1)/usr/share/nftables.d/ruleset-post/537-youtubeUnblock.nft
$(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR)/controller $(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR)/controller
$(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR)/model/cbi $(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR)/model/cbi
$(INSTALL_BIN) ./files/luasrc/controller/* $(1)$(LUCI_LIBRARYDIR)/controller $(INSTALL_DATA) ./files/luasrc/controller/* $(1)$(LUCI_LIBRARYDIR)/controller
$(INSTALL_BIN) ./files/luasrc/model/cbi/* $(1)$(LUCI_LIBRARYDIR)/model/cbi $(INSTALL_DATA) ./files/luasrc/model/cbi/* $(1)$(LUCI_LIBRARYDIR)/model/cbi
endef endef
$(eval $(call BuildPackage,youtubeUnblock)) $(eval $(call BuildPackage,youtubeUnblock))

View File

@ -6,7 +6,7 @@
START=91 START=91
USE_PROCD=1 USE_PROCD=1
PROCD_DEBUG=1 # PROCD_DEBUG=1
PROG=/usr/bin/youtubeUnblock PROG=/usr/bin/youtubeUnblock
# You should use uci for configuration # You should use uci for configuration
@ -83,7 +83,10 @@ start_service() {
config_load youtubeUnblock config_load youtubeUnblock
config_foreach parse_options youtubeUnblock config_foreach parse_options youtubeUnblock
echo "$OPTS"
if [[ "$PROCD_DEBUG" == "1" ]]; then
echo "$OPTS"
fi
procd_open_instance 'youtubeUnblock' procd_open_instance 'youtubeUnblock'
procd_set_param command $PROG $OPTS procd_set_param command $PROG $OPTS

View File

@ -1,5 +1,7 @@
uci -q batch << EOI #!/bin/sh
add youtubeUnblock youtubeUnblock [[ ! "$(uci -q get youtubeUnblock.youtubeUnblock)" == "" ]] && exit 0
uci batch << EOI
set youtubeUnblock.youtubeUnblock='youtubeUnblock'
set youtubeUnblock.youtubeUnblock.frag='tcp' set youtubeUnblock.youtubeUnblock.frag='tcp'
set youtubeUnblock.youtubeUnblock.frag_sni_reverse='1' set youtubeUnblock.youtubeUnblock.frag_sni_reverse='1'
set youtubeUnblock.youtubeUnblock.frag_middle_sni='1' set youtubeUnblock.youtubeUnblock.frag_middle_sni='1'
@ -21,3 +23,6 @@ add_list youtubeUnblock.youtubeUnblock.sni_domains='googleusercontent.com'
add_list youtubeUnblock.youtubeUnblock.sni_domains='gstatic.com' add_list youtubeUnblock.youtubeUnblock.sni_domains='gstatic.com'
add_list youtubeUnblock.youtubeUnblock.sni_domains='l.google.com' add_list youtubeUnblock.youtubeUnblock.sni_domains='l.google.com'
EOI EOI
uci commit
/etc/init.d/firewall restart &>/dev/null
exit 0 # IMPORTANT, IF WE NO PUT THIS, WILL EXECUTED ENDLESSLY

View File

@ -4,7 +4,6 @@ local m = Map("youtubeUnblock", "youtubeUnblock", "Bypasses Deep Packet Inspecti
local s = m:section(NamedSection, "youtubeUnblock", "youtubeUnblock", "youtubeUnblock", "Config. Check the README for more details <a href=\"https://github.com/Waujito/youtubeUnblock\">https://github.com/Waujito/youtubeUnblock</a>") local s = m:section(NamedSection, "youtubeUnblock", "youtubeUnblock", "youtubeUnblock", "Config. Check the README for more details <a href=\"https://github.com/Waujito/youtubeUnblock\">https://github.com/Waujito/youtubeUnblock</a>")
local o local o
s:option(Value, "queue_num", "queue num", "The number of netfilter queue youtubeUnblock will be linked to.")
s:option(Flag, "fake_sni", "fake sni", "This flag enables fake-sni which forces youtubeUnblock to send at least three packets instead of one with TLS ClientHello: Fake ClientHello, 1st part of original ClientHello, 2nd part of original ClientHello. This flag may be related to some Operation not permitted error messages, so before open an issue refer to Troubleshooting for EPERMS.") s:option(Flag, "fake_sni", "fake sni", "This flag enables fake-sni which forces youtubeUnblock to send at least three packets instead of one with TLS ClientHello: Fake ClientHello, 1st part of original ClientHello, 2nd part of original ClientHello. This flag may be related to some Operation not permitted error messages, so before open an issue refer to Troubleshooting for EPERMS.")
o = s:option(ListValue, "faking_strategy", "faking strategy", o = s:option(ListValue, "faking_strategy", "faking strategy",