Skip to content

Commit

Permalink
update passwall
Browse files Browse the repository at this point in the history
optimize subscription script and update new rules
  • Loading branch information
Lienol committed Oct 30, 2019
1 parent d69dba4 commit ff516df
Show file tree
Hide file tree
Showing 10 changed files with 334 additions and 591 deletions.
2 changes: 1 addition & 1 deletion lienol/luci-app-passwall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-passwall
PKG_VERSION:=2.0
PKG_RELEASE:=86-20191024
PKG_RELEASE:=88-20191031

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PO2LMO:=./po2lmo
Expand Down
17 changes: 5 additions & 12 deletions lienol/luci-app-passwall/luasrc/controller/passwall.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,16 @@ function hide_menu()
end

function link_add_server()
local type = luci.http.formvalue("type")
local link = luci.http.formvalue("link")
if type == "SSR" then
luci.sys.call('rm -f /tmp/ssr_links.conf && echo "' .. link ..
'" >> /tmp/ssr_links.conf')
luci.sys.call("/usr/share/passwall/subscription_ssr.sh add >/dev/null")
elseif type == "V2ray" then
luci.sys.call('rm -f /tmp/v2ray_links.conf && echo "' .. link ..
'" >> /tmp/v2ray_links.conf')
luci.sys
.call("/usr/share/passwall/subscription_v2ray.sh add >/dev/null")
end
luci.sys.call('rm -f /tmp/links.conf && echo "' .. link ..
'" >> /tmp/links.conf')
luci.sys.call("/usr/share/passwall/subscription.sh add >/dev/null")
end

function get_log()
-- luci.sys.exec("[ -f /var/log/passwall.log ] && sed '1!G;h;$!d' /var/log/passwall.log > /var/log/passwall_show.log")
luci.http.write(luci.sys.exec("[ -f '/var/log/passwall.log' ] && cat /var/log/passwall.log"))
luci.http.write(luci.sys.exec(
"[ -f '/var/log/passwall.log' ] && cat /var/log/passwall.log"))
end

function clear_log() luci.sys.call("echo '' > /var/log/passwall.log") end
Expand Down
5 changes: 1 addition & 4 deletions lienol/luci-app-passwall/luasrc/model/cbi/passwall/rule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ s = m:section(TypedSection, "global_subscribe", translate("Server Subscribe"))
s.anonymous = true

