OSDN Git Service

luci-app-unblockneteasemusic: rewrite func to add pub_access rule
[immortalwrt/luci.git] / applications / luci-app-unblockneteasemusic / root / usr / share / unblockneteasemusic / rules / chain.uc
index 8e513f7..79d0d64 100644 (file)
@@ -2,11 +2,18 @@
 
 let http_port = o_http_port;
 let https_port = o_https_port;
+let pub_access = o_pub_access;
 
 %}
 
+{% if (pub_access == 1): %}
+chain input_wan {
+       tcp dport {{ http_port }}-{{ https_port }} counter accept comment "!fw4: unblockneteasemusic-pub-access"
+}
+{% endif %}
+
 chain netease_cloud_music {
-       type nat hook prerouting priority -1;
+       type nat hook prerouting priority -1; policy accept;
        meta l4proto tcp ip daddr @neteasemusic_ipv4 jump netease_cloud_music_redir;
        meta l4proto tcp ip6 daddr @neteasemusic_ipv6 jump netease_cloud_music_redir;
 }
@@ -21,5 +28,3 @@ chain netease_cloud_music_redir {
        tcp dport 80 counter redirect to :{{ http_port }};
        tcp dport 443 counter redirect to :{{ https_port }};
 }
-
-