mirror of
https://github.com/tsingui/softcenter-1.git
synced 2024-11-14 09:55:17 +00:00
add ss
This commit is contained in:
parent
ee40027c7d
commit
cfa527300e
@ -13,12 +13,12 @@ fi
|
||||
version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
|
||||
version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
|
||||
md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
|
||||
md5_new=` md5sum aliddns.tar.gz | awk '{print $1}'`
|
||||
md5_new=` md5sum cfddns.tar.gz | awk '{print $1}'`
|
||||
|
||||
if [ -f ./aliddns.tar.gz ];then
|
||||
if [ -f ./cfddns.tar.gz ];then
|
||||
if [ "$version_old" != "$version_new" ];then
|
||||
mkdir ./history/$version_new/
|
||||
cp ./aliddns.tar.gz ./history/$version_new/
|
||||
cp ./cfddns.tar.gz ./history/$version_new/
|
||||
echo $version_new $md5_new >> ./history/version
|
||||
fi
|
||||
fi
|
||||
|
99
shadowsocks/Changelog.txt
Normal file
99
shadowsocks/Changelog.txt
Normal file
@ -0,0 +1,99 @@
|
||||
Koolshare Asuswrt-Merlin shadowsocks_mips Changelog
|
||||
===========================================
|
||||
|
||||
shadowsocks merlin 插件于2017年07月17日下架软件中心,就此封版,以后不再更新。
|
||||
|
||||
===========================================
|
||||
3.0.4
|
||||
- fix fix layout of load Main_Ss_LoadBlance.asp and Main_SsLocal_Content.asp
|
||||
|
||||
3.0.3
|
||||
- fix 修复SS访问控制,默认模式有几率变为空值,导致显示双working但是不能翻墙的问题。
|
||||
- fix 修复可能的浏览器兼容问题,导致不显示节点列表的问题。
|
||||
|
||||
3.0.2
|
||||
- fix 修复在X7.5固件下自定义dnsmasq,IP/CIDR白名单,域名白名单,IP/CIDR黑名单,域名黑名单内容在IE浏览器下显示乱码的问题;
|
||||
该问题是由X7.5固件浏览器兼容性的更改造成的,导致用IE浏览器提交后,ss不正常工作。
|
||||
|
||||
3.0.1
|
||||
- update 更新ssr-libev到最新,修复udp问题。
|
||||
3.0.0
|
||||
- update 大版本更新已经推送,更新后除了游戏模式/V2、Pcap_DNSproxy、KCPTUN功能外,其余和arm机型一致。
|
||||
支持最新ss,各种新加密方式,混淆等;支持最新ssr各种协议、加密方式、混淆等;支持负载均衡;....
|
||||
此处不再做过多说明,如果需要查看一些具体更新变化,可以参考arm机型的更新日志:(从2.8.9开始到3.4.9)
|
||||
https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/shadowsocks/Changelog.txt
|
||||
|
||||
2.8.8
|
||||
- fix fix redchn mode:
|
||||
|
||||
2.8.8
|
||||
- fix sync with arm and fix minor issue
|
||||
|
||||
2.8.3
|
||||
- fix fix overall mode
|
||||
- fix fix wrong address of changelog
|
||||
|
||||
|
||||
2.8.2
|
||||
- update sync with arm shadowsocks 2.8.2
|
||||
1.4.6
|
||||
- fix 修复节点ping测试和web连通性测试不能保存的bug
|
||||
- add 节点恢复增加对json格式导入的支持
|
||||
现在用json文件导入,会在已有节点基础上增加,不会覆盖
|
||||
而用备份文件导入,会和以前一样进行覆盖写入
|
||||
支持的json必须包含"password", "method", "server_port", "server", "remarks"字段
|
||||
实际测试用了枫叶主机的json原文件,windows纸飞机客户端的json文件通过,
|
||||
其它运营商的json文件如果包括以上字段应该也不会有问题
|
||||
shadowsocks-R的json文件,仅支持导入节点信息,不支持导入混淆信息等
|
||||
基本格式如下:
|
||||
{
|
||||
"password": "xxxxx",
|
||||
"method": "rc4-md5",
|
||||
"server_port": "65533",
|
||||
"remarks": "日本节点",
|
||||
"server": "aaa.bbb.com"
|
||||
},
|
||||
{
|
||||
"password": "xxxxx",
|
||||
"method": "rc4-md5",
|
||||
"server_port": "65533",
|
||||
"remarks": "美国节点",
|
||||
"server": "aaa.bbb.com"
|
||||
},
|
||||
|
||||
1.4.5
|
||||
- change 更新shadowsocks-libev客户端到2.4.6
|
||||
- change 更新shadowsocks-libev-ssr客户端为最新,支持tls1.2_ticket_auth自定义参数(不支持多个域名)
|
||||
- fix 增加ssr中http_simple的自定义参数
|
||||
- fix 增加socks5页面的chacha20-ietf加密方式
|
||||
|
||||
1.4.4
|
||||
- fix 更新ssr客户端为最新,支持tls1.2_ticket_auth
|
||||
- fix 修复pdnsd运行权限问题
|
||||
- add 增加未开启Enable JFFS custom scripts and configs选项提醒
|
||||
- add 增加节点google、youtube连通性测试
|
||||
- add 增加节点ping测试和丢包测试
|
||||
- add 增加大陆白名单模式pdnsd解析软件选项
|
||||
- add 增加gfwlist模式pdnsd解析软件选项
|
||||
|
||||
1.4.3
|
||||
- fix 修改版本号显示前缀,以区分ARM机型和mipsel机型
|
||||
|
||||
1.4.2
|
||||
- fix 更新dnscrypt-proxy解析列表,和arm机型保持一致
|
||||
- fix 因为mipsel机型性能原因,增大大陆白名单提交时间到45秒
|
||||
|
||||
1.4.1
|
||||
- fix fix dns2socks won't work
|
||||
|
||||
1.4.0
|
||||
- fix fix install.sh
|
||||
|
||||
1.3.9
|
||||
- fix fix tab older
|
||||
|
||||
1.3.8
|
||||
- add add 'raw.githubusercontent.com' to router ipset for better online version check
|
||||
|
||||
1.3.7
|
||||
- add add koolshare shadowsocks mipsel support
|
48
shadowsocks/README.md
Normal file
48
shadowsocks/README.md
Normal file
@ -0,0 +1,48 @@
|
||||
# koolshare.github.io
|
||||
####For koolshare.cn 小宝merlin改版固件 软件中心
|
||||
|
||||
<b>shadowsocks文件夹下的内容,用于向路由器内shadowsocks功能推送更新</b><br/>
|
||||
<b>此项目仅用于merlin koolshare mipsel架构改版固件</b><br/>
|
||||
* <b>shadowsocks/ss 文件夹 </b><br/>
|
||||
该文件夹用于存放shadowsocks相关脚本和规则文件:
|
||||
|
||||
* <b>shadowsocks/webs</b><br/>
|
||||
该文件夹用于存放shadowsocks的网页。
|
||||
|
||||
* <b>shadowsocks/res</b><br/>
|
||||
该文件夹用于存放shadowsocks网页元素。
|
||||
|
||||
* <b>shadowsocks/bin</b><br/>
|
||||
该文件夹用于存放shadowsocks的二进制文件。
|
||||
|
||||
* <b>shadowsocks/init.d</b><br/>
|
||||
该文件夹用于存放shadowsocks的开机启动文件,目前因为shadowsocks的启动依赖wan-start和nat-start两个启动文件,所以并没有用init.d的启动方式,而socks5使用了该方式
|
||||
|
||||
|
||||
|
||||
* <b>shadowsocks.tar.gz</b><br/>
|
||||
此文件为shadowsocks文件夹的打包,通过路由器访问 [https://raw.githubusercontent.com/koolshare/koolshare.github.io/master/shadowsocks_mips/shadowsocks.tar.gz](https://raw.githubusercontent.com/koolshare/koolshare.github.io/master/shadowsocks_mips/shadowsocks.tar.gz) 获取安装包更新。
|
||||
如果你更新出现问题,请按照以下方式手动更新:
|
||||
<pre>
|
||||
wget --no-check-certificate --timeout=15 -P /tmp https://raw.githubusercontent.com/koolshare/koolshare.github.io/master/shadowsocks/shadowsocks.tar.gz
|
||||
tar -zxvf /tmp/shadowsocks.tar.gz
|
||||
chmod +x /tmp/shadowsocks/install.sh
|
||||
sh /tmp/shadowsocks/install.sh
|
||||
</pre>
|
||||
|
||||
* <b>history文件夹</b><br/>
|
||||
该文件夹用于存放shadowsocks历史安装包,需要回滚历史版本的,可以下载对应版本,然后手动安装。
|
||||
|
||||
* <b>version</b><br/>
|
||||
在线版本号和shadowsocks.tar.gz的md5校验值,用于判断更新。
|
||||
|
||||
<b>怎样提交修改</b>
|
||||
需要再次说明的是,ss的在线更新是通过请求shadowsocks.tar.gz文件进行的,如果你有发现bug,并希望提交你的更改,需要做以下几点:<br/>
|
||||
1. 发现bug,修改需要修改的文件;<br/>
|
||||
2. 更新shadowsocks/ss_mips/version,更新版本号;<br/>
|
||||
3. 修改Changelog.txt文件,添加更新日志;<br/>
|
||||
4. 运行build.sh文件,这样会自动打包shadowsocks文件夹,并且更新versionn内的版本号和md5值,同时会把就版本丢进history中;<br/>
|
||||
5. 运行git status,查看被修改的文件,然后添加,评论,提交;<br/>
|
||||
|
||||
|
||||
|
25
shadowsocks/backup.sh
Executable file
25
shadowsocks/backup.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#! /bin/sh
|
||||
|
||||
# you can do something here
|
||||
# this shell scripts will run at the end of build.py scripts
|
||||
|
||||
|
||||
|
||||
mkdir -p history
|
||||
if [ ! -f ./history/version ];then
|
||||
touch ./history/version
|
||||
fi
|
||||
|
||||
version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
|
||||
version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
|
||||
md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
|
||||
md5_new=` md5sum shadowsocks.tar.gz | awk '{print $1}'`
|
||||
|
||||
if [ -f ./shadowsocks.tar.gz ];then
|
||||
if [ "$version_old" != "$version_new" ];then
|
||||
mkdir ./history/$version_new/
|
||||
cp ./shadowsocks.tar.gz ./history/$version_new/
|
||||
echo $version_new $md5_new >> ./history/version
|
||||
fi
|
||||
fi
|
||||
|
32
shadowsocks/build.sh
Executable file
32
shadowsocks/build.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
MODULE=shadowsocks
|
||||
VERSION=3.0.5
|
||||
TITLE=shadowsocks
|
||||
DESCRIPTION=shadowsocks
|
||||
HOME_URL=Main_Ss_Content.asp
|
||||
|
||||
# Check and include base
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ "$MODULE" == "" ]; then
|
||||
echo "module not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "$DIR/$MODULE/$MODULE/install.sh" ]; then
|
||||
echo "install script not found"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# now include build_base.sh
|
||||
. $DIR/../softcenter/build_base.sh
|
||||
|
||||
# change to module directory
|
||||
cd $DIR
|
||||
|
||||
# do something here
|
||||
|
||||
do_build_result
|
||||
|
||||
sh backup.sh $MODULE
|
8
shadowsocks/config.json.js
Normal file
8
shadowsocks/config.json.js
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":"3.0.5",
|
||||
"md5":"85056d753a7babd8b494a9b3a4b04266",
|
||||
"home_url":"Main_Ss_Content.asp",
|
||||
"title":"shadowsocks",
|
||||
"description":"shadowsocks",
|
||||
"build_date":"2019-01-15_12:45:31"
|
||||
}
|
8
shadowsocks/config.json.js.bak
Normal file
8
shadowsocks/config.json.js.bak
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":"3.0.4",
|
||||
"md5":"12530989ad53ce99084ecd4fc88c4c47",
|
||||
"home_url":"Main_Ss_Content.asp",
|
||||
"title":"shadowsocks",
|
||||
"description":"shadowsocks",
|
||||
"build_date":"2017-06-12_01:12:52"
|
||||
}
|
BIN
shadowsocks/history/shadowsocks_1.3.7.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.3.7.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.3.8.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.3.8.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.3.9.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.3.9.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.4.0.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.4.0.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.4.1.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.4.1.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.4.2.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.4.2.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.4.3.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.4.3.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.4.4.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.4.4.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.4.5.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.4.5.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_1.4.6.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_1.4.6.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_2.8.2.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_2.8.2.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_2.8.3.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_2.8.3.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_2.8.7.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_2.8.7.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_2.8.8.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_2.8.8.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/history/shadowsocks_2.8.9.tar.gz
Normal file
BIN
shadowsocks/history/shadowsocks_2.8.9.tar.gz
Normal file
Binary file not shown.
15
shadowsocks/history/version
Normal file
15
shadowsocks/history/version
Normal file
@ -0,0 +1,15 @@
|
||||
1.3.7 f55e8aa38c977d20676137367490db31
|
||||
1.3.8 d837d2ba03c1930393de6acadc9c59ec
|
||||
1.3.9 7579a7225f84945f22ffb8b00d340766
|
||||
1.4.0 d62532923e9ee7efa0ffdeac3392a347
|
||||
1.4.1 94b278c5c3f49c8d4ae5e085dd264b28
|
||||
1.4.2 b3a452d01f318120b56375548dfc5a3d
|
||||
1.4.3 6775c6db224a7538d02c2ede2beeaa1a
|
||||
1.4.4 3804d4317234757559d97aa46473f00b
|
||||
1.4.5 12b2b16c25c57716d120f20ff08fb644
|
||||
1.4.6 7431c97924c3ef2f4523fea94799d0a3
|
||||
2.8.2 9af0d937f5150c4f0287799281bd8f8f
|
||||
2.8.3 f75551d771a77e7f82640bbc5cfc3d5f
|
||||
2.8.7 72fc65ae418080a64189a64e76e26756
|
||||
2.8.8 4e3a0560e3ae648d5d23f51542d29360
|
||||
2.8.9 47346b43aedc7c91f73bd0d5c51f2df9
|
BIN
shadowsocks/shadowsocks.tar.gz
Normal file
BIN
shadowsocks/shadowsocks.tar.gz
Normal file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/chinadns
Executable file
BIN
shadowsocks/shadowsocks/bin/chinadns
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/client_linux_mips
Executable file
BIN
shadowsocks/shadowsocks/bin/client_linux_mips
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/dns2socks
Executable file
BIN
shadowsocks/shadowsocks/bin/dns2socks
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/dnscrypt-proxy
Executable file
BIN
shadowsocks/shadowsocks/bin/dnscrypt-proxy
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/haproxy
Executable file
BIN
shadowsocks/shadowsocks/bin/haproxy
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/obfs-local
Executable file
BIN
shadowsocks/shadowsocks/bin/obfs-local
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/pdnsd
Executable file
BIN
shadowsocks/shadowsocks/bin/pdnsd
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/resolveip
Executable file
BIN
shadowsocks/shadowsocks/bin/resolveip
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/rss-local
Executable file
BIN
shadowsocks/shadowsocks/bin/rss-local
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/rss-redir
Executable file
BIN
shadowsocks/shadowsocks/bin/rss-redir
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/ss-local
Executable file
BIN
shadowsocks/shadowsocks/bin/ss-local
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/ss-redir
Executable file
BIN
shadowsocks/shadowsocks/bin/ss-redir
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/ss-tunnel
Executable file
BIN
shadowsocks/shadowsocks/bin/ss-tunnel
Executable file
Binary file not shown.
BIN
shadowsocks/shadowsocks/bin/ssr-redir
Executable file
BIN
shadowsocks/shadowsocks/bin/ssr-redir
Executable file
Binary file not shown.
41
shadowsocks/shadowsocks/init.d/S89Socks5.sh
Executable file
41
shadowsocks/shadowsocks/init.d/S89Socks5.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
eval `dbus export shadowsocks`
|
||||
eval `dbus export ss`
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
|
||||
|
||||
kill_socks5(){
|
||||
kill `ps | grep ss-local | grep -v "grep" | grep -v "23456"|awk '{print $1}'` >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Start ss-local
|
||||
start_socks5(){
|
||||
|
||||
if [ "$ss_local_enable" == "1" ]; then
|
||||
echo $(date): enable ss_local...
|
||||
ss-local -b 0.0.0.0 -s "$ss_local_server" -p "$ss_local_port" -l "$ss_local_proxyport" -k "$ss_local_password" -m "$ss_local_method" -u -f /var/run/ss_local.pid
|
||||
echo $(date): done
|
||||
echo $(date):
|
||||
fi
|
||||
}
|
||||
|
||||
case $ACTION in
|
||||
start)
|
||||
if [ "$ss_local_enable" == "1" ];then
|
||||
start_socks5
|
||||
fi
|
||||
;;
|
||||
stop | kill )
|
||||
kill_socks5
|
||||
;;
|
||||
restart)
|
||||
kill_socks5
|
||||
start_socks5
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 (start|stop|restart)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
154
shadowsocks/shadowsocks/install.sh
Executable file
154
shadowsocks/shadowsocks/install.sh
Executable file
@ -0,0 +1,154 @@
|
||||
#! /bin/sh
|
||||
|
||||
eval `dbus export ss`
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
remove_conf(){
|
||||
ipset_value=`dbus list ss_ipset | cut -d "=" -f 1`
|
||||
redchn_value=`dbus list ss_redchn | cut -d "=" -f 1`
|
||||
overall_value=`dbus list ss_overall_ | cut -d "=" -f 1`
|
||||
for conf in $ipset_value $redchn_value $overall_value
|
||||
do
|
||||
echo 移除$conf
|
||||
dbus remove $conf
|
||||
done
|
||||
}
|
||||
|
||||
remove_conf
|
||||
# 判断路由架构和平台
|
||||
case $(uname -m) in
|
||||
mips)
|
||||
echo_date 固件平台【 merlin mips 】符合安装要求,开始安装插件!
|
||||
;;
|
||||
*)
|
||||
echo_date 本插件适用于 merlin mips固件平台,你的平台"$(uname -m)"不能安装!!!
|
||||
echo_date 退出安装!
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# 关闭ss
|
||||
mkdir -p /jffs/softcenter/ss
|
||||
if [ "$ss_basic_enable" == "1" ];then
|
||||
echo_date 先关闭ss,保证文件更新成功!
|
||||
sh /jffs/softcenter/ss/stop.sh stop_all
|
||||
fi
|
||||
|
||||
#升级前先删除无关文件
|
||||
echo_date 清理旧文件
|
||||
rm -rf /jffs/softcenter/ss/*
|
||||
rm -rf /jffs/softcenter/scripts/ss_*
|
||||
rm -rf /jffs/softcenter/webs/Main_Ss*
|
||||
rm -rf /jffs/softcenter/bin/ss-*
|
||||
rm -rf /jffs/softcenter/bin/rss-*
|
||||
rm -rf /jffs/softcenter/bin/obfs*
|
||||
rm -rf /jffs/softcenter/bin/haproxy
|
||||
rm -rf /jffs/softcenter/bin/redsocks2
|
||||
rm -rf /jffs/softcenter/bin/pdnsd
|
||||
rm -rf /jffs/softcenter/bin/dnscrypt-proxy
|
||||
rm -rf /jffs/softcenter/bin/dns2socks
|
||||
rm -rf /jffs/softcenter/bin/chinadns
|
||||
rm -rf /jffs/softcenter/bin/resolveip
|
||||
|
||||
|
||||
echo_date 复制新文件!
|
||||
cd /tmp
|
||||
|
||||
echo_date 复制相关二进制文件!
|
||||
cp -rf /tmp/shadowsocks/bin/* /jffs/softcenter/bin/
|
||||
chmod 755 /jffs/softcenter/bin/*
|
||||
[ ! -L "/jffs/softcenter/bin/rss-tunnel" ] && cp -rf /jffs/softcenter/bin/rss-local /jffs/softcenter/bin/rss-tunnel
|
||||
|
||||
echo_date 复制ss的脚本文件!
|
||||
cp -rf /tmp/shadowsocks/ss/* /jffs/softcenter/ss/
|
||||
cp -rf /tmp/shadowsocks/scripts/* /jffs/softcenter/scripts/
|
||||
cp -rf /tmp/shadowsocks/init.d/* /jffs/softcenter/init.d/
|
||||
|
||||
echo_date 复制网页文件!
|
||||
cp -rf /tmp/shadowsocks/webs/* /jffs/softcenter/webs/
|
||||
cp -rf /tmp/shadowsocks/res/* /jffs/softcenter/res/
|
||||
|
||||
echo_date 移除安装包!
|
||||
rm -rf /tmp/shadowsocks* >/dev/null 2>&1
|
||||
|
||||
|
||||
# transform data in skipd when ss version below 3.0.0
|
||||
curr_version=`dbus get ss_basic_version_local`
|
||||
comp=`/usr/bin/versioncmp $curr_version 3.0.0`
|
||||
if [ -n "$curr_version" ] && [ "$comp" == "1" ];then
|
||||
echo_date 从ss3.0.0版本开始,将对界面内textarea内的值和ss的密码进行base64加密,方便储存!
|
||||
echo_date 生成当前SS版本:$curr_version的配置文件到/jffs根目录!
|
||||
dbus list ss > /jffs/ss_conf_backup_$curr_version.txt
|
||||
echo_date 对部分ss数据进行base64加密数据!
|
||||
node_pass=`dbus list ssconf_basic_password |cut -d "=" -f 1|cut -d "_" -f4|sort -n`
|
||||
for node in $node_pass
|
||||
do
|
||||
dbus set ssconf_basic_password_$node=`dbus get ssconf_basic_password_$node|base64`
|
||||
done
|
||||
dbus set ss_basic_password=`dbus get ss_basic_password|base64`
|
||||
dbus set ss_basic_black_lan=`dbus get ss_basic_black_lan | base64`
|
||||
dbus set ss_basic_white_lan=`dbus get ss_basic_white_lan | base64`
|
||||
dbus set ss_ipset_black_domain_web=`dbus get ss_ipset_black_domain_web | base64`
|
||||
dbus set ss_ipset_white_domain_web=`dbus get ss_ipset_white_domain_web | base64`
|
||||
dbus set ss_ipset_dnsmasq=`dbus get ss_ipset_dnsmasq | base64`
|
||||
dbus set ss_ipset_black_ip=`dbus get ss_ipset_black_ip | base64`
|
||||
dbus set ss_redchn_isp_website_web=`dbus get ss_redchn_isp_website_web | base64`
|
||||
dbus set ss_redchn_dnsmasq=`dbus get ss_redchn_dnsmasq | base64`
|
||||
dbus set ss_redchn_wan_white_ip=`dbus get ss_redchn_wan_white_ip | base64`
|
||||
dbus set ss_redchn_wan_white_domain=`dbus get ss_redchn_wan_white_domain | base64`
|
||||
dbus set ss_redchn_wan_black_ip=`dbus get ss_redchn_wan_black_ip | base64`
|
||||
dbus set ss_redchn_wan_black_domain=`dbus get ss_redchn_wan_black_domain | base64`
|
||||
fi
|
||||
|
||||
# 设置一些默认值
|
||||
echo_date 设置一些默认值
|
||||
[ -z "$ss_dns_china" ] && dbus set ss_dns_china=11
|
||||
[ -z "$ss_dns_foreign" ] && dbus set ss_dns_foreign=1
|
||||
[ -z "$ss_basic_ss_obfs" ] && dbus set ss_basic_ss_obfs=0
|
||||
[ -z "$ss_acl_default_mode" ] && dbus set ss_acl_default_mode="$ss_basic_mode"
|
||||
[ -z "$ss_acl_default_port" ] && dbus set ss_acl_default_port=all
|
||||
[ -z "$ss_dns_plan" ] && dbus set ss_dns_china=1
|
||||
[ -z "$ss_dns_plan_chn" ] && dbus set ss_dns_china=2
|
||||
[ -z "$ss_dns_plan_gfw" ] && dbus set ss_dns_china=1
|
||||
|
||||
echo_date 为新安装文件赋予执行权限...
|
||||
chmod 755 /jffs/softcenter/ss/cru/*
|
||||
chmod 755 /jffs/softcenter/ss/rules/*
|
||||
chmod 755 /jffs/softcenter/ss/socks5/*
|
||||
chmod 755 /jffs/softcenter/ss/*
|
||||
chmod 755 /jffs/softcenter/scripts/ss*
|
||||
chmod 755 /jffs/softcenter/bin/*
|
||||
|
||||
# add icon into softerware center
|
||||
dbus set softcenter_module_shadowsocks_install=1
|
||||
dbus set softcenter_module_shadowsocks_version=3.1.6
|
||||
dbus set softcenter_module_shadowsocks_home_url=Main_Ss_Content.asp
|
||||
|
||||
new_version=`cat /jffs/softcenter/ss/version`
|
||||
dbus set ss_basic_version_local=$new_version
|
||||
|
||||
sleep 2
|
||||
echo_date 一点点清理工作...
|
||||
rm -rf /tmp/shadowsocks* >/dev/null 2>&1
|
||||
dbus set ss_basic_install_status="0"
|
||||
echo_date 安装更新成功,你为什么这么屌?!
|
||||
|
||||
if [ "$ss_basic_enable" == "1" ];then
|
||||
echo_date 重启ss!
|
||||
dbus set ss_basic_action=1
|
||||
. /jffs/softcenter/ss/ssconfig.sh restart
|
||||
fi
|
||||
echo_date 更新完毕,请等待网页自动刷新!
|
||||
echo XU6J03M6
|
||||
sleep 1
|
||||
killall ssconfig.sh >/dev/null 2>&1
|
||||
killall sh >/dev/null 2>&1
|
||||
kill `pidof ssconfig.sh` >/dev/null 2>&1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
BIN
shadowsocks/shadowsocks/res/all.png
Executable file
BIN
shadowsocks/shadowsocks/res/all.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
shadowsocks/shadowsocks/res/chn.png
Executable file
BIN
shadowsocks/shadowsocks/res/chn.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
BIN
shadowsocks/shadowsocks/res/gfw.png
Executable file
BIN
shadowsocks/shadowsocks/res/gfw.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
BIN
shadowsocks/shadowsocks/res/icon-shadowsocks.png
Executable file
BIN
shadowsocks/shadowsocks/res/icon-shadowsocks.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
349
shadowsocks/shadowsocks/res/shadowsocks.css
Executable file
349
shadowsocks/shadowsocks/res/shadowsocks.css
Executable file
@ -0,0 +1,349 @@
|
||||
.Bar_container {
|
||||
width:85%;
|
||||
height:20px;
|
||||
border:1px inset #999;
|
||||
margin:0 auto;
|
||||
margin-top:20px \9;
|
||||
background-color:#FFFFFF;
|
||||
z-index:100;
|
||||
}
|
||||
#proceeding_img_text {
|
||||
position:absolute;
|
||||
z-index:101;
|
||||
font-size:11px;
|
||||
color:#000000;
|
||||
line-height:21px;
|
||||
width: 83%;
|
||||
}
|
||||
#proceeding_img {
|
||||
height:21px;
|
||||
background:#C0D1D3 url(/images/ss_proceding.gif);
|
||||
}
|
||||
#ss_node_edit {
|
||||
background: url(/images/New_ui/ss_list.png);
|
||||
background-position: 0px 0px;
|
||||
width: 30px;
|
||||
height: 35px;
|
||||
}
|
||||
#update_logo, #update_now{
|
||||
border: 1px solid #222;
|
||||
background: linear-gradient(to bottom, #76a0ba 0%, #688292 100%); /* W3C */
|
||||
font-size:10pt;
|
||||
color: #fff;
|
||||
padding: 5px 5px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
width:20%;
|
||||
}
|
||||
|
||||
#update_logo:hover, #update_now:hover {
|
||||
border: 1px solid #222;
|
||||
background: linear-gradient(to bottom, #27c9c9 0%, #279fd9 100%); /* W3C */
|
||||
font-size:10pt;
|
||||
color: #fff;
|
||||
padding: 5px 5px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
width:20%;
|
||||
}
|
||||
.show-btn1, .show-btn1_1, .show-btn2, .show-btn3, .show-btn4, .show-btn5, .show-btn6, .show-btn7 {
|
||||
border: 1px solid #222;
|
||||
background: linear-gradient(to bottom, #76a0ba 0%, #688292 100%); /* W3C */
|
||||
background: linear-gradient(to bottom, #919fa4 0%, #67767d 100%); /* W3C */
|
||||
font-size:10pt;
|
||||
color: #fff;
|
||||
padding: 10px 3.75px;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
width:8.45601%;
|
||||
}
|
||||
.active {
|
||||
background: #2f3a3e;
|
||||
background: linear-gradient(to bottom, #a5b56f 0%, #677835 100%); /* W3C */
|
||||
background: linear-gradient(to bottom, #61b5de 0%, #279fd9 100%); /* W3C */
|
||||
}
|
||||
input[type=button]:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.contentM_qis {
|
||||
position: absolute;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
z-index: 200;
|
||||
background-color:#2B373B;
|
||||
margin-left: 50px;
|
||||
top: 240px;
|
||||
width:650px;
|
||||
return height:auto;
|
||||
box-shadow: 3px 3px 10px #000;
|
||||
display:none;
|
||||
}
|
||||
|
||||
.content_status {
|
||||
position: absolute;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius:10px;
|
||||
z-index: 10;
|
||||
background-color:#2B373B;
|
||||
margin-left: -215px;
|
||||
top: 240px;
|
||||
width:980px;
|
||||
return height:auto;
|
||||
box-shadow: 3px 3px 10px #000;
|
||||
background: rgba(0,0,0,0.85);
|
||||
display:none;
|
||||
}
|
||||
.user_title{
|
||||
text-align:center;
|
||||
font-size:18px;
|
||||
color:#99FF00;
|
||||
padding:10px;
|
||||
font-weight:bold;
|
||||
}
|
||||
.QISform_wireless {
|
||||
width:600px;
|
||||
font-size:12px;
|
||||
color:#FFFFFF;
|
||||
margin-top:10px;
|
||||
*margin-left:10px;
|
||||
}
|
||||
.QISform_wireless thead {
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
color:#FFFFFF;
|
||||
}
|
||||
.QISform_wireless th {
|
||||
padding-left:10px;
|
||||
*padding-left:30px;
|
||||
font-size:12px;
|
||||
font-weight:bolder;
|
||||
color: #FFFFFF;
|
||||
text-align:left;
|
||||
}
|
||||
.vpnClientTitle_td_unclick {
|
||||
background-color: #000;
|
||||
height: 30px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #222;
|
||||
}
|
||||
.vpnClientTitle_td_click {
|
||||
background-color: #4D595D;
|
||||
height: 30px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #222;
|
||||
}
|
||||
|
||||
#ss_node_list_table_td { -ms-overflow-style: none; overflow: auto; } /* for IE hide scrollbar on ss node ta */
|
||||
#ss_node_list_table_td::-webkit-scrollbar {
|
||||
width: 0px; /* remove scrollbar space */
|
||||
background: transparent; /* optional: just make scrollbar invisible */
|
||||
}
|
||||
|
||||
#log_content3, #log_content1, #proc_status { -ms-overflow-style: none; overflow: auto; } /* for IE hide scrollbar on ss node ta */
|
||||
#log_content3::-webkit-scrollbar, #log_content1::-webkit-scrollbar, #proc_status::-webkit-scrollbar {
|
||||
width: 0px; /* remove scrollbar space */
|
||||
background: transparent; /* optional: just make scrollbar invisible */
|
||||
}
|
||||
#log_content3:focus, #log_content1:focus, #proc_status:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#log_content3, #log_content1, #proc_status {overflow: -moz-scrollbars-none;}
|
||||
|
||||
|
||||
.FormTable1{
|
||||
table-layout:fixed;
|
||||
width:748px;
|
||||
font-size:12px;
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
border: 1px solid #000000;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.FormTable1 th{
|
||||
table-layout:fixed;
|
||||
overflow:hidden;
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
background-color:#1F2D35;
|
||||
color:#FFFFFF ; /*Viz add*/
|
||||
font-weight:normal;
|
||||
text-align: center;
|
||||
height: 30px;
|
||||
font-size:12px;
|
||||
padding-left: 5px;
|
||||
border: 1px solid #222;
|
||||
border-collapse: collapse;
|
||||
background:#2F3A3E;
|
||||
}
|
||||
|
||||
.FormTable1 td{
|
||||
table-layout:fixed;
|
||||
overflow:hidden;
|
||||
height: 30px;
|
||||
padding-left: 5px;
|
||||
background-color:#475A5F;
|
||||
text-align: center;
|
||||
border: 1px solid #222;
|
||||
border-collapse: collapse;
|
||||
white-space:nowrap;
|
||||
text-overflow:ellipsis;
|
||||
/*
|
||||
word-wrap:break-word;
|
||||
*/
|
||||
}
|
||||
|
||||
.SimpleNote { padding:5px 10px;}
|
||||
|
||||
#iframe1{
|
||||
font-family: sans-serif;
|
||||
color: red;
|
||||
}
|
||||
|
||||
#log_content3, #loading_block2, #log_content1 {line-height:1.5}
|
||||
.input_option{
|
||||
height:25px;
|
||||
background-color:#576D73;
|
||||
border-top-width:1px;
|
||||
border-bottom-width:1px;
|
||||
border-color:#888;
|
||||
color:#FFFFFF;
|
||||
font-family:'Courier New', Courier, mono;
|
||||
font-size:13px;
|
||||
}
|
||||
.input_option_2{
|
||||
height:25px;
|
||||
background-color:#475a5f;
|
||||
border: 0px solid #222;
|
||||
color:#FFFFFF;
|
||||
font-family:'Courier New', Courier, mono;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
.input_option_2:hover{
|
||||
height:25px;
|
||||
background-color:#576D73;
|
||||
border: 0px solid #222;
|
||||
color:#FFFFFF;
|
||||
font-family:'Courier New', Courier, mono;
|
||||
font-size:13px;
|
||||
}
|
||||
#ss_basic_kcp_parameter{
|
||||
display: block;
|
||||
margin:0 auto;
|
||||
overflow: hidden;
|
||||
width: 99%;
|
||||
font-size: 13px;
|
||||
font-family:'Courier New', Courier, mono;
|
||||
height: 25px;
|
||||
line-height: 1.5;
|
||||
padding:0px;
|
||||
}
|
||||
.ss_btn {
|
||||
border: 1px solid #222;
|
||||
background: linear-gradient(to bottom, #003333 0%, #000000 100%); /* W3C */
|
||||
font-size:10pt;
|
||||
color: #fff;
|
||||
padding: 5px 5px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
width:14%;
|
||||
}
|
||||
.ss_btn:hover {
|
||||
border: 1px solid #222;
|
||||
background: linear-gradient(to bottom, #27c9c9 0%, #279fd9 100%); /* W3C */
|
||||
font-size:10pt;
|
||||
color: #fff;
|
||||
padding: 5px 5px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
width:14%;
|
||||
}
|
||||
.kp_btn {
|
||||
border: 1px solid #222;
|
||||
background: linear-gradient(to bottom, #003333 0%, #000000 100%); /* W3C */
|
||||
font-size:10pt;
|
||||
color: #fff;
|
||||
padding: 5px 5px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
width:14%;
|
||||
}
|
||||
.kp_btn:hover {
|
||||
border: 1px solid #222;
|
||||
background: linear-gradient(to bottom, #27c9c9 0%, #279fd9 100%); /* W3C */
|
||||
font-size:10pt;
|
||||
color: #fff;
|
||||
padding: 5px 5px;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
width:14%;
|
||||
}
|
||||
.FormTitle_chrome56{
|
||||
margin-top:-100px;
|
||||
line-height:160%;
|
||||
font-size:12px;
|
||||
font-family:Arial, Verdana, Arial, Helvetica, sans-serif;
|
||||
border:1px solid #4D595D;
|
||||
color:white;
|
||||
position:relative;
|
||||
*margin-top:-1px;
|
||||
-webkit-border-bottom-right-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-moz-border-radius-bottomright: 3px;
|
||||
-moz-border-radius-bottomleft: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
behavior: url(/PIE.htc);
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
.FormTitle_chrome56 thead{
|
||||
color:#FFF;
|
||||
font-size:13px;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
background-color:#4D595D;
|
||||
}
|
||||
.FormTitle_chrome56 tbody{
|
||||
line-height:180%;
|
||||
}
|
||||
.FormTitle_chrome56 i {
|
||||
color: #FC0;
|
||||
font-style: normal;
|
||||
}
|
||||
.FormTitle_chrome56 em {
|
||||
color: #00ffe4;
|
||||
font-style: normal;
|
||||
}
|
||||
.FormTitle_chrome56 b {
|
||||
color: #1cfe16;
|
||||
font-style: normal;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
.FormTitle_firefox{
|
||||
margin-top:-100px;
|
||||
line-height:160%;
|
||||
font-size:12px;
|
||||
font-family:Arial, Verdana, Arial, Helvetica, sans-serif;
|
||||
border:1px solid #4D595D;
|
||||
color:white;
|
||||
}
|
||||
.FormTitle_firefox thead{
|
||||
color:#FFF;
|
||||
font-size:13px;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
background-color:#4D595D;
|
||||
}
|
||||
.FormTitle_firefox tbody{
|
||||
line-height:180%;
|
||||
}
|
||||
|
||||
.FormTitle_firefox i {
|
||||
color: #FC0;
|
||||
font-style: normal;
|
||||
}
|
||||
.FormTitle_firefox em {
|
||||
color: #00ffe4;
|
||||
font-style: normal;
|
||||
}
|
||||
.FormTitle_firefox b {
|
||||
color: #1cfe16;
|
||||
font-style: normal;
|
||||
font-weight:normal;
|
||||
}
|
841
shadowsocks/shadowsocks/res/ss-menu.js
Executable file
841
shadowsocks/shadowsocks/res/ss-menu.js
Executable file
@ -0,0 +1,841 @@
|
||||
|
||||
function browser_compatibility1(){
|
||||
//fw versiom
|
||||
var _fw="<% nvram_get("extendno"); %>";
|
||||
fw_version=parseFloat(_fw.split("X")[1]);
|
||||
// chrome
|
||||
var isChrome = navigator.userAgent.search("Chrome") > -1;
|
||||
if(isChrome){
|
||||
var major = navigator.userAgent.match("Chrome\/([0-9]*)\."); //check for major version
|
||||
var isChrome56 = (parseInt(major[1], 10) >= 56);
|
||||
} else {
|
||||
var isChrome56 = false;
|
||||
}
|
||||
if((isChrome56) && document.getElementById("FormTitle") && fw_version < 7.5){
|
||||
document.getElementById("FormTitle").className = "FormTitle_chrome56";
|
||||
//console.log("fw_version", fw_version);
|
||||
}else if((isChrome56) && document.getElementById("FormTitle") && fw_version >= 7.5){
|
||||
document.getElementById("FormTitle").className = "FormTitle";
|
||||
//console.log("chrome", fw_version);
|
||||
}
|
||||
//firefox
|
||||
var isFirefox = navigator.userAgent.search("Firefox") > -1;
|
||||
if((isFirefox) && document.getElementById("FormTitle") && fw_version < 7.5){
|
||||
document.getElementById("FormTitle").className = "FormTitle_firefox";
|
||||
if(current_url.indexOf("Main_Ss_Content.asp") == 0){
|
||||
document.getElementById("FormTitle").style.marginTop = "-100px"
|
||||
//console.log("firefox -100");
|
||||
}
|
||||
|
||||
}else if((isFirefox) && document.getElementById("FormTitle") && fw_version >= 7.5){
|
||||
document.getElementById("FormTitle").className = "FormTitle_firefox";
|
||||
if(current_url.indexOf("Main_Ss_Content.asp") == 0){
|
||||
document.getElementById("FormTitle").style.marginTop = "0px"
|
||||
//console.log("firefox 0");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function menu_hook(title, tab) {
|
||||
browser_compatibility1();
|
||||
var enable_ss = "<% nvram_get("enable_ss"); %>";
|
||||
var enable_soft = "<% nvram_get("enable_soft"); %>";
|
||||
if(enable_ss == "1" && enable_soft == "1"){
|
||||
tabtitle[tabtitle.length -2] = new Array("", "shadowsocks设置", "负载均衡设置", "Socks5设置");
|
||||
tablink[tablink.length -2] = new Array("", "Main_Ss_Content.asp", "Main_Ss_LoadBlance.asp", "Main_SsLocal_Content.asp");
|
||||
}else{
|
||||
tabtitle[tabtitle.length -1] = new Array("", "shadowsocks设置", "负载均衡设置", "Socks5设置");
|
||||
tablink[tablink.length -1] = new Array("", "Main_Ss_Content.asp", "Main_Ss_LoadBlance.asp", "Main_SsLocal_Content.asp");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var Base64;
|
||||
if (typeof btoa == "Function") {
|
||||
Base64 = {
|
||||
encode: function(e) {
|
||||
return btoa(e);
|
||||
},
|
||||
decode: function(e) {
|
||||
return atob(e);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
Base64 = {
|
||||
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
||||
encode: function(e) {
|
||||
var t = "";
|
||||
var n, r, i, s, o, u, a;
|
||||
var f = 0;
|
||||
e = Base64._utf8_encode(e);
|
||||
while (f < e.length) {
|
||||
n = e.charCodeAt(f++);
|
||||
r = e.charCodeAt(f++);
|
||||
i = e.charCodeAt(f++);
|
||||
s = n >> 2;
|
||||
o = (n & 3) << 4 | r >> 4;
|
||||
u = (r & 15) << 2 | i >> 6;
|
||||
a = i & 63;
|
||||
if (isNaN(r)) {
|
||||
u = a = 64
|
||||
} else if (isNaN(i)) {
|
||||
a = 64
|
||||
}
|
||||
t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a)
|
||||
}
|
||||
return t
|
||||
},
|
||||
decode: function(e) {
|
||||
var t = "";
|
||||
var n, r, i;
|
||||
var s, o, u, a;
|
||||
var f = 0;
|
||||
e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
while (f < e.length) {
|
||||
s = this._keyStr.indexOf(e.charAt(f++));
|
||||
o = this._keyStr.indexOf(e.charAt(f++));
|
||||
u = this._keyStr.indexOf(e.charAt(f++));
|
||||
a = this._keyStr.indexOf(e.charAt(f++));
|
||||
n = s << 2 | o >> 4;
|
||||
r = (o & 15) << 4 | u >> 2;
|
||||
i = (u & 3) << 6 | a;
|
||||
t = t + String.fromCharCode(n);
|
||||
if (u != 64) {
|
||||
t = t + String.fromCharCode(r)
|
||||
}
|
||||
if (a != 64) {
|
||||
t = t + String.fromCharCode(i)
|
||||
}
|
||||
}
|
||||
t = Base64._utf8_decode(t);
|
||||
return t
|
||||
},
|
||||
_utf8_encode: function(e) {
|
||||
e = e.replace(/\r\n/g, "\n");
|
||||
var t = "";
|
||||
for (var n = 0; n < e.length; n++) {
|
||||
var r = e.charCodeAt(n);
|
||||
if (r < 128) {
|
||||
t += String.fromCharCode(r)
|
||||
} else if (r > 127 && r < 2048) {
|
||||
t += String.fromCharCode(r >> 6 | 192);
|
||||
t += String.fromCharCode(r & 63 | 128)
|
||||
} else {
|
||||
t += String.fromCharCode(r >> 12 | 224);
|
||||
t += String.fromCharCode(r >> 6 & 63 | 128);
|
||||
t += String.fromCharCode(r & 63 | 128)
|
||||
}
|
||||
}
|
||||
return t
|
||||
},
|
||||
_utf8_decode: function(e) {
|
||||
var t = "";
|
||||
var n = 0;
|
||||
var r = c1 = c2 = 0;
|
||||
while (n < e.length) {
|
||||
r = e.charCodeAt(n);
|
||||
if (r < 128) {
|
||||
t += String.fromCharCode(r);
|
||||
n++
|
||||
} else if (r > 191 && r < 224) {
|
||||
c2 = e.charCodeAt(n + 1);
|
||||
t += String.fromCharCode((r & 31) << 6 | c2 & 63);
|
||||
n += 2
|
||||
} else {
|
||||
c2 = e.charCodeAt(n + 1);
|
||||
c3 = e.charCodeAt(n + 2);
|
||||
t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
|
||||
n += 3
|
||||
}
|
||||
}
|
||||
return t
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String.prototype.replaceAll = function(s1,s2){
|
||||
return this.replace(new RegExp(s1,"gm"),s2);
|
||||
}
|
||||
|
||||
function showSSLoadingBar(seconds){
|
||||
if(window.scrollTo)
|
||||
window.scrollTo(0,0);
|
||||
|
||||
disableCheckChangedStatus();
|
||||
|
||||
htmlbodyforIE = document.getElementsByTagName("html"); //this both for IE&FF, use "html" but not "body" because <!DOCTYPE html PUBLIC.......>
|
||||
htmlbodyforIE[0].style.overflow = "hidden"; //hidden the Y-scrollbar for preventing from user scroll it.
|
||||
|
||||
winW_H();
|
||||
|
||||
var blockmarginTop;
|
||||
var blockmarginLeft;
|
||||
if (window.innerWidth)
|
||||
winWidth = window.innerWidth;
|
||||
else if ((document.body) && (document.body.clientWidth))
|
||||
winWidth = document.body.clientWidth;
|
||||
|
||||
if (window.innerHeight)
|
||||
winHeight = window.innerHeight;
|
||||
else if ((document.body) && (document.body.clientHeight))
|
||||
winHeight = document.body.clientHeight;
|
||||
|
||||
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth){
|
||||
winHeight = document.documentElement.clientHeight;
|
||||
winWidth = document.documentElement.clientWidth;
|
||||
}
|
||||
|
||||
if(winWidth >1050){
|
||||
|
||||
winPadding = (winWidth-1050)/2;
|
||||
winWidth = 1105;
|
||||
blockmarginLeft= (winWidth*0.3)+winPadding-150;
|
||||
}
|
||||
else if(winWidth <=1050){
|
||||
blockmarginLeft= (winWidth)*0.3+document.body.scrollLeft-160;
|
||||
|
||||
}
|
||||
|
||||
if(winHeight >660)
|
||||
winHeight = 660;
|
||||
|
||||
blockmarginTop= winHeight*0.3-140
|
||||
|
||||
document.getElementById("loadingBarBlock").style.marginTop = blockmarginTop+"px";
|
||||
// marked by Jerry 2012.11.14 using CSS to decide the margin
|
||||
document.getElementById("loadingBarBlock").style.marginLeft = blockmarginLeft+"px";
|
||||
document.getElementById("loadingBarBlock").style.width = 770+"px";
|
||||
|
||||
|
||||
/*blockmarginTop = document.documentElement.scrollTop + 200;
|
||||
document.getElementById("loadingBarBlock").style.marginTop = blockmarginTop+"px";*/
|
||||
|
||||
document.getElementById("LoadingBar").style.width = winW+"px";
|
||||
document.getElementById("LoadingBar").style.height = winH+"px";
|
||||
|
||||
loadingSeconds = seconds;
|
||||
progress = 100/loadingSeconds;
|
||||
y = 0;
|
||||
if (socks5 == "1"){
|
||||
LoadingLocalProgress(seconds);
|
||||
} else {
|
||||
LoadingSSProgress(seconds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function LoadingSSProgress(seconds){
|
||||
action = document.form.ss_basic_action.value;
|
||||
document.getElementById("LoadingBar").style.visibility = "visible";
|
||||
if (document.form.ss_basic_action.value == 9){
|
||||
document.getElementById("loading_block3").innerHTML = "应用负载均衡设置 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>请勿刷新本页面,应用负载均衡设置 ...</font></li>");
|
||||
return true;
|
||||
}
|
||||
if (document.form.ss_basic_enable.value == 0){
|
||||
document.getElementById("loading_block3").innerHTML = "SS服务关闭中 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'><a href='http://www.koolshare.cn' target='_blank'></font>SS工作有问题?请来我们的<font color='#ffcc00'>论坛www.koolshare.cn</font>反应问题...</font></li>");
|
||||
} else {
|
||||
if (action == 1 || action == 2 || action == 3 || action == 4){
|
||||
if (document.form.ss_basic_mode.value == 6){
|
||||
document.getElementById("loading_block3").innerHTML = "回国启用中 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>此期间请勿访问屏蔽网址,以免污染DNS进入缓存</font></li><li><font color='#ffcc00'>在此期间请不要刷新本页面,不然可能导致问题!</font></li>");
|
||||
}else if (document.form.ss_basic_mode.value == 5){
|
||||
document.getElementById("loading_block3").innerHTML = "全局模式启用中 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>此期间请勿访问屏蔽网址,以免污染DNS进入缓存</font></li><li><font color='#ffcc00'>此模式非科学上网方式,会影响国内网页速度...</font></li><li><font color='#ffcc00'>注意:全局模式并非VPN,只支持TCP流量转发...</font></li><li><font color='#ffcc00'>请等待日志显示完毕,并出现自动关闭按钮!</font></li><li><font color='#ffcc00'>在此期间请不要刷新本页面,不然可能导致问题!</font></li>");
|
||||
} else if (document.form.ss_basic_mode.value == 2){
|
||||
document.getElementById("loading_block3").innerHTML = "大陆白名单模式启用中 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>此期间请勿访问屏蔽网址,以免污染DNS进入缓存</font></li><li><font color='#ffcc00'>请等待日志显示完毕,并出现自动关闭按钮!</font></li><li><font color='#ffcc00'>在此期间请不要刷新本页面,不然可能导致问题!</font></li>");
|
||||
} else if (document.form.ss_basic_mode.value == 1){
|
||||
document.getElementById("loading_block3").innerHTML = "gfwlist模式启用中 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>此期间请勿访问屏蔽网址,以免污染DNS进入缓存</font></li><li><font color='#ffcc00'>尝试不同的DNS解析方案,可以达到最佳的效果哦...</font></li><li><font color='#ffcc00'>请等待日志显示完毕,并出现自动关闭按钮!</font></li><li><font color='#ffcc00'>在此期间请不要刷新本页面,不然可能导致问题!</font></li>");
|
||||
}
|
||||
} else if (action == 5){
|
||||
document.getElementById("loading_block3").innerHTML = "shadowsocks插件升级 ..."
|
||||
//document.getElementById("log_content3").rows = 12;
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>请勿刷新本页面,等待脚本运行完毕后再刷新!</font></li><li><font color='#ffcc00'>升级服务会自动检测最新版本并下载升级...</font></li>");
|
||||
} else if (action == 6){
|
||||
document.getElementById("loading_block3").innerHTML = "shadowsocks规则更新 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>请勿刷新本页面,等待脚本运行完毕后再刷新!</font></li><li><font color='#ffcc00'>正在自动检测github上的更新...</font></li>");
|
||||
} else if (action == 7){
|
||||
document.getElementById("loading_block3").innerHTML = "恢复shadowsocks配置 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>请勿刷新本页面,配置恢复后需要重新提交!</font></li><li><font color='#ffcc00'>恢复配置中...</font></li>");
|
||||
} else if (action == 8){
|
||||
document.getElementById("loading_block3").innerHTML = "清空shadowsocks配置 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>请勿刷新本页面,正在清空shadowsocks配置...</font></li>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function LoadingLocalProgress(seconds){
|
||||
document.getElementById("LoadingBar").style.visibility = "visible";
|
||||
document.getElementById("loading_block3").innerHTML = "socks5启用中 ..."
|
||||
$j("#loading_block2").html("<li><font color='#ffcc00'>此期间请勿访问屏蔽网址,以免污染DNS进入缓存</font></li><li><font color='#ffcc00'>此模式非科学上网方式,会影响国内网页速度...</font></li><li><font color='#ffcc00'>注意:全局模式并非VPN,只支持TCP流量转发...</font></li>");
|
||||
y = y + progress;
|
||||
if(typeof(seconds) == "number" && seconds >= 0){
|
||||
if(seconds != 0){
|
||||
document.getElementById("proceeding_img").style.width = Math.round(y) + "%";
|
||||
document.getElementById("proceeding_img_text").innerHTML = Math.round(y) + "%";
|
||||
|
||||
if(document.getElementById("loading_block1")){
|
||||
document.getElementById("proceeding_img_text").style.width = document.getElementById("loading_block1").clientWidth;
|
||||
document.getElementById("proceeding_img_text").style.marginLeft = "175px";
|
||||
}
|
||||
--seconds;
|
||||
setTimeout("LoadingLocalProgress("+seconds+");", 1000);
|
||||
}
|
||||
else{
|
||||
document.getElementById("proceeding_img_text").innerHTML = "完成";
|
||||
y = 0;
|
||||
setTimeout("hideSSLoadingBar();",1000);
|
||||
refreshpage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hideSSLoadingBar(){
|
||||
x = -1;
|
||||
document.getElementById("LoadingBar").style.visibility = "hidden";
|
||||
checkss = 0;
|
||||
var action = document.form.ss_basic_action.value;
|
||||
if (action == 5 || action == 6 ||action == 7 ||action == 8 || action == 9){
|
||||
refreshpage();
|
||||
}else{
|
||||
htmlbodyforIE = document.getElementsByTagName("html"); //this both for IE&FF, use "html" but not "body" because <!DOCTYPE html PUBLIC.......>
|
||||
htmlbodyforIE[0].style.overflowY = "visible";
|
||||
decode_show();
|
||||
checkss = 0;
|
||||
$G("ss_basic_password").value = Base64.decode($G("ss_basic_password").value);
|
||||
setTimeout("get_ss_status_data();",2000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function pass_checked(obj){
|
||||
switchType(obj, document.form.show_pass.checked, true);
|
||||
}
|
||||
|
||||
function openShutManager(oSourceObj, oTargetObj, shutAble, oOpenTip, oShutTip) {
|
||||
var sourceObj = typeof oSourceObj == "string" ? document.getElementById(oSourceObj) : oSourceObj;
|
||||
var targetObj = typeof oTargetObj == "string" ? document.getElementById(oTargetObj) : oTargetObj;
|
||||
var openTip = oOpenTip || "";
|
||||
var shutTip = oShutTip || "";
|
||||
if (targetObj.style.display != "none") {
|
||||
if (shutAble) return;
|
||||
targetObj.style.display = "none";
|
||||
if (openTip && shutTip) {
|
||||
sourceObj.innerHTML = shutTip;
|
||||
}
|
||||
} else {
|
||||
if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
|
||||
$G(oTargetObj).style.margin = "0px 0px 0px 15px";
|
||||
}
|
||||
targetObj.style.display = "block";
|
||||
if (openTip && shutTip) {
|
||||
sourceObj.innerHTML = openTip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function openssHint(itemNum){
|
||||
statusmenu = "";
|
||||
width="350px";
|
||||
|
||||
if(itemNum == 10){
|
||||
statusmenu ="如果发现开关不能开启,那么请检查<a href='Advanced_System_Content.asp'><u><font color='#00F'>系统管理 -- 系统设置</font></u></a>页面内Enable JFFS custom scripts and configs是否开启。";
|
||||
_caption = "服务器说明";
|
||||
}
|
||||
|
||||
if(itemNum == 0){
|
||||
width="750px";
|
||||
bgcolor="#CC0066",
|
||||
statusmenu ="<li>通过对路由器内ss访问(<a href='https://www.google.com.tw/' target='_blank'><u><font color='#00F'>https://www.google.com.tw/</font></u></a>)状态的检测,返回状态信息。状态检测默认每10秒进行一次,可以通过附加设置中的选项,更改检测时间间隔,每次检测都会请求<a href='https://www.google.com.tw/' target='_blank'><u><font color='#00F'>https://www.google.com.tw/</font></u></a>,该请求不会进行下载,仅仅请求HTTP头部,请求成功后,会返回working信息,请求失败,会返回Problem detected!</li>"
|
||||
statusmenu +="</br><li>状态检测只在SS主界面打开时进行,网页关闭后,后台是不会进行检测的,每次进入页面,或者切换模式,重新提交等操作,状态检测会在此后5秒后进行,在这之前,状态会显示为watting... 如果显示Waiting for first refresh...则表示正在等待首次状态检测的结果。</li>"
|
||||
statusmenu +="</br><li>状态检测反应的是路由器本身访问https://www.google.com.tw/的结果,并不代表电脑或路由器下其它终端的访问结果,透过状态检测,可以为使用SS代理中遇到的一些问题进行排查,一下列举一些常见的情况:</li>"
|
||||
statusmenu +="</br><b><font color='#CC0066'>1:双working,不能访问被墙网站:</font></b>"
|
||||
statusmenu +="</br> <font color='#00F'>1.1:DNS缓存:</font>可能你在未开启ss的时候访问过被墙域名,DNS缓存受到了污染,只需要简单的刷新下缓存,window电脑通过在CMD中运行命令:<font color='#669900'>ipconfig /flushdns</font>刷新电脑DNS缓存,手机端可以通过尝试开启飞行模式后关闭飞行模式刷新DNS缓存。"
|
||||
statusmenu +="</br> <font color='#00F'>1.2:自定义DNS:</font>很多用户喜欢自己在电脑上定义DNS来使用,这样访问google等被墙网站,解析出来的域名基本都是污染的,因此建议将DNS解析改为自动获取。如果你的路由器很多人使用,你不能阻止别人自定义DNS,那么建议开启chromecast功能,路由器会将所有自定义的DNS劫持到自己的DNS服务器上,避免DNS污染。"
|
||||
statusmenu +="</br> <font color='#00F'>1.3:host:</font>电脑端以前设置过host翻墙,host翻墙失效快,DNS解析将通过host完成,不过路由器,如果host失效,使用chnroute翻墙的模式将无法使用;即使未失效,在gfwlist模式下,域名解析通过电脑host完成,而无法进入ipset,同样使得翻墙无法使用,因此强烈建议清除相关host!"
|
||||
statusmenu +="</br><b><font color='#CC0066'>2:国内working,国外Problem detected!:</font></b>"
|
||||
statusmenu +="</br> <font color='#00F'>2.1:检查你的SS账号:</font>在电脑端用SS客户端检查是否正常;"
|
||||
statusmenu +="</br> <font color='#00F'>2.2:是否使用了域名:</font>一些SS服务商提供的域名,特别是较为复杂的域名,可能有解析不了的问题,可尝试更换为IP地址;"
|
||||
statusmenu +="</br> <font color='#00F'>2.3:是否使用了含有特殊字符的密码:</font>极少数情况下,电脑端账号使用正常,路由端却Problem detected!是因为使用了包含特殊字符的密码;"
|
||||
statusmenu +="</br> <font color='#00F'>2.4:尝试更换国外dns:</font>此部分详细解析,请看DNS部分帮助文档;"
|
||||
statusmenu +="</br> <font color='#00F'>2.5:更换shadowsocks主程序:</font>meirlin ss一直使用最新的shadowsocks-libev和shadowsocksR-libev代码编译主程序,如果某次更新后出现这种情况,在检查了以上均无问题后,可能出现的问题就是路由器内的ss主程序和服务器端的不匹配,此时你可以通过下载历史安装包,将旧的主程序替换掉新的,主程序位于路由器下的/koolshare/bin目录,shadowsocks-libev:ss-redir,ss-local,ss-tunnel;shadowsocksR-libev:rss-redir,rss-local,rss-tunnel;"
|
||||
statusmenu +="</br> <font color='#00F'>2.6:更新服务器端:</font>如果你不希望更换路由器端主程序,可以更新最新服务器端来尝试解决问题,另外建议使用原版SS的朋友,在服务器端部署和路由器端相同版本的shadowsocks-libev;"
|
||||
statusmenu +="</br> <font color='#00F'>2.7:ntp时间问题:</font>如果你使用SSR,一些混淆协议是需要验证ss服务器和路由器的时间的,如果时间相差太多,那么就会出现Problem detected! 。"
|
||||
statusmenu +="</br><b><font color='#CC0066'>3:双Problem detected!:</font></b>"
|
||||
statusmenu +="</br> <font color='#00F'>3.1:更换国内DNS:</font>在电脑端用SS客户端检查是否正常;"
|
||||
statusmenu +="</br> <font color='#00F'>3.2:逐项检查第2点中每个项目。</font>"
|
||||
statusmenu +="</br><b><font color='#CC0066'>4:国内Problem detected!,国外working:</font></b>"
|
||||
statusmenu +="</br> <font color='#00F'>4.1:尝试更换国内DNS。</font>"
|
||||
statusmenu +="</br><b><font color='#CC0066'>5:国外间歇性Problem detected!:</font></b>"
|
||||
statusmenu +="</br> <font color='#00F'>5.1:检查你的SS服务器ping和丢包:</font>一些线路可能在高峰期或者线路调整期,导致丢包过多,获取状态失败;"
|
||||
statusmenu +="</br> <font color='#00F'>5.2:升级新版本后出现这种情况:</font>merlin ss插件从2015年6月,其核心部分就基本无改动,升级新版本出现这种情况,最大可能的原因,新版本升级了最新的ss或者ssr的主程序,解决方法可以通过回滚路由器内程序,也可以升级你的服务器端到最新,如果你是自己搭建的用户,建议最新原版shadowsocks-libev程序。"
|
||||
statusmenu +="</br><b><font color='#CC0066'>6:你遇到了非常少见的情况:</font></b>来这里反馈吧:<a href='https://telegram.me/joinchat/DCq55kC7pgWKX9J4cJ4dJw' target='_blank'><u><font color='#00F'>telegram</font></u></a>。"
|
||||
_caption = "状态检测";
|
||||
return overlib(statusmenu, OFFSETX, -460, LEFT, STICKY, WIDTH, 'width', CAPTION, _caption, CLOSETITLE, '');
|
||||
}
|
||||
|
||||
if(itemNum == 1){
|
||||
width="700px";
|
||||
bgcolor="#CC0066",
|
||||
//gfwlist
|
||||
statusmenu ="<span><b><font color='#CC0066'>【1】gfwlist模式:</font></b></br>"
|
||||
statusmenu +=" 该模式使用gfwlist区分流量,Shadowsocks会将所有访问gfwlist内域名的TCP链接转发到Shadowsocks服务器,实现透明代理;</br>"
|
||||
statusmenu +=" 和真正的gfwlist模式相比较,路由器内的gfwlist模式还是有一定缺点,因为它没法做到像gfwlist PAC文件一样,对某些域名的二级域名有例外规则。</br>"
|
||||
statusmenu +="<b><font color='#669900'>优点:</font></b>节省SS流量,可防止迅雷和PT流量。</br>"
|
||||
statusmenu +="<b><font color='#669900'>缺点:</font></b>代理受限于名单内的4000多个被墙网站,需要维护黑名单。一些不走域名解析的应用,比如telegram,需要单独添加IP/CIDR黑名单。</span></br></br>"
|
||||
//redchn
|
||||
statusmenu +="<span><b><font color='#CC0066'>【2】大陆白名单模式:</font></b></br>"
|
||||
statusmenu +=" 该模式使用chnroute IP网段区分国内外流量,ss-redir将流量转发到Shadowsocks服务器,实现透明代理;</br>"
|
||||
statusmenu +=" 由于采用了预先定义的ip地址块(chnroute),所以DNS解析就非常重要,如果一个国内有的网站被解析到了国外地址,那么这个国内网站是会走ss的;</br>"
|
||||
statusmenu +=" 因为使用了大量的cdn名单,能够保证常用的国内网站都获得国内的解析结果,但是即使如此还是不能完全保证国内的一些网站解析到国内地址,这个时候就推荐使用具备cdn解析能力的chinaDNS或者PcapDNSProxy。</br>"
|
||||
statusmenu +="<b><font color='#669900'>优点:</font></b>所有被墙国外网站均能通过代理访问,无需维护域名黑名单;主机玩家用此模式可以实现TCP代理国内直连。</br>"
|
||||
statusmenu +="<b><font color='#669900'>缺点:</font></b>消耗更多的Shadowsocks流量,迅雷下载和BT可能消耗SS流量。</span></br></br>"
|
||||
//overall
|
||||
statusmenu +="<span><b><font color='#CC0066'>【3】全局模式:</font></b></br>"
|
||||
statusmenu +=" 除局域网和ss服务器等流量不走代理,其它都走代理(udp不走),高级设置中提供了对代理协议的选择。</br>"
|
||||
statusmenu +="<b><font color='#669900'>优点:</font></b>简单暴力,全部出国;可选仅web浏览走ss,还是全部tcp代理走ss,因为不需要区分国内外流量,因此性能最好。</br>"
|
||||
statusmenu +="<b><font color='#669900'>缺点:</font></b>国内网站全部走ss,迅雷下载和BT全部走SS流量。</span></br></br>"
|
||||
_caption = "模式说明";
|
||||
return overlib(statusmenu, OFFSETX, -860, OFFSETY, -290, LEFT, STICKY, WIDTH, 'width', CAPTION, _caption, CLOSETITLE, '');
|
||||
}
|
||||
else if(itemNum == 2){
|
||||
|
||||
statusmenu ="此处填入你的SS服务器的地址。</br>建议优先填入<font color='#F46'>IP地址</font>。填入域名,特别是一些服务商给的复杂域名,有时遇到无法解析会导致Problem detected!";
|
||||
_caption = "服务器";
|
||||
}
|
||||
else if(itemNum == 3){
|
||||
statusmenu ="此处填入你的SS服务器的端口";
|
||||
_caption = "服务器端口";
|
||||
}
|
||||
else if(itemNum == 4){
|
||||
statusmenu ="此处填入你的SS服务器的密码。</br><font color='#F46'>注意:</font>使用带有特殊字符的密码,可能会导致SS链接不上服务器。";
|
||||
_caption = "服务器密码";
|
||||
}
|
||||
else if(itemNum == 5){
|
||||
statusmenu ="此处填入你的SS服务器的加密方式。</br><font color='#F46'>建议</font>如果是自己搭建服务器,建议使用对路由器负担比较小的加密方式,例如chacha20,chacha20-ietf等。";
|
||||
_caption = "服务器加密方式";
|
||||
}
|
||||
else if(itemNum == 7){
|
||||
statusmenu ="此处选择一次性验证(OTA)选项。</br><font color='#F46'>注意:</font>一次性验证需要服务器端开启支持,才能选择!</br>一般自己搭建原生SS服务器,建议开启此选项,OTA有抗重放攻击的能力。"
|
||||
statusmenu +="</br>shadowsocks-libev和最新的shadowsocks-python服务器端都能支持OTA选项的开启。"
|
||||
statusmenu +="</br>shadowsocksR服务器端也兼容OTA,你需要在服务端配置协议为verify_sha1_compatible,混淆可选择任意一个,但必须是兼容版的。"
|
||||
statusmenu +="</br>更多信息,请参考<a href='https://shadowsocks.org/en/spec/one-time-auth.html' target='_blank'><u><font color='#00F'>一次性验证(OTA)</font></u></a>";
|
||||
_caption = "一次性验证(OTA)";
|
||||
}
|
||||
else if(itemNum == 8){
|
||||
statusmenu ="更多信息,请参考<a href='https://github.com/breakwa11/shadowsocks-rss/blob/master/ssr.md' target='_blank'><u><font color='#00F'>ShadowsocksR 协议插件文档</font></u></a>"
|
||||
_caption = "协议插件(protocol)";
|
||||
}
|
||||
else if(itemNum == 9){
|
||||
statusmenu ="更多信息,请参考<a href='https://github.com/breakwa11/shadowsocks-rss/blob/master/ssr.md' target='_blank'><u><font color='#00F'>ShadowsocksR 协议插件文档</font></u></a>"
|
||||
_caption = "混淆插件 (obfs)";
|
||||
|
||||
}
|
||||
else if(itemNum == 11){
|
||||
statusmenu ="如果不知道如何填写,请一定留空,不然可能带来副作用!"
|
||||
statusmenu +="</br></br>请参考<a class='hintstyle' href='javascript:void(0);' onclick='openssHint(8)'><font color='#00F'>协议插件(protocol)</font></a>和<a class='hintstyle' href='javascript:void(0);' onclick='openssHint(9)'><font color='#00F'>混淆插件 (obfs)</font></a>内说明。"
|
||||
statusmenu +="</br></br>更多信息,请参考<a href='https://github.com/breakwa11/shadowsocks-rss/blob/master/ssr.md' target='_blank'><u><font color='#00F'>ShadowsocksR 协议插件文档</font></u></a>"
|
||||
_caption = "自定义参数 (obfs_param)";
|
||||
//return overlib(statusmenu, OFFSETX, -860, OFFSETY, -290, LEFT, STICKY, WIDTH, 'width', CAPTION, " ", CLOSETITLE, '');
|
||||
}
|
||||
else if(itemNum == 12){
|
||||
width="500px";
|
||||
statusmenu ="此处显示你的SS插件当前的版本号,当前版本:<% dbus_get_def("ss_basic_version_local", "未知"); %>,如果需要回滚SS版本,请参考以下操作步骤:";
|
||||
statusmenu +="</br></br><font color='#CC0066'>1 </font>进入<a href='Tools_Shell.asp' target='_blank'><u><font color='#00F'>webshell</font></u></a>或者其他telnet,ssh等能输入命令的工具";
|
||||
statusmenu +="</br><font color='#CC0066'>2 </font>请依次输入以下命令,等待上一条命令执行完后再运行下一条(这里以回滚2.8.9为例):";
|
||||
statusmenu +="</br></br> cd /tmp";
|
||||
statusmenu +="</br> wget --no-check-certificate https://raw.githubusercontent.com/koolshare/koolshare.github.io/mips_softerware_center/shadowsocks/history/shadowsocks_2.8.9.tar.gz";
|
||||
statusmenu +="</br> tar -zxvf /tmp/shadowsocks.tar.gz";
|
||||
statusmenu +="</br> chmod +x /tmp/shadowsocks/install.sh";
|
||||
statusmenu +="</br> sh /tmp/shadowsocks/install.sh";
|
||||
statusmenu +="</br></br>最后一条命令输入完后不会有任何打印信息。";
|
||||
statusmenu +="</br>回滚其它版本号,请参考<a href='https://github.com/koolshare/koolshare.github.io/tree/mips_softerware_center/shadowsocks/history' target='_blank'><u><font color='#00F'>版本历史列表</font></u></a>";
|
||||
_caption = "shadowsocks for merlin 版本";
|
||||
}
|
||||
else if(itemNum == 13){
|
||||
statusmenu =" SSR表示shadowwocksR-libev,相比较原版shadowwocksR-libev,其提供了强大的协议混淆插件,让你避开gfw的侦测。"
|
||||
statusmenu +="</br> 虽然你在节点编辑界面能够指定使用SS的类型,不过这里还是提供了勾选使用SSR的选项,是为了方便一些服务器端是兼容原版协议的用户,快速切换SS账号类型而设定。";
|
||||
_caption = "使用SSR";
|
||||
}
|
||||
else if(itemNum == 15){
|
||||
statusmenu =" 点击右侧的铅笔图标,进入节点界面,在节点界面,你可以进行节点的添加,修改,删除,应用,检查节点ping,和web访问性等操作。"
|
||||
_caption = "选择节点";
|
||||
}
|
||||
else if(itemNum == 16){
|
||||
statusmenu =" 此处不同模式会显示不同的图标,如果你是从2.0以前的老版本升级过来的,可能有些节点不会显示图标,只需要编辑一下节点,选择好模式,然后保存即可显示。"
|
||||
_caption = "模式";
|
||||
}
|
||||
else if(itemNum == 17){
|
||||
statusmenu ="节点名称支持中文,支持空格。"
|
||||
_caption = "节点名称";
|
||||
}
|
||||
else if(itemNum == 18){
|
||||
statusmenu ="优先建议使用ip地址"
|
||||
_caption = "服务器地址";
|
||||
}
|
||||
else if(itemNum == 19){
|
||||
statusmenu =" ping/丢包功能用于检测你的路由器到ss服务器的ping值和丢包;"
|
||||
statusmenu +="</br> 一些奇葩的运营商可能会禁ping,一些SS服务器也会禁止ping,此处检测就会failed,所以遇到这种情况不必惊恐。"
|
||||
_caption = "ping/丢包";
|
||||
}
|
||||
else if(itemNum == 20){
|
||||
statusmenu =" 延迟是你访问所测试网站,请求完整个网站所花的时间,间接的反应了你的ss的速度;"
|
||||
_caption = "延迟";
|
||||
}
|
||||
else if(itemNum == 21){
|
||||
statusmenu =" 编辑节点功能能帮助你快速的更改ss某个节点的设置,比如服务商更换IP地址之后,可以快速更改;"
|
||||
statusmenu +="</br> 编辑节点目前只支持相同类型节点的编辑,比如不能将ss节点编辑为ssr节点,如果你的ssr节点是兼容原版协议的,建议你在主面板用使用ssr勾选框来进行更改。"
|
||||
_caption = "编辑节点";
|
||||
}
|
||||
else if(itemNum == 22){
|
||||
statusmenu =" 删除节点功能能快速的删除某个特定的节点,为了方便快速删除,删除节点点击后生效,不会有是否确认弹出。"
|
||||
_caption = "编辑节点";
|
||||
}
|
||||
else if(itemNum == 23){
|
||||
statusmenu =" 点击使用节点能快速的将该节点填入主面板,但是你需要在主面板点击提交,才能使用该节点。"
|
||||
_caption = "使用节点";
|
||||
}
|
||||
else if(itemNum == 24){
|
||||
statusmenu =" 导出功能可以将ss所有的设置全部导出,包括节点信息,dns设定,黑白名单设定等;"
|
||||
statusmenu +="</br> 恢复配置功能可以使用之前导出的文件,也可以使用标准的json格式节点文件。"
|
||||
_caption = "导出恢复";
|
||||
}
|
||||
else if(itemNum == 25){
|
||||
statusmenu ="<font color='#CC0066'>1 在gfwlist模式下:</font>";
|
||||
statusmenu +="</br> 将用此处定义的国内DNS解析<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/gfwlist.conf' target='_blank'><u><font color='#00F'>gfwlist</font></u></a>以外的网址,包括全部国内网址和国外未被墙的网址。"
|
||||
statusmenu +="</br></br><font color='#CC0066'>2 在大陆白名单模式:</font>";
|
||||
statusmenu +="</br> 将用此处定义的国内DNS将解析国内<a href='https://github.com/koolshare/koolshare.github.io' target='_blank'><font color='#00F'>2W+个域名(CDN名单)</font></a> 参与维护这个列表。"
|
||||
_caption = "国内DNS";
|
||||
}
|
||||
else if(itemNum == 26){
|
||||
width="750px";
|
||||
statusmenu =" 国外DNS为大家提供了丰富的选择,其目的有二,一是为了保证大家有能用的国外DNS服务;二十在有能用的基础上,能够选择多种DNS解析方案,达到最佳的解析效果;所以如果你切换某个DNS程序,导致国外连接Problem detected! 那么久更换能用的就好,不用纠结某个解析方案不能用。"
|
||||
statusmenu +=" </br></br>下面我会就我的认知对几种国外DNS方案做一个简单介绍:"
|
||||
//dns2socks
|
||||
statusmenu +="</br><font color='#CC0066'>1:dns2socks:</font>"
|
||||
statusmenu +="</br> 可以说是万金油方案,作用是将 DNS请求通过一个socks5隧道转发到DNS服务器,和下文中ss-tunnel类似,不过1dns2socks是利用了SOCK5隧道代理,ss-tunnel是利用了加密UDP;该DNS方案不受到ss服务是否支持udp限制,不受到运营商是否封Opendns限制,只要能建立socoks5链接,就能使用;";
|
||||
statusmenu +="</br> 在gfwlist模式下,dns2socks用于针对性的解析gfwlist内的域名名单;在使用chnroute的模式(大陆白名单模式)dns2socks用于解析<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/cdn.txt' target='_blank'><u><font color='#00F'>国内cdn名单</font></u></a>以外的所有域名,所以一些没有包含在这份名单内的网站,而正好这个网站有部署国外地址的话,那么这个网站就会被解析为国外ip,然后由ipset判断流量走ss,当然这种情况是比较少的,因为一般常用的国内网站都包含在这份cdn名单内了。";
|
||||
//dnscrypt-proxy
|
||||
statusmenu +="</br><font color='#CC0066'>2:dnscrypt-proxy:</font>"
|
||||
statusmenu +="</br> 原理是通过加密连接到支持该程序的国外DNS服务器,由这些DNS服务器解析出gfwlist中域名的IP地址,因为该解析不走ss服务器,所以解析出的IP地址离SS服务器的距离随机,国外CDN较弱。这里提供了很多支持dnscrypt-proxy解析的节点列表,通常最常用的就是cisco(opendns),不过国内有些地区的运营商针对opendns有封锁,所以有时候选择dnscrypt-proxy + opendns的方案可能行不通;";
|
||||
statusmenu +="</br> 在gfwlist模式下,dnscrypt-proxy用于针对性的解析gfwlist内的域名名单;在使用chnroute的模式(大陆白名单模式)dnscrypt-proxy用于解析<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/cdn.txt' target='_blank'><u><font color='#00F'>国内cdn名单</font></u></a>以外的所有域名,所以一些没有包含在这份名单内的网站,而正好这个网站有部署国外地址的话,那么这个网站就会被解析为国外ip,然后由ipset判断流量走ss,当然这种情况是比较少的,因为一般常用的国内网站都包含在这份cdn名单内了。";
|
||||
//ss-tunnel
|
||||
statusmenu +="</br><font color='#CC0066'>3:ss-tunnel:</font>"
|
||||
statusmenu +="</br> 原理是将DNS请求,通过ss-tunnel利用UDP发送到ss服务器上,由ss服务器向你定义的DNS服务器发送解析请求,解析出gfwlist中域名的IP地址,这种方式解析出来的IP地址会距离ss服务器更近,具有较强的国外CDN效果;"
|
||||
statusmenu +="</br> 在gfwlist模式下,ss-tunnel用于针对性的解析gfwlist内的域名名单;在使用chnroute的模式(大陆白名单模式)ss-tunnel用于解析<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/cdn.txt' target='_blank'><u><font color='#00F'>国内cdn名单</font></u></a>以外的所有域名,所以一些没有包含在这份名单内的网站,而正好这个网站有部署国外地址的话,那么这个网站就会被解析为国外ip,然后由ipset判断流量走ss,当然这种情况是比较少的,因为一般常用的国内网站都包含在这份cdn名单内了。";
|
||||
//ChinaDNS
|
||||
statusmenu +="</br><font color='#CC0066'>4:ChinaDNS:</font>"
|
||||
statusmenu +="</br> 原理是通过ChinaDNS自身的DNS并发查询,同时将你要请求的域名同时向国内和国外DNS发起查询,然后用ChinaDNS内置的双向过滤+指针压缩功能来过滤掉污染ip,双向过滤保证了国内地址都用国内域名查询,因此使用ChinaDNS能够获得最佳的国内CDN效果,这里ChinaDNS国内服务器的选择是有要求的,这个DNS的ip地址必须在<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/chnroute.txt' target='_blank'><u><font color='#00F'>chnroute</font></u></a>定义的IP段内,同理你选择或者自定义的国外DNS必须在chnroute定义的IP段外,所以比如你在国内DNS处填写你的上级路由器的ip地址,类似192.168.1.1这种,会被ChinaDNS判断为国外IP地址,从而使得双向过滤功能失效,国外DNS解析的IP地址就会进入DNS缓存;";
|
||||
statusmenu +="</br> 因为ChinaDNS自己具备cdn解析能力,所以没必要再使用<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/cdn.txt' target='_blank'><u><font color='#00F'>国内cdn名单</font></u></a>,因为使用这个名单会对dnsmasq造成很大的负担!"
|
||||
statusmenu +="</br> 为了保证ChinaDNS国外解析的效果,这里我给出的ChinaDNS国外DNS都是又经过了一层软件(dns2socks,dnscrypt-proxy,ss-tunnel)的;同时你也可以自定义ChinaDNS国外dns去直接去请求国外DNS服务器,但是cdn效果就不会有经过上层软件后好。这里如果选择dns2socks或者ss-tunnel,ChinaDNS解析国外DNS会向上游软件去请求,而这两个上游软件都会经过SS服务器,可以说能达到良好的国外CDN效果;"
|
||||
statusmenu +="</br> 因为gfwlist模式的原理,不需要用到这个软件,也有良好的cdn效果,所以并没有必要在gfwlist模式中集成该方案;"
|
||||
//pdnsd
|
||||
statusmenu +="</br><font color='#CC0066'>5:pdnsd:</font>"
|
||||
statusmenu +="</br> pdnsd是一个老牌的dns解析软件了它不仅可以用来做解析软件,还能用来自己搭建dns缓存服务器;早期pdnsd的流行,主要是其支持TCP解析,然而随着gfw对投毒范围的越来越广泛,tcp解析已经不能保证无毒了,但是其强大的dns缓存机制,让我仍然不肯放弃它;";
|
||||
statusmenu +="</br> pdnsd域名解析具备强大的dns缓存机制,通过修改最小ttl时间,可以让缓存进入电脑后很长时间才会失效,优点就是每次解析国外网站,仅需1ms的时间;";
|
||||
statusmenu +="</br> 设置pdnsd的上有服务器,建议使用UDP方式,因为TCP方式,除非自己搭建支持TCP查询的DNS服务器,很难避免污染的情况,而UDP方式也是提供了(dns2socks,dnscrypt-proxy,ss-tunnel)三种上游软件,这里就不再赘述;";
|
||||
statusmenu +="</br> 在gfwlist模式下,pdnsd用于针对性的解析gfwlist内的域名名单,因此pdnsd的DNS缓存也只针对这部分域名;在使用chnroute的模式(大陆白名单模式)dnscrypt-proxy用于解析<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/cdn.txt' target='_blank'><u><font color='#00F'>国内cdn名单</font></u></a>以外的所有域名,pdnsd的DNS缓存也针对这部分域名(但是范围比使用gfwlist要大得多了),所以一些没有包含在这份名单内的网站,而正好这个网站有部署国外地址的话,那么这个网站就会被解析为国外ip,然后由ipset判断流量走ss,当然这种情况是比较少的,因为一般常用的国内网站都包含在这份cdn名单内了。";
|
||||
_caption = "国外DNS";
|
||||
return overlib(statusmenu, OFFSETX, -860, OFFSETY, -290, LEFT, STICKY, WIDTH, 'width', CAPTION, _caption, CLOSETITLE, '');
|
||||
|
||||
}
|
||||
else if(itemNum == 27){
|
||||
statusmenu =" ChinaDNS用于解析<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/cdn.txt' target='_blank'><u><font color='#00F'>国内cdn名单</font></u></a>以外的国内网址的DNS。"
|
||||
statusmenu +="</br> 因为ChinaDNS会将你定义的国内DNS和<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/chnroute.txt' target='_blank'><u><font color='#00F'>chnroute</font></u></a>做匹配,如果你定义的国内DNS不在<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/chnroute.txt' target='_blank'><u><font color='#00F'>chnroute</font></u></a>内,那么就是无效的,比如你定义了上级路由器的192.168.1.1的DNS那么就是无效的!"
|
||||
_caption = "ChinaDNS国内DNS";
|
||||
}
|
||||
else if(itemNum == 28){
|
||||
statusmenu =" ChinaDNS用于解析<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/chnroute.txt' target='_blank'><u><font color='#00F'>chnroute</font></u></a>以外的国外网址的DNS。"
|
||||
_caption = "ChinaDNS国外DNS";
|
||||
}
|
||||
else if(itemNum == 29){
|
||||
statusmenu =" 除非你知道你在做什么,这里还是建议大家使用udp查询方式。"
|
||||
_caption = "pdnsd查询方式";
|
||||
}
|
||||
else if(itemNum == 30){
|
||||
statusmenu =" 如果使用TCP查询,请一定确保查询结果没有污染。"
|
||||
_caption = "pdnsd上游服务器(TCP)";
|
||||
}
|
||||
else if(itemNum == 31){
|
||||
statusmenu =" dns2socks和ss-tunnel是走ss服务器的查询方式(国外cdn较好),dnscrypt-proxy是本地直接请求的方式(国外cdn较弱)。"
|
||||
_caption = "pdnsd上游服务器(UDP)";
|
||||
}
|
||||
else if(itemNum == 32){
|
||||
statusmenu =" 默认给出了最小TTL 24小时,最长TTL1周。"
|
||||
_caption = "pdnsd缓存设置";
|
||||
}
|
||||
else if(itemNum == 33){
|
||||
statusmenu ="填入需要强制用国内DNS解析的域名,一行一个,格式如下:。"
|
||||
statusmenu +="</br>注意:不支持通配符!"
|
||||
statusmenu +="</br></br>koolshare.cn"
|
||||
statusmenu +="</br>baidu.com"
|
||||
statusmenu +="</br></br>需要注意的是,这里要填写的一定是网站的一级域名,比如taobao.com才是正确的,www.taobao.com,http://www.taobao.com/这些格式都是错误的!"
|
||||
_caption = "自定义需要CDN加速网站";
|
||||
}
|
||||
else if(itemNum == 34){
|
||||
statusmenu ="填入自定义的dnsmasq设置,一行一个,格式如下:。"
|
||||
statusmenu +="</br></br>#例如hosts设置:"
|
||||
statusmenu +="</br>address=/koolshare.cn/2.2.2.2"
|
||||
statusmenu +="</br></br>#防DNS劫持设置"
|
||||
statusmenu +="</br>bogus-nxdomain=220.250.64.18"
|
||||
statusmenu +="</br></br>#指定config设置"
|
||||
statusmenu +="</br>conf-file=/jffs/mydnsmasq.conf"
|
||||
statusmenu +="</br></br>如果填入了错误的格式,可能导致dnsmasq启动失败!"
|
||||
statusmenu +="</br></br>如果填入的信息里带有英文逗号的,也会导致dnsmasq启动失败!"
|
||||
_caption = "自定义dnsamsq";
|
||||
}
|
||||
else if(itemNum == 38){
|
||||
statusmenu ="填入不需要走代理的外网ip/cidr地址,一行一个,格式如下:。"
|
||||
statusmenu +="</br></br>2.2.2.2"
|
||||
statusmenu +="</br>3.3.3.3"
|
||||
statusmenu +="</br>4.4.4.4/24"
|
||||
_caption = "IP/CIDR白名单";
|
||||
}
|
||||
else if(itemNum == 39){
|
||||
statusmenu ="填入不需要走代理的域名,一行一个,格式如下:。"
|
||||
statusmenu +="</br></br>google.com"
|
||||
statusmenu +="</br>facebook.com"
|
||||
statusmenu +="</br></br>需要注意的是,这里要填写的一定是网站的一级域名,比如google.com才是正确的,www.google.com,https://www.google.com/这些格式都是错误的!"
|
||||
statusmenu +="</br></br>需要清空电脑DNS缓存,才能立即看到效果"
|
||||
_caption = "域名白名单";
|
||||
}
|
||||
else if(itemNum == 40){
|
||||
statusmenu ="填入需要强制走代理的外网ip/cidr地址,,一行一个,格式如下:。"
|
||||
statusmenu +="</br></br>5.5.5.5"
|
||||
statusmenu +="</br>6.6.6.6"
|
||||
statusmenu +="</br>7.7.7.7/8"
|
||||
_caption = "IP/CIDR黑名单";
|
||||
}
|
||||
else if(itemNum == 41){
|
||||
statusmenu ="填入需要强制走代理的域名,,一行一个,格式如下:。"
|
||||
statusmenu +="</br></br>baidu.com"
|
||||
statusmenu +="</br>taobao.com"
|
||||
statusmenu +="</br></br>需要注意的是,这里要填写的一定是网站的一级域名,比如google.com才是正确的,www.baidu.com,http://www.baidu.com/这些格式都是错误的!"
|
||||
statusmenu +="</br></br>需要清空电脑DNS缓存,才能立即看到效果。"
|
||||
_caption = "IP/CIDR黑名单";
|
||||
}
|
||||
else if(itemNum == 42){
|
||||
statusmenu ="此处定义ss状态检测更新时间间隔,默认5秒。"
|
||||
_caption = "状态更新间隔";
|
||||
}
|
||||
else if(itemNum == 43){
|
||||
statusmenu ="chromecast功能能将所有来自局域网的DNS请求强行劫持到路由器自己的53端口上。"
|
||||
statusmenu +="</br>如果你不能防止局域网中的别人自定义DNS服务器,那么未必防止DNS污染,可以开启此选项;"
|
||||
statusmenu +="</br>开启后不管在电脑上定义什么DNS,都将会被劫持到你在路由器定义的DNS。"
|
||||
_caption = "chromecast";
|
||||
}
|
||||
else if(itemNum == 44){
|
||||
statusmenu ="shadowsocks规则更新包括了gfwlist模式中用到的<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/gfwlist.conf' target='_blank'><font color='#00F'><u>gfwlist</u></font></a>,在大陆白名单模式中用到的<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/chnroute.txt' target='_blank'><u><font color='#00F'>chnroute</font></u></a>和<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/cdn.txt' target='_blank'><u><font color='#00F'>国内cdn名单</font></u></a>"
|
||||
statusmenu +="</br>建议更新时间在凌晨闲时进行,以避免更新时重启ss服务器造成网络访问问题。"
|
||||
_caption = "shadowsocks规则自动更新";
|
||||
}
|
||||
else if(itemNum == 45){
|
||||
statusmenu ="通过局域网客户端控制功能,你能定义在当前模式下某个局域网地址是否走SS。"
|
||||
_caption = "局域网客户端控制";
|
||||
}
|
||||
else if(itemNum == 46){
|
||||
statusmenu ="一些用户的网络拨号可能比较滞后,为了保证SS在路由器开机后能正常启动,可以通过此功能,为ss的启动增加开机延迟。"
|
||||
_caption = "开机启动延迟";
|
||||
}
|
||||
else if(itemNum == 50){
|
||||
statusmenu ="通过此开关,你可以开启或者关闭侧边栏面板上的shadowsocks入口;"
|
||||
statusmenu +="</br>该开关在固件版本6.6.1(不包括6.6.1)以上起作用。"
|
||||
_caption = "侧边栏开关";
|
||||
}
|
||||
else if(itemNum == 51){
|
||||
width="600px";
|
||||
statusmenu ="如果你的ss服务器填写了域名,可以通过此处的设置来定义域名的解析方式"
|
||||
statusmenu +="</br></br><font color='#00F'>如果解析正确:</font>ip地址将用于ss的配置文件和iptables对vps ip的RETURN操作"
|
||||
statusmenu +="</br></br><font color='#00F'>如果解析失败:</font>ss的配置文件将会使用域名,然后由ss-redir自己去解析;iptables对vps ip的RETURN将不会添加,就会造成两种情况:"
|
||||
statusmenu +="</br> 1,如果ss-redir自己也解析失败,就会出现Problem detected!,然后你将不能访问自己的vps,除非关闭ss"
|
||||
statusmenu +="</br> 2,如果ss-redir自己解析成功,就会出现working...,虽然你能访问你的vps,但是是vps自己(127.0.0.1)访问自己,此时切换节点、关闭ss等操作,会断开你访问你vps的链接!当然,这对普通用户和购买ss帐号的用户没什么影响。"
|
||||
statusmenu +="</br></br>nslookup解析方式比较自由,能自定义dns解析服务器,解析成功率比较高,但是解析失败的时候可能导致脚本开在nslookup处,可能导致过早提交结束,从而导致fq的dns污染。"
|
||||
statusmenu +="</br></br>resolveip解析方式不会卡住脚本,如果4秒内不能解析成功,将不再尝试,然后把域名交给ss-redir自己取解析,并且不添加vps ip的RETURN条目。"
|
||||
statusmenu +="</br></br>如果你使用IP地址作为服务器地址,那么选择两者没有区别,如果你使用域名,建议优先使用resolveip方式,如果还是不行再使用nslookup方式,再不行,就更换nslookup方式的解析服务器"
|
||||
_caption = "SS服务器解析";
|
||||
}else if(itemNum == 52){
|
||||
statusmenu ="KCP协议,ss-libev混淆,负载均衡下均不支持UDP!"
|
||||
statusmenu +="</br>请检查你是否启用了其中之一。"
|
||||
_caption = "侧边栏开关";
|
||||
}else if(itemNum == 53){
|
||||
statusmenu ="此处可以自定义你偏向使用的DNS解析方案"
|
||||
statusmenu +="</br></br>国内优先:国外dns解析gfwlist名单内的国外域名,其余域名用国内dns解析,需要<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/gfwlist.conf' target='_blank'><u><font color='#00F'>gfwlist</font></u></a>,占用cpu较小,国内解析效果好。"
|
||||
statusmenu +="</br></br>国外优先:国内dns解析cdn名单内的国内域名用,其余域名用国外dns解析,需要<a href='https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui/maintain_files/cdn.txt' target='_blank'><u><font color='#00F'>国内cdn名单</font></u></a>,占用cpu较大,国外解析效果好。"
|
||||
_caption = "侧边栏开关";
|
||||
}
|
||||
else if(itemNum == 54){
|
||||
statusmenu ="更多信息,请参考<a href='https://breakwa11.blogspot.jp/2017/01/shadowsocksr-mu.html' target='_blank'><u><font color='#00F'>ShadowsocksR 协议参数文档</font></u></a>"
|
||||
_caption = "协议参数(protocol)";
|
||||
}
|
||||
//return overlib(statusmenu, OFFSETX, -160, LEFT, DELAY, 200);
|
||||
//return overlib(statusmenu, OFFSETX, -160, LEFT, STICKY, WIDTH, 'width', CAPTION, " ", FGCOLOR, "#4D595D", CAPCOLOR, "#000000", CLOSECOLOR, "#000000", MOUSEOFF, "1",TEXTCOLOR, "#FFF", CLOSETITLE, '');
|
||||
return overlib(statusmenu, OFFSETX, -160, LEFT, STICKY, WIDTH, 'width', CAPTION, _caption, CLOSETITLE, '');
|
||||
|
||||
var tag_name= document.getElementsByTagName('a');
|
||||
for (var i=0;i<tag_name.length;i++)
|
||||
tag_name[i].onmouseout=nd;
|
||||
|
||||
if(helpcontent == [] || helpcontent == "" || hint_array_id > helpcontent.length)
|
||||
return overlib('<#defaultHint#>', HAUTO, VAUTO);
|
||||
else if(hint_array_id == 0 && hint_show_id > 21 && hint_show_id < 24)
|
||||
return overlib(helpcontent[hint_array_id][hint_show_id], FIXX, 270, FIXY, 30);
|
||||
else{
|
||||
if(hint_show_id > helpcontent[hint_array_id].length)
|
||||
return overlib('<#defaultHint#>', HAUTO, VAUTO);
|
||||
else
|
||||
return overlib(helpcontent[hint_array_id][hint_show_id], HAUTO, VAUTO);
|
||||
}
|
||||
}
|
||||
|
||||
function showDropdownClientList(_callBackFun, _callBackFunParam, _interfaceMode, _containerID, _pullArrowID, _clientState) {
|
||||
document.body.addEventListener("click", function(_evt) {control_dropdown_client_block(_containerID, _pullArrowID, _evt);})
|
||||
if(clientList.length == 0){
|
||||
setTimeout(function() {
|
||||
genClientList();
|
||||
showDropdownClientList(_callBackFun, _callBackFunParam, _interfaceMode, _containerID, _pullArrowID);
|
||||
}, 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
var htmlCode = "";
|
||||
htmlCode += "<div id='" + _containerID + "_clientlist_online'></div>";
|
||||
htmlCode += "<div id='" + _containerID + "_clientlist_dropdown_expand' class='clientlist_dropdown_expand' onclick='expand_hide_Client(\"" + _containerID + "_clientlist_dropdown_expand\", \"" + _containerID + "_clientlist_offline\");' onmouseover='over_var=1;' onmouseout='over_var=0;'>Show Offline Client List</div>";
|
||||
htmlCode += "<div id='" + _containerID + "_clientlist_offline'></div>";
|
||||
document.getElementById(_containerID).innerHTML = htmlCode;
|
||||
|
||||
var param = _callBackFunParam.split(">");
|
||||
var clientMAC = "";
|
||||
var clientIP = "";
|
||||
var getClientValue = function(_attribute, _clienyObj) {
|
||||
var attribute_value = "";
|
||||
switch(_attribute) {
|
||||
case "mac" :
|
||||
attribute_value = _clienyObj.mac;
|
||||
break;
|
||||
case "ip" :
|
||||
if(clientObj.ip != "offline") {
|
||||
attribute_value = _clienyObj.ip;
|
||||
}
|
||||
break;
|
||||
case "name" :
|
||||
attribute_value = (clientObj.nickName == "") ? clientObj.name.replace(/'/g, "\\'") : clientObj.nickName.replace(/'/g, "\\'");
|
||||
break;
|
||||
default :
|
||||
attribute_value = _attribute;
|
||||
break;
|
||||
}
|
||||
return attribute_value;
|
||||
};
|
||||
|
||||
var genClientItem = function(_state) {
|
||||
var code = "";
|
||||
var clientName = (clientObj.nickName == "") ? clientObj.name : clientObj.nickName;
|
||||
|
||||
code += '<a id=' + clientList[i] + ' title=' + clientList[i] + '>';
|
||||
if(_state == "online")
|
||||
code += '<div onclick="' + _callBackFun + '(\'';
|
||||
else if(_state == "offline")
|
||||
code += '<div style="color:#A0A0A0" onclick="' + _callBackFun + '(\'';
|
||||
for(var j = 0; j < param.length; j += 1) {
|
||||
if(j == 0) {
|
||||
code += getClientValue(param[j], clientObj);
|
||||
}
|
||||
else {
|
||||
code += '\', \'';
|
||||
code += getClientValue(param[j], clientObj);
|
||||
}
|
||||
}
|
||||
code += '\''
|
||||
code += ', '
|
||||
code += '\''
|
||||
code += clientName;
|
||||
code += '\');">';
|
||||
code += '<strong>';
|
||||
if(clientName.length > 32) {
|
||||
code += clientName.substring(0, 30) + "..";
|
||||
}
|
||||
else {
|
||||
code += clientName;
|
||||
}
|
||||
code += '</strong>';
|
||||
if(_state == "offline")
|
||||
code += '<strong title="Remove this client" style="float:right;margin-right:5px;cursor:pointer;" onclick="removeClient(\'' + clientObj.mac + '\', \'' + _containerID + '_clientlist_dropdown_expand\', \'' + _containerID + '_clientlist_offline\')">×</strong>';
|
||||
code += '</div><!--[if lte IE 6.5]><iframe class="hackiframe2"></iframe><![endif]--></a>';
|
||||
return code;
|
||||
};
|
||||
|
||||
for(var i = 0; i < clientList.length; i +=1 ) {
|
||||
var clientObj = clientList[clientList[i]];
|
||||
switch(_clientState) {
|
||||
case "all" :
|
||||
if(_interfaceMode == "wl" && (clientList[clientList[i]].isWL == 0)) {
|
||||
continue;
|
||||
}
|
||||
if(_interfaceMode == "wired" && (clientList[clientList[i]].isWL != 0)) {
|
||||
continue;
|
||||
}
|
||||
if(clientObj.isOnline) {
|
||||
document.getElementById("" + _containerID + "_clientlist_online").innerHTML += genClientItem("online");
|
||||
}
|
||||
else if(clientObj.from == "nmpClient") {
|
||||
document.getElementById("" + _containerID + "_clientlist_offline").innerHTML += genClientItem("offline");
|
||||
}
|
||||
break;
|
||||
case "online" :
|
||||
if(_interfaceMode == "wl" && (clientList[clientList[i]].isWL == 0)) {
|
||||
continue;
|
||||
}
|
||||
if(_interfaceMode == "wired" && (clientList[clientList[i]].isWL != 0)) {
|
||||
continue;
|
||||
}
|
||||
if(clientObj.isOnline) {
|
||||
document.getElementById("" + _containerID + "_clientlist_online").innerHTML += genClientItem("online");
|
||||
}
|
||||
break;
|
||||
case "offline" :
|
||||
if(_interfaceMode == "wl" && (clientList[clientList[i]].isWL == 0)) {
|
||||
continue;
|
||||
}
|
||||
if(_interfaceMode == "wired" && (clientList[clientList[i]].isWL != 0)) {
|
||||
continue;
|
||||
}
|
||||
if(clientObj.from == "nmpClient") {
|
||||
document.getElementById("" + _containerID + "_clientlist_offline").innerHTML += genClientItem("offline");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(document.getElementById("" + _containerID + "_clientlist_offline").childNodes.length == "0") {
|
||||
if(document.getElementById("" + _containerID + "_clientlist_dropdown_expand") != null) {
|
||||
removeElement(document.getElementById("" + _containerID + "_clientlist_dropdown_expand"));
|
||||
}
|
||||
if(document.getElementById("" + _containerID + "_clientlist_offline") != null) {
|
||||
removeElement(document.getElementById("" + _containerID + "_clientlist_offline"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(document.getElementById("" + _containerID + "_clientlist_dropdown_expand").innerText == "Show Offline Client List") {
|
||||
document.getElementById("" + _containerID + "_clientlist_offline").style.display = "none";
|
||||
}
|
||||
else {
|
||||
document.getElementById("" + _containerID + "_clientlist_offline").style.display = "";
|
||||
}
|
||||
}
|
||||
if(document.getElementById("" + _containerID + "_clientlist_online").childNodes.length == "0") {
|
||||
if(document.getElementById("" + _containerID + "_clientlist_online") != null) {
|
||||
removeElement(document.getElementById("" + _containerID + "_clientlist_online"));
|
||||
}
|
||||
}
|
||||
|
||||
if(document.getElementById(_containerID).childNodes.length == "0")
|
||||
document.getElementById(_pullArrowID).style.display = "none";
|
||||
else
|
||||
document.getElementById(_pullArrowID).style.display = "";
|
||||
}
|
1
shadowsocks/shadowsocks/res/ss_proc_status.htm
Executable file
1
shadowsocks/shadowsocks/res/ss_proc_status.htm
Executable file
@ -0,0 +1 @@
|
||||
<% nvram_dump("ss_proc_status.log",""); %>
|
8
shadowsocks/shadowsocks/scripts/ss_check.sh
Executable file
8
shadowsocks/shadowsocks/scripts/ss_check.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
eval `dbus export ss`
|
||||
pros=`ps | grep "ssconfig.sh check" | grep -v grep | grep -v syscmd`
|
||||
|
||||
if [ -z $pros ]; then
|
||||
/jffs/softcenter/ss/ssconfig.sh check
|
||||
fi
|
16
shadowsocks/shadowsocks/scripts/ss_conf_remove.sh
Executable file
16
shadowsocks/shadowsocks/scripts/ss_conf_remove.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
echo_date 开始清理shadowsocks配置...
|
||||
confs=`dbus list ss | cut -d "=" -f 1 | grep -v "version" | grep -v "ss_basic_state_china" | grep -v "ss_basic_state_foreign"`
|
||||
|
||||
for conf in $confs
|
||||
do
|
||||
echo_date 移除$conf
|
||||
dbus remove $conf
|
||||
done
|
||||
echo_date 设置一些默认参数...
|
||||
dbus set ss_basic_enable="0"
|
||||
dbus set ss_basic_version_local=`cat /jffs/softcenter/ss/version`
|
||||
echo_date 尝试关闭shadowsocks...
|
||||
sh /jffs/softcenter/ss/stop.sh stop_all
|
193
shadowsocks/shadowsocks/scripts/ss_conf_restore.sh
Executable file
193
shadowsocks/shadowsocks/scripts/ss_conf_restore.sh
Executable file
@ -0,0 +1,193 @@
|
||||
#!/bin/sh
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
confs=`cat /tmp/ss_conf_backup.txt`
|
||||
format=`echo $confs|grep "{"`
|
||||
if [ -z "$format" ];then
|
||||
echo_date 检测到ss备份文件...
|
||||
cat /tmp/ss_conf_backup.txt | grep -E "^ss"| sed '/webtest/d' | sed '/ping/d' |sed '/ss_node_table/d' | sed '/_state_/d' | sed 's/=/=\"/' | sed 's/$/\"/g'|sed 's/^/dbus set /' | sed '1 i\\n' | sed '1 isource /jffs/softcenter/scripts/base.sh' | sed '1 i#!/bin/sh' > /tmp/ss_conf_backup_tmp.sh
|
||||
echo_date 开始恢复配置...
|
||||
chmod +x /tmp/ss_conf_backup_tmp.sh
|
||||
sh /tmp/ss_conf_backup_tmp.sh
|
||||
sleep 1
|
||||
backup_version=`dbus get ss_basic_version_local`
|
||||
comp=`versioncmp $backup_version 3.0.0`
|
||||
if [ "$comp" == "1" ];then
|
||||
echo_date 检测到备份文件来自低于3.0.0版本,开始对部分数据进行base64转换,以适应新版本!
|
||||
node_pass=`dbus list ssconf_basic_password |cut -d "=" -f 1|cut -d "_" -f4|sort -n`
|
||||
for node in $node_pass
|
||||
do
|
||||
dbus set ssconf_basic_password_$node=`dbus get ssconf_basic_password_$node|base64`
|
||||
done
|
||||
dbus set ss_basic_password=`dbus get ss_basic_password|base64`
|
||||
dbus set ss_basic_black_lan=`dbus get ss_basic_black_lan | base64`
|
||||
dbus set ss_basic_white_lan=`dbus get ss_basic_white_lan | base64`
|
||||
dbus set ss_ipset_black_domain_web=`dbus get ss_ipset_black_domain_web | base64`
|
||||
dbus set ss_ipset_white_domain_web=`dbus get ss_ipset_white_domain_web | base64`
|
||||
dbus set ss_ipset_dnsmasq=`dbus get ss_ipset_dnsmasq | base64`
|
||||
dbus set ss_ipset_black_ip=`dbus get ss_ipset_black_ip | base64`
|
||||
dbus set ss_redchn_isp_website_web=`dbus get ss_redchn_isp_website_web | base64`
|
||||
dbus set ss_redchn_dnsmasq=`dbus get ss_redchn_dnsmasq | base64`
|
||||
dbus set ss_redchn_wan_white_ip=`dbus get ss_redchn_wan_white_ip | base64`
|
||||
dbus set ss_redchn_wan_white_domain=`dbus get ss_redchn_wan_white_domain | base64`
|
||||
dbus set ss_redchn_wan_black_ip=`dbus get ss_redchn_wan_black_ip | base64`
|
||||
dbus set ss_redchn_wan_black_domain=`dbus get ss_redchn_wan_black_domain | base64`
|
||||
dbus set ss_game_dnsmasq=`dbus get ss_game_dnsmasq | base64`
|
||||
dbus set ss_gameV2_dnsmasq=`dbus get ss_gameV2_dnsmasq | base64`
|
||||
fi
|
||||
|
||||
dbus set ss_basic_enable="0"
|
||||
dbus set ss_basic_version_local=`cat /jffs/softcenter/ss/version`
|
||||
|
||||
echo_date 配置恢复成功!
|
||||
|
||||
else
|
||||
ss_formate=`echo $confs|grep "obfs"`
|
||||
if [ -z "$ss_formate" ];then
|
||||
|
||||
echo_date 检测到ss json配置文件...
|
||||
servers=$(cat /tmp/ss_conf_backup.txt |grep -w server|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2)
|
||||
ports=`cat /tmp/ss_conf_backup.txt |grep -w server_port|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
passwords=`cat /tmp/ss_conf_backup.txt |grep -w password|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
methods=`cat /tmp/ss_conf_backup.txt |grep -w method|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
remarks=`cat /tmp/ss_conf_backup.txt |grep -w remarks|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
|
||||
# flush previous test value in the table
|
||||
echo_date 尝试移除旧的webtest结果...
|
||||
webtest=`dbus list ssconf_basic_webtest_ | sort -n -t "_" -k 4|cut -d "=" -f 1`
|
||||
for line in $webtest
|
||||
do
|
||||
dbus remove "$line"
|
||||
done
|
||||
|
||||
# flush previous ping value in the table
|
||||
echo_date 尝试移除旧的ping测试结果...
|
||||
pings=`dbus list ssconf_basic_ping | sort -n -t "_" -k 4|cut -d "=" -f 1`
|
||||
for ping in $pings
|
||||
do
|
||||
dbus remove "$ping"
|
||||
done
|
||||
|
||||
echo_date 开始导入配置...导入json配置不会覆盖原有配置.
|
||||
last_node=`dbus list ssconf_basic_server|cut -d "=" -f 1| cut -d "_" -f 4| sort -nr|head -n 1`
|
||||
if [ ! -z "$last_node" ];then
|
||||
k=`expr $last_node + 1`
|
||||
else
|
||||
k=1
|
||||
fi
|
||||
min=1
|
||||
max=`cat /tmp/ss_conf_backup.txt |grep -wc server`
|
||||
while [ $min -le $max ]
|
||||
do
|
||||
echo_date "==============="
|
||||
echo_date import node $min
|
||||
echo_date $k
|
||||
|
||||
server=`echo $servers | awk "{print $"$min"}"`
|
||||
port=`echo $ports | awk "{print $"$min"}"`
|
||||
password=`echo $passwords | awk "{print $"$min"}"`
|
||||
method=`echo $methods | awk "{print $"$min"}"`
|
||||
remark=`echo $remarks | awk "{print $"$min"}"`
|
||||
|
||||
echo_date $server
|
||||
echo_date $port
|
||||
echo_date $password
|
||||
echo_date $method
|
||||
echo_date $remark
|
||||
|
||||
dbus set ssconf_basic_server_"$k"="$server"
|
||||
dbus set ssconf_basic_port_"$k"="$port"
|
||||
dbus set ssconf_basic_password_"$k"=`echo "$password" | base64`
|
||||
dbus set ssconf_basic_method_"$k"="$method"
|
||||
dbus set ssconf_basic_name_"$k"="$remark"
|
||||
dbus set ssconf_basic_use_rss_"$k"=0
|
||||
dbus set ssconf_basic_mode_"$k"=2
|
||||
min=`expr $min + 1`
|
||||
k=`expr $k + 1`
|
||||
done
|
||||
echo_date 导入配置成功!
|
||||
else
|
||||
echo_date 检测到ssr json配置文件...
|
||||
servers=$(cat /tmp/ss_conf_backup.txt |grep -w server|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2)
|
||||
ports=`cat /tmp/ss_conf_backup.txt |grep -w server_port|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
passwords=`cat /tmp/ss_conf_backup.txt |grep -w password|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
methods=`cat /tmp/ss_conf_backup.txt |grep -w method|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
remarks=`cat /tmp/ss_conf_backup.txt |grep -w remarks|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
obfs=`cat /tmp/ss_conf_backup.txt |grep -w obfs|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
obfsparam=`cat /tmp/ss_conf_backup.txt |grep -w obfsparam|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
protocol=`cat /tmp/ss_conf_backup.txt |grep -w protocol|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|cut -d ":" -f 2`
|
||||
protocolparam=`cat /tmp/ss_conf_backup.txt |grep -w protocolparam|sed 's/"//g'|sed 's/,//g'|sed 's/\s//g'|sed 's/protocolparam://g'`
|
||||
|
||||
# flush previous test value in the table
|
||||
echo_date 尝试移除旧的webtest结果...
|
||||
webtest=`dbus list ssconf_basic_webtest_ | sort -n -t "_" -k 4|cut -d "=" -f 1`
|
||||
for line in $webtest
|
||||
do
|
||||
dbus remove "$line"
|
||||
done
|
||||
|
||||
# flush previous ping value in the table
|
||||
echo_date 尝试移除旧的ping测试结果...
|
||||
pings=`dbus list ssconf_basic_ping | sort -n -t "_" -k 4|cut -d "=" -f 1`
|
||||
for ping in $pings
|
||||
do
|
||||
dbus remove "$ping"
|
||||
done
|
||||
|
||||
echo_date 开始导入配置...导入json配置不会覆盖原有配置.
|
||||
last_node=`dbus list ssconf_basic_server|cut -d "=" -f 1| cut -d "_" -f 4| sort -nr|head -n 1`
|
||||
if [ ! -z "$last_node" ];then
|
||||
k=`expr $last_node + 1`
|
||||
else
|
||||
k=1
|
||||
fi
|
||||
min=1
|
||||
max=`cat /tmp/ss_conf_backup.txt |grep -wc server`
|
||||
while [ $min -le $max ]
|
||||
do
|
||||
echo_date "==============="
|
||||
echo_date import node $min
|
||||
echo_date $k
|
||||
|
||||
server=`echo $servers | awk "{print $"$min"}"`
|
||||
port=`echo $ports | awk "{print $"$min"}"`
|
||||
password=`echo $passwords | awk "{print $"$min"}"`
|
||||
method=`echo $methods | awk "{print $"$min"}"`
|
||||
remark=`echo $remarks | awk "{print $"$min"}"`
|
||||
obf=`echo $obfs | awk "{print $"$min"}"`
|
||||
obfspara=`echo $obfsparam | awk "{print $"$min"}"`
|
||||
protoco=`echo $protocol | awk "{print $"$min"}"`
|
||||
protocolpara=`echo $protocolparam | awk "{print $"$min"}"`
|
||||
|
||||
echo_date $server
|
||||
echo_date $port
|
||||
echo_date $password
|
||||
echo_date $method
|
||||
echo_date $remark
|
||||
echo_date $obf
|
||||
echo_date $obfspara
|
||||
echo_date $protoco
|
||||
echo_date $protocolpara
|
||||
|
||||
dbus set ssconf_basic_server_"$k"="$server"
|
||||
dbus set ssconf_basic_port_"$k"="$port"
|
||||
dbus set ssconf_basic_password_"$k"=`echo "$password" | base64`
|
||||
dbus set ssconf_basic_method_"$k"="$method"
|
||||
dbus set ssconf_basic_name_"$k"="$remark"
|
||||
dbus set ssconf_basic_rss_obfs_"$k"="$obf"
|
||||
dbus set ssconf_basic_rss_obfs_param_"$k"="$obfspara"
|
||||
dbus set ssconf_basic_rss_protocol_"$k"="$protoco"
|
||||
dbus set ssconf_basic_rss_protocol_para_"$k"="$protocolpara"
|
||||
dbus set ssconf_basic_use_rss_"$k"=1
|
||||
dbus set ssconf_basic_mode_"$k"=2
|
||||
min=`expr $min + 1`
|
||||
k=`expr $k + 1`
|
||||
done
|
||||
echo_date 导入配置成功!
|
||||
fi
|
||||
fi
|
||||
echo_date 一点点清理工作...
|
||||
sleep 2
|
||||
rm -rf /tmp/ss_conf_*
|
||||
echo_date 完成!
|
9
shadowsocks/shadowsocks/scripts/ss_config.sh
Executable file
9
shadowsocks/shadowsocks/scripts/ss_config.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
eval `dbus export ss`
|
||||
|
||||
if [ "$ss_basic_enable" == "1" ];then
|
||||
sh /jffs/softcenter/ss/ssconfig.sh restart
|
||||
else
|
||||
sh /jffs/softcenter/ss/ssconfig.sh stop
|
||||
fi
|
204
shadowsocks/shadowsocks/scripts/ss_lb_config.sh
Executable file
204
shadowsocks/shadowsocks/scripts/ss_lb_config.sh
Executable file
@ -0,0 +1,204 @@
|
||||
#!/bin/sh
|
||||
# 导入skipd数据
|
||||
eval `dbus export ss`
|
||||
|
||||
# 引用环境变量等
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
username=`nvram get http_username`
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
write_haproxy_cfg(){
|
||||
echo_date 生成haproxy配置文件到/jffs/softcenter/configs目录.
|
||||
cat > /jffs/softcenter/configs/haproxy.cfg <<-EOF
|
||||
global
|
||||
log 127.0.0.1 local2
|
||||
chroot /usr/bin
|
||||
pidfile /var/run/haproxy.pid
|
||||
maxconn 4000
|
||||
user nobody
|
||||
daemon
|
||||
defaults
|
||||
mode tcp
|
||||
log global
|
||||
option tcplog
|
||||
option dontlognull
|
||||
option http-server-close
|
||||
#option forwardfor except 127.0.0.0/8
|
||||
option redispatch
|
||||
retries 2
|
||||
timeout http-request 10s
|
||||
timeout queue 1m
|
||||
timeout connect 3s
|
||||
timeout client 1m
|
||||
timeout server 1m
|
||||
timeout http-keep-alive 10s
|
||||
timeout check 10s
|
||||
maxconn 3000
|
||||
|
||||
listen admin_status
|
||||
bind 0.0.0.0:1188
|
||||
mode http
|
||||
stats refresh 30s
|
||||
stats uri /
|
||||
stats auth $username:$ss_lb_passwd
|
||||
#stats hide-version
|
||||
stats admin if TRUE
|
||||
resolvers mydns
|
||||
nameserver dns1 119.29.29.29:53
|
||||
nameserver dns2 114.114.114.114:53
|
||||
resolve_retries 3
|
||||
timeout retry 2s
|
||||
hold valid 10s
|
||||
listen shadowscoks_balance_load
|
||||
bind 0.0.0.0:$ss_lb_port
|
||||
mode tcp
|
||||
balance roundrobin
|
||||
EOF
|
||||
if [ "$ss_lb_heartbeat" == "1" ];then
|
||||
echo_date 启用故障转移心跳...
|
||||
lb_node=`dbus list ssconf_basic_use_lb_|sed 's/ssconf_basic_use_lb_//g' |cut -d "=" -f 1 | sort -n | sed '/^$/d'`
|
||||
for node in $lb_node
|
||||
do
|
||||
nick_name=`dbus get ssconf_basic_name_$node`
|
||||
if [ ! -z "$nick_name" ];then
|
||||
kcp=`dbus get ssconf_basic_use_kcp_$node`
|
||||
if [ "$kcp" == "1" ];then
|
||||
port="1091"
|
||||
name=`dbus get ssconf_basic_server_$node`:kcp
|
||||
server="127.0.0.1"
|
||||
else
|
||||
port=`dbus get ssconf_basic_port_$node`
|
||||
name=`dbus get ssconf_basic_server_$node`:$port
|
||||
server=`dbus get ssconf_basic_server_$node`
|
||||
IFIP=`echo $server|grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}|:"`
|
||||
if [ -z "$IFIP" ];then
|
||||
echo_date 检测到【"$nick_name"】节点域名格式,将尝试进行解析...
|
||||
if [ "$ss_basic_dnslookup" == "1" ];then
|
||||
echo_date 使用nslookup方式解析SS服务器的ip地址,解析dns:$ss_basic_dnslookup_server
|
||||
server=`nslookup "$server" $ss_basic_dnslookup_server | sed '1,4d' | awk '{print $3}' | grep -v :|awk 'NR==1{print}'`
|
||||
else
|
||||
echo_date 使用resolveip方式解析SS服务器的ip地址.
|
||||
server=`resolveip -4 -t 2 $server|awk 'NR==1{print}'`
|
||||
fi
|
||||
|
||||
if [ ! -z "$server" ];then
|
||||
echo_date 【"$nick_name"】节点ip地址解析成功:$server
|
||||
else
|
||||
echo_date【警告】:【"$nick_name"】节点ip解析失败,将由haproxy自己尝试解析.
|
||||
server=`dbus get ssconf_basic_server_$node`
|
||||
fi
|
||||
else
|
||||
echo_date 检测到【"$nick_name"】节点已经是IP格式,跳过解析...
|
||||
fi
|
||||
fi
|
||||
weight=`dbus get ssconf_basic_weight_$node`
|
||||
up=`dbus get ss_lb_up`
|
||||
down=`dbus get ss_lb_down`
|
||||
interval=`dbus get ss_lb_interval`
|
||||
mode=`dbus get ssconf_basic_lbmode_$node`
|
||||
if [ "$mode" == "3" ];then
|
||||
echo_date 载入【"$nick_name"】作为备用节点...
|
||||
cat >> /jffs/softcenter/configs/haproxy.cfg <<-EOF
|
||||
server $name $server:$port weight $weight rise $up fall $down check inter $interval resolvers mydns backup
|
||||
EOF
|
||||
elif [ "$mode" == "2" ];then
|
||||
echo_date 载入【"$nick_name"】作为主用节点...
|
||||
cat >> /jffs/softcenter/configs/haproxy.cfg <<-EOF
|
||||
server $name $server:$port weight $weight rise $up fall $down check inter $interval resolvers mydns
|
||||
EOF
|
||||
else
|
||||
echo_date 载入【"$nick_name"】作为负载均衡节点...
|
||||
cat >> /jffs/softcenter/configs/haproxy.cfg <<-EOF
|
||||
server $name $server:$port weight $weight rise $up fall $down check inter $interval resolvers mydns
|
||||
EOF
|
||||
fi
|
||||
else
|
||||
#检测到这个节点是空的,可能是某一次的残留,用这个方式处理一下
|
||||
dbus remove ssconf_basic_use_lb_$node
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
echo_date 不启用故障转移心跳...
|
||||
lb_node=`dbus list ssconf_basic_use_lb_|sed 's/ssconf_basic_use_lb_//g' |cut -d "=" -f 1 | sort -n | sed '/^$/d'`
|
||||
for node in $lb_node
|
||||
do
|
||||
nick_name=`dbus get ssconf_basic_name_$node`
|
||||
if [ ! -z "$nick_name" ];then
|
||||
kcp=`dbus get ssconf_basic_use_kcp_$node`
|
||||
if [ "$kcp" == 1 ];then
|
||||
port="1091"
|
||||
name=`dbus get ssconf_basic_server_$node`:kcp
|
||||
server="127.0.0.1"
|
||||
else
|
||||
port=`dbus get ssconf_basic_port_$node`
|
||||
name=`dbus get ssconf_basic_server_$node`:$port
|
||||
server=`dbus get ssconf_basic_server_$node`
|
||||
IFIP=`echo $server|grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}|:"`
|
||||
if [ -z "$IFIP" ];then
|
||||
echo_date 检测到【"$nick_name"】节点域名格式,将尝试进行解析...
|
||||
if [ "$ss_basic_dnslookup" == "1" ];then
|
||||
echo_date 使用nslookup方式解析SS服务器的ip地址,解析dns:$ss_basic_dnslookup_server
|
||||
server=`nslookup "$server" $ss_basic_dnslookup_server | sed '1,4d' | awk '{print $3}' | grep -v :|awk 'NR==1{print}'`
|
||||
else
|
||||
echo_date 使用resolveip方式解析SS服务器的ip地址.
|
||||
server=`resolveip -4 -t 2 $server|awk 'NR==1{print}'`
|
||||
fi
|
||||
|
||||
if [ ! -z "$server" ];then
|
||||
echo_date 【"$nick_name"】节点ip地址解析成功:$server
|
||||
else
|
||||
echo_date 【"$nick_name"】节点ip解析失败,将由haproxy自己尝试解析...
|
||||
server=`dbus get ssconf_basic_server_$node`
|
||||
fi
|
||||
else
|
||||
echo_date 检测到【"$nick_name"】节点已经是IP格式,跳过解析...
|
||||
fi
|
||||
fi
|
||||
port=`dbus get ssconf_basic_port_$node`
|
||||
weight=`dbus get ssconf_basic_weight_$node`
|
||||
mode=`dbus get ssconf_basic_lbmode_$node`
|
||||
if [ "$mode" == "3" ];then
|
||||
echo_date 载入节点:"$nick_name",作为备用节点...
|
||||
cat >> /jffs/softcenter/configs/haproxy.cfg <<-EOF
|
||||
server $name $server:$port weight $weight resolvers mydns backup
|
||||
EOF
|
||||
elif [ "$mode" == "2" ];then
|
||||
echo_date 载入节点:"$nick_name",作为主节点...
|
||||
cat >> /jffs/softcenter/configs/haproxy.cfg <<-EOF
|
||||
server $name $server:$port weight $weight resolvers mydns
|
||||
EOF
|
||||
else
|
||||
echo_date 载入节点:"$nick_name",作为负载均衡节点...
|
||||
cat >> /jffs/softcenter/configs/haproxy.cfg <<-EOF
|
||||
server $name $server:$port weight $weight resolvers mydns
|
||||
EOF
|
||||
fi
|
||||
else
|
||||
#检测到这个节点是空的,可能是某一次的残留,用这个方式处理一下
|
||||
dbus remove ssconf_basic_use_lb_$node
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
start_haproxy(){
|
||||
pid=`pidof haproxy`
|
||||
if [ -z "$pid" ];then
|
||||
echo_date ┏启动haproxy主进程...
|
||||
echo_date ┣如果此处等待过久,可能服务器域名解析失败造成的!可以刷新页面后关闭一次SS!
|
||||
echo_date ┣然后进入附加设置-SS服务器地址解析,更改解析dns或者更换解析方式!
|
||||
echo_date ┗启动haproxy主进程...
|
||||
haproxy -f /koolshare/configs/haproxy.cfg
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
if [ "$ss_lb_enable" == "1" ];then
|
||||
killall haproxy >/dev/null 2>&1
|
||||
write_haproxy_cfg
|
||||
start_haproxy
|
||||
echo_date 成功!
|
||||
else
|
||||
killall haproxy >/dev/null 2>&1
|
||||
fi
|
70
shadowsocks/shadowsocks/scripts/ss_ping.sh
Executable file
70
shadowsocks/shadowsocks/scripts/ss_ping.sh
Executable file
@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
eval `dbus export ssconf_basic`
|
||||
|
||||
# flush previous ping value in the table
|
||||
pings=`dbus list ssconf_basic_ping | sort -n -t "_" -k 4|cut -d "=" -f 1`
|
||||
if [ ! -z "$pings" ];then
|
||||
for ping in $pings
|
||||
do
|
||||
dbus remove "$ping"
|
||||
done
|
||||
fi
|
||||
|
||||
# start testing
|
||||
if [ "$ssconf_basic_Ping_node" != "0" ];then
|
||||
server_mu="$ssconf_basic_Ping_node"
|
||||
server_address=`dbus get ssconf_basic_server_$server_mu`
|
||||
[ "$ssconf_basic_Ping_Method" == "5" ] && ping_text=`ping -4 $server_address -c 10 -w 10 -q`
|
||||
[ "$ssconf_basic_Ping_Method" == "6" ] && ping_text=`ping -4 $server_address -c 20 -w 20 -q`
|
||||
[ "$ssconf_basic_Ping_Method" == "7" ] && ping_text=`ping -4 $server_address -c 50 -w 50 -q`
|
||||
ping_time=`echo $ping_text | awk -F '/' '{print $4}'`
|
||||
ping_loss=`echo $ping_text | awk -F ', ' '{print $3}' | awk '{print $1}'`
|
||||
|
||||
if [ ! -z "$ping_time" ];then
|
||||
dbus set ssconf_basic_ping_"$server_mu"="$ping_time" ms / "$ping_loss"
|
||||
else
|
||||
dbus set ssconf_basic_ping_"$server_mu"="failed"
|
||||
fi
|
||||
else
|
||||
if [ "$ssconf_basic_Ping_Method" == "1" ];then
|
||||
servers=`dbus list ssconf_basic_server | sort -n -t "_" -k 4`
|
||||
for server in $servers
|
||||
do
|
||||
server_mu=`echo $server|cut -d "=" -f 1|cut -d "_" -f 4`
|
||||
server_address=`echo $server|cut -d "=" -f 2`
|
||||
ping_text=`ping -4 $server_address -c 10 -w 10 -q`
|
||||
ping_time=`echo $ping_text | awk -F '/' '{print $4}'`
|
||||
ping_loss=`echo $ping_text | awk -F ', ' '{print $3}' | awk '{print $1}'`
|
||||
|
||||
if [ ! -z "$ping_time" ];then
|
||||
dbus set ssconf_basic_ping_"$server_mu"="$ping_time" ms / "$ping_loss"
|
||||
else
|
||||
dbus set ssconf_basic_ping_"$server_mu"="failed"
|
||||
fi
|
||||
done
|
||||
else
|
||||
servers=`dbus list ssconf_basic_server | sort -n -t "_" -k 4`
|
||||
for server in $servers
|
||||
do
|
||||
{
|
||||
server_mu=`echo $server|cut -d "=" -f 1|cut -d "_" -f 4`
|
||||
server_address=`echo $server|cut -d "=" -f 2`
|
||||
[ "$ssconf_basic_Ping_Method" == "2" ] && ping_text=`ping -4 $server_address -c 10 -w 10 -q`
|
||||
[ "$ssconf_basic_Ping_Method" == "3" ] && ping_text=`ping -4 $server_address -c 20 -w 20 -q`
|
||||
[ "$ssconf_basic_Ping_Method" == "4" ] && ping_text=`ping -4 $server_address -c 50 -w 50 -q`
|
||||
ping_time=`echo $ping_text | awk -F '/' '{print $4}'`
|
||||
ping_loss=`echo $ping_text | awk -F ', ' '{print $3}' | awk '{print $1}'`
|
||||
|
||||
if [ ! -z "$ping_time" ];then
|
||||
dbus set ssconf_basic_ping_"$server_mu"="$ping_time" ms / "$ping_loss"
|
||||
else
|
||||
dbus set ssconf_basic_ping_"$server_mu"="failed"
|
||||
fi
|
||||
}&
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
15
shadowsocks/shadowsocks/scripts/ss_ping_remove.sh
Executable file
15
shadowsocks/shadowsocks/scripts/ss_ping_remove.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
eval `dbus export ssconf_basic`
|
||||
|
||||
# flush previous ping value in the table
|
||||
pings=`dbus list ssconf_basic_ping | sort -n -t "_" -k 4|cut -d "=" -f 1`
|
||||
if [ ! -z "$pings" ];then
|
||||
for ping in $pings
|
||||
do
|
||||
dbus remove "$ping"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
36
shadowsocks/shadowsocks/scripts/ss_prestart.sh
Executable file
36
shadowsocks/shadowsocks/scripts/ss_prestart.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
echo_date ----------------------- shadowsocks 启动前触发脚本 -----------------------
|
||||
lb_enable=`dbus get ss_lb_enable`
|
||||
if [ "$lb_enable" == "1" ];then
|
||||
if [ `dbus get ss_basic_server | grep -o "127.0.0.1"` ] && [ `dbus get ss_basic_port` == `dbus get ss_lb_port` ];then
|
||||
echo_date ss启动前触发:触发启动负载均衡功能!
|
||||
#start haproxy
|
||||
sh /jffs/softcenter/scripts/ss_lb_config.sh
|
||||
#start kcptun
|
||||
lb_node=`dbus list ssconf_basic_use_lb_|sed 's/ssconf_basic_use_lb_//g' |cut -d "=" -f 1 | sort -n`
|
||||
for node in $lb_node
|
||||
do
|
||||
name=`dbus get ssconf_basic_name_$node`
|
||||
kcp=`dbus get ssconf_basic_use_kcp_$node`
|
||||
kcp_server=`dbus get ssconf_basic_server_$node`
|
||||
# marked for change in future
|
||||
server_ip=`nslookup "$kcp_server" 119.29.29.29 | sed '1,4d' | awk '{print $3}' | grep -v :|awk 'NR==1{print}'`
|
||||
kcp_port=`dbus get ss_basic_kcp_port`
|
||||
kcp_para=`dbus get ss_basic_kcp_parameter`
|
||||
if [ "$kcp" == "1" ];then
|
||||
export GOGC=40
|
||||
start-stop-daemon -S -q -b -m -p /tmp/var/kcp.pid -x /jffs/softcenter/bin/client_linux_mips -- -l 127.0.0.1:1091 -r $server_ip:$kcp_port $kcp_para
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo_date ss启动前触发:未选择负载均衡节点,不触发负载均衡启动!
|
||||
fi
|
||||
else
|
||||
if [ `dbus get ss_basic_server | grep -o "127.0.0.1"` ] && [ `dbus get ss_basic_port` == `dbus get ss_lb_port` ];then
|
||||
echo_date ss启动前触发【警告】:你选择了负载均衡节点,但是负载均衡开关未启用!!
|
||||
else
|
||||
echo_date ss启动前触发:你选择了普通节点,不触发负载均衡启动!.
|
||||
fi
|
||||
fi
|
197
shadowsocks/shadowsocks/scripts/ss_proc_status.sh
Executable file
197
shadowsocks/shadowsocks/scripts/ss_proc_status.sh
Executable file
@ -0,0 +1,197 @@
|
||||
#!/bin/sh
|
||||
|
||||
eval `dbus export ss`
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
source helper.sh
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
get_mode_name() {
|
||||
case "$1" in
|
||||
1)
|
||||
echo "【gfwlist模式】"
|
||||
;;
|
||||
2)
|
||||
echo "【大陆白名单模式】"
|
||||
;;
|
||||
5)
|
||||
echo "【全局模式】"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_dns_name() {
|
||||
case "$1" in
|
||||
1)
|
||||
echo "dns2socks"
|
||||
;;
|
||||
2)
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
echo "ssr-tunnel"
|
||||
else
|
||||
echo "ss-tunnel"
|
||||
fi
|
||||
;;
|
||||
3)
|
||||
echo "dnscrypt-proxy"
|
||||
;;
|
||||
4)
|
||||
echo "pdnsd"
|
||||
;;
|
||||
5)
|
||||
if [ "$ss_chinadns_foreign_method" == "1" ];then
|
||||
echo "chinadns, 上游dns方案dns2socks"
|
||||
elif [ "$ss_chinadns_foreign_method" == "3" ];then
|
||||
echo "chinadns, 上游dns方案ss-tunnel"
|
||||
elif [ "$ss_chinadns_foreign_method" == "4" ];then
|
||||
echo "chinadns, 上游dns方案自定义"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
echo_version(){
|
||||
echo ① 程序版本(插件版本:3.3.4):
|
||||
echo -----------------------------------------------------------
|
||||
echo "程序 版本 备注"
|
||||
echo "ss-redir 3.0.6 2017年6月9日"
|
||||
echo "ss-tunnel 3.0.6 2017年6月9日"
|
||||
echo "ss-local 3.0.6 2017年6月9日"
|
||||
echo "obfs-local 0.0.3 2017年6月9日"
|
||||
echo "ssr-redir 2.5.6 with mbed TLS 2.4.0"
|
||||
echo "ssr-tunnel 2.5.6 with mbed TLS 2.4.0"
|
||||
echo "ssr-local 2.5.6 with mbed TLS 2.4.0"
|
||||
echo "haproxy 1.7.5 "
|
||||
echo "dns2socks V2.0 "
|
||||
echo "dnscrypt-proxy 1.6.0 "
|
||||
echo "ChinaDNS 1.3.2 "
|
||||
echo "pndsd 1.2.9a-par "
|
||||
echo -----------------------------------------------------------
|
||||
}
|
||||
|
||||
check_status(){
|
||||
#echo ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
SS_REDIR=`pidof ss-redir`
|
||||
SS_TUNNEL=`pidof ss-tunnel`
|
||||
SS_LOCAL=`ps|grep ss-local|grep 23456|awk '{print $1}'`
|
||||
SSR_REDIR=`pidof rss-redir`
|
||||
SSR_LOCAL=`ps|grep rss-local|grep 23456|awk '{print $1}'`
|
||||
SSR_TUNNEL=`pidof rss-tunnel`
|
||||
DNS2SOCKS=`pidof dns2socks`
|
||||
DNS_CRYPT=`pidof dnscrypt-proxy`
|
||||
PDNSD=`pidof pdnsd`
|
||||
CHINADNS=`pidof chinadns`
|
||||
HAPROXY=`pidof haproxy`
|
||||
CHINADNS=`pidof chinadns`
|
||||
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
echo_version
|
||||
echo
|
||||
echo ② 检测当前相关进程工作状态:(你正在使用SSR-libev,选择的模式是$(get_mode_name $ss_basic_mode),国外DNS解析方案是:$(get_dns_name $ss_dns_foreign))
|
||||
echo -----------------------------------------------------------
|
||||
echo "程序 状态 PID"
|
||||
[ -n "$SSR_REDIR" ] && echo "ssr-redir 工作中 pid:$SSR_REDIR" || echo "ssr-redir 未运行"
|
||||
else
|
||||
echo_version
|
||||
echo
|
||||
echo ② 检测当前相关进程工作状态:(你正在使用SS-libev,选择的模式是$(get_mode_name $ss_basic_mode),国外DNS解析方案是:$(get_dns_name $ss_dns_foreign))
|
||||
echo -----------------------------------------------------------
|
||||
echo "程序 状态 PID"
|
||||
[ -n "$SS_REDIR" ] && echo "ss-redir 工作中 pid:$SS_REDIR" || echo "ss-redir 未运行"
|
||||
fi
|
||||
if [ "$ss_basic_server" == "127.0.0.1" ];then
|
||||
[ -n "$HAPROXY" ] && echo "haproxy 工作中 pid:$HAPROXY" || echo "haproxy 未运行"
|
||||
fi
|
||||
if [ "$ss_dns_foreign" == "1" ];then
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
[ -n "$SSR_LOCAL" ] && echo "ssr-local 工作中 pid:$SSR_LOCAL" || echo "ssr-local 未运行"
|
||||
[ -n "$DNS2SOCKS" ] && echo "dns2socks 工作中 pid:$DNS2SOCKS" || echo "dns2socks 未运行"
|
||||
else
|
||||
[ -n "$SS_LOCAL" ] && echo "ss-local 工作中 pid:$SS_LOCAL" || echo "ss-local 未运行"
|
||||
[ -n "$DNS2SOCKS" ] && echo "dns2socks 工作中 pid:$DNS2SOCKS" || echo "dns2socks 未运行"
|
||||
fi
|
||||
elif [ "$ss_dns_foreign" == "2" ];then
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
[ -n "$SSR_TUNNEL" ] && echo "ssr-tunnel 工作中 pid:$SSR_TUNNEL" || echo "ssr-tunnel 未运行"
|
||||
else
|
||||
[ -n "$SS_TUNNEL" ] && echo "ss-tunnel 工作中 pid:$SS_TUNNEL" || echo "ss-tunnel 未运行"
|
||||
fi
|
||||
elif [ "$ss_dns_foreign" == "3" ];then
|
||||
[ -n "$DNS_CRYPT" ] && echo "dnscrypt-proxy 工作中 pid:$DNS_CRYPT" || echo "dnscrypt-proxy 未运行"
|
||||
elif [ "$ss_dns_foreign" == "4" ];then
|
||||
if [ "$ss_pdnsd_method" == "1" ];then
|
||||
if [ "$ss_pdnsd_udp_server" == "1" ];then
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
[ -n "$SSR_LOCAL" ] && echo "ssr-local 工作中 pid:$SSR_LOCAL" || echo "ssr-local 未运行"
|
||||
[ -n "$DNS2SOCKS" ] && echo "dns2socks 工作中 pid:$DNS2SOCKS" || echo "dns2socks 未运行"
|
||||
else
|
||||
[ -n "$SS_LOCAL" ] && echo "ss-local 工作中 pid:$SS_LOCAL" || echo "ss-local 未运行"
|
||||
[ -n "$DNS2SOCKS" ] && echo "dns2socks 工作中 pid:$DNS2SOCKS" || echo "dns2socks 未运行"
|
||||
fi
|
||||
elif [ "$ss_pdnsd_udp_server" == "3" ];then
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
[ -n "$SSR_TUNNEL" ] && echo "ssr-tunnel 工作中 pid:$SSR_TUNNEL" || echo "ssr-tunnel 未运行"
|
||||
else
|
||||
[ -n "$SS_TUNNEL" ] && echo "ss-tunnel 工作中 pid:$SS_TUNNEL" || echo "ss-tunnel 未运行"
|
||||
fi
|
||||
elif [ "$ss_pdnsd_udp_server" == "2" ];then
|
||||
[ -n "$DNS_CRYPT" ] && echo "dnscrypt-proxy 工作中 pid:$DNS_CRYPT" || echo "dnscrypt-proxy 未运行"
|
||||
fi
|
||||
fi
|
||||
[ -n "$PDNSD" ] && echo "pdnsd 工作中 pid:$PDNSD" || echo "pdnsd 未运行"
|
||||
|
||||
elif [ "$ss_dns_foreign" == "5" ];then
|
||||
if [ "$ss_chinadns_foreign_method" == "1" ];then
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
[ -n "$SSR_LOCAL" ] && echo "ssr-local 工作中 pid:$SSR_LOCAL" || echo "ssr-local 未运行"
|
||||
[ -n "$DNS2SOCKS" ] && echo "dns2socks 工作中 pid:$DNS2SOCKS" || echo "dns2socks 未运行"
|
||||
else
|
||||
[ -n "$SS_LOCAL" ] && echo "ss-local 工作中 pid:$SS_LOCAL" || echo "ss-local 未运行"
|
||||
[ -n "$DNS2SOCKS" ] && echo "dns2socks 工作中 pid:$DNS2SOCKS" || echo "dns2socks 未运行"
|
||||
fi
|
||||
elif [ "$ss_chinadns_foreign_method" == "2" ];then
|
||||
[ -n "$DNS_CRYPT" ] && echo "dnscrypt-proxy 工作中 pid:$DNS_CRYPT" || echo "dnscrypt-proxy 未运行"
|
||||
elif [ "$ss_chinadns_foreign_method" == "3" ];then
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
[ -n "$SSR_TUNNEL" ] && echo "ssr-tunnel 工作中 pid:$SSR_TUNNEL" || echo "ssr-tunnel 未运行"
|
||||
else
|
||||
[ -n "$SS_TUNNEL" ] && echo "ss-tunnel 工作中 pid:$SS_TUNNEL" || echo "ss-tunnel 未运行"
|
||||
fi
|
||||
fi
|
||||
[ -n "$CHINADNS" ] && echo "chinadns 工作中 pid:$CHINADNS" || echo "chinadns 未运行"
|
||||
fi
|
||||
|
||||
echo -----------------------------------------------------------
|
||||
echo
|
||||
echo
|
||||
echo ③ 检测iptbales工作状态:
|
||||
#echo ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
echo ----------------------------------------------------- nat表 PREROUTING 链 --------------------------------------------------------
|
||||
iptables -nvL PREROUTING -t nat
|
||||
echo
|
||||
echo ----------------------------------------------------- nat表 OUTPUT 链 ------------------------------------------------------------
|
||||
iptables -nvL OUTPUT -t nat
|
||||
echo
|
||||
echo ----------------------------------------------------- nat表 SHADOWSOCKS 链 --------------------------------------------------------
|
||||
iptables -nvL SHADOWSOCKS -t nat
|
||||
echo
|
||||
echo ----------------------------------------------------- nat表 SHADOWSOCKS_GFW 链 ----------------------------------------------------
|
||||
iptables -nvL SHADOWSOCKS_GFW -t nat
|
||||
echo
|
||||
echo ----------------------------------------------------- nat表 SHADOWSOCKS_CHN 链 -----------------------------------------------------
|
||||
iptables -nvL SHADOWSOCKS_CHN -t nat
|
||||
echo
|
||||
echo ----------------------------------------------------- nat表 SHADOWSOCKS_GLO 链 -----------------------------------------------------
|
||||
iptables -nvL SHADOWSOCKS_GLO -t nat
|
||||
echo
|
||||
echo ----------------------------------------------------- nat表 SHADOWSOCKS_HOM 链 -----------------------------------------------------
|
||||
iptables -nvL SHADOWSOCKS_HOM -t nat
|
||||
echo -----------------------------------------------------------------------------------------------------------------------------------
|
||||
echo
|
||||
}
|
||||
|
||||
if [ "$ss_basic_enable" == "1" ];then
|
||||
check_status > /tmp/ss_proc_status.log 2>&1
|
||||
else
|
||||
echo 插件尚未启用!
|
||||
fi
|
||||
echo XU6J03M6 >> /tmp/ss_proc_status.log
|
145
shadowsocks/shadowsocks/scripts/ss_rule_update.sh
Executable file
145
shadowsocks/shadowsocks/scripts/ss_rule_update.sh
Executable file
@ -0,0 +1,145 @@
|
||||
#!/bin/sh
|
||||
eval `dbus export ss`
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
# version dectet
|
||||
version_gfwlist1=$(cat /jffs/softcenter/ss/rules/version | sed -n 1p | sed 's/ /\n/g'| sed -n 1p)
|
||||
version_chnroute1=$(cat /jffs/softcenter/ss/rules/version | sed -n 2p | sed 's/ /\n/g'| sed -n 1p)
|
||||
version_cdn1=$(cat /jffs/softcenter/ss/rules/version | sed -n 4p | sed 's/ /\n/g'| sed -n 1p)
|
||||
|
||||
echo ====================================================================================================
|
||||
echo_date 开始更新shadowsocks规则,请等待...
|
||||
wget --no-check-certificate --timeout=8 -qO - https://raw.githubusercontent.com/paldier/softcenter/master/maintain_files/version1 > /tmp/version1
|
||||
if [ "$?" == "0" ]; then
|
||||
echo_date 检测到在线版本文件,继续...
|
||||
else
|
||||
echo_date 没有检测到在线版本欸,可能是访问github有问题,去大陆白名单模式试试吧!
|
||||
rm -rf /tmp/version1
|
||||
exit
|
||||
fi
|
||||
|
||||
online_content=$(cat /tmp/version1)
|
||||
if [ -z "$online_content" ];then
|
||||
rm -rf /tmp/version1
|
||||
fi
|
||||
|
||||
git_line1=$(cat /tmp/version1 | sed -n 1p)
|
||||
git_line2=$(cat /tmp/version1 | sed -n 2p)
|
||||
git_line4=$(cat /tmp/version1 | sed -n 4p)
|
||||
|
||||
version_gfwlist2=$(echo $git_line1 | sed 's/ /\n/g'| sed -n 1p)
|
||||
version_chnroute2=$(echo $git_line2 | sed 's/ /\n/g'| sed -n 1p)
|
||||
version_cdn2=$(echo $git_line4 | sed 's/ /\n/g'| sed -n 1p)
|
||||
|
||||
md5sum_gfwlist2=$(echo $git_line1 | sed 's/ /\n/g'| tail -n 2 | head -n 1)
|
||||
md5sum_chnroute2=$(echo $git_line2 | sed 's/ /\n/g'| tail -n 2 | head -n 1)
|
||||
md5sum_cdn2=$(echo $git_line4 | sed 's/ /\n/g'| tail -n 2 | head -n 1)
|
||||
|
||||
# update gfwlist
|
||||
if [ "$ss_basic_gfwlist_update" == "1" ];then
|
||||
if [ ! -z "$version_gfwlist2" ];then
|
||||
if [ "$version_gfwlist1" != "$version_gfwlist2" ];then
|
||||
echo_date 检测到新版本gfwlist,开始更新...
|
||||
echo_date 下载gfwlist到临时文件...
|
||||
wget --no-check-certificate --timeout=8 -qO - https://raw.githubusercontent.com/paldier/softcenter/master/maintain_files/gfwlist.conf > /tmp/gfwlist.conf
|
||||
md5sum_gfwlist1=$(md5sum /tmp/gfwlist.conf | sed 's/ /\n/g'| sed -n 1p)
|
||||
if [ "$md5sum_gfwlist1"x = "$md5sum_gfwlist2"x ];then
|
||||
echo_date 下载完成,校验通过,将临时文件覆盖到原始gfwlist文件
|
||||
mv /tmp/gfwlist.conf /jffs/softcenter/ss/rules/gfwlist.conf
|
||||
sed -i "1s/.*/$git_line1/" /jffs/softcenter/ss/rules/version
|
||||
reboot="1"
|
||||
echo_date 你的gfwlist已经更新到最新了哦~
|
||||
else
|
||||
echo_date 下载完成,但是校验没有通过!
|
||||
fi
|
||||
else
|
||||
echo_date 检测到gfwlist本地版本号和在线版本号相同,那还更新个毛啊!
|
||||
fi
|
||||
else
|
||||
echo_date gfwlist文件下载失败!
|
||||
fi
|
||||
else
|
||||
echo_date 然而你并没有勾选gfwlist更新!
|
||||
fi
|
||||
|
||||
|
||||
# update chnroute
|
||||
if [ "$ss_basic_chnroute_update" == "1" ];then
|
||||
if [ ! -z "$version_chnroute2" ];then
|
||||
if [ "$version_chnroute1" != "$version_chnroute2" ];then
|
||||
echo_date 检测到新版本chnroute,开始更新...
|
||||
echo_date 下载chnroute到临时文件...
|
||||
wget --no-check-certificate --timeout=8 -qO - https://raw.githubusercontent.com/paldier/softcenter/master/maintain_files/chnroute.txt > /tmp/chnroute.txt
|
||||
md5sum_chnroute1=$(md5sum /tmp/chnroute.txt | sed 's/ /\n/g'| sed -n 1p)
|
||||
if [ "$md5sum_chnroute1"x = "$md5sum_chnroute2"x ];then
|
||||
echo_date 下载完成,校验通过,将临时文件覆盖到原始chnroute文件
|
||||
mv /tmp/chnroute.txt /jffs/softcenter/ss/rules/chnroute.txt
|
||||
sed -i "2s/.*/$git_line2/" /jffs/softcenter/ss/rules/version
|
||||
reboot="1"
|
||||
echo_date 你的chnroute已经更新到最新了哦~
|
||||
else
|
||||
echo_date md5sum 下载完成,但是校验没有通过!
|
||||
fi
|
||||
else
|
||||
echo_date 检测到chnroute本地版本号和在线版本号相同,那还更新个毛啊!
|
||||
fi
|
||||
else
|
||||
echo_date file chnroute文件下载失败!
|
||||
fi
|
||||
else
|
||||
echo_date 然而你并没有勾选chnroute更新!
|
||||
fi
|
||||
|
||||
# update cdn file
|
||||
if [ "$ss_basic_cdn_update" == "1" ];then
|
||||
if [ ! -z "$version_cdn2" ];then
|
||||
if [ "$version_cdn1" != "$version_cdn2" ];then
|
||||
echo_date 检测到新版本cdn名单,开始更新...
|
||||
echo_date 下载cdn名单到临时文件...
|
||||
wget --no-check-certificate --timeout=8 -qO - https://raw.githubusercontent.com/paldier/softcenter/master/maintain_files/cdn.txt > /tmp/cdn.txt
|
||||
md5sum_cdn1=$(md5sum /tmp/cdn.txt | sed 's/ /\n/g'| sed -n 1p)
|
||||
if [ "$md5sum_cdn1"x = "$md5sum_cdn2"x ];then
|
||||
echo_date 下载完成,校验通过,将临时文件覆盖到原始cdn名单文件
|
||||
mv /tmp/cdn.txt /jffs/softcenter/ss/rules/cdn.txt
|
||||
sed -i "4s/.*/$git_line4/" /jffs/softcenter/ss/rules/version
|
||||
reboot="1"
|
||||
echo_date 你的cdn名单已经更新到最新了哦~
|
||||
else
|
||||
echo_date 下载完成,但是校验没有通过!
|
||||
fi
|
||||
else
|
||||
echo_date 检测到cdn名单本地版本号和在线版本号相同,那还更新个毛啊!
|
||||
fi
|
||||
else
|
||||
echo_date file cdn名单文件下载失败!
|
||||
fi
|
||||
else
|
||||
echo_date 然而你并没有勾选cdn名单更新!
|
||||
fi
|
||||
|
||||
|
||||
rm -rf /tmp/gfwlist.conf1
|
||||
rm -rf /tmp/chnroute.txt1
|
||||
rm -rf /tmp/cdn.txt1
|
||||
rm -rf /tmp/version1
|
||||
|
||||
echo_date Shadowsocks更新进程运行完毕!
|
||||
# write number
|
||||
nvram set update_ipset="$(cat /jffs/softcenter/ss/rules/version | sed -n 1p | sed 's/#/\n/g'| sed -n 1p)"
|
||||
nvram set update_chnroute="$(cat /jffs/softcenter/ss/rules/version | sed -n 2p | sed 's/#/\n/g'| sed -n 1p)"
|
||||
nvram set update_cdn="$(cat /jffs/softcenter/ss/rules/version | sed -n 4p | sed 's/#/\n/g'| sed -n 1p)"
|
||||
nvram set ipset_numbers=$(cat /jffs/softcenter/ss/rules/gfwlist.conf | grep -c ipset)
|
||||
nvram set chnroute_numbers=$(cat /jffs/softcenter/ss/rules/chnroute.txt | grep -c .)
|
||||
nvram set cdn_numbers=$(cat /jffs/softcenter/ss/rules/cdn.txt | grep -c .)
|
||||
|
||||
# reboot ss
|
||||
if [ "$reboot" == "1" ];then
|
||||
echo_date 自动重启shadowsocks,以应用新的规则文件!请稍后!
|
||||
dbus set ss_basic_action=1
|
||||
sh /jffs/softcenter/ss/ssconfig.sh restart
|
||||
fi
|
||||
echo ====================================================================================================
|
||||
exit
|
||||
|
3
shadowsocks/shadowsocks/scripts/ss_socks5.sh
Executable file
3
shadowsocks/shadowsocks/scripts/ss_socks5.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
/jffs/softcenter/ss/socks5/socks5config.sh restart
|
5
shadowsocks/shadowsocks/scripts/ss_update.sh
Executable file
5
shadowsocks/shadowsocks/scripts/ss_update.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
eval `dbus export ss`
|
||||
|
||||
sh /jffs/softcenter/ss/ssconfig.sh update
|
94
shadowsocks/shadowsocks/scripts/ss_webtest.sh
Executable file
94
shadowsocks/shadowsocks/scripts/ss_webtest.sh
Executable file
@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
eval `dbus export ssconf_basic`
|
||||
|
||||
# flush previous test value in the table
|
||||
webtest=`dbus list ssconf_basic_webtest_ | sort -n -t "_" -k 4|cut -d "=" -f 1`
|
||||
if [ ! -z "$webtest" ];then
|
||||
for line in $webtest
|
||||
do
|
||||
dbus remove "$line"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
start_webtest(){
|
||||
array1=`dbus get ssconf_basic_server_$nu`
|
||||
array2=`dbus get ssconf_basic_port_$nu`
|
||||
array3=`dbus get ssconf_basic_password_$nu|base64 -d`
|
||||
array4=`dbus get ssconf_basic_method_$nu`
|
||||
array5=`dbus get ssconf_basic_use_rss_$nu`
|
||||
array6=`dbus get ssconf_basic_onetime_auth_$nu`
|
||||
array7=`dbus get ssconf_basic_rss_protocol_$nu`
|
||||
array8=`dbus get ssconf_basic_rss_obfs_$nu`
|
||||
array9=`dbus get ssconf_basic_ss_obfs_$nu`
|
||||
array10=`dbus get ssconf_basic_ss_obfs_host_$nu`
|
||||
array11=`dbus get ssconf_basic_mode_$nu`
|
||||
|
||||
[ $array6 -ne 1 ] && ARG_OTA="" || ARG_OTA="-A";
|
||||
if [ "$array10" != "" ];then
|
||||
if [ "$array9" == "http" ];then
|
||||
ARG_OBFS="--obfs http --obfs-host $array10"
|
||||
elif [ "$array9" == "tls" ];then
|
||||
ARG_OBFS="--obfs tls --obfs-host $array10"
|
||||
else
|
||||
ARG_OBFS=""
|
||||
fi
|
||||
else
|
||||
if [ "$array9" == "http" ];then
|
||||
ARG_OBFS="--obfs http"
|
||||
elif [ "$array9" == "tls" ];then
|
||||
ARG_OBFS="--obfs tls"
|
||||
else
|
||||
ARG_OBFS=""
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$array11" == "1" ] || [ "$array11" == "2" ] || [ "$array11" == "3" ] || [ "$array11" == "5" ];then
|
||||
if [ "$array5" == "1" ];then
|
||||
cat > /tmp/tmp_ss.json <<-EOF
|
||||
{
|
||||
"server":"$array1",
|
||||
"server_port":$array2,
|
||||
"local_port":23458,
|
||||
"password":"$array3",
|
||||
"timeout":600,
|
||||
"protocol":"$array7",
|
||||
"obfs":"$array8",
|
||||
"method":"$array4"
|
||||
}
|
||||
EOF
|
||||
rss-local -b 0.0.0.0 -l 23458 -c /tmp/tmp_ss.json -u -f /var/run/sslocal2.pid >/dev/null 2>&1
|
||||
result=`curl -o /dev/null -s -w %{time_total}:%{speed_download} --socks5-hostname 127.0.0.1:23458 $ssconf_basic_test_domain`
|
||||
# result=`curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download} --socks5-hostname 127.0.0.1:23456 https://www.google.com/`
|
||||
sleep 1
|
||||
dbus set ssconf_basic_webtest_$nu=$result
|
||||
sleep 1
|
||||
kill -9 `ps|grep ss-local|grep 23458|awk '{print $1}'`
|
||||
rm -rf /tmp/tmp_ss.json
|
||||
else
|
||||
ss-local -b 0.0.0.0 -l 23458 -s $array1 -p $array2 -k $array3 -m $array4 -u $ARG_OTA $ARG_OBFS -f /var/run/sslocal3.pid >/dev/null 2>&1
|
||||
result=`curl -o /dev/null -s -w %{time_total}:%{speed_download} --socks5-hostname 127.0.0.1:23458 $ssconf_basic_test_domain`
|
||||
sleep 1
|
||||
dbus set ssconf_basic_webtest_$nu=$result
|
||||
sleep 1
|
||||
kill -9 `ps|grep ss-local|grep 23458|awk '{print $1}'`
|
||||
fi
|
||||
else
|
||||
dbus set ssconf_basic_webtest_$nu="failed"
|
||||
fi
|
||||
}
|
||||
|
||||
# start testing
|
||||
if [ "$ssconf_basic_test_node" != "0" ];then
|
||||
nu="$ssconf_basic_test_node"
|
||||
start_webtest
|
||||
else
|
||||
server_nu=`dbus list ssconf_basic_server | sort -n -t "_" -k 4|cut -d "=" -f 1|cut -d "_" -f 4`
|
||||
for nu in $server_nu
|
||||
do
|
||||
start_webtest
|
||||
done
|
||||
fi
|
13
shadowsocks/shadowsocks/scripts/ss_webtest_remove.sh
Executable file
13
shadowsocks/shadowsocks/scripts/ss_webtest_remove.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
eval `dbus export ssconf_basic`
|
||||
|
||||
# flush previous test value in the table
|
||||
webtest=`dbus list ssconf_basic_webtest_ | sort -n -t "_" -k 4|cut -d "=" -f 1`
|
||||
if [ ! -z "$webtest" ];then
|
||||
for line in $webtest
|
||||
do
|
||||
dbus remove "$line"
|
||||
done
|
||||
fi
|
||||
|
10
shadowsocks/shadowsocks/ss/cru/china.sh
Executable file
10
shadowsocks/shadowsocks/ss/cru/china.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
/usr/sbin/wget -4 --spider --quiet --tries=2 --timeout=2 www.baidu.com
|
||||
if [ "$?" == "0" ]; then
|
||||
log='[ '$LOGTIME' ] working...'
|
||||
else
|
||||
log='[ '$LOGTIME' ] Problem detected!'
|
||||
fi
|
||||
nvram set ss_china_state="$log"
|
||||
#dbus ram ss_basic_state_china="$log"
|
13
shadowsocks/shadowsocks/ss/cru/foreign.sh
Executable file
13
shadowsocks/shadowsocks/ss/cru/foreign.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
server_ip=`nslookup "facebook.com" 127.0.0.1 | sed '1,4d' | awk '{print $3}' | grep -v :|awk 'NR==1{print}'`
|
||||
/usr/sbin/wget -4 --spider --quiet --tries=2 --timeout=2 $server_ip
|
||||
|
||||
if [ "$?" == "0" ]; then
|
||||
log='[ '$LOGTIME' ] working...'
|
||||
else
|
||||
log='[ '$LOGTIME' ] Problem detected!'
|
||||
fi
|
||||
|
||||
nvram set ss_foreign_state="$log"
|
||||
#dbus ram ss_basic_state_foreign="$log"
|
4
shadowsocks/shadowsocks/ss/cru/version
Executable file
4
shadowsocks/shadowsocks/ss/cru/version
Executable file
@ -0,0 +1,4 @@
|
||||
2016-08-21-2 # dce75ad554bf8bcec63da1d92f5a6a00 gfwlist
|
||||
2016-08-21 # 5e91c37d2a2dd2d9f88555413af6faa0 chnroute
|
||||
2016-02-26 # 7c8569e96bc6893a146d5e093a3b0434 adblock
|
||||
2016-04-27 # 2bdbabfedb7cd8bdee596525079c8b0b cdn
|
275
shadowsocks/shadowsocks/ss/nat-start.sh
Executable file
275
shadowsocks/shadowsocks/ss/nat-start.sh
Executable file
@ -0,0 +1,275 @@
|
||||
#!/bin/sh
|
||||
eval `dbus export ss`
|
||||
lan_ipaddr=$(nvram get lan_ipaddr)
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
flush_nat(){
|
||||
echo_date 尝试先清除已存在的iptables规则,防止重复添加
|
||||
# flush rules and set if any
|
||||
iptables -t nat -D PREROUTING -p tcp -j SHADOWSOCKS >/dev/null 2>&1
|
||||
sleep 1
|
||||
iptables -t nat -F SHADOWSOCKS > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS > /dev/null 2>&1
|
||||
iptables -t nat -F SHADOWSOCKS_GFW > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS_GFW > /dev/null 2>&1
|
||||
iptables -t nat -F SHADOWSOCKS_CHN > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS_CHN > /dev/null 2>&1
|
||||
iptables -t nat -F SHADOWSOCKS_GLO > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS_GLO > /dev/null 2>&1
|
||||
iptables -t nat -F SHADOWSOCKS_HOM > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS_HOM > /dev/null 2>&1
|
||||
iptables -t nat -D OUTPUT -p tcp -m set --set router dst -j REDIRECT --to-ports 3333 >/dev/null 2>&1
|
||||
iptables -t nat -D PREROUTING -p udp --dport 53 -j DNAT --to $lan_ipaddr >/dev/null 2>&1
|
||||
}
|
||||
|
||||
flush_ipset(){
|
||||
echo_date 先清空已存在的ipset名单,防止重复添加
|
||||
ipset -F chnroute >/dev/null 2>&1 && ipset -X chnroute >/dev/null 2>&1
|
||||
ipset -F white_ip >/dev/null 2>&1 && ipset -X white_ip >/dev/null 2>&1
|
||||
ipset -F white_cidr >/dev/null 2>&1 && ipset -X white_cidr >/dev/null 2>&1
|
||||
ipset -F black_ip >/dev/null 2>&1 && ipset -X black_ip >/dev/null 2>&1
|
||||
ipset -F black_cidr >/dev/null 2>&1 && ipset -X black_cidr >/dev/null 2>&1
|
||||
ipset -F gfwlist >/dev/null 2>&1 && ipset -X gfwlist >/dev/null 2>&1
|
||||
ipset -F router >/dev/null 2>&1 && ipset -X router >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# creat ipset rules
|
||||
creat_ipset(){
|
||||
echo_date 创建ipset名单
|
||||
ipset -N white_ip iphash
|
||||
ipset -N white_cidr nethash
|
||||
ipset -N black_ip iphash
|
||||
ipset -N black_cidr nethash
|
||||
ipset -N gfwlist iphash
|
||||
ipset -N router iphash
|
||||
#ipset -N chnroute nethash
|
||||
sed -e "s/^/-A chnroute &/g" -e "1 i\-N chnroute nethash --hashsize 81920" /jffs/softcenter/ss/rules/chnroute.txt | awk '{print $0} END{print "COMMIT"}' | ipset -R
|
||||
}
|
||||
|
||||
add_white_black_ip(){
|
||||
# black cidr for telegram
|
||||
ip_tg="149.154.0.0/16 91.108.4.0/22 91.108.56.0/24 109.239.140.0/24 67.198.55.0/24"
|
||||
for ip in $ip_tg
|
||||
do
|
||||
ipset -A black_cidr $ip >/dev/null 2>&1
|
||||
done
|
||||
# black ip/cidr for user defined in the web
|
||||
if [ -n "$ss_wan_black_ip" ];then
|
||||
#ss_wan_black_ip=`dbus get ss_wan_black_ip|base64 -d|sed '/\#/d'`
|
||||
ip_format=`echo $ss_wan_black_ip|base64 -d|sed '/\#/d'|grep -v "/"`
|
||||
cidr_format=`echo $ss_wan_black_ip|base64 -d|sed '/\#/d'|grep "/"`
|
||||
|
||||
if [ -n "$ip_format" ];then
|
||||
echo_date 应用IP黑名单
|
||||
for ip in "$ip_format"
|
||||
do
|
||||
ipset -A black_ip "$ip" >/dev/null 2>&1
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$cidr_format" ];then
|
||||
echo_date 应用CIDR黑名单
|
||||
for cidr in "$cidr_format"
|
||||
do
|
||||
ipset -A black_cidr "$cidr" >/dev/null 2>&1
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# white ip/cidr
|
||||
ip1=$(nvram get wan0_ipaddr | cut -d"." -f1,2)
|
||||
[ -n "$ss_basic_server_ip" ] && SERVER_IP=$ss_basic_server_ip || SERVER_IP=""
|
||||
ISP_DNS1=$(nvram get wan0_dns|sed 's/ /\n/g'|grep -v 0.0.0.0|grep -v 127.0.0.1|sed -n 1p)
|
||||
ISP_DNS2=$(nvram get wan0_dns|sed 's/ /\n/g'|grep -v 0.0.0.0|grep -v 127.0.0.1|sed -n 2p)
|
||||
|
||||
cidr_lan="0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 169.254.0.0/16 172.16.0.0/12 192.168.0.0/16 224.0.0.0/4 240.0.0.0/4 $ip1.0.0/16"
|
||||
ip_lan="$SERVER_IP 223.5.5.5 223.6.6.6 114.114.114.114 114.114.115.115 1.2.4.8 210.2.4.8 112.124.47.27 114.215.126.16 180.76.76.76 119.29.29.29 $ISP_DNS1 $ISP_DNS2"
|
||||
for ip in $ip_lan
|
||||
do
|
||||
ipset -A white_ip $ip >/dev/null 2>&1
|
||||
done
|
||||
|
||||
for cidr in $cidr_lan
|
||||
do
|
||||
ipset -A white_cidr $cidr >/dev/null 2>&1
|
||||
done
|
||||
|
||||
# white ip/cidr for user defined in the web
|
||||
if [ -n "$ss_wan_white_ip" ];then
|
||||
ip_format=`echo $ss_wan_white_ip|base64 -d|sed '/\#/d'|grep -v "/"`
|
||||
cidr_format=`echo $ss_wan_white_ip|base64 -d|sed '/\#/d'|grep "/"`
|
||||
|
||||
if [ -n "$ip_format" ];then
|
||||
echo_date 应用IP白名单
|
||||
for ip in "$ip_format"
|
||||
do
|
||||
ipset -A white_ip "$ip" >/dev/null 2>&1
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$cidr_format" ];then
|
||||
echo_date 应用CIDR白名单
|
||||
for cidr in "$cidr_format"
|
||||
do
|
||||
ipset -A white_cidr "$cidr" >/dev/null 2>&1
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
get_action_chain() {
|
||||
case "$1" in
|
||||
0)
|
||||
echo "RETURN"
|
||||
;;
|
||||
1)
|
||||
echo "SHADOWSOCKS_GFW"
|
||||
;;
|
||||
2)
|
||||
echo "SHADOWSOCKS_CHN"
|
||||
;;
|
||||
5)
|
||||
echo "SHADOWSOCKS_GLO"
|
||||
;;
|
||||
6)
|
||||
echo "SHADOWSOCKS_HOM"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_mode_name() {
|
||||
case "$1" in
|
||||
0)
|
||||
echo "不通过SS"
|
||||
;;
|
||||
1)
|
||||
echo "gfwlist模式"
|
||||
;;
|
||||
2)
|
||||
echo "大陆白名单模式"
|
||||
;;
|
||||
5)
|
||||
echo "全局模式"
|
||||
;;
|
||||
6)
|
||||
echo "回国模式"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
factor(){
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
echo ""
|
||||
else
|
||||
echo "$2 $1"
|
||||
fi
|
||||
}
|
||||
|
||||
get_jump_mode(){
|
||||
case "$1" in
|
||||
0)
|
||||
echo "j"
|
||||
;;
|
||||
*)
|
||||
echo "g"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
lan_acess_control(){
|
||||
# lan access control
|
||||
acl_nu=`dbus list ss_acl_mode|sed 1d|sort -n -t "=" -k 2|cut -d "=" -f 1 | cut -d "_" -f 4`
|
||||
if [ -n "$acl_nu" ]; then
|
||||
for acl in $acl_nu
|
||||
do
|
||||
ipaddr=`dbus get ss_acl_ip_$acl`
|
||||
ports=`dbus get ss_acl_port_$acl`
|
||||
[ "$ports" == "all" ] && ports=""
|
||||
proxy_mode=`dbus get ss_acl_mode_$acl`
|
||||
proxy_name=`dbus get ss_acl_name_$acl`
|
||||
[ "$ports" == "" ] && echo_date 加载ACL规则:$ipaddr:all模式为:$(get_mode_name $proxy_mode) || echo_date 加载ACL规则:$ipaddr:$ports模式为:$(get_mode_name $proxy_mode)
|
||||
iptables -t nat -A SHADOWSOCKS $(factor $ipaddr "-s") -p tcp $(factor $ports "-m multiport --dport") -$(get_jump_mode $proxy_mode) $(get_action_chain $proxy_mode)
|
||||
[ "$proxy_mode" == "3" ] || [ "$proxy_mode" == "4" ] && \
|
||||
iptables -t mangle -A SHADOWSOCKS $(factor $ipaddr "-s") -p udp $(factor $ports "-m multiport --dport") -$(get_jump_mode $proxy_mode) $(get_action_chain $proxy_mode)
|
||||
done
|
||||
|
||||
if [ -n "ss_acl_default_mode=" ];then
|
||||
echo_date 加载ACL规则:其余主机模式为:$(get_mode_name $ss_acl_default_mode)
|
||||
else
|
||||
echo_date 加载ACL规则:其余主机模式为:$(get_mode_name $ss_basic_mode)
|
||||
dbus set ss_acl_default_mode="$ss_basic_mode"
|
||||
fi
|
||||
else
|
||||
ss_acl_default_mode=$ss_basic_mode
|
||||
echo_date 加载ACL规则:所有模式为:$(get_mode_name $ss_basic_mode)
|
||||
fi
|
||||
}
|
||||
|
||||
apply_nat_rules(){
|
||||
#----------------------BASIC RULES---------------------
|
||||
echo_date 写入iptables规则到nat表中...
|
||||
iptables -t nat -N SHADOWSOCKS
|
||||
iptables -t nat -A SHADOWSOCKS -p tcp -m set --set white_ip dst -j RETURN
|
||||
iptables -t nat -A SHADOWSOCKS -p tcp -m set --set white_cidr dst -j RETURN
|
||||
#-----------------------FOR GLOABLE---------------------
|
||||
iptables -t nat -N SHADOWSOCKS_GLO
|
||||
iptables -t nat -A SHADOWSOCKS_GLO -p tcp -j REDIRECT --to-ports 3333
|
||||
#-----------------------FOR GFWLIST---------------------
|
||||
iptables -t nat -N SHADOWSOCKS_GFW
|
||||
iptables -t nat -A SHADOWSOCKS_GFW -p tcp -m set --set black_ip dst -j REDIRECT --to-ports 3333
|
||||
iptables -t nat -A SHADOWSOCKS_GFW -p tcp -m set --set black_cidr dst -j REDIRECT --to-ports 3333
|
||||
iptables -t nat -A SHADOWSOCKS_GFW -p tcp -m set --set gfwlist dst -j REDIRECT --to-ports 3333
|
||||
#-----------------------FOR CHNMODE---------------------
|
||||
iptables -t nat -N SHADOWSOCKS_CHN
|
||||
iptables -t nat -A SHADOWSOCKS_CHN -p tcp -m set --set black_ip dst -j REDIRECT --to-ports 3333
|
||||
iptables -t nat -A SHADOWSOCKS_CHN -p tcp -m set --set black_cidr dst -j REDIRECT --to-ports 3333
|
||||
iptables -t nat -A SHADOWSOCKS_CHN -p tcp -m set ! --set chnroute dst -j REDIRECT --to-ports 3333
|
||||
#-----------------------FOR HOMEMODE---------------------
|
||||
iptables -t nat -N SHADOWSOCKS_HOM
|
||||
iptables -t nat -A SHADOWSOCKS_HOM -p tcp -m set --set black_ip dst -j REDIRECT --to-ports 3333
|
||||
iptables -t nat -A SHADOWSOCKS_HOM -p tcp -m set --set black_cidr dst -j REDIRECT --to-ports 3333
|
||||
iptables -t nat -A SHADOWSOCKS_HOM -p tcp -m set --set chnroute dst -j REDIRECT --to-ports 3333
|
||||
#-----------------------FOR ROUTER---------------------
|
||||
[ "$ss_basic_mode" != "6" ] && iptables -t nat -A OUTPUT -p tcp -m set --set router dst -j REDIRECT --to-ports 3333
|
||||
#-------------------------------------------------------
|
||||
# 局域网黑名单(不走ss)/局域网黑名单(走ss)
|
||||
lan_acess_control
|
||||
# 把最后剩余流量重定向到相应模式的nat表中对对应的主模式的链
|
||||
[ "$ss_acl_default_port" == "all" ] && ss_acl_default_port=""
|
||||
iptables -t nat -A SHADOWSOCKS -p tcp $(factor $ss_acl_default_port "-m multiport --dport") -j $(get_action_chain $ss_acl_default_mode)
|
||||
# 重定所有流量到 SHADOWSOCKS
|
||||
iptables -t nat -I PREROUTING 1 -p tcp -j SHADOWSOCKS
|
||||
}
|
||||
|
||||
chromecast(){
|
||||
LOG1=开启chromecast功能(DNS劫持功能)
|
||||
LOG2=chromecast功能未开启,建议开启~
|
||||
if [ "$ss_basic_chromecast" == "1" ];then
|
||||
IPT_ACTION="-A"
|
||||
echo_date $LOG1
|
||||
else
|
||||
IPT_ACTION="-D"
|
||||
echo_date $LOG2
|
||||
fi
|
||||
iptables -t nat $IPT_ACTION PREROUTING -p udp --dport 53 -j DNAT --to $lan_ipaddr >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
start_all)
|
||||
flush_nat
|
||||
flush_ipset
|
||||
creat_ipset
|
||||
add_white_black_ip
|
||||
apply_nat_rules
|
||||
chromecast
|
||||
;;
|
||||
add_new_ip)
|
||||
add_white_black_ip
|
||||
;;
|
||||
start_part_for_addon)
|
||||
#ss_basic_action=4
|
||||
flush_nat
|
||||
chromecast
|
||||
apply_nat_rules
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 (start_all|restart_wb_list)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
51324
shadowsocks/shadowsocks/ss/rules/cdn.txt
Executable file
51324
shadowsocks/shadowsocks/ss/rules/cdn.txt
Executable file
File diff suppressed because it is too large
Load Diff
8299
shadowsocks/shadowsocks/ss/rules/chnroute.txt
Executable file
8299
shadowsocks/shadowsocks/ss/rules/chnroute.txt
Executable file
File diff suppressed because it is too large
Load Diff
79
shadowsocks/shadowsocks/ss/rules/dnscrypt-resolvers.csv
Executable file
79
shadowsocks/shadowsocks/ss/rules/dnscrypt-resolvers.csv
Executable file
@ -0,0 +1,79 @@
|
||||
Name,Full name,Description,Location,Coordinates,URL,Version,DNSSEC validation,No logs,Namecoin,Resolver address,Provider name,Provider public key,Provider public key TXT record
|
||||
adguard-dns-family-ns1,Adguard DNS Family Protection 1,Adguard DNS with safesearch and adult content blocking,Anycast,,https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.132:5443,2.dnscrypt.family.ns1.adguard.com,B831:5DD7:B14B:6EE3:20A4:70DC:2ED6:B1AA:398C:C9E5:86F8:5D45:45D6:B8C9:B500:5ABA,pk.family.ns1.adguard.com
|
||||
adguard-dns-family-ns2,Adguard DNS Family Protection 2,Adguard DNS with safesearch and adult content blocking,Anycast,,https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.134:5443,2.dnscrypt.family.ns2.adguard.com,8C21:17A9:EBC1:57D6:FB64:056F:0ADB:C11C:5D83:6734:73C4:6E25:8D9B:2F57:D4EE:351F,pk.family.ns2.adguard.com
|
||||
adguard-dns-ns1,Adguard DNS 1,Remove ads and protect your computer from malware,Anycast,,https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.130:5443,2.dnscrypt.default.ns1.adguard.com,D12B:47F2:52DC:F2C2:BBF8:9910:86EA:F79C:E449:5D8B:16C8:A0C4:322E:52CA:3F39:0873,pk.default.ns1.adguard.com
|
||||
adguard-dns-ns2,Adguard DNS 2,Remove ads and protect your computer from malware,Anycast,,https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.131:5443,2.dnscrypt.default.ns2.adguard.com,81D0:02D3:6A4C:A50C:473B:7479:650F:E12E:02B3:21CB:6138:562A:208E:403D:FDC5:5E94,pk.default.ns2.adguard.com
|
||||
cisco,Cisco OpenDNS,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
|
||||
cisco-familyshield,Cisco OpenDNS with FamilyShield,Block websites not suitable for children,Anycast,,https://www.opendns.com/home-internet-security/parental-controls/,1,no,no,no,208.67.220.123,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
|
||||
cisco-ipv6,Cisco OpenDNS over IPv6,Cisco OpenDNS IPv6 sandbox,Anycast,,https://www.opendns.com/about/innovations/ipv6/,1,no,no,no,[2620:0:ccc::2]:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
|
||||
cisco-port53,Cisco OpenDNS backward compatibility port 53,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220:53,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
|
||||
cloudns-syd,CloudNS Sydney,CloudNS is an Australian based security focused DNS provider,"Sydney, AU",,https://cloudns.com.au,1,yes,yes,no,113.20.8.17,2.dnscrypt-cert-2.cloudns.com.au,67A4:323E:581F:79B9:BC54:825F:54FE:1025:8B4F:37EB:0D07:0BCE:4010:6195:D94F:E330,
|
||||
cs-cawest,CS Canada west DNSCrypt server,provided by cryptostorm.is,"Vancouver, CA",,https://cryptostorm.is,1,no,yes,no,162.221.207.228,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-cfi,CS cryptofree France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,no,212.83.175.31,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-cfii,CS secondary cryptofree France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,no,195.154.61.33,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-ch,CS Switzerland DNSCrypt server,provided by cryptostorm.is,"Baar, Switzerland",,https://cryptostorm.is,1,no,yes,no,185.60.147.77,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-de,CS Germany DNSCrypt server,provided by cryptostorm.is,"Frankfurt, Germany",,https://cryptostorm.is,1,no,yes,no,46.165.222.246,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-fr2,CS secondary France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,yes,212.129.46.32,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-rome,CS Italy DNSCrypt server,provided by cryptostorm.is,"Buffalo, NY",,https://cryptostorm.is,1,no,yes,no,95.141.47.58,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-useast,CS New York City NY US DNSCrypt server,provided by cryptostorm.is,"Buffalo, NY",,https://cryptostorm.is,1,no,yes,no,173.234.159.235,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-usnorth,CS Chicago IL US DNSCrypt server,provided by cryptostorm.is,"Chicago, IL",,https://cryptostorm.is,1,no,yes,no,173.234.56.115,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-ussouth,CS Dallas TX US DNSCrypt server,provided by cryptostorm.is,"Dallas, TX",,https://cryptostorm.is,1,no,yes,no,70.32.38.67,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-ussouth2,CS Atlanta GA US DNSCrypt server,provided by cryptostorm.is,"Atlanta, GA",,https://cryptostorm.is,1,no,yes,no,108.62.19.131,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-uswest,CS Seattle WA US DNSCrypt server,provided by cryptostorm.is,"Seattle, WA",,https://cryptostorm.is,1,no,yes,yes,76.164.234.11,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
cs-uswest2,CS Las Vegas NV US DNSCrypt server,provided by cryptostorm.is,"Las Vegas, NV",,https://cryptostorm.is,1,no,yes,no,104.238.194.235,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
|
||||
d0wn-au-ns1,OpenNIC Resolver Australia 01 - d0wn,Server provided by Martin 'd0wn' Albus,Australia,,https://dns.d0wn.biz,1,no,yes,yes,27.100.36.191,2.dnscrypt-cert.au.d0wn.biz,A7D9:0F8E:9A98:1381:176A:3D25:36DE:E865:8538:9CD8:78BC:C3B5:A146:23F1:C2EF:58D8,pubkey.au.dnscrypt.d0wn.biz
|
||||
d0wn-bg-ns1,OpenNIC Resolver Bulgaria 01 - d0wn,Server provided by Martin 'd0wn' Albus,Bulgaria,,https://dns.d0wn.biz,1,no,yes,yes,217.12.203.133,2.dnscrypt-cert.bg.d0wn.biz,423C:D823:B3EA:2015:F027:ECF1:5704:3EB7:764A:D02D:9447:56E6:51FD:D06F:E571:2FCC,pubkey.bg.dnscrypt.d0wn.biz
|
||||
d0wn-cy-ns1,OpenNIC Resolver Cyprus 01 - d0wn,Server provided by Martin 'd0wn' Albus,Cyprus,,https://dns.d0wn.biz,1,no,yes,yes,213.169.148.11,2.dnscrypt-cert.cy.d0wn.biz,2144:4FE7:59C3:13B9:FABB:FC2A:F975:9F9C:CD9A:2ED7:0978:3A25:7347:4B83:8F86:EA2B,pubkey.cy.dnscrypt.d0wn.biz
|
||||
d0wn-de-ns1,OpenNIC Resolver Germany 01 - d0wn,Server provided by Martin 'd0wn' Albus,Germany,,https://dns.d0wn.biz,1,no,yes,yes,82.211.31.248,2.dnscrypt-cert.de.d0wn.biz,D4A8:6FB5:AA0C:2B6B:8C13:8C29:7F69:F9C8:29C8:E157:F279:6FC7:7366:290F:2A80:0AD2,pubkey.de.dnscrypt.d0wn.biz
|
||||
d0wn-de-ns2,OpenNIC Resolver Germany 02 - d0wn,Server provided by Martin 'd0wn' Albus,Germany,,https://dns.d0wn.biz,1,no,yes,yes,185.137.15.105,2.dnscrypt-cert.de2.d0wn.biz,8C62:691A:A7EA:69D3:8A25:86AA:2715:87F0:9B11:9159:0663:55FC:1CD0:61C5:C863:1940,pubkey.de2.dnscrypt.d0wn.biz
|
||||
d0wn-dk-ns1,OpenNIC Resolver Denmark 01 - d0wn,Server provided by Martin 'd0wn' Albus,Denmark,,https://dns.d0wn.biz,1,no,yes,yes,77.66.108.93,2.dnscrypt-cert.dk.d0wn.biz,0838:C9CF:2292:2D4C:4DB7:4A5E:ED10:DD36:66DD:9551:7238:6387:B7A0:2FA0:885A:5F77,pubkey.dk.dnscrypt.d0wn.biz
|
||||
d0wn-fr-ns2,OpenNIC Resolver France 02 - d0wn,Server provided by Martin 'd0wn' Albus,France,,https://dns.d0wn.biz,1,no,yes,yes,37.187.0.40,2.dnscrypt-cert.fr2.d0wn.biz,25A7:DB7B:7835:55D5:7DA4:7C0C:57F8:9C5F:0220:3D09:67E3:585A:723E:E0D1:CB38:F767,pubkey.fr2.dnscrypt.d0wn.biz
|
||||
d0wn-es-ns1,OpenNIC Resolver Spain 01- d0wn,Server provided by Martin 'd0wn' Albus,Spain,,https://dns.d0wn.biz,1,no,yes,yes,91.142.220.29,2.dnscrypt-cert.es.d0wn.biz,EB09:E854:AEDA:9705:CB47:ED69:EADD:4156:3653:82C5:C88D:A2E3:6917:3B54:4774:7505,pubkey.es.dnscrypt.d0wn.biz
|
||||
d0wn-gr-ns1,OpenNIC Resolver Greece 01 - d0wn,Server provided by Martin 'd0wn' Albus,Greece,,https://dns.d0wn.biz,1,no,yes,yes,85.25.105.193,2.dnscrypt-cert.gr.d0wn.biz,D056:D3A4:9568:5AFE:4B0D:C688:7A75:41B2:7217:F0C9:75A5:A6C0:142D:363B:F992:9867,pubkey.gr.dnscrypt.d0wn.biz
|
||||
d0wn-hk-ns1,OpenNIC Resolver Hong Kong 01 - d0wn,Server provided by Martin 'd0wn' Albus,Hong Kong,,https://dns.d0wn.biz,1,no,yes,yes,45.124.66.200,2.dnscrypt-cert.hk.d0wn.biz,84ED:0DFF:7967:5DBD:2D93:65A2:A6AB:7F90:146F:A50B:048C:8C75:651B:AA55:7129:6740,pubkey.hk.dnscrypt.d0wn.biz
|
||||
d0wn-is-ns1,OpenNIC Resolver Iceland 01 - d0wn,Server provided by Martin 'd0wn' Albus,Iceland,,https://dns.d0wn.biz,1,no,yes,yes,37.235.49.61,2.dnscrypt-cert.is.d0wn.biz,2B28:974E:073A:6B38:722A:5BE1:F7A0:250C:508F:A809:238F:8F3D:76D8:6098:20D7:B2D9,pubkey.is.dnscrypt.d0wn.biz
|
||||
d0wn-lu-ns1,OpenNIC Resolver Luxembourg 01 - d0wn,Server provided by Martin 'd0wn' Albus,Luxembourg,,https://dns.d0wn.biz,1,no,yes,yes,104.244.72.13,2.dnscrypt-cert.lu.d0wn.biz,737B:B68B:7D3C:896F:260D:91C3:60A6:AD64:8CD3:1B22:4D5F:7089:490C:539F:2EC6:C309,pubkey.lu.dnscrypt.d0wn.biz
|
||||
d0wn-lu-ns1-ipv6,OpenNIC Resolver Luxembourg 01 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,Luxembourg,,https://dns.d0wn.biz,1,no,yes,yes,[2605:6400:30:fbb5:0:1ce:1ce:babe]:443,2.dnscrypt-cert.lu.d0wn.biz,737B:B68B:7D3C:896F:260D:91C3:60A6:AD64:8CD3:1B22:4D5F:7089:490C:539F:2EC6:C309,pubkey.lu.dnscrypt.d0wn.biz
|
||||
d0wn-lv-ns1,OpenNIC Resolver Latvia 01 - d0wn,Server provided by Martin 'd0wn' Albus,Latvia,,https://dns.d0wn.biz,1,no,yes,yes,89.111.13.60,2.dnscrypt-cert.lv.d0wn.biz,1B70:FB6F:2E47:1753:91EF:1084:ECD2:983A:9018:F3E3:DDF1:E563:E528:156A:664A:1AE8,pubkey.lv.dnscrypt.d0wn.biz
|
||||
d0wn-lv-ns2,OpenNIC Resolver Latvia 02 - d0wn,Server provided by Martin 'd0wn' Albus,Latvia,,https://dns.d0wn.biz,1,no,yes,yes,185.86.151.28,2.dnscrypt-cert.lv2.d0wn.biz,B111:F80C:E3E0:1C36:CC73:0995:009E:6351:EF08:0503:309D:9417:7AA3:8C67:916D:0CDF,pubkey.lv.dnscrypt.d0wn.biz
|
||||
d0wn-lv-ns2-ipv6,OpenNIC Resolver Latvia 01 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,Latvia,,https://dns.d0wn.biz,1,no,yes,yes,[2a02:7aa0:1201::f60e:2719]:443,2.dnscrypt-cert.lv2.d0wn.biz,B111:F80C:E3E0:1C36:CC73:0995:009E:6351:EF08:0503:309D:9417:7AA3:8C67:916D:0CDF,pubkey.lv.dnscrypt.d0wn.biz
|
||||
d0wn-nl-ns3,OpenNIC Resolver Netherlands 03 - d0wn,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,185.133.72.116,2.dnscrypt-cert.nl3.d0wn.biz,01FC:1AA9:F71F:F09E:55CE:0D04:9ACA:2B11:9536:319E:04A9:C3AE:77CB:127D:4C53:0651,pubkey.nl3.dnscrypt.d0wn.biz
|
||||
d0wn-nl-ns3-ipv6,OpenNIC Resolver Netherlands 03 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,[2a06:7240:5:601:dead:beef:e3e7:7a9d]:443,2.dnscrypt-cert.nl3.d0wn.biz,01FC:1AA9:F71F:F09E:55CE:0D04:9ACA:2B11:9536:319E:04A9:C3AE:77CB:127D:4C53:0651,pubkey.nl2.dnscrypt.d0wn.biz
|
||||
d0wn-random-ns1,OpenNIC Resolver Moldova 01 - d0wn,Server provided by Martin 'd0wn' Albus,Moldova,,https://dns.d0wn.biz,1,no,yes,yes,178.17.170.133,2.dnscrypt-cert.random.d0wn.biz,A420:867F:ED5C:024C:C86A:EECE:AA05:194B:017F:D2FF:9E72:385A:874F:8CE5:6832:ED2E,pubkey.random.dnscrypt.d0wn.biz
|
||||
d0wn-random-ns2,OpenNIC Resolver Netherlands 02 - d0wn,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,185.14.29.140,2.dnscrypt-cert.random2.d0wn.biz,9112:338E:7D0B:5E78:B792:9BB6:1B75:4888:AC94:65B5:B86B:B5DE:CCF3:E5B9:15A5:DC54,pubkey.random2.dnscrypt.d0wn.biz
|
||||
d0wn-ro-ns1,OpenNIC Resolver Romania 01 - d0wn,Server provided by Martin 'd0wn' Albus,Romania,,https://dns.d0wn.biz,1,no,yes,yes,77.81.104.121,2.dnscrypt-cert.ro.d0wn.biz,DA9E:6882:B0F8:335E:B5F4:A059:1B7D:EE6F:BD55:4451:93B4:13BF:AFFC:7D26:4527:CE1A,pubkey.ro.dnscrypt.d0wn.biz
|
||||
d0wn-ro-ns1-ipv6,OpenNIC Resolver Romania 01 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,Romania,,https://dns.d0wn.biz,1,no,yes,yes,[2a04:9dc0:c1:7::cb9:f785]:443,2.dnscrypt-cert.ro.d0wn.biz,DA9E:6882:B0F8:335E:B5F4:A059:1B7D:EE6F:BD55:4451:93B4:13BF:AFFC:7D26:4527:CE1A,pubkey.ro.dnscrypt.d0wn.biz
|
||||
d0wn-ru-ns1,OpenNIC Resolver Russia 01 - d0wn,Server provided by Martin 'd0wn' Albus,Russia,,https://dns.d0wn.biz,1,no,yes,yes,91.214.71.181,2.dnscrypt-cert.ru.d0wn.biz,0ECA:BC40:E0A1:335F:0221:4240:AB86:2919:D16A:2393:CCEB:4B40:9EB9:4F24:3077:ED99,pubkey.ru.dnscrypt.d0wn.biz
|
||||
d0wn-se-ns1,OpenNIC Resolver Sweden 01 - d0wn,Server provided by Martin 'd0wn' Albus,Sweden,,https://dns.d0wn.biz,1,no,yes,yes,95.215.44.124,2.dnscrypt-cert.se.d0wn.biz,9D4F:762B:DD24:F77A:64B4:7E0F:F5C6:93FD:A02A:39E9:8FEC:0CEE:F252:3A5F:A403:C032,pubkey.se.dnscrypt.d0wn.biz
|
||||
d0wn-se-ns1-ipv6,OpenNIC Resolver Sweden 01 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,Sweden,,https://dns.d0wn.biz,1,no,yes,yes,[2a02:7aa0:1619::4f50:a69]:443,2.dnscrypt-cert.se.d0wn.biz,9D4F:762B:DD24:F77A:64B4:7E0F:F5C6:93FD:A02A:39E9:8FEC:0CEE:F252:3A5F:A403:C032,pubkey.se.dnscrypt.d0wn.biz
|
||||
d0wn-sg-ns1,OpenNIC Resolver Singapore 01 - d0wn,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,128.199.248.105,2.dnscrypt-cert.sg.d0wn.biz,D82B:2B76:1DA0:8470:B55B:820C:FAAB:9F32:D632:E9E0:5616:2CE7:7D21:E970:98FF:4A34,pubkey.sg.dnscrypt.d0wn.biz
|
||||
d0wn-sg-ns2,OpenNIC Resolver Singapore 02 - d0wn,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,210.16.120.139,2.dnscrypt-cert.sg2.d0wn.biz,0F00:63C4:6EAF:29C3:29CD:E125:2033:6F0A:0C72:7CDD:F1F4:3D47:F95D:02BC:07F7:9FFC,pubkey.sg2.dnscrypt.d0wn.biz
|
||||
d0wn-sg-ns2-ipv6,OpenNIC Resolver Singapore 01 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,[2403:5680::1:200f]:443,2.dnscrypt-cert.sg2.d0wn.biz,0F00:63C4:6EAF:29C3:29CD:E125:2033:6F0A:0C72:7CDD:F1F4:3D47:F95D:02BC:07F7:9FFC,pubkey.sg.dnscrypt.d0wn.biz
|
||||
d0wn-tz-ns1,OpenNIC Resolver Tanzania 01 - d0wn,Server provided by Martin 'd0wn' Albus,Tanzania,,https://dns.d0wn.biz,1,no,yes,yes,41.79.69.13,2.dnscrypt-cert.tz.d0wn.biz,B79F:A025:1AF6:2125:DF3E:3B03:856D:4CB7:704E:45EB:B850:3A7B:C6AA:5510:D87D:087D,pubkey.tz.dnscrypt.d0wn.biz
|
||||
d0wn-ua-ns1,OpenNIC Resolver Ukraine 01 - d0wn,Server provided by Martin 'd0wn' Albus,Ukraine,,https://dns.d0wn.biz,1,no,yes,yes,217.12.210.54,2.dnscrypt-cert.ua.d0wn.biz,3B1E:D468:FFD3:F261:20DE:E7F1:6A74:E1D5:D59E:B40D:F3EA:99BC:0B05:70CC:292D:99BA,pubkey.ua.dnscrypt.d0wn.biz
|
||||
d0wn-ua-ns1-ipv6,OpenNIC Resolver Ukraine 01 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,Ukraine,,https://dns.d0wn.biz,1,no,yes,yes,[2a02:27a8:0:2::556]:443,2.dnscrypt-cert.ua.d0wn.biz,3B1E:D468:FFD3:F261:20DE:E7F1:6A74:E1D5:D59E:B40D:F3EA:99BC:0B05:70CC:292D:99BA,pubkey.ua.dnscrypt.d0wn.biz
|
||||
d0wn-uk-ns1,OpenNIC Resolver United Kingdom 01 - d0wn,Server provided by Martin 'd0wn' Albus,United Kingdom,,https://dns.d0wn.biz,1,no,yes,yes,185.121.25.85,2.dnscrypt-cert.uk.d0wn.biz,FADB:BE63:7FCD:FE22:0DBE:D433:438C:5A1D:C267:1E96:4B67:1918:B15F:9121:77D7:5B2E,pubkey.uk.dnscrypt.d0wn.biz
|
||||
d0wn-uk-ns1-ipv6,OpenNIC Resolver United Kingdom 01 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,United Kingdom,,https://dns.d0wn.biz,1,no,yes,yes,[2a04:92c7:7:7::14ae:460a]:443,2.dnscrypt-cert.uk.d0wn.biz,FADB:BE63:7FCD:FE22:0DBE:D433:438C:5A1D:C267:1E96:4B67:1918:B15F:9121:77D7:5B2E,pubkey.uk.dnscrypt.d0wn.biz
|
||||
d0wn-us-ns1,OpenNIC Resolver United States of America 01 - d0wn,Server provided by Martin 'd0wn' Albus,United States of America,,https://dns.d0wn.biz,1,no,yes,yes,199.195.249.174,2.dnscrypt-cert.us.d0wn.biz,6741:6E7F:4744:194E:D725:91A2:1A62:A715:78F9:62CD:5263:84FC:DAA8:6C7E:4D9F:438B,pubkey.us.dnscrypt.d0wn.biz
|
||||
d0wn-us-ns1-ipv6,OpenNIC Resolver United States of America 01 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,United States of America,,https://dns.d0wn.biz,1,no,yes,yes,[2605:6400:10:59:0:b19:b00b:babe]:443,2.dnscrypt-cert.us.d0wn.biz,6741:6E7F:4744:194E:D725:91A2:1A62:A715:78F9:62CD:5263:84FC:DAA8:6C7E:4D9F:438B,pubkey.us.dnscrypt.d0wn.biz
|
||||
d0wn-us-ns2,OpenNIC Resolver United States of America 02 - d0wn,Server provided by Martin 'd0wn' Albus,United States of America,,https://dns.d0wn.biz,1,no,yes,yes,209.141.53.57,2.dnscrypt-cert.us2.d0wn.biz,A22D:99C4:E2E9:CB94:67F0:E36A:619F:418B:466C:5786:C0B8:ACAA:B716:71F7:1F81:F5F8,pubkey.us.dnscrypt.d0wn.biz
|
||||
d0wn-us-ns2-ipv6,OpenNIC Resolver United States of America 02 over IPv6 - d0wn,Server provided by Martin 'd0wn' Albus,United States of America,,https://dns.d0wn.biz,1,no,yes,yes,[2605:6400:20:7d7:1:5ee:bad:c0de]:443,2.dnscrypt-cert.us2.d0wn.biz,A22D:99C4:E2E9:CB94:67F0:E36A:619F:418B:466C:5786:C0B8:ACAA:B716:71F7:1F81:F5F8,pubkey.us.dnscrypt.d0wn.biz
|
||||
dns-freedom,DNS Freedom,DNSCrypt Server provided by DNS Freedom,CA,,https://dns-freedom.com,1,yes,yes,no,64.137.242.181,2.dnscrypt-cert.dns-freedom.com,CCA2:B4BF:EAD8:7F45:419F:F161:ACE1:AFA7:D48E:A37A:FB1E:B136:292A:46CF:BDDF:426D,
|
||||
dnscrypt.eu-dk,DNSCrypt.eu Denmark,"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,77.66.84.233,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu
|
||||
dnscrypt.eu-dk-ipv6,DNSCrypt.eu Denmark over IPv6,"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,[2001:1448:243::dc2]:443,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu
|
||||
dnscrypt.eu-nl,DNSCrypt.eu Holland,"Free, non-logged, uncensored. Hosted by RamNode.",Netherlands,,https://dnscrypt.eu,1,yes,yes,no,176.56.237.171,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu
|
||||
dnscrypt.eu-nl-ipv6,DNSCrypt.eu Holland over IPv6,"Free, non-logged, uncensored. Hosted by RamNode.",Netherlands,,https://dnscrypt.eu,1,yes,yes,no,[2a00:d880:3:1::a6c1:2e89]:443,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu
|
||||
dnscrypt.org-fr,DNSCrypt.org France,DNSSEC/Non-logged/Uncensored - ARM server donated by Scaleway.com,"Paris, France",,https://fr.dnscrypt.org,2,yes,yes,no,212.47.228.136,2.dnscrypt-cert.fr.dnscrypt.org,E801:B84E:A606:BFB0:BAC0:CE43:445B:B15E:BA64:B02F:A3C4:AA31:AE10:636A:0790:324D,pubkey.fr.dnscrypt.org
|
||||
fvz-anyone,Primary OpenNIC Anycast DNS Resolver,Fusl's public primary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,185.121.177.177,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,
|
||||
fvz-anyone-ipv6,Primary OpenNIC Anycast DNS IPv6 Resolver,Fusl's public primary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,[2a05:dfc7:5::53]:443,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,
|
||||
fvz-anytwo,Secondary OpenNIC Anycast DNS Resolver,Fusl's public secondary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,185.121.177.53,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,
|
||||
fvz-anytwo-ipv6,Secondary OpenNIC Anycast DNS IPv6 Resolver,Fusl's public secondary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,[2a05:dfc7:5::5353]:443,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,
|
||||
ipredator,Ipredator.se Server,Public DNSCrypt server in Sweden provided by Ipredator.se,Sweden,,https://www.ipredator.se,1,no,yes,no,194.132.32.32,2.dnscrypt-cert.ipredator.se,C44C:566A:A8D6:46C4:32B1:04F5:3D00:961B:32DC:71CF:1C04:BD9E:B013:E480:E7A4:7828,pubkey.resolver2.ipredator.se
|
||||
ns0.dnscrypt.is,"ns0.dnscrypt.is in Reykjavík, Iceland","DNSSEC enabled, non-logging, uncensored. Sponsored by 1984 Hosting.","Reykjavík, Iceland",,https://dnscrypt.is,1,yes,yes,no,93.95.228.87,2.dnscrypt-cert.ns0.dnscrypt.is,EE41:6A83:451C:218F:37B2:B736:78C4:999F:7DE6:89D1:31D2:7866:7C8E:A8BB:1C95:B402,pubkey.ns0.dnscrypt.is
|
||||
okturtles,okTurtles,For a surveillance-free world. HTTPS is broken. DNSChain fixes it.,"Georgia, US","33.032501, -83.895699",http://okturtles.com/,1,no,yes,yes,23.226.227.93,2.dnscrypt-cert.okturtles.com,1D85:3953:E34F:AFD0:05F9:4C6F:D1CC:E635:D411:9904:0D48:D19A:5D35:0B6A:7C81:73CB,
|
||||
opennic-tumabox,TumaBox,Public DNS server operated by TumaBox.org,Germany,,http://wiki.tumabox.org/doku.php?id=dns,1,no,yes,yes,130.255.73.90:5353,2.tumabox.org,D591:7B11:6A35:3114:C238:AA99:A6EB:0C28:7CF7:6805:41AC:5DBF:A8A0:239E:228C:5B06,
|
||||
ovpnse,OVPN.se Integritet AB,Public DNS server in Sweden by OVPN.se,Sweden,"59.2877011, 18.0771273",https://www.ovpn.se,1,no,yes,no,46.227.67.134:55,2.dnscrypt-cert.dnscrypt01.ovpn.se,B0D6:3658:E23F:5AE1:495C:03C2:319D:D6F1:F2E1:E067:BD23:6F56:503F:27A8:C5D9:2390,
|
||||
soltysiak,Soltysiak,Public DNSCrypt server in Poland,Poland,"52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,178.216.201.222:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com
|
||||
soltysiak-ipv6,Soltysiak over IPv6,Public DNSCrypt server in Poland,Poland,"52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,[2001:470:70:4ff::2]:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com
|
||||
ventricle.us,Anatomical DNS,Public DNSCrypt resolver provided by Jacob Henner,"New York, NY",,https://jacobhenner.com,1,yes,yes,no,107.170.57.34,2.dnscrypt-cert.dnscrypt.ventricle.us,E985:F118:AD4E:3CC6:5FF2:2520:1890:C6F5:58B7:5B5A:52F5:6B17:CFEA:C100:5C8B:9BAA,pubkey.dnscrypt.ventricle.us
|
||||
yandex,Yandex,Yandex public DNS server,Anycast,,https://www.yandex.com,1,no,no,no,77.88.8.78:15353,2.dnscrypt-cert.browser.yandex.net,D384:C071:C9F7:4662:AF2A:CCD5:7B5D:CC97:14D4:07B6:AD36:01E1:AEDC:06D5:6D49:6327,
|
|
38
shadowsocks/shadowsocks/ss/rules/dnsmasq.postconf
Normal file
38
shadowsocks/shadowsocks/ss/rules/dnsmasq.postconf
Normal file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
CONFIG=$1
|
||||
source /usr/sbin/helper.sh
|
||||
ss_dns_china=`dbus get ss_dns_china`
|
||||
ss_dns_china_user=`dbus get ss_dns_china_user`
|
||||
ss_dns_plan=`dbus get ss_dns_plan`
|
||||
|
||||
ISP_DNS1=$(nvram get wan0_dns|sed 's/ /\n/g'|grep -v 0.0.0.0|grep -v 127.0.0.1|sed -n 1p)
|
||||
ISP_DNS2=$(nvram get wan0_dns|sed 's/ /\n/g'|grep -v 0.0.0.0|grep -v 127.0.0.1|sed -n 2p)
|
||||
if [ "$ss_dns_china" == "1" ];then
|
||||
[ -n "$ISP_DNS1" ] && CDN1="$ISP_DNS1" || CDN1="114.114.114.114"
|
||||
[ -n "$ISP_DNS2" ] && CDN2="$ISP_DNS2" || CDN2="114.114.115.115"
|
||||
fi
|
||||
[ "$ss_dns_china" == "2" ] && CDN="223.5.5.5"
|
||||
[ "$ss_dns_china" == "3" ] && CDN="223.6.6.6"
|
||||
[ "$ss_dns_china" == "4" ] && CDN="114.114.114.114"
|
||||
[ "$ss_dns_china" == "5" ] && CDN="114.114.115.115"
|
||||
[ "$ss_dns_china" == "6" ] && CDN="1.2.4.8"
|
||||
[ "$ss_dns_china" == "7" ] && CDN="210.2.4.8"
|
||||
[ "$ss_dns_china" == "8" ] && CDN="112.124.47.27"
|
||||
[ "$ss_dns_china" == "9" ] && CDN="114.215.126.16"
|
||||
[ "$ss_dns_china" == "10" ] && CDN="180.76.76.76"
|
||||
[ "$ss_dns_china" == "11" ] && CDN="119.29.29.29"
|
||||
[ "$ss_dns_china" == "12" ] && CDN="$ss_dns_china_user"
|
||||
|
||||
if [ "$ss_dns_plan" == "1" ] || [ -z "$ss_dns_china" ];then
|
||||
if [ "$ss_dns_china" == "1" ];then
|
||||
pc_insert "no-poll" "server=$CDN2#53" "/etc/dnsmasq.conf"
|
||||
pc_insert "no-poll" "server=$CDN1#53" "/etc/dnsmasq.conf"
|
||||
pc_insert "no-poll" "all-servers" "/etc/dnsmasq.conf"
|
||||
else
|
||||
pc_insert "no-poll" "server=$CDN#53" "/etc/dnsmasq.conf"
|
||||
fi
|
||||
elif [ "$ss_dns_plan" == "2" ];then
|
||||
pc_insert "no-poll" "server=127.0.0.1#7913" "/etc/dnsmasq.conf"
|
||||
fi
|
||||
pc_insert "no-poll" "no-resolv" "/etc/dnsmasq.conf"
|
10932
shadowsocks/shadowsocks/ss/rules/gfwlist.conf
Executable file
10932
shadowsocks/shadowsocks/ss/rules/gfwlist.conf
Executable file
File diff suppressed because it is too large
Load Diff
5
shadowsocks/shadowsocks/ss/rules/output.conf
Executable file
5
shadowsocks/shadowsocks/ss/rules/output.conf
Executable file
@ -0,0 +1,5 @@
|
||||
# for router itself
|
||||
ipset=/.google.com.tw/router
|
||||
ipset=/.github.com/router
|
||||
ipset=/.github.io/router
|
||||
ipset=/.raw.githubusercontent.com/router
|
4
shadowsocks/shadowsocks/ss/rules/version
Executable file
4
shadowsocks/shadowsocks/ss/rules/version
Executable file
@ -0,0 +1,4 @@
|
||||
2018-11-15 # 059d8ce42055b411b79f47b3fd912691 gfwlist
|
||||
2018-11-25 # f8b2d91949aa7b78da6dd44bd23fdcc3 chnroute
|
||||
2016-02-26 # 7c8569e96bc6893a146d5e093a3b0434 adblock
|
||||
2018-11-25 # b04f1816699f304134994ebc64d29325 cdn
|
3805
shadowsocks/shadowsocks/ss/socks5/chn.acl
Executable file
3805
shadowsocks/shadowsocks/ss/socks5/chn.acl
Executable file
File diff suppressed because it is too large
Load Diff
3774
shadowsocks/shadowsocks/ss/socks5/gfwlist.acl
Executable file
3774
shadowsocks/shadowsocks/ss/socks5/gfwlist.acl
Executable file
File diff suppressed because it is too large
Load Diff
70
shadowsocks/shadowsocks/ss/socks5/socks5config.sh
Executable file
70
shadowsocks/shadowsocks/ss/socks5/socks5config.sh
Executable file
@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
eval `dbus export shadowsocks`
|
||||
eval `dbus export ss`
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
|
||||
kill_socks5(){
|
||||
kill `ps | grep ss-local | grep -v "grep" | grep -v "23456"|awk '{print $1}'` >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Start ss-local
|
||||
start_socks5(){
|
||||
if [ "$ss_local_obfs_host" != "" ];then
|
||||
if [ "$ss_local_obfs" == "http" ];then
|
||||
ARG_OBFS="obfs=http;obfs-host=$ss_basic_ss_obfs_host"
|
||||
elif [ "$ss_local_obfs" == "tls" ];then
|
||||
ARG_OBFS="obfs=tls;obfs-host=$ss_basic_ss_obfs_host"
|
||||
else
|
||||
ARG_OBFS=""
|
||||
fi
|
||||
else
|
||||
if [ "$ss_local_obfs" == "http" ];then
|
||||
ARG_OBFS="obfs=http"
|
||||
elif [ "$ss_local_obfs" == "tls" ];then
|
||||
ARG_OBFS="obfs=tls"
|
||||
else
|
||||
ARG_OBFS=""
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ "$ss_local_acl" == "0" ];then
|
||||
ARG_ACL=""
|
||||
elif [ "$ss_local_acl" == "1" ];then
|
||||
ARG_ACL="--acl /jffs/softcenter/ss/socks5/gfwlist.acl"
|
||||
elif [ "$ss_local_acl" == "2" ];then
|
||||
ARG_ACL="--acl /jffs/softcenter/ss/socks5/chn.acl"
|
||||
fi
|
||||
|
||||
echo_date enable ss_local...
|
||||
if [ "$ss_local_obfs" == "0" ];then
|
||||
ss-local -b 0.0.0.0 -s "$ss_local_server" -p "$ss_local_port" -l "$ss_local_proxyport" -k "$ss_local_password" -m "$ss_local_method" -u $ARG_ACL -f /var/run/ss_local.pid
|
||||
else
|
||||
ss-local -b 0.0.0.0 -s "$ss_local_server" -p "$ss_local_port" -l "$ss_local_proxyport" -k "$ss_local_password" -m "$ss_local_method" -u $ARG_ACL --plugin obfs-local --plugin-opts "$ARG_OBFS" -f /var/run/ss_local.pid
|
||||
fi
|
||||
}
|
||||
|
||||
case $ACTION in
|
||||
start)
|
||||
if [ "$ss_local_enable" == "1" ];then
|
||||
start_socks5
|
||||
fi
|
||||
;;
|
||||
stop | kill )
|
||||
kill_socks5
|
||||
;;
|
||||
restart)
|
||||
kill_socks5
|
||||
if [ "$ss_local_enable" == "1" ];then
|
||||
start_socks5
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 (start|stop|restart)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
220
shadowsocks/shadowsocks/ss/ssconfig.sh
Executable file
220
shadowsocks/shadowsocks/ss/ssconfig.sh
Executable file
@ -0,0 +1,220 @@
|
||||
#!/bin/sh
|
||||
eval `dbus export shadowsocks`
|
||||
eval `dbus export ss`
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
ss_basic_version_local=`cat /jffs/softcenter/ss/version`
|
||||
dbus set ss_basic_version_local=$ss_basic_version_local
|
||||
backup_url="http://sc.paldier.com/shadowsocks/"
|
||||
main_url="https://raw.githubusercontent.com/paldier/softcenter/master/shadowsocks"
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
# creat dnsmasq.d folder
|
||||
creat_folder(){
|
||||
if [ ! -d /tmp/etc/dnsmasq.user ];then
|
||||
mkdir -p /tmp/etc/dnsmasq.user
|
||||
fi
|
||||
}
|
||||
|
||||
install_ss(){
|
||||
echo_date 开始解压压缩包...
|
||||
tar -zxf shadowsocks.tar.gz
|
||||
dbus set ss_basic_install_status="2"
|
||||
chmod a+x /tmp/shadowsocks/install.sh
|
||||
echo_date 开始安装更新文件...
|
||||
sh /tmp/shadowsocks/install.sh
|
||||
}
|
||||
|
||||
# update ss
|
||||
update_ss(){
|
||||
# ss_basic_install_status= #
|
||||
# ss_basic_install_status=0 #
|
||||
# ss_basic_install_status=1 #正在下载更新......
|
||||
# ss_basic_install_status=2 #正在安装更新...
|
||||
# ss_basic_install_status=3 #安装更新成功,5秒后刷新本页!
|
||||
# ss_basic_install_status=4 #下载文件校验不一致!
|
||||
# ss_basic_install_status=5 #然而并没有更新!
|
||||
# ss_basic_install_status=6 #正在检查是否有更新~
|
||||
# ss_basic_install_status=7 #检测更新错误!
|
||||
# ss_basic_install_status=8 #更换更新服务器
|
||||
echo_date 更新过程中请不要做奇怪的事,不然可能导致问题!
|
||||
dbus set ss_basic_install_status="6"
|
||||
echo_date 开启SS检查更新:正在检测主服务器在线版本号...
|
||||
ss_basic_version_web1=`curl --connect-timeout 5 -s "$main_url"/version | sed -n 1p`
|
||||
if [ ! -z $ss_basic_version_web1 ];then
|
||||
echo_date 检测到主服务器在线版本号:$ss_basic_version_web1
|
||||
dbus set ss_basic_version_web=$ss_basic_version_web1
|
||||
if [ "$ss_basic_version_local" != "$ss_basic_version_web1" ];then
|
||||
echo_date 主服务器在线版本号:"$ss_basic_version_web1" 和本地版本号:"$ss_basic_version_local" 不同!
|
||||
dbus set ss_basic_install_status="1"
|
||||
cd /tmp
|
||||
md5_web1=`curl -s "$main_url"/version | sed -n 2p`
|
||||
echo_date 开启下载进程,从主服务器上下载更新包...
|
||||
wget --no-check-certificate --timeout=5 "$main_url"/shadowsocks.tar.gz
|
||||
md5sum_gz=`md5sum /tmp/shadowsocks.tar.gz | sed 's/ /\n/g'| sed -n 1p`
|
||||
if [ "$md5sum_gz" != "$md5_web1" ]; then
|
||||
echo_date 更新包md5校验不一致!估计是下载的时候出了什么状况,请等待一会儿再试...
|
||||
dbus set ss_basic_install_status="4"
|
||||
rm -rf /tmp/shadowsocks* >/dev/null 2>&1
|
||||
sleep 1
|
||||
echo_date 更换备用更新服务器1,请稍后...
|
||||
dbus set ss_basic_install_status="8"
|
||||
sleep 1
|
||||
update_ss2
|
||||
else
|
||||
echo_date 更新包md5校验一致! 开始安装!...
|
||||
install_ss
|
||||
fi
|
||||
else
|
||||
echo_date 主服务器在线版本号:"$ss_basic_version_web1" 和本地版本号:"$ss_basic_version_local" 相同!
|
||||
dbus set ss_basic_install_status="5"
|
||||
sleep 1
|
||||
echo_date 那还更新个毛啊,关闭更新进程!
|
||||
dbus set ss_basic_install_status="0"
|
||||
exit
|
||||
fi
|
||||
else
|
||||
echo_date 没有检测到主服务器在线版本号,访问github服务器有点问题哦~
|
||||
dbus set ss_basic_install_status="7"
|
||||
sleep 2
|
||||
echo_date 更换备用更新服务器1,请稍后...
|
||||
dbus set ss_basic_install_status="8"
|
||||
sleep 1
|
||||
update_ss2
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
update_ss2(){
|
||||
# ss_basic_install_status= #
|
||||
# ss_basic_install_status=0 #
|
||||
# ss_basic_install_status=1 #正在下载更新......
|
||||
# ss_basic_install_status=2 #正在安装更新...
|
||||
# ss_basic_install_status=3 #安装更新成功,5秒后刷新本页!
|
||||
# ss_basic_install_status=4 #下载文件校验不一致!
|
||||
# ss_basic_install_status=5 #然而并没有更新!
|
||||
# ss_basic_install_status=6 #正在检查是否有更新~
|
||||
# ss_basic_install_status=7 #检测更新错误1!
|
||||
# ss_basic_install_status=8 #更换奔涌更新服务器1
|
||||
# ss_basic_install_status=9 #检测更新错误2!
|
||||
|
||||
dbus set ss_basic_install_status="6"
|
||||
echo_date 开启SS检查更新:正在检测备用服务器在线版本号...
|
||||
ss_basic_version_web2=`curl --connect-timeout 5 -s "$backup_url"/version | sed -n 1p`
|
||||
if [ ! -z $ss_basic_version_web2 ];then
|
||||
echo_date 检测到备用服务器在线版本号:$ss_basic_version_web1
|
||||
dbus set ss_basic_version_web=$ss_basic_version_web2
|
||||
if [ "$ss_basic_version_local" != "$ss_basic_version_web2" ];then
|
||||
echo_date 备用服务器在线版本号:"$ss_basic_version_web1" 和本地版本号:"$ss_basic_version_local" 不同!
|
||||
dbus set ss_basic_install_status="1"
|
||||
cd /tmp
|
||||
md5_web2=`curl -s "$backup_url"/version | sed -n 2p`
|
||||
echo_date 开启下载进程,从备用服务器上下载更新包...
|
||||
wget "$backup_url"/shadowsocks.tar.gz
|
||||
md5sum_gz=`md5sum /tmp/shadowsocks.tar.gz | sed 's/ /\n/g'| sed -n 1p`
|
||||
if [ "$md5sum_gz" != "$md5_web2" ]; then
|
||||
echo_date 更新包md5校验不一致!估计是下载的时候除了什么状况,请等待一会儿再试...
|
||||
dbus set ss_basic_install_status="4"
|
||||
rm -rf /tmp/shadowsocks* >/dev/null 2>&1
|
||||
sleep 2
|
||||
echo_date 然而只有这一台备用更更新服务器,请尝试离线手动安装...
|
||||
dbus set ss_basic_install_status="0"
|
||||
exit
|
||||
else
|
||||
echo_date 更新包md5校验一致! 开始安装!...
|
||||
install_ss
|
||||
fi
|
||||
else
|
||||
echo_date 备用服务器在线版本号:"$ss_basic_version_web1" 和本地版本号:"$ss_basic_version_local" 相同!
|
||||
dbus set ss_basic_install_status="5"
|
||||
sleep 2
|
||||
echo_date 那还更新个毛啊,关闭更新进程!
|
||||
dbus set ss_basic_install_status="0"
|
||||
exit
|
||||
fi
|
||||
else
|
||||
echo_date 没有检测到备用服务器在线版本号,访问备用服务器有点问题哦,你网络很差欸~
|
||||
dbus set ss_basic_install_status="7"
|
||||
sleep 2
|
||||
echo_date 然而只有这一台备用更更新服务器,请尝试离线手动安装...
|
||||
dbus set ss_basic_install_status="0"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
# Enable service by user choose
|
||||
apply_ss(){
|
||||
sh /jffs/softcenter/ss/stop.sh stop_all
|
||||
sh /jffs/softcenter/scripts/ss_prestart.sh
|
||||
sh /jffs/softcenter/ss/start.sh start_all
|
||||
# if [ "1" == "$ss_basic_action" ]; then
|
||||
# sh /jffs/softcenter/ss/stop.sh stop_part
|
||||
# sh /jffs/softcenter/scripts/ss_prestart.sh
|
||||
# sh /jffs/softcenter/ss/start.sh start_all
|
||||
# elif [ "2" == "$ss_basic_action" ]; then
|
||||
# sh /jffs/softcenter/ss/start.sh restart_dns
|
||||
# elif [ "3" == "$ss_basic_action" ]; then
|
||||
# sh /jffs/softcenter/ss/start.sh restart_wb_list
|
||||
# elif [ "4" == "$ss_basic_action" ]; then
|
||||
# sh /jffs/softcenter/ss/start.sh restart_addon
|
||||
# fi
|
||||
# dbus set ss_basic_action="1"
|
||||
}
|
||||
|
||||
disable_ss(){
|
||||
sh /jffs/softcenter/ss/stop.sh stop_all
|
||||
dbus set ss_basic_action="1"
|
||||
}
|
||||
|
||||
# write number into nvram with no commit
|
||||
write_numbers(){
|
||||
nvram set update_ipset="$(cat /jffs/softcenter/ss/rules/version | sed -n 1p | sed 's/#/\n/g'| sed -n 1p)"
|
||||
nvram set update_chnroute="$(cat /jffs/softcenter/ss/rules/version | sed -n 2p | sed 's/#/\n/g'| sed -n 1p)"
|
||||
nvram set update_cdn="$(cat /jffs/softcenter/ss/rules/version | sed -n 4p | sed 's/#/\n/g'| sed -n 1p)"
|
||||
nvram set ipset_numbers=$(cat /jffs/softcenter/ss/rules/gfwlist.conf | grep -c ipset)
|
||||
nvram set chnroute_numbers=$(cat /jffs/softcenter/ss/rules/chnroute.txt | grep -c .)
|
||||
nvram set cdn_numbers=$(cat /jffs/softcenter/ss/rules/cdn.txt | grep -c .)
|
||||
}
|
||||
|
||||
set_ulimit(){
|
||||
ulimit -n 16384
|
||||
}
|
||||
|
||||
case $ACTION in
|
||||
start)
|
||||
if [ "$ss_basic_enable" == "1" ];then
|
||||
creat_folder
|
||||
set_ulimit
|
||||
apply_ss
|
||||
write_numbers
|
||||
else
|
||||
echo ss not enabled
|
||||
fi
|
||||
;;
|
||||
stop | kill )
|
||||
disable_ss
|
||||
echo_date
|
||||
echo_date 你已经成功关闭shadowsocks服务~
|
||||
echo_date See you again!
|
||||
echo_date
|
||||
echo_date =============== 梅林固件 - shadowsocks by sadoneli\&Xiaobao ===============
|
||||
;;
|
||||
restart)
|
||||
#disable_ss
|
||||
creat_folder
|
||||
set_ulimit
|
||||
apply_ss
|
||||
write_numbers
|
||||
echo_date
|
||||
echo_date Enjoy surfing internet without "Great Fire Wall"!
|
||||
echo_date
|
||||
echo_date =============== 梅林固件 - shadowsocks by sadoneli\&Xiaobao ===============
|
||||
dbus fire onssstart
|
||||
dbus set ss_basic_install_status="0"
|
||||
;;
|
||||
update)
|
||||
update_ss
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 (start|stop|restart|kill|reconfigure)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
640
shadowsocks/shadowsocks/ss/start.sh
Executable file
640
shadowsocks/shadowsocks/ss/start.sh
Executable file
@ -0,0 +1,640 @@
|
||||
#!/bin/sh
|
||||
#--------------------------------------------------------------------------------------
|
||||
# Variable definitions
|
||||
eval `dbus export ss`
|
||||
source /jffs/softcenter/scripts/base.sh
|
||||
source helper.sh
|
||||
ss_basic_password=`echo $ss_basic_password|base64 -d`
|
||||
CONFIG_FILE=/jffs/softcenter/ss/ss.json
|
||||
DNS_PORT=7913
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
ISP_DNS=$(nvram get wan0_dns|sed 's/ /\n/g'|grep -v 0.0.0.0|grep -v 127.0.0.1|sed -n 1p)
|
||||
[ "$ss_dns_china" == "1" ] && [ ! -z "$ISP_DNS" ] && CDN="$ISP_DNS"
|
||||
[ "$ss_dns_china" == "1" ] && [ -z "$ISP_DNS" ] && CDN="114.114.114.114"
|
||||
[ "$ss_dns_china" == "2" ] && CDN="223.5.5.5"
|
||||
[ "$ss_dns_china" == "3" ] && CDN="223.6.6.6"
|
||||
[ "$ss_dns_china" == "4" ] && CDN="114.114.114.114"
|
||||
[ "$ss_dns_china" == "5" ] && CDN="114.114.115.115"
|
||||
[ "$ss_dns_china" == "6" ] && CDN="1.2.4.8"
|
||||
[ "$ss_dns_china" == "7" ] && CDN="210.2.4.8"
|
||||
[ "$ss_dns_china" == "8" ] && CDN="112.124.47.27"
|
||||
[ "$ss_dns_china" == "9" ] && CDN="114.215.126.16"
|
||||
[ "$ss_dns_china" == "10" ] && CDN="180.76.76.76"
|
||||
[ "$ss_dns_china" == "11" ] && CDN="119.29.29.29"
|
||||
[ "$ss_dns_china" == "12" ] && CDN="$ss_dns_china_user"
|
||||
|
||||
# try to resolv the ss server ip if it is domain...
|
||||
resolv_server_ip(){
|
||||
IFIP=`echo $ss_basic_server|grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}|:"`
|
||||
if [ -z "$IFIP" ];then
|
||||
echo_date 使用nslookup方式解析SS服务器的ip地址,解析dns:$ss_basic_dnslookup_server
|
||||
if [ "$ss_basic_dnslookup" == "1" ];then
|
||||
server_ip=`nslookup "$ss_basic_server" $ss_basic_dnslookup_server | sed '1,4d' | awk '{print $3}' | grep -v :|awk 'NR==1{print}'`
|
||||
if [ "$?" == "0" ]; then
|
||||
echo_date SS服务器的ip地址解析成功:$server_ip.
|
||||
else
|
||||
echo_date SS服务器域名解析失败!
|
||||
echo_date 尝试用resolveip方式解析...
|
||||
server_ip=`resolveip -4 -t 2 $ss_basic_server|awk 'NR==1{print}'`
|
||||
if [ "$?" == "0" ]; then
|
||||
echo_date SS服务器的ip地址解析成功:$server_ip.
|
||||
else
|
||||
echo_date 使用resolveip方式SS服务器域名解析失败!请更换nslookup解析方式的DNS地址后重试!
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo_date 使用resolveip方式解析SS服务器的ip地址.
|
||||
server_ip=`resolveip -4 -t 2 $ss_basic_server|awk 'NR==1{print}'`
|
||||
fi
|
||||
|
||||
if [ ! -z "$server_ip" ];then
|
||||
ss_basic_server="$server_ip"
|
||||
dbus set ss_basic_server_ip="$server_ip"
|
||||
dbus set ss_basic_dns_success="1"
|
||||
else
|
||||
dbus remvoe ss_basic_server_ip
|
||||
echo_date SS服务器的ip地址解析失败,将由ss-redir自己解析.
|
||||
dbus set ss_basic_dns_success="0"
|
||||
fi
|
||||
else
|
||||
dbus set ss_basic_server_ip=$ss_basic_server
|
||||
echo_date 检测到你的SS服务器已经是IP格式:$ss_basic_server,跳过解析...
|
||||
dbus set ss_basic_dns_success="1"
|
||||
fi
|
||||
}
|
||||
# create shadowsocks config file...
|
||||
creat_ss_json(){
|
||||
if [ "$ss_basic_ss_obfs_host" != "" ];then
|
||||
if [ "$ss_basic_ss_obfs" == "http" ];then
|
||||
ARG_OBFS="obfs=http;obfs-host=$ss_basic_ss_obfs_host"
|
||||
elif [ "$ss_basic_ss_obfs" == "tls" ];then
|
||||
ARG_OBFS="obfs=tls;obfs-host=$ss_basic_ss_obfs_host"
|
||||
else
|
||||
ARG_OBFS=""
|
||||
fi
|
||||
else
|
||||
if [ "$ss_basic_ss_obfs" == "http" ];then
|
||||
ARG_OBFS="obfs=http"
|
||||
elif [ "$ss_basic_ss_obfs" == "tls" ];then
|
||||
ARG_OBFS="obfs=tls"
|
||||
else
|
||||
ARG_OBFS=""
|
||||
fi
|
||||
fi
|
||||
echo_date 创建SS配置文件到$CONFIG_FILE
|
||||
if [ "$ss_basic_use_rss" == "0" ];then
|
||||
cat > $CONFIG_FILE <<-EOF
|
||||
{
|
||||
"server":"$ss_basic_server",
|
||||
"server_port":$ss_basic_port,
|
||||
"local_port":3333,
|
||||
"password":"$ss_basic_password",
|
||||
"timeout":600,
|
||||
"method":"$ss_basic_method"
|
||||
}
|
||||
EOF
|
||||
elif [ "$ss_basic_use_rss" == "1" ];then
|
||||
cat > $CONFIG_FILE <<-EOF
|
||||
{
|
||||
"server":"$ss_basic_server",
|
||||
"server_port":$ss_basic_port,
|
||||
"local_port":3333,
|
||||
"password":"$ss_basic_password",
|
||||
"timeout":600,
|
||||
"protocol":"$ss_basic_rss_protocol",
|
||||
"protocol_param":"$ss_basic_rss_protocol_para",
|
||||
"obfs":"$ss_basic_rss_obfs",
|
||||
"obfs_param":"$ss_basic_rss_obfs_param",
|
||||
"method":"$ss_basic_method"
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
start_sslocal(){
|
||||
echo_date ┣开启ss-local,为dns2socks提供socks5端口:23456
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
rss-local -b 0.0.0.0 -l 23456 -c $CONFIG_FILE -u -f /var/run/sslocal1.pid >/dev/null 2>&1
|
||||
elif [ "$ss_basic_use_rss" == "0" ];then
|
||||
if [ "$ss_basic_ss_obfs" == "0" ];then
|
||||
ss-local -b 0.0.0.0 -l 23456 -c $CONFIG_FILE -u -f /var/run/sslocal1.pid >/dev/null 2>&1
|
||||
else
|
||||
ss-local -b 0.0.0.0 -l 23456 -c $CONFIG_FILE -u --plugin obfs-local --plugin-opts "$ARG_OBFS" -f /var/run/sslocal1.pid >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
start_dns(){
|
||||
# Start DNS2SOCKS
|
||||
if [ "1" == "$ss_dns_foreign" ] || [ -z "$ss_dns_foreign" ]; then
|
||||
# start ss-local on port 23456
|
||||
start_sslocal
|
||||
echo_date 开启dns2socks,监听端口:23456
|
||||
dns2socks 127.0.0.1:23456 "$ss_dns2socks_user" 127.0.0.1:$DNS_PORT > /dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
# Start ss-tunnel
|
||||
[ "$ss_sstunnel" == "1" ] && gs="208.67.220.220:53"
|
||||
[ "$ss_sstunnel" == "2" ] && gs="8.8.8.8:53"
|
||||
[ "$ss_sstunnel" == "3" ] && gs="8.8.4.4:53"
|
||||
[ "$ss_sstunnel" == "4" ] && gs="$ss_sstunnel_user"
|
||||
if [ "2" == "$ss_dns_foreign" ];then
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
echo_date 开启ssr-tunnel...
|
||||
rss-tunnel -b 0.0.0.0 -c /jffs/softcenter/ss/ss.json -l $DNS_PORT -L "$gs" -u -f /var/run/sstunnel.pid >/dev/null 2>&1
|
||||
elif [ "$ss_basic_use_rss" == "0" ];then
|
||||
echo_date 开启ss-tunnel...
|
||||
if [ "$ss_basic_ss_obfs" == "0" ];then
|
||||
ss-tunnel -b 0.0.0.0 -s $ss_basic_server -p $ss_basic_port -m $ss_basic_method -k $ss_basic_password -l $DNS_PORT -L "$gs" -u -f /var/run/sstunnel.pid >/dev/null 2>&1
|
||||
else
|
||||
ss-tunnel -b 0.0.0.0 -s $ss_basic_server -p $ss_basic_port -m $ss_basic_method -k $ss_basic_password -l $DNS_PORT -L "$gs" -u --plugin obfs-local --plugin-opts "$ARG_OBFS" -f /var/run/sstunnel.pid >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start dnscrypt-proxy
|
||||
if [ "3" == "$ss_dns_foreign" ];then
|
||||
echo_date 开启 dnscrypt-proxy,你选择了"$ss_opendns"节点.
|
||||
dnscrypt-proxy --local-address=127.0.0.1:$DNS_PORT --daemonize -L /jffs/softcenter/ss/rules/dnscrypt-resolvers.csv -R $ss_opendns >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
# Start pdnsd
|
||||
if [ "4" == "$ss_dns_foreign" ]; then
|
||||
echo_date 开启 pdnsd,pdnsd进程可能会不稳定,请自己斟酌.
|
||||
echo_date 创建/jffs/softcenter/ss/pdnsd文件夹.
|
||||
mkdir -p /jffs/softcenter/ss/pdnsd
|
||||
if [ "$ss_pdnsd_method" == "1" ];then
|
||||
echo_date 创建pdnsd配置文件到/tmp/var/etc/pdnsd.conf
|
||||
echo_date 你选择了-仅udp查询-,需要开启上游dns服务,以防止dns污染.
|
||||
cat > /tmp/var/etc/pdnsd.conf <<-EOF
|
||||
global {
|
||||
perm_cache=2048;
|
||||
cache_dir="/tmp/var/etc/";
|
||||
run_as="nobody";
|
||||
server_port = $DNS_PORT;
|
||||
server_ip = 127.0.0.1;
|
||||
status_ctl = on;
|
||||
query_method=udp_only;
|
||||
min_ttl=$ss_pdnsd_server_cache_min;
|
||||
max_ttl=$ss_pdnsd_server_cache_max;
|
||||
timeout=10;
|
||||
}
|
||||
|
||||
server {
|
||||
label= "BLUECAVE";
|
||||
ip = 127.0.0.1;
|
||||
port = 1099;
|
||||
root_server = on;
|
||||
uptest = none;
|
||||
}
|
||||
EOF
|
||||
if [ "$ss_pdnsd_udp_server" == "1" ];then
|
||||
echo_date 开启dns2socks作为pdnsd的上游服务器.
|
||||
start_sslocal
|
||||
dns2socks 127.0.0.1:23456 "$ss_pdnsd_udp_server_dns2socks" 127.0.0.1:1099 > /dev/null 2>&1 &
|
||||
elif [ "$ss_pdnsd_udp_server" == "2" ];then
|
||||
echo_date 开启dnscrypt-proxy作为pdnsd的上游服务器.
|
||||
dnscrypt-proxy --local-address=127.0.0.1:1099 --daemonize -L /jffs/softcenter/ss/rules/dnscrypt-resolvers.csv -R "$ss_pdnsd_udp_server_dnscrypt"
|
||||
elif [ "$ss_pdnsd_udp_server" == "3" ];then
|
||||
[ "$ss_pdnsd_udp_server_ss_tunnel" == "1" ] && dns1="208.67.220.220:53"
|
||||
[ "$ss_pdnsd_udp_server_ss_tunnel" == "2" ] && dns1="8.8.8.8:53"
|
||||
[ "$ss_pdnsd_udp_server_ss_tunnel" == "3" ] && dns1="8.8.4.4:53"
|
||||
[ "$ss_pdnsd_udp_server_ss_tunnel" == "4" ] && dns1="$ss_pdnsd_udp_server_ss_tunnel_user"
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
echo_date 开启ssr-tunnel作为pdnsd的上游服务器.
|
||||
rss-tunnel -b 0.0.0.0 -c /jffs/softcenter/ss/ss.json -l 1099 -L "$dns1" -u -f /var/run/sstunnel.pid >/dev/null 2>&1
|
||||
elif [ "$ss_basic_use_rss" == "0" ];then
|
||||
echo_date 开启ss-tunnel作为pdnsd的上游服务器.
|
||||
if [ "$ss_basic_ss_obfs" == "0" ];then
|
||||
ss-tunnel -b 0.0.0.0 -s $ss_basic_server -p $ss_basic_port -m $ss_basic_method -k $ss_basic_password -l $DNS_PORT -L "$dns1" -u -f /var/run/sstunnel.pid >/dev/null 2>&1
|
||||
else
|
||||
ss-tunnel -b 0.0.0.0 -s $ss_basic_server -p $ss_basic_port -m $ss_basic_method -k $ss_basic_password -l $DNS_PORT -L "$dns1" -u --plugin obfs-local --plugin-opts "$ARG_OBFS" -f /var/run/sstunnel.pid >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif [ "$ss_pdnsd_method" == "2" ];then
|
||||
echo_date 创建pdnsd配置文件到/tmp/var/etc/pdnsd.conf
|
||||
echo_date 你选择了-仅tcp查询-,使用"$ss_pdnsd_server_ip":"$ss_pdnsd_server_port"进行tcp查询.
|
||||
cat > /tmp/var/etc/pdnsd.conf <<-EOF
|
||||
global {
|
||||
perm_cache=2048;
|
||||
cache_dir="/tmp/var/etc/";
|
||||
run_as="nobody";
|
||||
server_port = $DNS_PORT;
|
||||
server_ip = 127.0.0.1;
|
||||
status_ctl = on;
|
||||
query_method=tcp_only;
|
||||
min_ttl=$ss_pdnsd_server_cache_min;
|
||||
max_ttl=$ss_pdnsd_server_cache_max;
|
||||
timeout=10;
|
||||
}
|
||||
|
||||
server {
|
||||
label= "BLUECAVE";
|
||||
ip = $ss_pdnsd_server_ip;
|
||||
port = $ss_pdnsd_server_port;
|
||||
root_server = on;
|
||||
uptest = none;
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
chmod 644 /tmp/var/etc/pdnsd.conf
|
||||
CACHEDIR=/tmp/var/etc
|
||||
CACHE=/tmp/var/etc/pdnsd.cache
|
||||
USER=nobody
|
||||
GROUP=nogroup
|
||||
|
||||
if ! test -f "$CACHE"; then
|
||||
echo_date 创建pdnsd缓存文件.
|
||||
dd if=/dev/zero of=/tmp/var/etc/pdnsd.cache bs=1 count=4 2> /dev/null
|
||||
chown -R $USER.$GROUP $CACHEDIR 2> /dev/null
|
||||
fi
|
||||
|
||||
echo_date 启动pdnsd进程...
|
||||
pdnsd --daemon -c /tmp/var/etc/pdnsd.conf -p /var/run/pdnsd.pid
|
||||
fi
|
||||
|
||||
# Start chinadns
|
||||
if [ "5" == "$ss_dns_foreign" ];then
|
||||
echo_date ┏你选择了chinaDNS作为解析方案!
|
||||
[ "$ss_chinadns_china" == "1" ] && rcc="223.5.5.5"
|
||||
[ "$ss_chinadns_china" == "2" ] && rcc="223.6.6.6"
|
||||
[ "$ss_chinadns_china" == "3" ] && rcc="114.114.114.114"
|
||||
[ "$ss_chinadns_china" == "4" ] && rcc="114.114.115.115"
|
||||
[ "$ss_chinadns_china" == "5" ] && rcc="1.2.4.8"
|
||||
[ "$ss_chinadns_china" == "6" ] && rcc="210.2.4.8"
|
||||
[ "$ss_chinadns_china" == "7" ] && rcc="112.124.47.27"
|
||||
[ "$ss_chinadns_china" == "8" ] && rcc="114.215.126.16"
|
||||
[ "$ss_chinadns_china" == "9" ] && rcc="180.76.76.76"
|
||||
[ "$ss_chinadns_china" == "10" ] && rcc="119.29.29.29"
|
||||
[ "$ss_chinadns_china" == "11" ] && rcc="$ss_chinadns_china_user"
|
||||
|
||||
if [ "$ss_chinadns_foreign_method" == "1" ];then
|
||||
[ "$ss_chinadns_foreign_dns2socks" == "1" ] && rcfd="208.67.220.220:53"
|
||||
[ "$ss_chinadns_foreign_dns2socks" == "2" ] && rcfd="8.8.8.8:53"
|
||||
[ "$ss_chinadns_foreign_dns2socks" == "3" ] && rcfd="8.8.4.4:53"
|
||||
[ "$ss_chinadns_foreign_dns2socks" == "4" ] && rcfd="$ss_chinadns_foreign_dns2socks_user"
|
||||
|
||||
start_sslocal
|
||||
echo_date ┣开启dns2socks,作为chinaDNS上游国外dns,转发dns:$rcfd
|
||||
dns2socks 127.0.0.1:23456 "$rcfd" 127.0.0.1:1055 > /dev/null 2>&1 &
|
||||
elif [ "$ss_chinadns_foreign_method" == "2" ];then
|
||||
echo_date ┣开启 dnscrypt-proxy,作为chinaDNS上游国外dns,你选择了"$ss_chinadns_foreign_dnscrypt"节点.
|
||||
dnscrypt-proxy --local-address=127.0.0.1:1055 --daemonize -L /jffs/softcenter/ss/rules/dnscrypt-resolvers.csv -R $ss_chinadns_foreign_dnscrypt >/dev/null 2>&1
|
||||
elif [ "$ss_chinadns_foreign_method" == "3" ];then
|
||||
[ "$ss_chinadns_foreign_sstunnel" == "1" ] && rcfs="208.67.220.220:53"
|
||||
[ "$ss_chinadns_foreign_sstunnel" == "2" ] && rcfs="8.8.8.8:53"
|
||||
[ "$ss_chinadns_foreign_sstunnel" == "3" ] && rcfs="8.8.4.4:53"
|
||||
[ "$ss_chinadns_foreign_sstunnel" == "4" ] && rcfs="$ss_chinadns_foreign_sstunnel_user"
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
echo_date ┣开启ssr-tunnel,作为chinaDNS上游国外dns,转发dns:$rcfs
|
||||
rss-tunnel -b 127.0.0.1 -c /jffs/softcenter/ss/ss.json -l 1055 -L "$rcfs" -u -f /var/run/sstunnel.pid >/dev/null 2>&1
|
||||
elif [ "$ss_basic_use_rss" == "0" ];then
|
||||
echo_date ┣开启ss-tunnel,作为chinaDNS上游国外dns,转发dns:$rcfs
|
||||
if [ "$ss_basic_ss_obfs" == "0" ];then
|
||||
ss-tunnel -b 0.0.0.0 -s $ss_basic_server -p $ss_basic_port -m $ss_basic_method -k $ss_basic_password -l 1055 -L "$rcfs" -u -f /var/run/sstunnel.pid
|
||||
else
|
||||
ss-tunnel -b 0.0.0.0 -s $ss_basic_server -p $ss_basic_port -m $ss_basic_method -k $ss_basic_password -l 1055 -L "$rcfs" -u --plugin obfs-local --plugin-opts "$ARG_OBFS" -f /var/run/sstunnel.pid >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
elif [ "$ss_chinadns_foreign_method" == "4" ];then
|
||||
echo_date ┣你选择了自定义chinadns国外dns!dns:$ss_chinadns_foreign_method_user
|
||||
fi
|
||||
echo_date ┗开启chinadns进程!
|
||||
chinadns -p $DNS_PORT -s "$rcc",127.0.0.1:1055 -m -d -c /jffs/softcenter/ss/rules/chnroute.txt >/dev/null 2>&1 &
|
||||
fi
|
||||
}
|
||||
#--------------------------------------------------------------------------------------
|
||||
load_cdn_site(){
|
||||
# append china site
|
||||
rm -rf /tmp/etc/dnsmasq.user/sscdn.conf
|
||||
|
||||
|
||||
if [ "$ss_dns_plan" == "2" ] && [ "$ss_dns_foreign" != "5" ] && [ "$ss_dns_foreign" != "6" ];then
|
||||
echo_date 生成cdn加速列表到/tmp/etc/dnsmasq.user/sscdn.conf,加速用的dns:$CDN
|
||||
echo "#for china site CDN acclerate" >> /tmp/etc/dnsmasq.user/sscdn.conf
|
||||
cat /jffs/softcenter/ss/rules/cdn.txt | sed "s/^/server=&\/./g" | sed "s/$/\/&$CDN/g" | sort | awk '{if ($0!=line) print;line=$0}' >>/tmp/etc/dnsmasq.user/sscdn.conf
|
||||
fi
|
||||
|
||||
# append user defined china site
|
||||
if [ ! -z "$ss_isp_website_web" ];then
|
||||
cdnsites=$(echo $ss_isp_website_web | base64 -d)
|
||||
echo_date 生成自定义cdn加速域名到/tmp/etc/dnsmasq.user/sscdn.conf
|
||||
echo "#for user defined china site CDN acclerate" >> /tmp/etc/dnsmasq.user/sscdn.conf
|
||||
for cdnsite in $cdnsites
|
||||
do
|
||||
echo "$cdnsite" | sed "s/^/server=&\/./g" | sed "s/$/\/&$CDN/g" >> /tmp/etc/dnsmasq.user/sscdn.conf
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
custom_dnsmasq(){
|
||||
rm -rf /tmp/etc/dnsmasq.user/custom.conf
|
||||
if [ ! -z "$ss_dnsmasq" ];then
|
||||
echo_date 添加自定义dnsmasq设置到/tmp/etc/dnsmasq.user/custom.conf
|
||||
echo "$ss_dnsmasq" | base64 -d | sort -u >> /tmp/etc/dnsmasq.user/custom.conf
|
||||
fi
|
||||
}
|
||||
|
||||
append_white_black_conf(){
|
||||
# append white domain list, bypass ss
|
||||
rm -rf /tmp/etc/dnsmasq.user/wblist.conf
|
||||
# github need to go ss
|
||||
if [ "$ss_basic_mode" != "6" ];then
|
||||
echo "#for router itself" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "server=/.google.com.tw/127.0.0.1#7913" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "ipset=/.google.com.tw/router" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "server=/.github.com/127.0.0.1#7913" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "ipset=/.github.com/router" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "server=/.github.io/127.0.0.1#7913" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "ipset=/.github.io/router" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "server=/.raw.githubusercontent.com/127.0.0.1#7913" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "ipset=/.raw.githubusercontent.com/router" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "server=/.adblockplus.org/127.0.0.1#7913" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "ipset=/.adblockplus.org/router" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
fi
|
||||
# append white domain list,not through ss
|
||||
wanwhitedomain=$(echo $ss_wan_white_domain | base64 -d)
|
||||
if [ ! -z $ss_wan_white_domain ];then
|
||||
echo_date 应用域名白名单
|
||||
echo "#for white_domain" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
for wan_white_domain in $wanwhitedomain
|
||||
do
|
||||
echo "$wan_white_domain" | sed "s/^/server=&\/./g" | sed "s/$/\/127.0.0.1#7913/g" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "$wan_white_domain" | sed "s/^/ipset=&\/./g" | sed "s/$/\/white_ip/g" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
done
|
||||
fi
|
||||
|
||||
# apple 和microsoft不能走ss
|
||||
echo "#for special site" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
for wan_white_domain2 in "apple.com" "microsoft.com"
|
||||
do
|
||||
echo "$wan_white_domain2" | sed "s/^/server=&\/./g" | sed "s/$/\/$CDN#53/g" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "$wan_white_domain2" | sed "s/^/ipset=&\/./g" | sed "s/$/\/white_ip/g" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
done
|
||||
|
||||
# append black domain list,through ss
|
||||
wanblackdomain=$(echo $ss_wan_black_domain | base64 -d)
|
||||
if [ ! -z $ss_wan_black_domain ];then
|
||||
echo_date 应用域名黑名单
|
||||
echo "#for black_domain" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
for wan_black_domain in $wanblackdomain
|
||||
do
|
||||
echo "$wan_black_domain" | sed "s/^/server=&\/./g" | sed "s/$/\/127.0.0.1#7913/g" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
echo "$wan_black_domain" | sed "s/^/ipset=&\/./g" | sed "s/$/\/black_ip/g" >> /tmp/etc/dnsmasq.user/wblist.conf
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
ln_conf(){
|
||||
|
||||
gfw_on=`dbus list ss_acl_mode_|cut -d "=" -f 2 | grep 1`
|
||||
rm -rf /tmp/etc/dnsmasq.user/gfwlist.conf
|
||||
if [ "$ss_basic_mode" == "1" ];then
|
||||
echo_date 创建gfwlist的软连接到/jffs/etc/dnsmasq.d/文件夹.
|
||||
ln -sf /jffs/softcenter/ss/rules/gfwlist.conf /tmp/etc/dnsmasq.user/gfwlist.conf
|
||||
elif [ "$ss_basic_mode" == "2" ] || [ "$ss_basic_mode" == "3" ];then
|
||||
if [ ! -f /tmp/etc/dnsmasq.user/gfwlist.conf ] && [ "$ss_dns_plan" == "1" ] || [ -n "$gfw_on" ];then
|
||||
echo_date 创建gfwlist的软连接到/tmp/etc/dnsmasq.user/文件夹.
|
||||
ln -sf /jffs/softcenter/ss/rules/gfwlist.conf /tmp/etc/dnsmasq.user/gfwlist.conf
|
||||
fi
|
||||
fi
|
||||
#echo_date 创建dnsmasq.postconf软连接到/jffs/scripts/文件夹.
|
||||
rm -rf /jffs/scripts/dnsmasq.postconf
|
||||
ln -sf /koolshare/ss/rules/dnsmasq.postconf /jffs/scripts/dnsmasq.postconf
|
||||
}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------
|
||||
nat_auto_start(){
|
||||
mkdir -p /jffs/scripts
|
||||
# creating iptables rules to nat-start
|
||||
if [ ! -f /jffs/scripts/nat-start ]; then
|
||||
cat > /jffs/scripts/nat-start <<-EOF
|
||||
#!/bin/sh
|
||||
dbus fire onnatstart
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
writenat=$(cat /jffs/scripts/nat-start | grep "nat-start")
|
||||
if [ -z "$writenat" ];then
|
||||
echo_date 添加nat-start触发事件...用于ss的nat规则重启后或网络恢复后的加载.
|
||||
[ $ss_basic_sleep -ne 0 ] && \
|
||||
sed -i "2a sleep $ss_basic_sleep" /jffs/scripts/nat-start
|
||||
[ $ss_basic_sleep -ne 0 ] && \
|
||||
sed -i '3a sh /jffs/softcenter/ss/nat-start.sh start_all' /jffs/scripts/nat-start || \
|
||||
sed -i '2a sh /jffs/softcenter/ss/nat-start.sh start_all' /jffs/scripts/nat-start
|
||||
chmod +x /jffs/scripts/nat-start
|
||||
fi
|
||||
}
|
||||
#--------------------------------------------------------------------------------------
|
||||
wan_auto_start(){
|
||||
# Add service to auto start
|
||||
if [ ! -f /jffs/scripts/wan-start ]; then
|
||||
cat > /jffs/scripts/wan-start <<-EOF
|
||||
#!/bin/sh
|
||||
dbus fire onwanstart
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
startss=$(cat /jffs/scripts/wan-start | grep "/jffs/softcenter/scripts/ss_config.sh")
|
||||
if [ -z "$startss" ];then
|
||||
echo_date 添加wan-start触发事件...用于ss的各种程序的开机启动,启动延迟$ss_basic_sleep
|
||||
[ $ss_basic_sleep -ne 0 ] && \
|
||||
sed -i "2a sleep $ss_basic_sleep" /jffs/scripts/wan-start
|
||||
[ $ss_basic_sleep -ne 0 ] && \
|
||||
sed -i '3a sh /jffs/softcenter/scripts/ss_config.sh' /jffs/scripts/wan-start || \
|
||||
sed -i '2a sh /jffs/softcenter/scripts/ss_config.sh' /jffs/scripts/wan-start
|
||||
fi
|
||||
chmod +x /jffs/scripts/wan-start
|
||||
}
|
||||
|
||||
#=======================================================================================
|
||||
|
||||
start_ss_redir(){
|
||||
# Start ss-redir
|
||||
if [ "$ss_basic_use_rss" == "1" ];then
|
||||
echo_date 开启ssr-redir进程,用于透明代理.
|
||||
rss-redir -b 0.0.0.0 -c $CONFIG_FILE -f /var/run/shadowsocks.pid >/dev/null 2>&1
|
||||
elif [ "$ss_basic_use_rss" == "0" ];then
|
||||
echo_date 开启ss-redir进程,用于透明代理.
|
||||
if [ "$ss_basic_ss_obfs" == "0" ];then
|
||||
ss-redir -b 0.0.0.0 -c $CONFIG_FILE -f /var/run/shadowsocks.pid >/dev/null 2>&1
|
||||
else
|
||||
ss-redir -b 0.0.0.0 -c $CONFIG_FILE --plugin obfs-local --plugin-opts "$ARG_OBFS" -f /var/run/shadowsocks.pid >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
write_cron_job(){
|
||||
if [ "1" == "$ss_basic_rule_update" ]; then
|
||||
echo_date 添加ss规则定时更新任务,每天"$ss_basic_rule_update_time"自动检测更新规则.
|
||||
cru a ssupdate "0 $ss_basic_rule_update_time * * * /bin/sh /jffs/softcenter/scripts/ss_rule_update.sh"
|
||||
else
|
||||
echo_date ss规则定时更新任务未启用!
|
||||
fi
|
||||
}
|
||||
|
||||
kill_cron_job(){
|
||||
jobexist=`cru l|grep ssupdate`
|
||||
if [ ! -z "$jobexist" ];then
|
||||
echo_date 删除ss规则定时更新任务.
|
||||
sed -i '/ssupdate/d' /var/spool/cron/crontabs/* >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
stop_dns(){
|
||||
dnscrypt=$(ps | grep "dnscrypt-proxy" | grep -v "grep")
|
||||
pdnsd=$(ps | grep "pdnsd" | grep -v "grep")
|
||||
chinadns=$(ps | grep "chinadns" | grep -v "grep")
|
||||
DNS2SOCK=$(ps | grep "dns2socks" | grep -v "grep")
|
||||
Pcap_DNSProxy=$(ps | grep "Pcap_DNSProxy" | grep -v "grep")
|
||||
PID_DNS_SH=$(ps |grep "/jffs/softcenter/ss/dns/dns.sh" | grep -v "grep" |awk '{print $1}')
|
||||
sstunnel=$(ps | grep "ss-tunnel" | grep -v "grep" | grep -vw "rss-tunnel")
|
||||
rsstunnel=$(ps | grep "rss-tunnel" | grep -v "grep" | grep -vw "ss-tunnel")
|
||||
# kill dnscrypt-proxy
|
||||
if [ ! -z "$dnscrypt" ]; then
|
||||
echo_date 关闭dnscrypt-proxy进程...
|
||||
killall dnscrypt-proxy
|
||||
fi
|
||||
# kill ss-tunnel
|
||||
if [ ! -z "$sstunnel" ]; then
|
||||
echo_date 关闭ss-tunnel进程...
|
||||
killall ss-tunnel >/dev/null 2>&1
|
||||
fi
|
||||
if [ ! -z "$rsstunnel" ]; then
|
||||
echo_date 关闭rss-tunnel进程...
|
||||
killall rss-tunnel >/dev/null 2>&1
|
||||
fi
|
||||
# kill pdnsd
|
||||
if [ ! -z "$pdnsd" ]; then
|
||||
echo_date 关闭pdnsd进程...
|
||||
killall pdnsd
|
||||
fi
|
||||
# kill chinadns
|
||||
if [ ! -z "$chinadns" ]; then
|
||||
echo_date 关闭chinadns进程...
|
||||
killall chinadns
|
||||
fi
|
||||
# kill dns2socks
|
||||
if [ ! -z "$DNS2SOCK" ]; then
|
||||
echo_date 关闭dns2socks进程...
|
||||
killall dns2socks
|
||||
fi
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------------------------
|
||||
|
||||
load_nat(){
|
||||
nat_ready=$(iptables -t nat -L PREROUTING -v -n --line-numbers|grep -v PREROUTING|grep -v destination)
|
||||
i=120
|
||||
until [ -n "$nat_ready" ]
|
||||
do
|
||||
i=$(($i-1))
|
||||
if [ "$i" -lt 1 ];then
|
||||
echo_date "错误:不能正确加载nat规则!"
|
||||
sh /jffs/softcenter/ss/stop.sh stop_all
|
||||
exit
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
echo_date "加载nat规则!"
|
||||
sh /jffs/softcenter/ss/nat-start.sh start_all
|
||||
}
|
||||
|
||||
restart_dnsmasq(){
|
||||
# Restart dnsmasq
|
||||
echo_date 重启dnsmasq服务...
|
||||
/sbin/service restart_dnsmasq >/dev/null 2>&1
|
||||
}
|
||||
|
||||
remove_status(){
|
||||
nvram set ss_foreign_state=""
|
||||
nvram set ss_china_state=""
|
||||
}
|
||||
|
||||
main_portal(){
|
||||
if [ "$ss_main_portal" == "1" ];then
|
||||
nvram set enable_ss=1
|
||||
nvram commit
|
||||
else
|
||||
nvram set enable_ss=0
|
||||
nvram commit
|
||||
fi
|
||||
}
|
||||
|
||||
load_module(){
|
||||
xt=`lsmod | grep xt_set`
|
||||
OS=$(uname -r)
|
||||
if [ -f /lib/modules/${OS}/kernel/net/netfilter/xt_set.ko ] && [ -z "$xt" ];then
|
||||
echo_date "加载xt_set.ko内核模块!"
|
||||
insmod /lib/modules/${OS}/kernel/net/netfilter/xt_set.ko
|
||||
fi
|
||||
}
|
||||
|
||||
restart_addon(){
|
||||
#ss_basic_action=4
|
||||
echo_date ----------------------------- 重启附加功能 -----------------------------
|
||||
# for sleep walue in start up files
|
||||
old_sleep=`cat /jffs/scripts/nat-start | grep sleep | awk '{print $2}'`
|
||||
new_sleep="$ss_basic_sleep"
|
||||
if [ "$old_sleep" = "$new_sleep" ];then
|
||||
echo_date 开机延迟时间未改变,仍然是"$ss_basic_sleep"秒.
|
||||
else
|
||||
echo_date 设置"$ss_basic_sleep"秒开机延迟...
|
||||
# delete boot delay in nat-start and wan-start
|
||||
sed -i '/jffs/softcenter/d' /jffs/scripts/nat-start >/dev/null 2>&1
|
||||
sed -i '/sleep/d' /jffs/scripts/nat-start >/dev/null 2>&1
|
||||
sed -i '/jffs/softcenter/d' /jffs/scripts/wan-start >/dev/null 2>&1
|
||||
sed -i '/sleep/d' /jffs/scripts/wan-start >/dev/null 2>&1
|
||||
# re add delay in nat-start and wan-start
|
||||
nat_auto_start >/dev/null 2>&1
|
||||
wan_auto_start >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
#remove_status
|
||||
remove_status
|
||||
main_portal
|
||||
|
||||
if [ "$ss_basic_dnslookup" == "1" ];then
|
||||
echo_date 设置使用nslookup方式解析SS服务器的ip地址.
|
||||
else
|
||||
echo_date 设置使用resolveip方式解析SS服务器的ip地址.
|
||||
fi
|
||||
echo_date -------------------------- 附加功能重启完毕! ---------------------------
|
||||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
start_all)
|
||||
#ss_basic_action=1
|
||||
echo_date ------------------------- 梅林固件 shadowsocks --------------------------
|
||||
resolv_server_ip
|
||||
creat_ss_json
|
||||
#creat_dnsmasq_basic_conf
|
||||
load_cdn_site
|
||||
custom_dnsmasq
|
||||
append_white_black_conf && ln_conf
|
||||
nat_auto_start
|
||||
wan_auto_start
|
||||
write_cron_job
|
||||
start_dns
|
||||
start_ss_redir
|
||||
load_module
|
||||
load_nat
|
||||
restart_dnsmasq
|
||||
remove_status
|
||||
nvram set ss_mode=2
|
||||
nvram commit
|
||||
echo_date ------------------------- shadowsocks 启动完毕 -------------------------
|
||||
[ "$ss_basic_action" == "4" ] && restart_addon
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 (start_all)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
241
shadowsocks/shadowsocks/ss/stop.sh
Executable file
241
shadowsocks/shadowsocks/ss/stop.sh
Executable file
@ -0,0 +1,241 @@
|
||||
#!/bin/sh
|
||||
#--------------------------------------------------------------------------
|
||||
# Variable definitions
|
||||
# source /jffs/softcenter/configs/ss.sh
|
||||
eval `dbus export shadowsocks`
|
||||
eval `dbus export ss`
|
||||
alias echo_date='echo $(date +%Y年%m月%d日\ %X):'
|
||||
redsocks2=$(ps | grep "redsocks2" | grep -v "grep")
|
||||
dnscrypt=$(ps | grep "dnscrypt-proxy" | grep -v "grep")
|
||||
sokcs5=$(ps|grep ss-local|grep -vw rss-local|grep -v 23456|cut -d " " -f 1)
|
||||
ssredir=$(ps | grep "ss-redir" | grep -v "grep" | grep -vw "rss-redir")
|
||||
rssredir=$(ps | grep "rss-redir" | grep -v "grep" | grep -vw "ss-redir")
|
||||
sstunnel=$(ps | grep "ss-tunnel" | grep -v "grep" | grep -vw "rss-tunnel")
|
||||
rsstunnel=$(ps | grep "rss-tunnel" | grep -v "grep" | grep -vw "ss-tunnel")
|
||||
pdnsd=$(ps | grep "pdnsd" | grep -v "grep")
|
||||
chinadns=$(ps | grep "chinadns" | grep -v "grep")
|
||||
DNS2SOCK=$(ps | grep "dns2socks" | grep -v "grep")
|
||||
client_linux_mips=$(ps | grep "client_linux_mips" | grep -v "grep")
|
||||
haproxy=$(ps | grep "haproxy" | grep -v "grep")
|
||||
obfsLocal=$(ps | grep "obfs-local" | grep -v "grep")
|
||||
lan_ipaddr=$(nvram get lan_ipaddr)
|
||||
ip_rule_exist=`/usr/sbin/ip rule show | grep "fwmark 0x1/0x1 lookup 310" | grep -c 310`
|
||||
nvram set ss_mode=0
|
||||
dbus set dns2socks=0
|
||||
nvram commit
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
restore_conf(){
|
||||
# delete dnsmasq postconf file
|
||||
if [ -f /jffs/scripts/dnsmasq.postconf ]; then
|
||||
echo_date 删除/jffs/scripts/dnsmasq.postconf
|
||||
rm -f /jffs/scripts/dnsmasq.postconf
|
||||
fi
|
||||
# delete custom.conf
|
||||
if [ -f /tmp/etc/dnsmasq.user/custom.conf ];then
|
||||
echo_date 删除 /tmp/etc/dnsmasq.user/custom.conf
|
||||
rm -rf /tmp/etc/dnsmasq.user/custom.conf
|
||||
fi
|
||||
}
|
||||
|
||||
bring_up_dnsmasq(){
|
||||
# Bring up dnsmasq
|
||||
echo_date 重启dnsmasq服务...
|
||||
service restart_dnsmasq >/dev/null 2>&1
|
||||
}
|
||||
|
||||
restore_nat(){
|
||||
echo_date 尝试先清除已存在的iptables规则,防止重复添加
|
||||
# flush rules and set if any
|
||||
iptables -t nat -D PREROUTING -p tcp -j SHADOWSOCKS >/dev/null 2>&1
|
||||
sleep 1
|
||||
iptables -t nat -F SHADOWSOCKS > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS > /dev/null 2>&1
|
||||
iptables -t nat -F SHADOWSOCKS_GFW > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS_GFW > /dev/null 2>&1
|
||||
iptables -t nat -F SHADOWSOCKS_CHN > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS_CHN > /dev/null 2>&1
|
||||
iptables -t nat -F SHADOWSOCKS_GLO > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS_GLO > /dev/null 2>&1
|
||||
iptables -t nat -F SHADOWSOCKS_HOM > /dev/null 2>&1 && iptables -t nat -X SHADOWSOCKS_HOM > /dev/null 2>&1
|
||||
iptables -t nat -D OUTPUT -p tcp -m set --set router dst -j REDIRECT --to-ports 3333 >/dev/null 2>&1
|
||||
iptables -t nat -D PREROUTING -p udp --dport 53 -j DNAT --to $lan_ipaddr >/dev/null 2>&1
|
||||
|
||||
#ip route del local 0.0.0.0/0 dev lo table 300 >/dev/null 2>&1
|
||||
/usr/sbin/ip route del local 0.0.0.0/0 dev lo table 310 >/dev/null 2>&1
|
||||
|
||||
|
||||
|
||||
if [ ! -z "ip_rule_exist" ];then
|
||||
until [ "$ip_rule_exist" = 0 ]
|
||||
do
|
||||
#ip rule del fwmark 0x01/0x01 table 310
|
||||
/usr/sbin/ip rule del fwmark 0x01/0x01 table 310 pref 789
|
||||
ip_rule_exist=`expr $ip_rule_exist - 1`
|
||||
done
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
destory_ipset(){
|
||||
# flush and destory ipset
|
||||
ipset -F router >/dev/null 2>&1
|
||||
ipset -F chnroute >/dev/null 2>&1
|
||||
ipset -F white_ip >/dev/null 2>&1
|
||||
ipset -F white_cidr >/dev/null 2>&1
|
||||
ipset -F black_ip >/dev/null 2>&1
|
||||
ipset -F black_cidr >/dev/null 2>&1
|
||||
ipset -F gfwlist >/dev/null 2>&1
|
||||
|
||||
ipset -X router >/dev/null 2>&1
|
||||
ipset -X chnroute >/dev/null 2>&1
|
||||
ipset -X white_ip >/dev/null 2>&1
|
||||
ipset -X white_cidr >/dev/null 2>&1
|
||||
ipset -X black_ip >/dev/null 2>&1
|
||||
ipset -X black_cidr >/dev/null 2>&1
|
||||
ipset -X gfwlist >/dev/null 2>&1
|
||||
}
|
||||
|
||||
restore_start_file(){
|
||||
echo_date 清除nat-start, wan-start中相关的SS启动命令...
|
||||
|
||||
# restore nat-start file if any
|
||||
sed -i '/source/,/warning/d' /jffs/scripts/nat-start >/dev/null 2>&1
|
||||
sed -i '/nat-start/d' /jffs/scripts/nat-start >/dev/null 2>&1
|
||||
sed -i '/jffs/softcenter/d' /jffs/scripts/nat-start >/dev/null 2>&1
|
||||
sed -i '/sleep 5/d' /jffs/scripts/nat-start >/dev/null 2>&1
|
||||
|
||||
# clear start up command line in wan-start
|
||||
sed -i '/start.sh/d' /jffs/scripts/wan-start >/dev/null 2>&1
|
||||
sed -i '/ssconfig/d' /jffs/scripts/wan-start >/dev/null 2>&1
|
||||
sed -i '/jffs/softcenter/d' /jffs/scripts/wan-start >/dev/null 2>&1
|
||||
sed -i '/sleep/d' /jffs/scripts/wan-start >/dev/null 2>&1
|
||||
sed -i '/sleep/d' /jffs/scripts/nat-start >/dev/null 2>&1
|
||||
}
|
||||
|
||||
kill_process(){
|
||||
#--------------------------------------------------------------------------
|
||||
# kill dnscrypt-proxy
|
||||
if [ ! -z "$dnscrypt" ]; then
|
||||
echo_date 关闭dnscrypt-proxy进程...
|
||||
killall dnscrypt-proxy
|
||||
fi
|
||||
#--------------------------------------------------------------------------
|
||||
# kill redsocks2
|
||||
if [ ! -z "$redsocks2" ]; then
|
||||
echo_date 关闭redsocks2进程...
|
||||
killall redsocks2
|
||||
fi
|
||||
#--------------------------------------------------------------------------
|
||||
# kill ss-redir
|
||||
if [ ! -z "$ssredir" ];then
|
||||
echo_date 关闭ss-redir进程...
|
||||
killall ss-redir
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -z "$rssredir" ];then
|
||||
echo_date 关闭ssr-redir进程...
|
||||
killall rss-redir
|
||||
fi
|
||||
#--------------------------------------------------------------------------
|
||||
# kill ss-local
|
||||
sslocal=`ps | grep ss-local | grep -v "grep" | grep -w "23456" | awk '{print $1}'`
|
||||
if [ ! -z "$sslocal" ];then
|
||||
echo_date 关闭ss-local进程:23456端口...
|
||||
kill $sslocal >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
ssrlocal=`ps | grep rss-local | grep -v "grep" | grep -w "23456" | awk '{print $1}'`
|
||||
if [ ! -z "$ssrlocal" ];then
|
||||
echo_date 关闭ssr-local进程:23456端口...
|
||||
kill $ssrlocal >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# kill ss-tunnel
|
||||
if [ ! -z "$sstunnel" ];then
|
||||
echo_date 关闭ss-tunnel进程...
|
||||
killall ss-tunnel
|
||||
fi
|
||||
|
||||
if [ ! -z "$rsstunnel" ];then
|
||||
echo_date 关闭rss-tunnel进程...
|
||||
killall rss-tunnel
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# kill pdnsd
|
||||
if [ ! -z "$pdnsd" ];then
|
||||
echo_date 关闭pdnsd进程...
|
||||
killall pdnsd
|
||||
fi
|
||||
#--------------------------------------------------------------------------
|
||||
# kill chinadns
|
||||
if [ ! -z "$chinadns" ];then
|
||||
echo_date 关闭chinadns进程...
|
||||
killall chinadns
|
||||
fi
|
||||
#--------------------------------------------------------------------------
|
||||
# kill dns2socks
|
||||
if [ ! -z "$DNS2SOCK" ];then
|
||||
echo_date 关闭dns2socks进程...
|
||||
killall dns2socks
|
||||
fi
|
||||
|
||||
if [ ! -z "$client_linux_mips" ];then
|
||||
echo_date 关闭kcp协议进程...
|
||||
killall client_linux_mips >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ ! -z "$haproxy" ];then
|
||||
echo_date 关闭haproxy进程...
|
||||
killall haproxy >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
[ -n "$obfsLocal" ] && echo_date 关闭obfs-local进程... && killall obfs-local >/dev/null 2>&1
|
||||
}
|
||||
|
||||
kill_cron_job(){
|
||||
# kill crontab job
|
||||
echo_date 删除ss规则更新计划任务.
|
||||
sed -i '/ssupdate/d' /var/spool/cron/crontabs/* >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
remove_conf_and_settings(){
|
||||
echo_date 删除ss相关的名单配置文件.
|
||||
# remove conf under /jffs/configs/dnsmasq.d
|
||||
rm -rf /tmp/etc/dnsmasq.user/gfwlist.conf
|
||||
rm -rf /tmp/etc/dnsmasq.user/cdn.conf
|
||||
rm -rf /tmp/etc/dnsmasq.user/custom.conf
|
||||
rm -rf /tmp/etc/dnsmasq.user/wblist.conf
|
||||
rm -rf /tmp/etc/dnsmasq.user/sscdn.conf
|
||||
rm -rf /tmp/etc/dnsmasq.user/custom.conf
|
||||
rm -rf /tmp/etc/dnsmasq.user/wblist.conf
|
||||
|
||||
# remove ss state
|
||||
dbus remove ss_basic_state_china
|
||||
dbus remove ss_basic_state_foreign
|
||||
}
|
||||
|
||||
case $1 in
|
||||
stop_all)
|
||||
#KCP_basic_action=0 应用所有设置
|
||||
echo_date =============== 梅林固件 - shadowsocks by sadoneli\&Xiaobao ===============
|
||||
echo_date
|
||||
echo_date -------------------------- 关闭Shadowsocks ------------------------------
|
||||
restore_conf
|
||||
remove_conf_and_settings
|
||||
bring_up_dnsmasq
|
||||
restore_nat
|
||||
destory_ipset
|
||||
restore_start_file
|
||||
kill_process
|
||||
kill_cron_job
|
||||
echo_date -------------------------- Shadowsocks已关闭 -----------------------------
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 (stop_all|stop_part)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
1
shadowsocks/shadowsocks/ss/version
Executable file
1
shadowsocks/shadowsocks/ss/version
Executable file
@ -0,0 +1 @@
|
||||
3.0.4
|
33
shadowsocks/shadowsocks/uninstall.sh
Executable file
33
shadowsocks/shadowsocks/uninstall.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#! /bin/sh
|
||||
|
||||
sh /jffs/softcenter/ss/ssconfig.sh stop
|
||||
sh /jffs/softcenter/scripts/ss_conf_remove.sh
|
||||
sleep 1
|
||||
rm -rf /jffs/softcenter/ss/*
|
||||
rm -rf /jffs/softcenter/scripts/ss_*
|
||||
rm -rf /jffs/softcenter/webs/Main_Ss*
|
||||
rm -rf /jffs/softcenter/bin/ss-tunnel
|
||||
rm -rf /jffs/softcenter/bin/ss-local
|
||||
rm -rf /jffs/softcenter/bin/ss-server
|
||||
rm -rf /jffs/softcenter/bin/ss-redir
|
||||
rm -rf /jffs/softcenter/bin/rss*
|
||||
rm -rf /jffs/softcenter/bin/obfs*
|
||||
rm -rf /jffs/softcenter/bin/haproxy
|
||||
rm -rf /jffs/softcenter/bin/redsocks2
|
||||
rm -rf /jffs/softcenter/bin/pdnsd
|
||||
#rm -rf /jffs/softcenter/bin/Pcap_DNSProxy
|
||||
rm -rf /jffs/softcenter/bin/dnscrypt-proxy
|
||||
rm -rf /jffs/softcenter/bin/dns2socks
|
||||
rm -rf /jffs/softcenter/bin/client_linux_mips
|
||||
rm -rf /jffs/softcenter/bin/chinadns
|
||||
rm -rf /jffs/softcenter/bin/resolveip
|
||||
|
||||
|
||||
dbus remove softcenter_module_shadowsocks_home_url
|
||||
dbus remove softcenter_module_shadowsocks_install
|
||||
dbus remove softcenter_module_shadowsocks_md5
|
||||
dbus remove softcenter_module_shadowsocks_version
|
||||
|
||||
dbus remove ss_basic_enable
|
||||
dbus remove ss_basic_version_local
|
||||
dbus remove ss_basic_version_web
|
352
shadowsocks/shadowsocks/webs/Main_SsLocal_Content.asp
Executable file
352
shadowsocks/shadowsocks/webs/Main_SsLocal_Content.asp
Executable file
@ -0,0 +1,352 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<meta HTTP-EQUIV="Expires" CONTENT="-1">
|
||||
<link rel="shortcut icon" href="images/favicon.png">
|
||||
<link rel="icon" href="images/favicon.png">
|
||||
<title>Shadowsocks - Socks5代理设置</title>
|
||||
<link rel="stylesheet" type="text/css" href="index_style.css">
|
||||
<link rel="stylesheet" type="text/css" href="form_style.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/element.css">
|
||||
<script language="JavaScript" type="text/javascript" src="/state.js"></script>
|
||||
<script language="JavaScript" type="text/javascript" src="/help.js"></script>
|
||||
<script language="JavaScript" type="text/javascript" src="/general.js"></script>
|
||||
<script language="JavaScript" type="text/javascript" src="/popup.js"></script>
|
||||
<script language="JavaScript" type="text/javascript" src="/client_function.js"></script>
|
||||
<script language="JavaScript" type="text/javascript" src="/validator.js"></script>
|
||||
<script type="text/javascript" src="/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="/switcherplugin/jquery.iphone-switch.js"></script>
|
||||
<script type="text/javascript" src="/dbconf?p=ss&v=<% uptime(); %>"></script>
|
||||
<script type="text/javascript" src="/res/ss-menu.js"></script>
|
||||
<style>
|
||||
.Bar_container{
|
||||
width:85%;
|
||||
height:20px;
|
||||
border:1px inset #999;
|
||||
margin:0 auto;
|
||||
margin-top:20px \9;
|
||||
background-color:#FFFFFF;
|
||||
z-index:100;
|
||||
}
|
||||
#proceeding_img_text{
|
||||
position:absolute;
|
||||
z-index:101;
|
||||
font-size:11px; color:#000000;
|
||||
line-height:21px;
|
||||
width: 83%;
|
||||
}
|
||||
#proceeding_img{
|
||||
height:21px;
|
||||
background:#C0D1D3 url(/images/ss_proceding.gif);
|
||||
}
|
||||
#ClientList_Block_PC {
|
||||
border: 1px outset #999;
|
||||
background-color: #576D73;
|
||||
position: absolute;
|
||||
*margin-top:26px;
|
||||
margin-left: 3px;
|
||||
*margin-left:-129px;
|
||||
width: 255px;
|
||||
text-align: left;
|
||||
height: auto;
|
||||
overflow-y: auto;
|
||||
z-index: 200;
|
||||
padding: 1px;
|
||||
display: none;
|
||||
}
|
||||
#ClientList_Block_PC div {
|
||||
background-color: #576D73;
|
||||
height: auto;
|
||||
*height:20px;
|
||||
line-height: 20px;
|
||||
text-decoration: none;
|
||||
font-family: Lucida Console;
|
||||
padding-left: 2px;
|
||||
}
|
||||
#ClientList_Block_PC a {
|
||||
background-color: #EFEFEF;
|
||||
color: #FFF;
|
||||
font-size: 12px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
text-decoration: none;
|
||||
}
|
||||
#ClientList_Block_PC div:hover, #ClientList_Block a:hover {
|
||||
background-color: #3366FF;
|
||||
color: #FFFFFF;
|
||||
cursor: default;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var socks5 = 1
|
||||
var $j = jQuery.noConflict();
|
||||
var $G = function (id) {
|
||||
return document.getElementById(id);
|
||||
};
|
||||
|
||||
function init(){
|
||||
show_menu(menu_hook);
|
||||
conf_to_obj();
|
||||
buildswitch();
|
||||
toggle_switch();
|
||||
update_visibility();
|
||||
}
|
||||
|
||||
function toggle_switch(){
|
||||
var rrt = document.getElementById("switch");
|
||||
if (document.form.ss_local_enable.value != "1") {
|
||||
rrt.checked = false;
|
||||
} else {
|
||||
rrt.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
function buildswitch(){
|
||||
$j("#switch").click(
|
||||
function(){
|
||||
if(document.getElementById('switch').checked){
|
||||
document.form.ss_local_enable.value = 1;
|
||||
|
||||
}else{
|
||||
document.form.ss_local_enable.value = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function conf_to_obj(){
|
||||
if(typeof db_ss != "undefined") {
|
||||
for(var field in db_ss) {
|
||||
var el = document.getElementById(field);
|
||||
if(el != null) {
|
||||
el.value = db_ss[field];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
document.getElementById("logArea").innerHTML = "无法读取配置,jffs为空或配置文件不存在?";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function onSubmitCtrl(o, s) {
|
||||
if(validForm()){
|
||||
showSSLoadingBar(5);
|
||||
document.form.action_mode.value = s;
|
||||
updateOptions();
|
||||
}
|
||||
}
|
||||
|
||||
function done_validating(action){
|
||||
return true;
|
||||
}
|
||||
|
||||
function updateOptions(){
|
||||
document.form.enctype = "";
|
||||
document.form.encoding = "";
|
||||
document.form.action = "/applydb.cgi?p=ss_local_";
|
||||
document.form.action_script.value = "ss_socks5.sh";
|
||||
document.form.submit();
|
||||
}
|
||||
|
||||
function validForm(){
|
||||
var is_ok = true;
|
||||
return is_ok;
|
||||
}
|
||||
|
||||
function update_visibility(){
|
||||
showhide("ss_obfs_host", (document.form.ss_local_obfs.value !== "0" ));
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init();">
|
||||
<div id="TopBanner"></div>
|
||||
<div id="Loading" class="popup_bg"></div>
|
||||
<div id="LoadingBar" class="popup_bar_bg">
|
||||
<table cellpadding="5" cellspacing="0" id="loadingBarBlock" class="loadingBarBlock" align="center">
|
||||
<tr>
|
||||
<td height="100">
|
||||
<div id="loading_block3" style="margin:10px auto;width:85%; font-size:12pt;"></div>
|
||||
<div id="loading_block1" class="Bar_container">
|
||||
<span id="proceeding_img_text"></span>
|
||||
<div id="proceeding_img"></div>
|
||||
</div>
|
||||
<div id="loading_block2" style="margin:10px auto; width:85%;">此期间请勿访问屏蔽网址,以免污染DNS进入缓存</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<iframe name="hidden_frame" id="hidden_frame" src="" width="0" height="0" frameborder="0"></iframe>
|
||||
<form method="post" name="form" action="/applyss.cgi" target="hidden_frame">
|
||||
<input type="hidden" name="current_page" value="Main_SsLocal_Content.asp">
|
||||
<input type="hidden" name="next_page" value="Main_SsLocal_Content.asp">
|
||||
<input type="hidden" name="group_id" value="">
|
||||
<input type="hidden" name="modified" value="0">
|
||||
<input type="hidden" name="action_mode" value="">
|
||||
<input type="hidden" name="action_script" value="">
|
||||
<input type="hidden" name="action_wait" value="8">
|
||||
<input type="hidden" name="first_time" value="">
|
||||
<input type="hidden" name="preferred_lang" id="preferred_lang" value="<% nvram_get("preferred_lang"); %>">
|
||||
<input type="hidden" name="firmver" value="<% nvram_get("firmver"); %>">
|
||||
<input type="hidden" id="ss_local_enable" name="ss_local_enable" value='<% dbus_get_def("ss_local_enable", "0"); %>'/>
|
||||
<table class="content" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="17"> </td>
|
||||
<td valign="top" width="202">
|
||||
<div id="mainMenu"></div>
|
||||
<div id="subMenu"></div>
|
||||
</td>
|
||||
<td valign="top"><div id="tabMenu" class="submenuBlock"></div>
|
||||
<table width="98%" border="0" align="left" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td align="left" valign="top">
|
||||
<table width="760px" border="0" cellpadding="5" cellspacing="0" bordercolor="#6b8fa3" class="FormTitle" id="FormTitle">
|
||||
<tr>
|
||||
<td bgcolor="#4D595D" colspan="3" valign="top"><div> </div>
|
||||
<div class="formfonttitle">Shadowsocks - Socks5代理设置</div>
|
||||
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px"><img src="/images/New_ui/export/line_export.png"></div>
|
||||
<div class="SimpleNote">
|
||||
<li><i>说明:</i>此页面允许配置第二个shadosocks账号,功能仅限于在路由器上打开一个连接到shadowsocks服务器的socks5端口。如果你使用chrome浏览器,你可以使用SwitchyOmega插件去连接这个socks5代理。</li></br>
|
||||
<li><i>此页面功能独立于ss,单独开关:</i></li>
|
||||
</div>
|
||||
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px"><img src="/images/New_ui/export/line_export.png"></div>
|
||||
<table width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">Shadowsocks - ss-local - 高级设置</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr id="switch_tr">
|
||||
<th>
|
||||
<label>开关</label>
|
||||
</th>
|
||||
<td colspan="2">
|
||||
<div class="switch_field" style="display:table-cell;float: left;">
|
||||
<label for="switch">
|
||||
<input id="switch" class="switch" type="checkbox" style="display: none;">
|
||||
<div class="switch_container" >
|
||||
<div class="switch_bar"></div>
|
||||
<div class="switch_circle transition_style">
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="20%">服务器(建议填写IP地址)</th>
|
||||
<td>
|
||||
<input style="background-image: none;background-color: #576d73;border:1px solid gray" type="text" class="ssconfig input_ss_table" id="ss_local_server" name="ss_local_server" maxlength="100" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="20%">服务器端口</th>
|
||||
<td>
|
||||
<input type="text" class="ssconfig input_ss_table" id="ss_local_port" name="ss_local_port" maxlength="100" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="20%">密码</th>
|
||||
<td>
|
||||
<input type="password" class="ssconfig input_ss_table" id="ss_local_password" name="ss_local_password" maxlength="100" value="" onBlur="switchType(this, false);" onFocus="switchType(this, true);">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="20%">加密方法</th>
|
||||
<td>
|
||||
<select id="ss_local_method" name="ss_local_method" style="width:165px;margin:0px 0px 0px 2px;" class="input_option">
|
||||
<option value="rc4-md5">rc4-md5</option>
|
||||
<option value="aes-128-gcm">aes-128-gcm</option>
|
||||
<option value="aes-192-gcm">aes-192-gcm</option>
|
||||
<option value="aes-256-gcm">aes-256-gcm</option>
|
||||
<option value="aes-128-cfb">aes-128-cfb</option>
|
||||
<option value="aes-192-cfb">aes-192-cfb</option>
|
||||
<option value="aes-256-cfb" selected>aes-256-cfb</option>
|
||||
<option value="aes-128-ctr">aes-128-ctr</option>
|
||||
<option value="aes-192-ctr">aes-192-ctr</option>
|
||||
<option value="aes-256-ctr">aes-256-ctr</option>
|
||||
<option value="camellia-128-cfb">camellia-128-cfb</option>
|
||||
<option value="camellia-192-cfb">camellia-192-cfb</option>
|
||||
<option value="camellia-256-cfb">camellia-256-cfb</option>
|
||||
<option value="bf-cfb">bf-cfb</option>
|
||||
<option value="salsa20">salsa20</option>
|
||||
<option value="chacha20">chacha20</option>
|
||||
<option value="chacha20-poly1305">chacha20-poly1305</option>
|
||||
<option value="chacha20-ietf">chacha20-ietf</option>
|
||||
<option value="chacha20-ietf-poly1305">chacha20-ietf-poly1305</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="20%">超时时间</th>
|
||||
<td>
|
||||
<input type="text" class="ssconfig input_ss_table" id="ss_local_timeout" name="ss_local_timeout" maxlength="100" value="600">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="20%">本地代理端口</th>
|
||||
<td>
|
||||
<input type="text" class="ssconfig input_ss_table" id="ss_local_proxyport" name="ss_local_proxyport" maxlength="100" value="1082">
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="ss_obfs">
|
||||
<th width="35%">混淆 (obfs)</th>
|
||||
<td>
|
||||
<select id="ss_local_obfs" name="ss_local_obfs" style="width:164px;margin:0px 0px 0px 2px;" class="input_option" onchange="update_visibility();" >
|
||||
<option class="content_input_fd" value="0">关闭</option>
|
||||
<option class="content_input_fd" value="tls">tls</option>
|
||||
<option class="content_input_fd" value="http">http</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="ss_obfs_host">
|
||||
<th width="35%">混淆主机名 (obfs_host)</th>
|
||||
<td>
|
||||
<input type="text" name="ss_local_obfs_host" id="ss_local_obfs_host" placeholder="bing.com" class="ssconfig input_ss_table" maxlength="100" value=""></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="acl_support">
|
||||
<th>ACL控制</th>
|
||||
<td>
|
||||
<select name="ss_local_acl" id="ss_local_acl" class="input_option" style="width:165px;margin:0px 0px 0px 2px;">
|
||||
<option value="0" selected>不使用</option>
|
||||
<option value="1">gfwlist.pac</option>
|
||||
<option value="2">chn.pac</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="warning" style="font-size:14px;margin:20px auto;"></div>
|
||||
<div class="apply_gen">
|
||||
<input class="button_gen" id="cmdBtn" onClick="onSubmitCtrl(this, ' Refresh ')" type="button" value="提交" />
|
||||
</div>
|
||||
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px"><img src="/images/New_ui/export/line_export.png"></div>
|
||||
<div class="KoolshareBottom">论坛技术支持: <a href="http://www.koolshare.cn" target="_blank"> <i><u>www.koolshare.cn</u></i> </a> <br/>
|
||||
博客技术支持: <a href="http://www.mjy211.com" target="_blank"> <i><u>www.mjy211.com</u></i> </a> <br/>
|
||||
Github项目: <a href="https://github.com/koolshare/koolshare.github.io" target="_blank"> <i><u>github.com/koolshare</u></i> </a> <br/>
|
||||
Shell by: <a href="mailto:sadoneli@gmail.com"> <i>sadoneli</i> </a>, Web by: <i>Xiaobao</i> </div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="10" align="center" valign="top"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="footer"></div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
<!--[if !IE]>-->
|
||||
jQuery.noConflict();
|
||||
(function($){
|
||||
var i = 0;
|
||||
})(jQuery);
|
||||
<!--<![endif]-->
|
||||
</script>
|
||||
</html>
|
||||
|
3209
shadowsocks/shadowsocks/webs/Main_Ss_Content.asp
Executable file
3209
shadowsocks/shadowsocks/webs/Main_Ss_Content.asp
Executable file
File diff suppressed because it is too large
Load Diff
735
shadowsocks/shadowsocks/webs/Main_Ss_LoadBlance.asp
Executable file
735
shadowsocks/shadowsocks/webs/Main_Ss_LoadBlance.asp
Executable file
@ -0,0 +1,735 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache"/>
|
||||
<meta HTTP-EQUIV="Expires" CONTENT="-1"/>
|
||||
<link rel="shortcut icon" href="images/favicon.png"/>
|
||||
<link rel="icon" href="images/favicon.png"/>
|
||||
<title>软件中心 - 负载均衡</title>
|
||||
<link rel="stylesheet" type="text/css" href="index_style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="form_style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="usp_style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="ParentalControl.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/icon.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/element.css">
|
||||
<script type="text/javascript" src="/state.js"></script>
|
||||
<script type="text/javascript" src="/popup.js"></script>
|
||||
<script type="text/javascript" src="/help.js"></script>
|
||||
<script type="text/javascript" src="/validator.js"></script>
|
||||
<script type="text/javascript" src="/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="/general.js"></script>
|
||||
<script type="text/javascript" src="/switcherplugin/jquery.iphone-switch.js"></script>
|
||||
<script type="text/javascript" src="/dbconf?p=ss&v=<% uptime(); %>"></script>
|
||||
<script type="text/javascript" src="/res/softcenter.js"></script>
|
||||
<script language="JavaScript" type="text/javascript" src="/client_function.js"></script>
|
||||
<script type="text/javascript" src="/res/ss-menu.js"></script>
|
||||
<style>
|
||||
.cloud_main_radius h2 { border-bottom:1px #AAA dashed;}
|
||||
.cloud_main_radius h3 { font-size:12px;color:#FFF;font-weight:normal;font-style: normal;}
|
||||
.cloud_main_radius h4 { font-size:12px;color:#FC0;font-weight:normal;font-style: normal;}
|
||||
.cloud_main_radius h5 { color:#FFF;font-weight:normal;font-style: normal;}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
var socks5 = 0
|
||||
var Base64;
|
||||
if(typeof btoa == "Function") {
|
||||
Base64 = {encode:function(e){ return btoa(e); }, decode:function(e){ return atob(e);}};
|
||||
} else {
|
||||
Base64 ={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}}
|
||||
}
|
||||
String.prototype.replaceAll = function(s1,s2){
|
||||
return this.replace(new RegExp(s1,"gm"),s2);
|
||||
}
|
||||
function init() {
|
||||
show_menu(menu_hook);
|
||||
buildswitch();
|
||||
conf2obj();
|
||||
//delTr_onstart();
|
||||
var rrt = document.getElementById("switch");
|
||||
if (document.form.ss_lb_enable.value != "1") {
|
||||
rrt.checked = false;
|
||||
} else {
|
||||
rrt.checked = true;
|
||||
}
|
||||
loadAllConfigs();
|
||||
refresh_table();
|
||||
load_lb_node_nu();
|
||||
generate_link();
|
||||
update_visibility();
|
||||
}
|
||||
|
||||
function buildswitch(){
|
||||
$j("#switch").click(
|
||||
function(){
|
||||
if(document.getElementById('switch').checked){
|
||||
document.form.ss_lb_enable.value = 1;
|
||||
|
||||
}else{
|
||||
document.form.ss_lb_enable.value = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onSubmitCtrl(o, s) {
|
||||
|
||||
lb_enable = $G("ss_lb_enable").value;
|
||||
if (lb_enable == 0){
|
||||
del_lb_node();
|
||||
}else if (lb_enable == 1){
|
||||
if (lb_node_nu < 2){
|
||||
alert("必须选择大于或者等于2个节点,才能正常提交!");
|
||||
return false;
|
||||
}
|
||||
add_new_lb_node();
|
||||
}
|
||||
document.form.action_mode.value = s;
|
||||
document.form.action_script.value = "ss_lb_config.sh";
|
||||
document.form.ss_basic_action.value = 9;
|
||||
document.form.submit();
|
||||
showSSLoadingBar();
|
||||
noChange2 = 0;
|
||||
setTimeout("checkCmdRet2();", 500);
|
||||
}
|
||||
|
||||
function conf2obj(){ //用dbus值填写表单
|
||||
for (var field in db_ss) {
|
||||
$j('#'+field).val(db_ss[field]);
|
||||
}
|
||||
}
|
||||
|
||||
function getAllConfigs() { //取得所有ss节点数据,并且格式化成数组
|
||||
var dic = {};
|
||||
node_global_max = 0;
|
||||
for (var field in db_ss) {
|
||||
names = field.split("_");
|
||||
dic[names[names.length - 1]] = 'ok';
|
||||
}
|
||||
confs = {};
|
||||
var p = "ssconf_basic";
|
||||
var params = ["name", "server", "port", "password", "method"];
|
||||
for (var field in dic) {
|
||||
var obj = {};
|
||||
if (typeof db_ss[p + "_name_" + field] == "undefined") {
|
||||
obj["name"] = '节点' + field;
|
||||
} else {
|
||||
obj["name"] = db_ss[p + "_name_" + field];
|
||||
}
|
||||
|
||||
if (typeof db_ss[p + "_ping_" + field] == "undefined") {
|
||||
obj["ping"] = '';
|
||||
} else if (db_ss[p + "_ping_" + field] == "failed") {
|
||||
obj["ping"] = '<font color="#FFCC00">failed</font>';
|
||||
} else {
|
||||
obj["ping"] = parseFloat(db_ss[p + "_ping_" + field].split(" ")[0]).toPrecision(3) + " ms / " + parseFloat(db_ss[p + "_ping_" + field].split(" ")[3]) + "%";
|
||||
}
|
||||
|
||||
if (typeof db_ss[p + "_webtest_" + field] == "undefined") {
|
||||
obj["webtest"] = '';
|
||||
} else {
|
||||
var time_total = parseFloat(db_ss[p + "_webtest_" + field].split(":")[0]).toFixed(2);
|
||||
if (time_total == 0.00){
|
||||
obj["webtest"] = '<font color=#FFCC00">failed</font>';
|
||||
}else{
|
||||
obj["webtest"] = parseFloat(db_ss[p + "_webtest_" + field].split(":")[0]).toFixed(2) + " s";
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof db_ss[p + "_mode_" + field] == "undefined"){
|
||||
obj["mode"] = '';
|
||||
}else {
|
||||
obj["mode"] = db_ss[p + "_mode_" + field];
|
||||
}
|
||||
|
||||
if (typeof db_ss[p + "_onetime_auth_" + field] == "undefined"){
|
||||
obj["onetime_auth"] = '';
|
||||
}else {
|
||||
obj["onetime_auth"] = db_ss[p + "_onetime_auth_" + field];
|
||||
}
|
||||
if (typeof db_ss[p + "_use_rss_" + field] == "undefined"){
|
||||
obj["use_rss"] = '';
|
||||
}else {
|
||||
obj["use_rss"] = db_ss[p + "_use_rss_" + field];
|
||||
}
|
||||
|
||||
if (typeof db_ss[p + "_use_lb_" + field] == "undefined"){
|
||||
obj["use_lb"] = '0';
|
||||
}else {
|
||||
obj["use_lb"] = db_ss[p + "_use_lb_" + field];
|
||||
}
|
||||
if (typeof db_ss[p + "_iflb_" + field] == "undefined"){
|
||||
obj["iflb"] = '0';
|
||||
}else {
|
||||
obj["iflb"] = db_ss[p + "_iflb_" + field];
|
||||
}
|
||||
|
||||
if (typeof db_ss[p + "_weight_" + field] == "undefined"){
|
||||
obj["weight"] = '';
|
||||
}else {
|
||||
obj["weight"] = db_ss[p + "_weight_" + field];
|
||||
}
|
||||
if (typeof db_ss[p + "_lbmode_" + field] == "undefined"){
|
||||
obj["lbmode"] = '';
|
||||
}else {
|
||||
obj["lbmode"] = db_ss[p + "_lbmode_" + field];
|
||||
}
|
||||
if (typeof db_ss[p + "_rss_protocol_" + field] == "undefined"){
|
||||
obj["rss_protocol"] = '';
|
||||
}else {
|
||||
obj["rss_protocol"] = db_ss[p + "_rss_protocol_" + field];
|
||||
}
|
||||
|
||||
if (typeof db_ss[p + "_rss_obfs_" + field] == "undefined"){
|
||||
obj["rss_obfs"] = '';
|
||||
}else {
|
||||
obj["rss_obfs"] = db_ss[p + "_rss_obfs_" + field];
|
||||
}
|
||||
|
||||
if (typeof db_ss[p + "_rss_obfs_param_" + field] == "undefined"){
|
||||
obj["rss_obfs_param"] = '';
|
||||
}else {
|
||||
obj["rss_obfs_param"] = db_ss[p + "_rss_obfs_param_" + field];
|
||||
}
|
||||
|
||||
for (var i = 1; i < params.length; i++) {
|
||||
var ofield = p + "_" + params[i] + "_" + field;
|
||||
if (typeof db_ss[ofield] == "undefined") {
|
||||
obj = null;
|
||||
break;
|
||||
}
|
||||
obj[params[i]] = db_ss[ofield];
|
||||
}
|
||||
if (obj != null) {
|
||||
var node_i = parseInt(field);
|
||||
if (node_i > node_global_max) {
|
||||
node_global_max = node_i;
|
||||
}
|
||||
obj["node"] = field;
|
||||
confs[field] = obj;
|
||||
}
|
||||
}
|
||||
return confs;
|
||||
}
|
||||
|
||||
function load_lb_node_nu(){
|
||||
lb_node_nu = 0;
|
||||
confs = getAllConfigs();
|
||||
for (var field in confs) {
|
||||
var c = confs[field];
|
||||
if (c["use_lb"] == "1"){
|
||||
lb_node_nu ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadBasicOptions(confs) { //载入节点选择列表
|
||||
var option = $j("#ss_lb_node");
|
||||
option.find('option').remove().end();
|
||||
for (var field in confs) {
|
||||
var c = confs[field];
|
||||
if (c["use_lb"] != 1 && c["server"] !== "127.0.0.1"){ //节点选择列表中显示所有的非负载均衡节点,并且不显示负载均衡节点本身
|
||||
option.append($j("<option>", {
|
||||
value: field,
|
||||
text: c.name
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function add_new_lb_node(){ //点击添加按钮后,
|
||||
confs = getAllConfigs();
|
||||
cur_lb_node=node_global_max + 1;
|
||||
for (var field in confs) {
|
||||
var c = confs[field];
|
||||
|
||||
if (c["server"] == "127.0.0.1" && c["port"] == db_ss['ss_lb_port']){
|
||||
//alert("你的节点列表里已经有负载均衡的节点,请删除后再添加");
|
||||
cur_lb_node=field;
|
||||
}
|
||||
if (confs[field].use_lb == 1){
|
||||
min_lb_node=field;
|
||||
}
|
||||
}
|
||||
var ns = {};
|
||||
ns["ssconf_basic_name_" + cur_lb_node] = $G("ss_lb_name").value;
|
||||
ns["ssconf_basic_server_" + cur_lb_node] = "127.0.0.1";
|
||||
ns["ssconf_basic_mode_" + cur_lb_node] = db_ss['ssconf_basic_mode_' + min_lb_node];
|
||||
ns["ssconf_basic_port_" + cur_lb_node] = $G("ss_lb_port").value;
|
||||
ns["ssconf_basic_password_" + cur_lb_node] = db_ss['ssconf_basic_password_' + min_lb_node];
|
||||
ns["ssconf_basic_method_" + cur_lb_node] = db_ss['ssconf_basic_method_' + min_lb_node];
|
||||
ns["ssconf_basic_onetime_auth_" + cur_lb_node] = db_ss['ssconf_basic_onetime_auth_' + min_lb_node];
|
||||
ns["ssconf_basic_rss_protocol_" + cur_lb_node] = db_ss['ssconf_basic_rss_protocol_' + min_lb_node];
|
||||
ns["ssconf_basic_rss_obfs_" + cur_lb_node] = db_ss['ssconf_basic_rss_obfs_' + min_lb_node];
|
||||
ns["ssconf_basic_rss_obfs_param_" + cur_lb_node] = db_ss['ssconf_basic_rss_obfs_param_' + min_lb_node];
|
||||
ns["ssconf_basic_use_rss_" + cur_lb_node] = db_ss['ssconf_basic_use_rss_' + min_lb_node];
|
||||
//ns["ssconf_basic_iflb_" + cur_lb_node] = "1";
|
||||
$j.ajax({
|
||||
url: '/applydb.cgi?p=ssconf_basic',
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'text',
|
||||
data: $j.param(ns),
|
||||
error: function(xhr) {
|
||||
console.log("error in posting config of table");
|
||||
},
|
||||
success: function(response) {
|
||||
console.log("success in posting config of table");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function del_lb_node(o) { //删除节点功能
|
||||
confs = getAllConfigs();
|
||||
cur_lb_node=node_global_max + 1;
|
||||
for (var field in confs) {
|
||||
var c = confs[field];
|
||||
|
||||
if (c["server"] == "127.0.0.1" && c["port"] == db_ss['ss_lb_port']){
|
||||
cur_lb_node=field;
|
||||
}
|
||||
}
|
||||
|
||||
var ns = {};
|
||||
ns["ssconf_basic_name_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_server_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_mode_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_port_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_password_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_method_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_onetime_auth_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_rss_protocol_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_rss_obfs_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_rss_obfs_param_" + cur_lb_node] = "";
|
||||
ns["ssconf_basic_use_rss_" + cur_lb_node] = "";
|
||||
//ns["ssconf_basic_iflb_" + cur_lb_node] = "";
|
||||
$j.ajax({
|
||||
url: '/applydb.cgi?use_rm=1&p=ssconf_basic',
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'text',
|
||||
data: $j.param(ns),
|
||||
error: function(xhr) {
|
||||
console.log("error in posting config of table");
|
||||
},
|
||||
success: function(response) {
|
||||
console.log("success in posting config of table");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addTr(){ //点击添加按钮动作
|
||||
lb_node_nu ++;
|
||||
var ns = {};
|
||||
var node_sel = $G("ss_lb_node").value;
|
||||
ns["ssconf_basic_use_lb_" + node_sel] = 1;
|
||||
ns["ssconf_basic_weight_" + node_sel] = $G("ss_lb_weight").value;
|
||||
ns["ssconf_basic_lbmode_" + node_sel] = $G("ss_lb_mode").value;
|
||||
$j.ajax({
|
||||
url: '/applydb.cgi?p=ssconf_basic',
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'text',
|
||||
data: $j.param(ns),
|
||||
error: function(xhr) {
|
||||
console.log("error in posting config of table");
|
||||
},
|
||||
success: function(response) {
|
||||
refresh_table();
|
||||
loadAllConfigs();
|
||||
$j("#ss_lb_node option[value='" + node_sel + "']").remove();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delTr(o) { //删除节点功能
|
||||
lb_node_nu --;
|
||||
var id = $j(o).attr("id");
|
||||
var ids = id.split("_");
|
||||
var p = "ssconf_basic";
|
||||
id = ids[ids.length - 1];
|
||||
var ns = {};
|
||||
ns["ssconf_basic_use_lb_" + id] = "";
|
||||
ns["ssconf_basic_weight_" + id] = "";
|
||||
ns["ssconf_basic_lbmode_" + id] = "";
|
||||
$j.ajax({
|
||||
url: '/applydb.cgi?use_rm=1&p=ssconf_basic',
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'text',
|
||||
data: $j.param(ns),
|
||||
error: function(xhr) {
|
||||
console.log("error in posting config of table");
|
||||
},
|
||||
success: function(response) {
|
||||
refresh_table();
|
||||
loadAllConfigs();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function delTr_onstart() { //删除节点功能
|
||||
confs = getAllConfigs();
|
||||
for (var field in confs) {
|
||||
var c = confs[field];
|
||||
if (c["server"] == "127.0.0.1" && c["port"] == db_ss['ss_lb_port']){
|
||||
//alert("你的节点列表里已经有负载均衡的节点,请删除后再添加");
|
||||
console.log("lb_node already in table");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
var ns = {};
|
||||
for (var i = 1; i < node_global_max; i++) {
|
||||
ns["ssconf_basic_use_lb_" + i] = "";
|
||||
}
|
||||
|
||||
$j.ajax({
|
||||
url: '/applydb.cgi?use_rm=1&p=ssconf_basic',
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'text',
|
||||
data: $j.param(ns),
|
||||
error: function(xhr) {
|
||||
console.log("error in posting config of table");
|
||||
},
|
||||
success: function(response) {
|
||||
refresh_table();
|
||||
loadAllConfigs();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function refresh_table() {
|
||||
$j.ajax({
|
||||
url: '/dbconf?p=ss',
|
||||
dataType: 'html',
|
||||
error: function(xhr){
|
||||
},
|
||||
success: function(response){
|
||||
$j.globalEval(response);
|
||||
$j("#lb_node_table").find("tr:gt(0)").remove();
|
||||
$j('#lb_node_table tr:last').after(refresh_html());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function refresh_html() {
|
||||
confs = getAllConfigs();
|
||||
var html = '';
|
||||
for (var field in confs) {
|
||||
var c = confs[field];
|
||||
if(c["use_lb"] == 1){
|
||||
html = html + '<tr>';
|
||||
html = html + '<td id="ss_node_name_' + c["node"] + '" style="width:85px;">' + c["name"] + '</td>';
|
||||
html = html + '<td id="ss_node_server_' + c["node"] + '" style="width:85px;">' + c["server"] + '</td>';
|
||||
html = html + '<td id="ss_node_port_' + c["node"] + '" style="width:37px;">' + c["port"] + '</td>';
|
||||
html = html + '<td id="ss_node_password_' + c["node"] + '" style="width:75px;">' + Base64.decode(c["password"]) + '</td>';
|
||||
html = html + '<td id="ss_node_method_' + c["node"] + '" style="width:75px;">' + c["method"] + '</td>';
|
||||
if(c["lbmode"] == 3){
|
||||
html = html + '<td id="ss_node_mode_' + c["node"] + '" style="width:75px;">备用节点</td>';
|
||||
}else if(c["lbmode"] == 2){
|
||||
html = html + '<td id="ss_node_mode_' + c["node"] + '" style="width:75px;">主用节点</td>';
|
||||
}else if(c["lbmode"] == 1){
|
||||
html = html + '<td id="ss_node_mode_' + c["node"] + '" style="width:75px;">负载均衡</td>';
|
||||
}
|
||||
html = html + '<td id="ss_node_weight_' + c["node"] + '" style="width:75px;">' + c["weight"] + '</td>';
|
||||
html = html + '<td style="width:33px;">'
|
||||
html = html + '<input style="margin-top: 4px;margin-left:-3px;" id="td_node_' + c["node"] + '" class="remove_btn" type="button" onclick="delTr(this);" value="">'
|
||||
html = html + '</td>';
|
||||
html = html + '</tr>';
|
||||
}
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
function loadAllConfigs() {
|
||||
confs = getAllConfigs();
|
||||
loadBasicOptions(confs);
|
||||
}
|
||||
|
||||
function reload_Soft_Center(){
|
||||
location.href = "/Main_Soft_center.asp";
|
||||
}
|
||||
|
||||
function generate_link(){
|
||||
var link = window.btoa("http://"+'<% nvram_get("lan_ipaddr"); %>'+":1188")
|
||||
document.getElementById("link4.1").href = "http://"+'<% nvram_get("lan_ipaddr"); %>'+":1188";
|
||||
document.getElementById("link4.1").innerHTML = "<i><u>http://"+'<% nvram_get("lan_ipaddr"); %>'+":1188</i></u>";
|
||||
}
|
||||
|
||||
function update_visibility(){
|
||||
showhide("heartbeat_detai", (document.form.ss_lb_heartbeat.value == "1"));
|
||||
}
|
||||
var _responseLen;
|
||||
var noChange2 = 0;
|
||||
function checkCmdRet2(){
|
||||
$j.ajax({
|
||||
url: '/cmdRet_check.htm',
|
||||
dataType: 'html',
|
||||
error: function(xhr){
|
||||
setTimeout("checkCmdRe2t();", 1000);
|
||||
},
|
||||
success: function(response){
|
||||
var retArea = $G("log_content3");
|
||||
if(response.search("XU6J03M6") != -1){
|
||||
retArea.value = response.replace("XU6J03M6", " ");
|
||||
$G("ok_button").style.display = "";
|
||||
retArea.scrollTop = retArea.scrollHeight;
|
||||
x = 6;
|
||||
count_down_close();
|
||||
return true;
|
||||
}else{
|
||||
$G("ok_button").style.display = "none";
|
||||
}
|
||||
|
||||
if(_responseLen == response.length){
|
||||
noChange2++;
|
||||
}else{
|
||||
noChange2 = 0;
|
||||
}
|
||||
|
||||
if(noChange2 > 12){
|
||||
return false;
|
||||
}else{
|
||||
setTimeout("checkCmdRet2();", 1000);
|
||||
}
|
||||
retArea.value = response;
|
||||
retArea.scrollTop = retArea.scrollHeight;
|
||||
_responseLen = response.length;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var x = 6;
|
||||
function count_down_close(){
|
||||
if (x == "0"){
|
||||
hideSSLoadingBar();
|
||||
}
|
||||
if (x < 0){
|
||||
$G("ok_button1").value = "手动关闭"
|
||||
return false;
|
||||
}
|
||||
$G("ok_button1").value = "自动关闭(" + x + ")"
|
||||
--x;
|
||||
setTimeout("count_down_close();",1000);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init();">
|
||||
<div id="TopBanner"></div>
|
||||
<div id="Loading" class="popup_bg"></div>
|
||||
<div id="LoadingBar" class="popup_bar_bg">
|
||||
<table cellpadding="5" cellspacing="0" id="loadingBarBlock" class="loadingBarBlock" align="center">
|
||||
<tr>
|
||||
<td height="100">
|
||||
<div id="loading_block3" style="margin:10px auto;margin-left:10px;width:85%; font-size:12pt;"></div>
|
||||
<div id="loading_block2" style="margin:10px auto;width:95%;"></div>
|
||||
<div id="log_content2" style="margin-left:15px;margin-right:15px;margin-top:10px;">
|
||||
<textarea cols="63" rows="25" wrap="off" readonly="readonly" id="log_content3" style="border:1px solid #000;width:99%; font-family:'Courier New', Courier, mono; font-size:11px;background:#000;color:#FFFFFF;"></textarea>
|
||||
</div>
|
||||
<div id="ok_button" class="apply_gen" style="background: #000;display: none;">
|
||||
<input id="ok_button1" class="button_gen" type="button" onclick="hideSSLoadingBar()" value="确定">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<iframe name="hidden_frame" id="hidden_frame" src="" width="0" height="0" frameborder="0"></iframe>
|
||||
<form method="POST" name="form" action="/applydb.cgi?p=ss" target="hidden_frame">
|
||||
<input type="hidden" name="current_page" value="Main_Ss_LoadBlance.asp"/>
|
||||
<input type="hidden" name="next_page" value="Main_Ss_LoadBlance.asp"/>
|
||||
<input type="hidden" name="group_id" value=""/>
|
||||
<input type="hidden" name="modified" value="0"/>
|
||||
<input type="hidden" name="action_mode" value=""/>
|
||||
<input type="hidden" name="action_script" value=""/>
|
||||
<input type="hidden" name="action_wait" value=""/>
|
||||
<input type="hidden" name="first_time" value=""/>
|
||||
<input type="hidden" name="preferred_lang" id="preferred_lang" value="<% nvram_get("preferred_lang"); %>"/>
|
||||
<input type="hidden" id="ss_basic_action" name="ss_basic_action" value="9" />
|
||||
<input type="hidden" name="firmver" value="<% nvram_get("firmver"); %>"/>
|
||||
<input type="hidden" id="ss_lb_enable" name="ss_lb_enable" value='<% dbus_get_def("ss_lb_enable", "0"); %>'/>
|
||||
<table class="content" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="17"> </td>
|
||||
<td valign="top" width="202">
|
||||
<div id="mainMenu"></div>
|
||||
<div id="subMenu"></div>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<div id="tabMenu" class="submenuBlock"></div>
|
||||
<table width="98%" border="0" align="left" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td align="left" valign="top">
|
||||
<table width="760px" border="0" cellpadding="5" cellspacing="0" bordercolor="#6b8fa3" class="FormTitle" id="FormTitle">
|
||||
<tr>
|
||||
<td bgcolor="#4D595D" colspan="3" valign="top">
|
||||
<div> </div>
|
||||
<table width="100%" height="150px" style="border-collapse:collapse;">
|
||||
<tr >
|
||||
<td colspan="5" class="cloud_main_radius">
|
||||
<div style="padding:10px;width:95%;font-style:italic;font-size:14px;">
|
||||
<br/><br/>
|
||||
<table width="100%" >
|
||||
<tr>
|
||||
<td>
|
||||
<ul style="margin-top:-80px;padding-left:15px;" >
|
||||
<li style="margin-top:-5px;">
|
||||
<h3 id="push_content1" >在此页面可以设置多个shadowsocks或者shadowsocksR帐号负载均衡,同时具有故障转移、自动恢复的功能。</h3>
|
||||
</li>
|
||||
<li style="margin-top:-5px;">
|
||||
<h3 id="push_content2"><font color="#FFCC00">注意:设置负载均衡的节点需要加密方式和密码完全一致!SS、SSR、KCP之间暂不支持设置负载均衡。</font></h3>
|
||||
</li>
|
||||
<li id="push_content3_li" style="margin-top:-5px;">
|
||||
<h3 id="push_content3">提交设置后会开启haproxy,并在ss节点配置中增加一个服务器IP为127.0.0.1,端口为负载均衡服务器端口的帐号;</h3>
|
||||
</li>
|
||||
<li id="push_content4_li" style="margin-top:-5px;">
|
||||
<h3 id="push_content4">负载均衡模式下不支持udp转发:不能使用ss-tunnel作为国外dns方案。</h3>
|
||||
</li>
|
||||
<li id="push_content5_li" style="margin-top:-5px;">
|
||||
<h3 id="push_content4">强烈建议需要负载均衡的ss节点使用ip格式,使用域名会使haproxy进程加载过慢!</h3>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height="10px">
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="margin:-20px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable" id="routing_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">开关设置</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr id="switch_tr">
|
||||
<th>
|
||||
<label>是否启用负载均衡</label>
|
||||
</th>
|
||||
<td colspan="2">
|
||||
<div class="switch_field" style="display:table-cell">
|
||||
<label for="switch">
|
||||
<input id="switch" class="switch" type="checkbox" style="display: none;">
|
||||
<div class="switch_container" >
|
||||
<div class="switch_bar"></div>
|
||||
<div class="switch_circle transition_style">
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width:25%;">Haproxy控制台</th>
|
||||
<td>
|
||||
<div style="padding-top:5px;">
|
||||
<a id="link4.1" href="http://aria2.me/glutton/" target="_blank"></a>
|
||||
|
||||
登录帐号:<i><% nvram_get("http_username"); %></i>
|
||||
|
||||
登录密码:
|
||||
<input type="password" maxlength="64" id="ss_lb_passwd" name="ss_lb_passwd" value="<% nvram_get("http_passwd"); %>" class="input_ss_table" style="width:80px;" autocorrect="off" autocapitalize="off"></input>
|
||||
<div style="margin-left:420px;margin-top:-21px;margin-bottom:2px"><input type="checkbox" name="show_pass" onclick="pass_checked(document.form.ss_lb_passwd);">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Haproxy端口(用于ss监听)</th>
|
||||
<td>
|
||||
<input type="text" maxlength="64" id="ss_lb_port" name="ss_lb_port" value="1181" class="input_ss_table" style="width:60px;" autocorrect="off" autocapitalize="off"></input>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Haproxy故障检测心跳</th>
|
||||
<td>
|
||||
<select id="ss_lb_heartbeat" name="ss_lb_heartbeat" style="width:70px;margin:0px 0px 0px 2px;" class="input_option" onchange="update_visibility();">
|
||||
<option value="0">不启用</option>
|
||||
<option value="1" selected>启用</option>
|
||||
</select>
|
||||
<span id="heartbeat_detai">
|
||||
|
||||
成功:
|
||||
<input type="text" maxlength="64" id="ss_lb_up" name="ss_lb_up" value="2" class="input_ss_table" style="width:20px;" autocorrect="off" autocapitalize="off"></input>
|
||||
次;
|
||||
|
||||
失败:
|
||||
<input type="text" maxlength="64" id="ss_lb_down" name="ss_lb_down" value="3" class="input_ss_table" style="width:20px;" autocorrect="off" autocapitalize="off"></input>
|
||||
次;
|
||||
|
||||
心跳间隔:
|
||||
<input type="text" maxlength="64" id="ss_lb_interval" name="ss_lb_interval" value="2000" class="input_ss_table" style="width:40px;" autocorrect="off" autocapitalize="off"></input>
|
||||
ms
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>节点名(添加到ss节点列表)</th>
|
||||
<td>
|
||||
<input type="text" maxlength="64" id="ss_lb_name" name="ss_lb_name" value="负载均衡" class="input_ss_table" style="width:80px;" autocorrect="off" autocapitalize="off"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>服务器添加</th>
|
||||
<td>
|
||||
<select id="ss_lb_node" name="ss_lb_node" style="width:130px;margin:0px 0px 0px 2px;" class="input_option" >
|
||||
</select>
|
||||
|
||||
权重:
|
||||
<input type="text" class="input_ss_table" style="width:30px" id="ss_lb_weight" name="ss_lb_weight" maxlength="100" value="50"/>
|
||||
|
||||
属性:
|
||||
<select id="ss_lb_mode" name="ss_lb_mode" style="width:90px;margin:0px 0px 0px 2px;" class="input_option" onchange="update_visibility();">
|
||||
<option value="1" selected>负载均衡</option>
|
||||
<option value="2">主用节点</option>
|
||||
<option value="3">备用节点</option>
|
||||
</select>
|
||||
|
||||
<input style="float:left;margin-top:-28px;margin-left:370px;" type="button" class="add_btn" onclick="addTr()" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="margin:10px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable" id="lb_node_table">
|
||||
<tr>
|
||||
<th style="width:70px;">服务器别名</th>
|
||||
<th style="width:90px;">服务器</th>
|
||||
<th style="width:90px;">服务器端口</th>
|
||||
<th style="width:90px;">密码</th>
|
||||
<th style="width:90px;">加密方式</th>
|
||||
<th style="width:35px;">属性</th>
|
||||
<th style="width:35px;">权重</th>
|
||||
<th style="width:35px;">删除</th>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="log_content" style="margin-top:10px;display: none;">
|
||||
<textarea cols="63" rows="21" wrap="off" readonly="readonly" id="log_content1" style="width:99%; font-family:'Courier New', Courier, mono; font-size:11px;background:#475A5F;color:#FFFFFF;"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="apply_gen">
|
||||
<input id="cmdBtn" class="button_gen" type="button" onclick="onSubmitCtrl(this, ' Refresh ')" value="提交">
|
||||
</div>
|
||||
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px"><img src="/images/New_ui/export/line_export.png"></div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="10" align="center" valign="top"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
<div id="footer"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
2
shadowsocks/version
Normal file
2
shadowsocks/version
Normal file
@ -0,0 +1,2 @@
|
||||
3.0.5
|
||||
85056d753a7babd8b494a9b3a4b04266
|
@ -10,6 +10,16 @@
|
||||
"title": "网络测速",
|
||||
"version": "0.2.3"
|
||||
},
|
||||
{
|
||||
"build_date": "2019-01-15_12:45:31",
|
||||
"description": "shadowsocks",
|
||||
"home_url": "Main_Ss_Content.asp",
|
||||
"md5": "85056d753a7babd8b494a9b3a4b04266",
|
||||
"name": "shadowsocks",
|
||||
"tar_url": "shadowsocks/shadowsocks.tar.gz",
|
||||
"title": "shadowsocks",
|
||||
"version": "3.0.5"
|
||||
},
|
||||
{
|
||||
"build_date": "2019-01-13_23:00:27",
|
||||
"description": "Cloudflare解析自动更新IP",
|
||||
@ -82,7 +92,7 @@
|
||||
}
|
||||
],
|
||||
"home_url": "https://raw.githubusercontent.com/paldier/softcenter/master",
|
||||
"md5": "59ac9ab949d719056c43094dc59db706",
|
||||
"md5": "f85034b38f4335d289e69a1228484d45",
|
||||
"tar_url": "softcenter/softcenter.tar.gz",
|
||||
"version": "1.1.6"
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"version":"1.1.6",
|
||||
"md5":"59ac9ab949d719056c43094dc59db706"
|
||||
"md5":"f85034b38f4335d289e69a1228484d45"
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ def work_paths_by_walk():
|
||||
print os.path.join(root,sub)
|
||||
|
||||
def work_parent():
|
||||
ignore_paths = frozenset(["maintain_files", "softcenter", "v2ray", "adbyby", "ddnspod", "gdddns", "shadowsocks"])
|
||||
ignore_paths = frozenset(["maintain_files", "softcenter", "v2ray", "adbyby", "ddnspod", "gdddns"])
|
||||
for fname in os.listdir(parent_path):
|
||||
|
||||
if fname[0] == "." or fname in ignore_paths:
|
||||
|
Binary file not shown.
@ -1,2 +1,2 @@
|
||||
1.1.6
|
||||
59ac9ab949d719056c43094dc59db706
|
||||
f85034b38f4335d289e69a1228484d45
|
||||
|
Loading…
Reference in New Issue
Block a user