mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2026-01-31 14:40:36 +03:00
Add new flags from #132 to configuration interfaces
This commit is contained in:
@@ -34,6 +34,16 @@ o:depends("faking_strategy", "randseq")
|
|||||||
o = s:option(Value, "fake_sni_seq_len", "fake sni seq len", "This flag specifies youtubeUnblock to build a complicated construction of fake client hello packets. length determines how much fakes will be sent.")
|
o = s:option(Value, "fake_sni_seq_len", "fake sni seq len", "This flag specifies youtubeUnblock to build a complicated construction of fake client hello packets. length determines how much fakes will be sent.")
|
||||||
o:depends("fake_sni", 1)
|
o:depends("fake_sni", 1)
|
||||||
|
|
||||||
|
o = s:option(ListValue, "fake_sni_type", "fake sni type", "This flag specifies which faking message type should be used for fake packets. For random, the message of the random length and with random payload will be sent. For default the default payload (sni=www.google.com) is used. And for the custom option, the payload from --fake-custom-payload section utilized. Defaults to <code>default</code>.")
|
||||||
|
o:value("default", "default")
|
||||||
|
o:value("custom", "custom")
|
||||||
|
o:value("random", "random")
|
||||||
|
o.widget="radio"
|
||||||
|
o:depends("fake_sni", 1)
|
||||||
|
|
||||||
|
o = s:option(Value, "fake_custom_payload", "fake custom payload", "Useful with --fake-sni-type=custom. You should specify the payload for fake message manually. Use hex format: --fake-custom-payload=0001020304 mean that 5 bytes sequence: 0x00, 0x01, 0x02, 0x03, 0x04 used as fake.")
|
||||||
|
o:depends("fake_sni_type", "custom")
|
||||||
|
|
||||||
o = s:option(ListValue, "frag", "fragmentation strategy", "Specifies the fragmentation strategy for the packet. Tcp is used by default. Ip fragmentation may be blocked by DPI system. None specifies no fragmentation. Probably this won't work, but may be will work for some fake sni strategies.")
|
o = s:option(ListValue, "frag", "fragmentation strategy", "Specifies the fragmentation strategy for the packet. Tcp is used by default. Ip fragmentation may be blocked by DPI system. None specifies no fragmentation. Probably this won't work, but may be will work for some fake sni strategies.")
|
||||||
o:value("tcp", "tcp")
|
o:value("tcp", "tcp")
|
||||||
o:value("ip", "ip")
|
o:value("ip", "ip")
|
||||||
@@ -145,6 +155,13 @@ function fwo.write(self, section)
|
|||||||
sys.call("/etc/init.d/firewall reload")
|
sys.call("/etc/init.d/firewall reload")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local rso = bs:option(Button, "_reset_settings", "Reset settins to defaults")
|
||||||
|
rso.inputtitle = "Reset"
|
||||||
|
rso.inputstyle = "negative"
|
||||||
|
function rso.write(self, section)
|
||||||
|
sys.call("/usr/share/youtubeUnblock/youtubeUnblock_defaults.sh --force")
|
||||||
|
end
|
||||||
|
|
||||||
local logs = sys.exec("logread -l 800 -p youtubeUnblock | grep youtubeUnblock | sed '1!G;h;$!d'")
|
local logs = sys.exec("logread -l 800 -p youtubeUnblock | grep youtubeUnblock | sed '1!G;h;$!d'")
|
||||||
local o = bs:option(DummyValue, "_logs", "Logs")
|
local o = bs:option(DummyValue, "_logs", "Logs")
|
||||||
o.rawhtml = true
|
o.rawhtml = true
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ define Package/youtubeUnblock/install
|
|||||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-youtubeUnblock.sh $(1)/etc/uci-defaults/99-youtubeUnblock.sh
|
$(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/
|
||||||
$(INSTALL_DATA) ./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)/usr/share/youtubeUnblock/
|
||||||
|
$(INSTALL_BIN) ./files/etc/uci-defaults/99-youtubeUnblock.sh $(1)/usr/share/youtubeUnblock/youtubeUnblock_defaults.sh
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/youtubeUnblock/postinst
|
||||||
|
/etc/init.d/firewall reload
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,youtubeUnblock))
|
$(eval $(call BuildPackage,youtubeUnblock))
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ parse_options() {
|
|||||||
append_commasep_list "$config" sni_domains
|
append_commasep_list "$config" sni_domains
|
||||||
fi
|
fi
|
||||||
|
|
||||||
append_opts "$config" queue_num fake_sni_seq_len faking_strategy faking_ttl fake_seq_offset frag frag_sni_pos fk_winsize synfake_len seg2delay packet_mark
|
append_opts "$config" queue_num fake_sni_seq_len faking_strategy faking_ttl fake_seq_offset frag frag_sni_pos fk_winsize synfake_len seg2delay packet_mark fake_sni_type fake_custom_payload
|
||||||
append_commasep_list "$config" exclude_domains
|
append_commasep_list "$config" exclude_domains
|
||||||
append_opts_boolean "$config" fake_sni frag_sni_reverse frag_sni_faked frag_middle_sni synfake
|
append_opts_boolean "$config" fake_sni frag_sni_reverse frag_sni_faked frag_middle_sni synfake
|
||||||
append_opts_btoggler "$config" quic_drop silent trace no_gso no_ipv6
|
append_opts_btoggler "$config" quic_drop silent trace no_gso no_ipv6
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[[ ! "$(uci -q get youtubeUnblock.youtubeUnblock)" == "" ]] && exit 0
|
[[ ! "$(uci -q get youtubeUnblock.youtubeUnblock)" == "" ]] && [[ ! "$1" == "--force" ]] && exit 0
|
||||||
|
[[ ! "$(uci -q get youtubeUnblock.youtubeUnblock)" == "" ]] && uci delete youtubeUnblock.youtubeUnblock
|
||||||
|
|
||||||
touch /etc/config/youtubeUnblock
|
touch /etc/config/youtubeUnblock
|
||||||
uci batch << EOI
|
uci batch << EOI
|
||||||
set youtubeUnblock.youtubeUnblock='youtubeUnblock'
|
set youtubeUnblock.youtubeUnblock='youtubeUnblock'
|
||||||
@@ -13,6 +15,8 @@ set youtubeUnblock.youtubeUnblock.packet_mark='32768'
|
|||||||
set youtubeUnblock.youtubeUnblock.fake_sni='1'
|
set youtubeUnblock.youtubeUnblock.fake_sni='1'
|
||||||
set youtubeUnblock.youtubeUnblock.faking_strategy='pastseq'
|
set youtubeUnblock.youtubeUnblock.faking_strategy='pastseq'
|
||||||
set youtubeUnblock.youtubeUnblock.fake_sni_seq_len='1'
|
set youtubeUnblock.youtubeUnblock.fake_sni_seq_len='1'
|
||||||
|
set youtubeUnblock.youtubeUnblock.fake_sni_type='default'
|
||||||
|
set youtubeUnblock.youtubeUnblock.fake_custom_payload=''
|
||||||
add_list youtubeUnblock.youtubeUnblock.sni_domains='googlevideo.com'
|
add_list youtubeUnblock.youtubeUnblock.sni_domains='googlevideo.com'
|
||||||
add_list youtubeUnblock.youtubeUnblock.sni_domains='ggpht.com'
|
add_list youtubeUnblock.youtubeUnblock.sni_domains='ggpht.com'
|
||||||
add_list youtubeUnblock.youtubeUnblock.sni_domains='ytimg.com'
|
add_list youtubeUnblock.youtubeUnblock.sni_domains='ytimg.com'
|
||||||
@@ -25,5 +29,3 @@ 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
|
uci commit
|
||||||
/etc/init.d/firewall restart &>/dev/null
|
|
||||||
exit 0
|
|
||||||
|
|||||||
Reference in New Issue
Block a user