diff --git a/youtubeUnblock/Makefile b/youtubeUnblock/Makefile index 3083ab2..6e9cde0 100644 --- a/youtubeUnblock/Makefile +++ b/youtubeUnblock/Makefile @@ -50,13 +50,13 @@ define Package/youtubeUnblock/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/etc/init.d/youtubeUnblock $(1)/etc/init.d/youtubeUnblock $(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/ - $(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)/model/cbi - $(INSTALL_BIN) ./files/luasrc/controller/* $(1)$(LUCI_LIBRARYDIR)/controller - $(INSTALL_BIN) ./files/luasrc/model/cbi/* $(1)$(LUCI_LIBRARYDIR)/model/cbi + $(INSTALL_DATA) ./files/luasrc/controller/* $(1)$(LUCI_LIBRARYDIR)/controller + $(INSTALL_DATA) ./files/luasrc/model/cbi/* $(1)$(LUCI_LIBRARYDIR)/model/cbi endef $(eval $(call BuildPackage,youtubeUnblock)) diff --git a/youtubeUnblock/files/etc/init.d/youtubeUnblock b/youtubeUnblock/files/etc/init.d/youtubeUnblock index 0609f01..e33bf8b 100755 --- a/youtubeUnblock/files/etc/init.d/youtubeUnblock +++ b/youtubeUnblock/files/etc/init.d/youtubeUnblock @@ -6,7 +6,7 @@ START=91 USE_PROCD=1 -PROCD_DEBUG=1 +# PROCD_DEBUG=1 PROG=/usr/bin/youtubeUnblock # You should use uci for configuration @@ -83,7 +83,10 @@ start_service() { config_load youtubeUnblock config_foreach parse_options youtubeUnblock - echo "$OPTS" + + if [[ "$PROCD_DEBUG" == "1" ]]; then + echo "$OPTS" + fi procd_open_instance 'youtubeUnblock' procd_set_param command $PROG $OPTS diff --git a/youtubeUnblock/files/etc/uci-defaults/99-youtubeUnblock b/youtubeUnblock/files/etc/uci-defaults/99-youtubeUnblock.sh similarity index 81% rename from youtubeUnblock/files/etc/uci-defaults/99-youtubeUnblock rename to youtubeUnblock/files/etc/uci-defaults/99-youtubeUnblock.sh index 2d71789..ab8f3c0 100644 --- a/youtubeUnblock/files/etc/uci-defaults/99-youtubeUnblock +++ b/youtubeUnblock/files/etc/uci-defaults/99-youtubeUnblock.sh @@ -1,5 +1,7 @@ -uci -q batch << EOI -add youtubeUnblock youtubeUnblock +#!/bin/sh +[[ ! "$(uci -q get youtubeUnblock.youtubeUnblock)" == "" ]] && exit 0 +uci batch << EOI +set youtubeUnblock.youtubeUnblock='youtubeUnblock' set youtubeUnblock.youtubeUnblock.frag='tcp' set youtubeUnblock.youtubeUnblock.frag_sni_reverse='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='l.google.com' EOI +uci commit +/etc/init.d/firewall restart &>/dev/null +exit 0 # IMPORTANT, IF WE NO PUT THIS, WILL EXECUTED ENDLESSLY diff --git a/youtubeUnblock/files/luasrc/model/cbi/youtubeUnblock.lua b/youtubeUnblock/files/luasrc/model/cbi/youtubeUnblock.lua index beb746d..8d5808a 100644 --- a/youtubeUnblock/files/luasrc/model/cbi/youtubeUnblock.lua +++ b/youtubeUnblock/files/luasrc/model/cbi/youtubeUnblock.lua @@ -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 https://github.com/Waujito/youtubeUnblock") 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.") o = s:option(ListValue, "faking_strategy", "faking strategy",