Skip to content

Commit

Permalink
update@20210126
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 26, 2021
1 parent b137926 commit fa5c401
Show file tree
Hide file tree
Showing 18 changed files with 211 additions and 222 deletions.
4 changes: 2 additions & 2 deletions luci-app-jd-dailybonus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-jd-dailybonus
LUCI_PKGARCH:=all
PKG_VERSION:=1.0.2
PKG_RELEASE:=20210124
PKG_VERSION:=1.0.3
PKG_RELEASE:=20210125

include $(INCLUDE_DIR)/package.mk

Expand Down
4 changes: 2 additions & 2 deletions luci-app-jd-dailybonus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Luci for JD dailybonus Script for Openwrt
一个运行在openwrt下的京东签到插件。

### Update Log 2021-01-24 v1.0.2
### Update Log 2021-01-25 v1.0.3

#### Updates

Expand Down Expand Up @@ -67,4 +67,4 @@ openwrt-nanopi-r1s-h5 : https://github.com/jerrykuku/openwrt-nanopi-r1s-h5

### 支持我
如果你觉得我做的不错,可以赞赏一下。
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/photo_2019-12-22_11-40-20.jpg" width="300" height="300">
<img src="https://raw.githubusercontent.com/jerrykuku/staff/master/photo_2019-12-22_11-40-20.jpg" width="300" height="300">
7 changes: 7 additions & 0 deletions luci-app-jd-dailybonus/luasrc/controller/jd-dailybonus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function index()
entry({'admin', 'services', 'jd-dailybonus', 'check_update'}, call('check_update')) -- 检查更新
entry({'admin', 'services', 'jd-dailybonus', 'qrcode'}, call('qrcode')) -- 获取二维码
entry({'admin', 'services', 'jd-dailybonus', 'check_login'}, call('check_login')) -- 获取二维码
entry({'admin', 'services', 'jd-dailybonus', 'realtime_log'}, call('get_log')) -- 获取实时日志
end

-- 执行程序
Expand Down Expand Up @@ -122,4 +123,10 @@ function check_login()

luci.http.prepare_content('application/json')
luci.http.write_json(return_json)
end

function get_log()
local fs = require "nixio.fs"
local log = fs.readfile("/var/log/jd_dailybonus.log") or ""
luci.http.write(log)
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
local fs = require "nixio.fs"
local jd = "jd-dailybonus"
local conffile = "/www/JD_DailyBonus.htm"

log = SimpleForm("logview")
log.submit = false
Expand All @@ -11,7 +9,7 @@ t = log:field(TextValue, "1", nil)
t.rmempty = true
t.rows = 30
function t.cfgvalue()
return fs.readfile(conffile) or ""
return fs.readfile("/var/log/jd_dailybonus.log") or ""
end
t.readonly="readonly"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local fs = require "nixio.fs"
local jd = "jd-dailybonus"

s = SimpleForm("scriptview")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ <h3>二维码已失效</h3>
const QRCODE_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","qrcode")%>';
const CHECK_LOGIN_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","check_login")%>';
const UPDATE_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","update")%>';
const LOG_URL = '<%=luci.dispatcher.build_url("admin", "services", "jd-dailybonus","realtime_log")%>';
const CHECKING_TEXT = '<%= translate("正在检查是否存在新的版本 ...") %>';
const UPDATING_TEXT = '<%= translate("正在更新脚本,请稍候 ...") %>';
const NEW_VERSION = '<%= translate("当前已是最新版本:") %>';
Expand Down Expand Up @@ -281,7 +282,7 @@ <h3 style="margin-left:0;">服务正在执行中,请勿刷新!</h3>