---- Subscribe URL
o = s:option(DynamicList, "baseurl_ssr", translate("SSR Subscribe URL"),
translate(
"Servers unsubscribed will be deleted in next update; Please summit the Subscribe URL first before manually update."))
o = s:option(DynamicList, "baseurl_v2ray", translate("V2ray Subscribe URL"),
o = s:option(DynamicList, "subscribe_url", translate("Subscribe URL"),
translate(
"Servers unsubscribed will be deleted in next update; Please summit the Subscribe URL first before manually update."))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@

<script type="text/javascript">
//<![CDATA[
function ajax_add_server(type,link) {
if(type && link) {
function ajax_add_server(link) {
if (link) {
XHR.get('<%=dsp.build_url("admin/vpn/passwall/link_add_server")%>', {
'type': type,
'link': link
},
function(x, data) {
Expand All @@ -50,13 +49,9 @@
}

function add_server() {
var servers_type_dom = document.getElementById("servers_type");
var servers_type_dom_index = servers_type_dom.selectedIndex;

var servers_type = servers_type_dom.options[servers_type_dom_index].value;
var servers_link = document.getElementById("servers_link").value;
if (servers_link.trim() != "") {
ajax_add_server(servers_type,servers_link);
ajax_add_server(servers_link);
}
else {
alert("<%:Please Enter The Link%>");
Expand All @@ -74,17 +69,8 @@
</div>

<div id="div1">
<div class="cbi-value" data-index="1" data-depends="[]">
<label class="cbi-value-title"><%:Server Type%></label>
<div class="cbi-value-field">
<select id="servers_type" class="cbi-input-select" size="1">
<option value="SSR" selected="selected">SSR</option>
<option value="V2ray">V2ray</option>
</select>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Please Enter The Link%></label>
<label class="cbi-value-title"><%:Please Enter The SS/SSR/V2ray Link%></label>
<div class="cbi-value-field">
<textarea id="servers_link" rows="5" cols="50"></textarea>
</div>
Expand Down
11 changes: 4 additions & 7 deletions lienol/luci-app-passwall/po/zh-cn/passwall.po
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ msgstr "本机"
msgid "Danger"
msgstr "危险"

msgid "Please Enter The Link"
msgstr "请输入链接"
msgid "Please Enter The SS/SSR/V2ray Link"
msgstr "请输入SS/SSR/V2ray链接"

msgid "Add Server"
msgstr "添加服务器"
Expand Down Expand Up @@ -505,11 +505,8 @@ msgstr "如果你希望从内存中运行,请更改路径,例如/tmp/brook
msgid "Server Subscribe"
msgstr "服务器订阅"

msgid "SSR Subscribe URL"
msgstr "SSR订阅网址"

msgid "V2ray Subscribe URL"
msgstr "V2ray订阅网址"
msgid "Subscribe URL"
msgstr "订阅网址"

msgid "Servers unsubscribed will be deleted in next update; Please summit the Subscribe URL first before manually update."
msgstr "取消订阅的服务器将在下次更新时删除,请先输入订阅网址保存提交之后再更新。"
Expand Down
2 changes: 1 addition & 1 deletion lienol/luci-app-passwall/root/etc/config/passwall
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ config global_rules
option Pcap_Routing_update '0'
option Pcap_WhiteList_update '0'
option auto_update '0'
option gfwlist_version '2019-10-18'
option chnroute_version '2019-10-18'
option gfwlist_version '2019-10-28'

config global_app
option v2ray_client_file '/usr/bin/v2ray/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ server=/.2017.hk/127.0.0.1#7913
ipset=/.2017.hk/gfwlist
server=/.21andy.com/127.0.0.1#7913
ipset=/.21andy.com/gfwlist
server=/.21join.com/127.0.0.1#7913
ipset=/.21join.com/gfwlist
server=/.21pron.com/127.0.0.1#7913
ipset=/.21pron.com/gfwlist
server=/.21sextury.com/127.0.0.1#7913
Expand Down Expand Up @@ -2336,6 +2338,8 @@ server=/.demo.opera-mini.net/127.0.0.1#7913
ipset=/.demo.opera-mini.net/gfwlist
server=/.democrats.org/127.0.0.1#7913
ipset=/.democrats.org/gfwlist
server=/.demosisto.hk/127.0.0.1#7913
ipset=/.demosisto.hk/gfwlist
server=/.depositphotos.com/127.0.0.1#7913
ipset=/.depositphotos.com/gfwlist
server=/.derekhsu.homeip.net/127.0.0.1#7913
Expand Down Expand Up @@ -3064,6 +3068,8 @@ server=/.fanhaodang.com/127.0.0.1#7913
ipset=/.fanhaodang.com/gfwlist
server=/.fanqiang.tk/127.0.0.1#7913
ipset=/.fanqiang.tk/gfwlist
server=/.fanqiangdang.com/127.0.0.1#7913
ipset=/.fanqiangdang.com/gfwlist
server=/.fanqianghou.com/127.0.0.1#7913
ipset=/.fanqianghou.com/gfwlist
server=/.fanqiangyakexi.net/127.0.0.1#7913
Expand Down Expand Up @@ -3372,6 +3378,8 @@ server=/.freefuckvids.com/127.0.0.1#7913
ipset=/.freefuckvids.com/gfwlist
server=/.freegao.com/127.0.0.1#7913
ipset=/.freegao.com/gfwlist
server=/.freehongkong.org/127.0.0.1#7913
ipset=/.freehongkong.org/gfwlist
server=/.freeilhamtohti.org/127.0.0.1#7913
ipset=/.freeilhamtohti.org/gfwlist
server=/.freekwonpyong.org/127.0.0.1#7913
Expand Down Expand Up @@ -6788,6 +6796,8 @@ server=/.ny.visiontimes.com/127.0.0.1#7913
ipset=/.ny.visiontimes.com/gfwlist
server=/.nyaa.eu/127.0.0.1#7913
ipset=/.nyaa.eu/gfwlist
server=/.nyaa.si/127.0.0.1#7913
ipset=/.nyaa.si/gfwlist
server=/.nydus.ca/127.0.0.1#7913
ipset=/.nydus.ca/gfwlist
server=/.nylon-angel.com/127.0.0.1#7913
Expand Down Expand Up @@ -7616,6 +7626,8 @@ server=/.rapidmoviez.com/127.0.0.1#7913
ipset=/.rapidmoviez.com/gfwlist
server=/.rapidvpn.com/127.0.0.1#7913
ipset=/.rapidvpn.com/gfwlist
server=/.rarbgprx.org/127.0.0.1#7913
ipset=/.rarbgprx.org/gfwlist
server=/.raremovie.cc/127.0.0.1#7913
ipset=/.raremovie.cc/gfwlist
server=/.raremovie.net/127.0.0.1#7913
Expand Down Expand Up @@ -9672,6 +9684,8 @@ server=/.tycool.com/127.0.0.1#7913
ipset=/.tycool.com/gfwlist
server=/.typepad.com/127.0.0.1#7913
ipset=/.typepad.com/gfwlist
server=/.u15.info/127.0.0.1#7913
ipset=/.u15.info/gfwlist
server=/.u9un.com/127.0.0.1#7913
ipset=/.u9un.com/gfwlist
server=/.ub0.cc/127.0.0.1#7913
Expand Down Expand Up @@ -10856,6 +10870,8 @@ server=/.yibaochina.com/127.0.0.1#7913
ipset=/.yibaochina.com/gfwlist
server=/.yidio.com/127.0.0.1#7913
ipset=/.yidio.com/gfwlist
server=/.yigeni.com/127.0.0.1#7913
ipset=/.yigeni.com/gfwlist
server=/.yilubbs.com/127.0.0.1#7913
ipset=/.yilubbs.com/gfwlist
server=/.yingsuoss.com/127.0.0.1#7913
Expand Down
Loading

0 comments on commit ff516df

Please sign in to comment.