Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tbblgm119
lede
提交
ac6cb489
L
lede
项目概览
tbblgm119
/
lede
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
lede
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ac6cb489
编写于
10月 15, 2019
作者:
L
LEAN-ESX
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
luci-app-ssr-plus: add whitelist and blacklist domain support
上级
1aa668b3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
54 addition
and
3 deletion
+54
-3
package/lean/luci-app-ssr-plus/Makefile
package/lean/luci-app-ssr-plus/Makefile
+1
-1
package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua
...ci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua
+36
-0
package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po
package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po
+1
-1
package/lean/luci-app-ssr-plus/root/etc/config/black.list
package/lean/luci-app-ssr-plus/root/etc/config/black.list
+0
-0
package/lean/luci-app-ssr-plus/root/etc/config/white.list
package/lean/luci-app-ssr-plus/root/etc/config/white.list
+0
-0
package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr
package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr
+2
-0
package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules
package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules
+8
-1
package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/gfw2ipset.sh
...uci-app-ssr-plus/root/usr/share/shadowsocksr/gfw2ipset.sh
+6
-0
未找到文件。
package/lean/luci-app-ssr-plus/Makefile
浏览文件 @
ac6cb489
...
...
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME
:=
luci-app-ssr-plus
PKG_VERSION
:=
1
PKG_RELEASE
:=
11
0
PKG_RELEASE
:=
11
2
PKG_CONFIG_DEPENDS
:=
CONFIG_PACKAGE_
$(PKG_NAME)
_INCLUDE_Shadowsocks
\
CONFIG_PACKAGE_
$(PKG_NAME)
_INCLUDE_V2ray
\
...
...
package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/control.lua
浏览文件 @
ac6cb489
local
m
,
s
,
o
local
NXFS
=
require
"nixio.fs"
m
=
Map
(
"shadowsocksr"
,
translate
(
"IP black-and-white list"
))
...
...
@@ -49,4 +50,39 @@ end)
-- o:value("2", translatef("Forwarded Proxy"))
-- o.rmempty = false
s
:
tab
(
"esc"
,
translate
(
"Bypass Domain List"
))
local
escconf
=
"/etc/config/white.list"
o
=
s
:
taboption
(
"esc"
,
TextValue
,
"escconf"
)
o
.
rows
=
13
o
.
wrap
=
"off"
o
.
rmempty
=
true
o
.
cfgvalue
=
function
(
self
,
section
)
return
NXFS
.
readfile
(
escconf
)
or
""
end
o
.
write
=
function
(
self
,
section
,
value
)
NXFS
.
writefile
(
escconf
,
value
:
gsub
(
"
\r\n
"
,
"
\n
"
))
end
o
.
remove
=
function
(
self
,
section
,
value
)
NXFS
.
writefile
(
escconf
,
""
)
end
s
:
tab
(
"block"
,
translate
(
"Black Domain List"
))
local
blockconf
=
"/etc/config/black.list"
o
=
s
:
taboption
(
"block"
,
TextValue
,
"blockconf"
)
o
.
rows
=
13
o
.
wrap
=
"off"
o
.
rmempty
=
true
o
.
cfgvalue
=
function
(
self
,
section
)
return
NXFS
.
readfile
(
blockconf
)
or
" "
end
o
.
write
=
function
(
self
,
section
,
value
)
NXFS
.
writefile
(
blockconf
,
value
:
gsub
(
"
\r\n
"
,
"
\n
"
))
end
o
.
remove
=
function
(
self
,
section
,
value
)
NXFS
.
writefile
(
blockconf
,
""
)
end
return
m
\ No newline at end of file
package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po
浏览文件 @
ac6cb489
...
...
@@ -408,7 +408,7 @@ msgid "Server Count"
msgstr "服务器节点数量"
msgid "IP black-and-white list"
msgstr "
IP
黑白名单"
msgstr "黑白名单"
msgid "WAN IP AC"
msgstr "WAN IP访问控制"
...
...
package/lean/luci-app-ssr-plus/root/etc/config/black.list
0 → 100644
浏览文件 @
ac6cb489
package/lean/luci-app-ssr-plus/root/etc/config/white.list
0 → 100644
浏览文件 @
ac6cb489
package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr
浏览文件 @
ac6cb489
...
...
@@ -484,6 +484,8 @@ start() {
if
rules
;
then
start_redir
/usr/share/shadowsocksr/gfw2ipset.sh
mkdir
-p
/tmp/dnsmasq.d
if
!
[
"
$run_mode
"
=
"oversea"
]
;
then
...
...
package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules
浏览文件 @
ac6cb489
...
...
@@ -67,6 +67,8 @@ flush_r() {
ipset
-X
fplan 2>/dev/null
ipset
-X
gmlan 2>/dev/null
ipset
-X
oversea 2>/dev/null
ipset
-X
whitelist 2>/dev/null
ipset
-X
blacklist 2>/dev/null
[
-n
"
$FWI
"
]
&&
echo
'#!/bin/sh'
>
$FWI
return
0
}
...
...
@@ -74,7 +76,7 @@ flush_r() {
ipset_r
()
{
ipset
-N
gmlan
hash
:net 2>/dev/null
for
ip
in
$LAN_GM_IP
;
do
ipset -! add gmlan
$ip
;
done
if
[
"
$RUNMODE
"
=
"router"
]
;
then
ipset -!
-R
<<-
EOF
|| return 1
create ss_spec_wan_ac hash:net
...
...
@@ -114,6 +116,11 @@ EOF
ipset
-N
fplan
hash
:net 2>/dev/null
for
ip
in
$LAN_FP_IP
;
do
ipset -! add fplan
$ip
;
done
$IPT
-I
SS_SPEC_WAN_AC
-m
set
--match-set
fplan src
-j
SS_SPEC_WAN_FW
ipset
-N
whitelist
hash
:net 2>/dev/null
ipset
-N
blacklist
hash
:net 2>/dev/null
$IPT
-I
SS_SPEC_WAN_AC
-m
set
--match-set
blacklist src
-j
SS_SPEC_WAN_FW
$IPT
-I
SS_SPEC_WAN_AC
-m
set
--match-set
whitelist src
-j
SS_SPEC_WAN_FW
return
$?
}
...
...
package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/gfw2ipset.sh
浏览文件 @
ac6cb489
...
...
@@ -3,3 +3,9 @@
awk
'!/^$/&&!/^#/{printf("ipset=/.%s/'
"gfwlist"
'\n",$0)}'
/etc/config/gfw.list
>
/etc/dnsmasq.ssr/custom_forward.conf
awk
'!/^$/&&!/^#/{printf("server=/.%s/'
"127.0.0.1#5335"
'\n",$0)}'
/etc/config/gfw.list
>>
/etc/dnsmasq.ssr/custom_forward.conf
awk
'!/^$/&&!/^#/{printf("ipset=/.%s/'
"blacklist"
'\n",$0)}'
/etc/config/black.list
>
/etc/dnsmasq.ssr/blacklist_forward.conf
awk
'!/^$/&&!/^#/{printf("server=/.%s/'
"127.0.0.1#5335"
'\n",$0)}'
/etc/config/black.list
>>
/etc/dnsmasq.ssr/blacklist_forward.conf
awk
'!/^$/&&!/^#/{printf("ipset=/.%s/'
"whitelist"
'\n",$0)}'
/etc/config/white.list
>
/etc/dnsmasq.ssr/whitelist_forward.conf
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录