//获取实时日志
function get_realtime_log() {
XHR.poll(1, "/JD_DailyBonus.htm", null, x => {
XHR.poll(1, LOG_URL, null, x => {
let retArea = document.getElementById("log_content3");
if (x.response.search(" 秒") != -1) {
noChange++;
Expand Down
12 changes: 6 additions & 6 deletions luci-app-jd-dailybonus/root/usr/share/jd-dailybonus/newapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
NAME=jd-dailybonus
TEMP_SCRIPT=/tmp/JD_DailyBonus.js
JD_SCRIPT=/usr/share/jd-dailybonus/JD_DailyBonus.js
LOG_HTM=/www/JD_DailyBonus.htm
LOG_FILE=/var/log/jd_dailybonus.log
CRON_FILE=/etc/crontabs/root
usage() {
cat <<-EOF
Expand Down Expand Up @@ -60,13 +60,13 @@ add_cron() {
# Run Script

notify() {
grep "Cookie失效" /www/JD_DailyBonus.htm >/dev/null
grep "Cookie失效" ${LOG_FILE} >/dev/null
if [ $? -eq 0 ]; then
title="$(date '+%Y年%m月%d日') 京东签到 Cookie 失效"
else
title="$(date '+%Y年%m月%d日') 京东签到"
fi
desc=$(cat /www/JD_DailyBonus.htm | grep -E '签到号|签到概览|签到奖励|其他奖励|账号总计|其他总计' | sed 's/$/&\n/g')
desc=$(cat ${LOG_FILE} | grep -E '签到号|签到概览|签到奖励|其他奖励|账号总计|其他总计' | sed 's/$/&\n/g')
#serverchan
sckey=$(uci_get_by_type global serverchan)
if [ ! -z $sckey ]; then
Expand Down Expand Up @@ -95,9 +95,9 @@ notify() {
}

run() {
echo -e $(date '+%Y-%m-%d %H:%M:%S %A') >$LOG_HTM 2>/dev/null
[ ! -f "/usr/bin/node" ] && echo -e "未安装node.js,请安装后再试!\nNode.js is not installed, please try again after installation!" >>$LOG_HTM && exit 1
(cd /usr/share/jd-dailybonus/ && node $JD_SCRIPT >>$LOG_HTM 2>/dev/null && notify &)
echo -e $(date '+%Y-%m-%d %H:%M:%S %A') >$LOG_FILE 2>/dev/null
[ ! -f "/usr/bin/node" ] && echo -e "未安装node.js,请安装后再试!\nNode.js is not installed, please try again after installation!" >>$LOG_FILE && exit 1
(cd /usr/share/jd-dailybonus/ && node $JD_SCRIPT >>$LOG_FILE 2>/dev/null && notify &)
}

save() {
Expand Down
21 changes: 5 additions & 16 deletions luci-app-ssr-plus/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=182
PKG_RELEASE:=10
PKG_VERSION:=183
PKG_RELEASE:=3

define Package/$(PKG_NAME)/conffiles
/etc/config/shadowsocksr
Expand All @@ -19,11 +19,11 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin
default n

config PACKAGE_$(PKG_NAME)_INCLUDE_Xray
bool "Include Xray"
bool "Include Xray (V2RAY/Trojan-GO implemented)"
default y if i386||x86_64||arm||aarch64

config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan
bool "Include Trojan"
bool "Include Trojan (OpenSSL)"
default n if i386||x86_64||arm||aarch64

config PACKAGE_$(PKG_NAME)_INCLUDE_Redsocks2
Expand All @@ -35,14 +35,6 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy
depends on !(arc||armeb||mips||mips64||powerpc)
default n

config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
bool "Include V2ray"
default n

config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan-go
bool "Include Trojan-go"
default y if i386||x86_64||arm||aarch64

config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
bool "Include Kcptun"
default n
Expand All @@ -55,16 +47,13 @@ endef
LUCI_TITLE:=SS/SSR/V2Ray/Trojan/NaiveProxy/Socks5/Tun LuCI interface
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +pdnsd-alt +wget-ssl +lua +libuci-lua \
+microsocks +dns2socks +shadowsocksr-libev-ssr-local +tcping +resolveip\
+microsocks +dns2socks +shadowsocksr-libev-ssr-local +tcping +resolveip +ipt2socks-alt \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-local \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:simple-obfs \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin:v2ray-plugin \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan-go:trojan-go \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:ipt2socks \
+PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy:naiveproxy \
+PACKAGE_$(PKG_NAME)_INCLUDE_Redsocks2:redsocks2 \
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \
Expand Down
53 changes: 34 additions & 19 deletions luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,21 @@ local encrypt_methods_ss = {
}

local encrypt_methods_v2ray_ss = {
-- aead
"aes-128-gcm",
"aes-256-gcm",
"chacha20-ietf-poly1305",
"none"
-- xray_ss
"none",
"plain",
"aes-128-cfb",
"aes-256-cfb",
"chacha20",
"chacha20-ietf",
-- aead
"aes-128-gcm",
"aes-256-gcm",
"chacha20-poly1305",
"chacha20-ietf-poly1305",
"aead_aes_128_gcm",
"aead_aes_256_gcm",
"aead_chacha20_poly1305"
}

local protocol = {
Expand Down Expand Up @@ -142,7 +152,7 @@ end
if is_finded("xray") or is_finded("v2ray") then
o:value("v2ray", translate("V2Ray/XRay"))
end
if is_finded("trojan")then
if is_finded("trojan") then
o:value("trojan", translate("Trojan"))
end
if is_finded("trojan-go") then
Expand All @@ -152,10 +162,13 @@ end
if is_finded("naive") then
o:value("naiveproxy", translate("NaiveProxy"))
end
if is_finded("redsocks2") then
if is_finded("ipt2socks-alt") or is_finded("ipt2socks") then
o:value("socks5", translate("Socks5"))
end
if is_finded("redsocks2") then
o:value("tun", translate("Network Tunnel"))
end

o.description = translate("Using incorrect encryption mothod may causes service fail to start")

o = s:option(Value, "alias", translate("Alias(optional)"))
Expand All @@ -170,12 +183,12 @@ o:depends("type", "tun")
o.description = translate("Redirect traffic to this network interface")

o = s:option(ListValue, "v2ray_protocol", translate("V2Ray/XRay protocol"))
o:value("vmess", translate("Vmess"))
o:value("vmess", translate("VMess"))
o:value("vless", translate("VLESS"))
o:value("http", translate("HTTP"))
o:value("socks", translate("Socks"))
o:value("shadowsocks", translate("Shadowsocks"))
o:value("trojan", translate("Trojan"))
o:value("shadowsocks", translate("Shadowsocks"))
o:value("socks", translate("Socks"))
o:value("http", translate("HTTP"))
o:depends("type", "v2ray")

o = s:option(Value, "server", translate("Server Address"))
Expand Down Expand Up @@ -243,7 +256,9 @@ o.rmempty = true
o:depends("type", "ss")

o = s:option(ListValue, "encrypt_method_v2ray_ss", translate("Encrypt Method"))
for _, v in ipairs(encrypt_methods_v2ray_ss) do o:value(v) end
for _, v in ipairs(encrypt_methods_v2ray_ss) do
o:value(v)
end
o.rmempty = true
o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})

Expand Down Expand Up @@ -502,13 +517,13 @@ o:depends("type", "trojan-go")

-- XTLS
if is_finded("xray") then
o = s:option(Flag, "xtls", translate("XTLS"))
o.rmempty = true
o.default = "0"
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "tcp", tls = false})
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "kcp", tls = false})
o:depends({type = "v2ray", v2ray_protocol = "trojan", transport = "tcp", tls = false})
o:depends({type = "v2ray", v2ray_protocol = "trojan", transport = "kcp", tls = false})
o = s:option(Flag, "xtls", translate("XTLS"))
o.rmempty = true
o.default = "0"
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "tcp", tls = false})
o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "kcp", tls = false})
o:depends({type = "v2ray", v2ray_protocol = "trojan", transport = "tcp", tls = false})
o:depends({type = "v2ray", v2ray_protocol = "trojan", transport = "kcp", tls = false})
end

-- Flow
Expand Down
4 changes: 3 additions & 1 deletion luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@
url0 = ssu[1]
}
var sstr = url0;
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = ssu[0];
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "v2ray";
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].dispatchEvent(event);
document.getElementsByName('cbid.shadowsocksr.' + sid + '.v2ray_protocol')[0].value = "trojan";
document.getElementsByName('cbid.shadowsocksr.' + sid + '.v2ray_protocol')[0].dispatchEvent(event);
var team = sstr.split('@');
var password = team[0]
var serverPart = team[1].split(':');
Expand Down
8 changes: 4 additions & 4 deletions luci-app-ssr-plus/root/etc/init.d/shadowsocksr
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ start_udp() {
trojan) #client
gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_local_port
ln_start_bin $(first_type trojan-go trojan) $type --config $udp_config_file
ln_start_bin $(first_type ipt2socks) ipt2socks -U -b 0.0.0.0 -4 -s 127.0.0.1 -p $tmp_udp_local_port -l $tmp_udp_port
ln_start_bin $(first_type ipt2socks-alt ipt2socks) ipt2socks -U -b 0.0.0.0 -4 -s 127.0.0.1 -p $tmp_udp_local_port -l $tmp_udp_port
echolog "UDP TPROXY Relay:$($(first_type trojan-go trojan) --version 2>&1 | head -1) Started!"
;;
trojan-go)
Expand All @@ -376,7 +376,7 @@ start_udp() {
if [ "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable 0)" == "1" ]; then
local auth="-a $(uci_get_by_name $UDP_RELAY_SERVER username) -k $(uci_get_by_name $UDP_RELAY_SERVER password)"
fi
ln_start_bin $(first_type ipt2socks-alt) ipt2socks-alt $udp_config_file -U -4 -s $(uci_get_by_name $UDP_RELAY_SERVER server) -p $(uci_get_by_name $UDP_RELAY_SERVER server_port) -l $tmp_udp_port $auth
ln_start_bin $(first_type ipt2socks-alt ipt2socks) ipt2socks $udp_config_file -U -4 -s $(uci_get_by_name $UDP_RELAY_SERVER server) -p $(uci_get_by_name $UDP_RELAY_SERVER server_port) -l $tmp_udp_port $auth
#gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_port
#ln_start_bin $(first_type redsocks2) redsocks2 -c $udp_config_file
echolog "UDP TPROXY Relay:Socks5 REDIRECT/TPROXY Started!"
Expand Down Expand Up @@ -444,7 +444,7 @@ start_shunt() {
if [ "$(uci_get_by_name $SHUNT_SERVER auth_enable 0)" == "1" ]; then
local auth="-a $(uci_get_by_name $SHUNT_SERVER username) -k $(uci_get_by_name $SHUNT_SERVER password)"
fi
ln_start_bin $(first_type ipt2socks-alt) ipt2socks-alt $shunt_config_file -R -4 -s $(uci_get_by_name $SHUNT_SERVER server) -p $(uci_get_by_name $SHUNT_SERVER server_port) -l $tmp_shunt_port $auth
ln_start_bin $(first_type ipt2socks-alt ipt2socks) ipt2socks $shunt_config_file -R -4 -s $(uci_get_by_name $SHUNT_SERVER server) -p $(uci_get_by_name $SHUNT_SERVER server_port) -l $tmp_shunt_port $auth
#gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port
#ln_start_bin $(first_type redsocks2) redsocks2 -c $shunt_config_file
if [ -n "$tmp_local_port" ]; then
Expand Down Expand Up @@ -563,7 +563,7 @@ Start_Run() {
if [ "$(uci_get_by_name $GLOBAL_SERVER auth_enable 0)" == "1" ]; then
local auth="-a $(uci_get_by_name $GLOBAL_SERVER username) -k $(uci_get_by_name $GLOBAL_SERVER password)"
fi
ln_start_bin $(first_type ipt2socks-alt) ipt2socks-alt $tcp_config_file -R -4 -j $threads -s $(uci_get_by_name $GLOBAL_SERVER server) -p $(uci_get_by_name $GLOBAL_SERVER server_port) -l $tcp_port $auth
ln_start_bin $(first_type ipt2socks-alt ipt2socks) ipt2socks $tcp_config_file -R -4 -j $threads -s $(uci_get_by_name $GLOBAL_SERVER server) -p $(uci_get_by_name $GLOBAL_SERVER server_port) -l $tcp_port $auth
#gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
#for i in $(seq 1 $threads); do
# ln_start_bin $(first_type redsocks2) redsocks2 -c $tcp_config_file
Expand Down
1 change: 1 addition & 0 deletions luci-app-ssr-plus/root/etc/uci-defaults/luci-ssr-plus
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ if [ ! -s "/etc/config/shadowsocksr" ]; then
fi
sed -i "s/option type 'vmess'"/"option type 'v2ray'\n\toption v2ray_protocol 'vmess'/g" /etc/config/shadowsocksr
sed -i "s/option type 'vless'"/"option type 'v2ray'\n\toption v2ray_protocol 'vless'/g" /etc/config/shadowsocksr
sed -i "s/option type 'trojan'"/"option type 'v2ray'\n\toption v2ray_protocol 'trojan'/g" /etc/config/shadowsocksr
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache
exit 0
Loading

0 comments on commit fa5c401

Please sign in to comment.