Merge Mainline

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
This commit is contained in:
CN_SZTL 2021-01-16 18:13:19 +08:00
commit 4ceedc3f17
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
46 changed files with 5875 additions and 7940 deletions

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-vssr
PKG_VERSION:=1.20
PKG_RELEASE:=20201209
PKG_VERSION:=1.21
PKG_RELEASE:=20210114
include $(INCLUDE_DIR)/package.mk

View File

@ -1,3 +1,11 @@
--[[
Author: your name
Date: 2019-11-11 09:33:07
LastEditTime: 2021-01-14 18:50:06
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \luci-app-vssr\luasrc\model\cbi\vssr\socks5.lua
--]]
local vssr = 'vssr'
local uci = luci.model.uci.cursor()
local server_table = {}
@ -34,4 +42,32 @@ if nixio.fs.access('/usr/bin/v2ray/v2ray') or nixio.fs.access('/usr/bin/v2ray')
o.rmempty = false
end
-- [[ Http Proxy ]]--
if nixio.fs.access('/usr/bin/v2ray/v2ray') or nixio.fs.access('/usr/bin/v2ray') or nixio.fs.access('/usr/bin/xray') or nixio.fs.access('/usr/bin/xray/xray') then
s = m:section(TypedSection, 'http_proxy', translate('V2ray HTTP Proxy'))
s.anonymous = true
o = s:option(Flag, 'enable_server', translate('Enable Servers'))
o.rmempty = false
o = s:option(Flag, 'enable_auth', translate('Enable Auth'))
o.rmempty = false
o = s:option(Value, 'http_user', translate('HTTP user'))
o.default = 'user'
o.rmempty = true
o:depends('enable_auth', '1')
o = s:option(Value, 'http_pass', translate('HTTP pass'))
o.default = 'password'
o.password = true
o.rmempty = true
o:depends('enable_auth', '1')
o = s:option(Value, 'local_port', translate('Local Port'))
o.datatype = 'port'
o.default = 1088
o.rmempty = false
end
return m

View File

@ -5,7 +5,6 @@
const GET_FLAG_URL = '<%=luci.dispatcher.build_url("admin", "services", "vssr","flag")%>';
var sid;
function getFlag(remark, hosts, sid) {
XHR.get(GET_FLAG_URL,
{ host: hosts, remark: remark },
@ -67,7 +66,6 @@
return document.getElementById('cbid.vssr.' + sid + id);
}
function import_ssr_url(btn, urlname, sids) {
sid = sids;
var s = document.getElementById(urlname + '-status');

View File

@ -13,8 +13,8 @@
var _responseLen;
var noChange = 0;
var modal = '<div class="modals-bg">' +
'<div class="modals">' +
var modal = '<div class="modals-bg hide">' +
'<div class="modals hide">' +
'<h2><%:Subscription%></h2>' +
'<h3 style="margin-left:0;"><%:Subscribing,Please do not refresh!%></h3>' +
'<textarea cols="63" rows="28" wrap="on" readonly="readonly" id="log_content3" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>' +
@ -24,7 +24,10 @@
//显示并开始刷新订阅
function update_subscribe() {
$("body").append(modal);
$(".modals-bg").show();
$(".modals-bg").removeClass("hide");
setTimeout(function(){
$(".modals").removeClass("hide");
}, 200);
setTimeout("get_realtime_log();", 500);
}
//保存订阅按钮

View File

@ -173,7 +173,10 @@ msgid "Alias"
msgstr "别名"
msgid "V2ray SOCKS5 Proxy"
msgstr "V2ray SOCKS5代理"
msgstr "V2ray SOCKS5 代理"
msgid "V2ray HTTP Proxy"
msgstr "V2ray HTTP 代理"
msgid "Server"
msgstr "服务器"
@ -539,6 +542,12 @@ msgstr "用户名"
msgid "Socks pass"
msgstr "密码"
msgid "HTTP user"
msgstr "用户名"
msgid "HTTP pass"
msgstr "密码"
msgid "Enable Servers"
msgstr "开启服务"

View File

@ -21,6 +21,14 @@ config socks5_proxy
option Socks_user 'user'
option Socks_pass 'password'
config http_proxy
option enable_server '0'
option local_port '1088'
option local_address '0.0.0.0'
option enable_auth '0'
option http_user 'user'
option http_pass 'password'
config access_control
option wan_bp_list '/etc/vssr/china_ssr.txt'
option lan_ac_mode 'b'

View File

@ -19,7 +19,12 @@ EXTRA_COMMANDS=rules
CONFIG_FILE=/var/etc/${NAME}_t.json
CONFIG_UDP_FILE=/var/etc/${NAME}_u.json
CONFIG_SOCK5_FILE=/var/etc/${NAME}_s.json
CRON_FILE=/etc/crontabs/root
#定义可执行文件路径
VSSR_RULES_BIN=/usr/bin/vssr-rules
#初始化配置
server_count=0
redir_tcp=0
redir_udp=0
@ -32,9 +37,10 @@ switch_enable=0
shunt_enable=0
switch_server=$1
MAXFD=32768
CRON_FILE=/etc/crontabs/root
threads=1
scount=0
#读取 uci 数据
uci_get_by_name() {
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
echo ${ret:=$3}
@ -45,6 +51,24 @@ uci_get_by_type() {
echo ${ret:=$3}
}
run_mode=$(uci_get_by_type global run_mode)
is_xray=$(uci_get_by_type global use_xray)
#查找可执行文件
find_bin() {
case "$1" in
ss) ret="ss-redir" ;;
ss-local) ret="ss-local" ;;
ssr) ret="ssr-redir" ;;
ssr-local) ret="ssr-local" ;;
ssr-server) ret="ssr-server" ;;
v2ray | vless) [[ $is_xray = "1" ]] && ret="xray" || ret="v2ray" ;;
trojan) ret="trojan" ;;
esac
echo $(find /usr -perm /+x -type f -name $ret)
}
#添加定时执行脚本
add_cron() {
sed -i '/vssr.log/d' $CRON_FILE && echo '0 1 * * * echo "" > /tmp/vssr.log' >>$CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/bin/lua /usr/share/vssr/subscribe.lua" >>$CRON_FILE
@ -52,13 +76,16 @@ add_cron() {
crontab $CRON_FILE
}
#删除定时执行脚本
del_cron() {
sed -i '/vssr/d' $CRON_FILE
sed -i '/vssr.log/d' $CRON_FILE
/etc/init.d/cron restart
}
#计算分流数量
count_shunt() {
scount=0
snum=0
eval shunt_array1="youtube"
eval shunt_array2="tw_video"
eval shunt_array3="netflix"
@ -71,17 +98,16 @@ count_shunt() {
local server_index=$(uci_get_by_type global ${a}_server)
local server_type=$(uci_get_by_name $server_index type)
if [ "$server_type" != "" ]; then
scount=$(($scount + 1))
snum=$(($snum + 1))
fi
done
echo $snum
}
count_shunt
run_mode=$(uci_get_by_type global run_mode)
is_xray=$(uci_get_by_type global use_xray)
#创建配置文件
gen_config_file() {
local hostip=$(uci_get_by_name $1 server)
[ $2 = "0" -a $kcp_flag = "1" ] && hostip="127.0.0.1"
if [ $2 = "0" ]; then
@ -93,17 +119,12 @@ gen_config_file() {
config_file=$CONFIG_UDP_FILE
server_obj=$UDP_RELAY_SERVER
fi
if [ $(uci_get_by_name $1 fast_open 0) = "1" ]; then
fastopen="true"
else
fastopen="false"
fi
[[ $(uci_get_by_name $1 fast_open 0) = "1" ]] && fastopen="true" || fastopen="false"
local stype=$(uci_get_by_name $1 type)
local port=$(uci_get_by_name $1 local_port)
if [ "$stype" == "vless" ]; then
stype="v2ray"
fi
[[ "$stype" == "vless" ]] && stype="v2ray"
if [ "$stype" == "trojan" ]; then
if [ "$re_type" == "udp" ]; then
re_type="client"
@ -112,16 +133,19 @@ gen_config_file() {
re_type="nat"
fi
fi
local mport=0
if [ $3 = "1" ]; then
stype="v2ray"
mport=1090
re_type="tcp"
fi
lua /usr/share/vssr/genconfig_${stype}.lua ${server_obj} ${re_type} ${port} ${hostip} ${mport} >${config_file}
sed -i 's/\\//g' $config_file
}
#获取arg输出
get_arg_out() {
case "$(uci_get_by_type access_control router_proxy 1)" in
1) echo "-o" ;;
@ -129,6 +153,7 @@ get_arg_out() {
esac
}
#启动规则
start_rules() {
local server=$(uci_get_by_name $GLOBAL_SERVER server)
#resolve name
@ -184,15 +209,12 @@ start_rules() {
#deal gfw firewall rule
local gfwmode=""
if [ "$run_mode" = "gfw" ]; then
gfwmode="-g"
elif [ "$run_mode" = "router" ]; then
gfwmode="-r"
elif [ "$run_mode" = "oversea" ]; then
gfwmode="-c"
elif [ "$run_mode" = "all" ]; then
gfwmode="-z"
fi
case "$run_mode" in
gfw) gfwmode="-g" ;;
router) gfwmode="-r" ;;
oversea) gfwmode="-c" ;;
all) gfwmode="-z" ;;
esac
local dports=$(uci_get_by_type global dports 1)
if [ $dports = "1" ]; then
@ -201,7 +223,7 @@ start_rules() {
proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443 "
fi
/usr/bin/vssr-rules \
$VSSR_RULES_BIN \
-s "$server" \
-l "$local_port" \
-S "$udp_server" \
@ -217,6 +239,7 @@ start_rules() {
return $?
}
#启动PDNSD
start_pdnsd() {
local usr_dns="$1"
local usr_port="$2"
@ -264,24 +287,8 @@ start_pdnsd() {
/usr/sbin/pdnsd -c /var/etc/pdnsd.conf -d
}
find_bin() {
case "$1" in
ss) ret="/usr/bin/ss-redir" ;;
ss-local) ret="/usr/bin/ss-local" ;;
ssr) ret="/usr/bin/ssr-redir" ;;
ssr-local) ret="/usr/bin/ssr-local" ;;
ssr-server) ret="/usr/bin/ssr-server" ;;
v2ray | vless)
ret="/usr/bin/v2ray/v2ray" && [ ! -f "$ret" ] && ret="/usr/bin/v2ray"
if [ $is_xray = "1" ]; then
ret="/usr/bin/xray" && [ ! -f "$ret" ] && ret="/usr/bin/xray/xray"
fi
;;
trojan) ret="/usr/sbin/trojan" ;;
esac
echo $ret
}
#分流节点
#开启分流
start_shunt() {
eval shunt_type1="global"
eval shunt_type2="youtube"
@ -359,8 +366,7 @@ start_redir() {
local stype=$(uci_get_by_name $GLOBAL_SERVER type)
sscmd=$(find_bin $stype)
local utype=$(uci_get_by_name $UDP_RELAY_SERVER type)
ucmd=$(find_bin $utype)
if [ "$(uci_get_by_type global threads 0)" = "0" ]; then
threads=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
@ -369,6 +375,7 @@ start_redir() {
fi
#转发TCP
redir_tcp=1
scount=$(count_shunt)
if [ $scount == "0" ]; then
local last_config_file=$CONFIG_FILE
case "$stype" in
@ -407,6 +414,8 @@ start_redir() {
#转发UDP
if [ -n "$UDP_RELAY_SERVER" ]; then
redir_udp=1
local utype=$(uci_get_by_name $UDP_RELAY_SERVER type)
ucmd=$(find_bin $utype)
gen_config_file $UDP_RELAY_SERVER 1 0
last_config_file=$CONFIG_UDP_FILE
case "$stype" in
@ -466,11 +475,7 @@ start_redir() {
}
gen_service_file() {
if [ $(uci_get_by_name $1 fast_open) = "1" ]; then
fastopen="true"
else
fastopen="false"
fi
[[ $(uci_get_by_name $1 fast_open) = "1" ]] && fastopen="true" || fastopen="false"
cat <<-EOF >$2
{
"server": "0.0.0.0",
@ -503,6 +508,7 @@ start_service() {
iptables -t filter -A SSR-SERVER-RULE -p udp --dport $(uci_get_by_name $1 server_port) -j ACCEPT
return 0
}
gen_serv_include() {
FWI=$(uci get firewall.vssr.path 2>/dev/null)
[ -n "$FWI" ] || return 0
@ -534,15 +540,17 @@ start_server() {
}
start_local() {
local local_server=$(uci_get_by_type socks5_proxy enable_server)
local socks_server=$(uci_get_by_type socks5_proxy enable_server)
local http_server=$(uci_get_by_type http_proxy enable_server)
[ "$local_server" = "0" ] && return 1
if [ "$socks_server" = "0" -a "$http_server" = "0" ]; then
return 1
fi
mkdir -p /var/run /var/etc
lua /usr/share/vssr/genconfig_v2ray_s.lua >$CONFIG_SOCK5_FILE
sed -i 's/\\//g' $config_file
socksbin=$(find_bin "v2ray")
echo $socksbin
$socksbin -config $CONFIG_SOCK5_FILE >/dev/null 2>&1 &
local_enable=1
}
@ -638,7 +646,7 @@ stop() {
killall -q -9 ss-redir ss-local obfs-local ssr-redir ssr-local ssr-server v2ray v2ray-plugin xray trojan microsocks ipt2socks dns2socks pdnsd
if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then
rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf /tmp/dnsmasq.ssr /tmp/dnsmasq.oversea
rm -rf /tmp/dnsmasq.d/dnsmasq-ssr.conf /tmp/dnsmasq.ssr /tmp/dnsmasq.oversea
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
del_cron

View File

@ -2,25 +2,47 @@ local ucursor = require 'luci.model.uci'.cursor()
local name = 'vssr'
local json = require 'luci.jsonc'
local proto = 'socks'
local socks_switch = ucursor:get_first(name, 'socks5_proxy', 'enable_server')
local auth_type = ucursor:get_first(name, 'socks5_proxy', 'enable_auth')
local local_port = ucursor:get_first(name, 'socks5_proxy', 'local_port')
local Socks_user = ucursor:get_first(name, 'socks5_proxy', 'Socks_user')
local Socks_pass = ucursor:get_first(name, 'socks5_proxy', 'Socks_pass')
local http_switch = ucursor:get_first(name, 'socks5_proxy', 'enable_server')
local auth_typeh = ucursor:get_first(name, 'http_proxy', 'enable_auth')
local local_porth = ucursor:get_first(name, 'http_proxy', 'local_port')
local http_user = ucursor:get_first(name, 'http_proxy', 'http_user')
local http_pass = ucursor:get_first(name, 'http_proxy', 'http_pass')
function gen_inbound(sw, auth_type, local_port, user, pass, proto)
local bound = {}
if sw == 0 then
bound = nil
else
bound = {
port = local_port,
protocol = proto,
settings = {
auth = (auth_type == '1') and 'password' or 'noauth',
accounts = (auth_type == '1') and {{user = (auth_type == '1') and user, pass = pass}} or nil
}
}
end
return bound
end
inbounds_table = {}
table.insert(inbounds_table, gen_inbound(socks_switch, auth_type, local_port, Socks_user, Socks_pass, 'socks'))
table.insert(inbounds_table, gen_inbound(http_switch, auth_typeh, local_porth, http_user, http_pass, 'http'))
local v2ray = {
log = {
-- error = "/var/log/v2ray.log",
loglevel = 'warning'
},
-- 传入连接
inbound = {
port = local_port,
protocol = proto,
settings = {
auth = (auth_type == '1') and 'password' or 'noauth',
accounts = (auth_type == '1') and {{user = (auth_type == '1') and Socks_user, pass = Socks_pass}} or nil
}
},
inbounds = inbounds_table,
-- 传出连接
outbound = {protocol = 'freedom'},
-- 额外传出连接

View File

@ -390,7 +390,7 @@ local execute = function()
end
-- diff
do
assert(next(nodeResult), 'node result is empty')
assert(next(nodeResult), '获取不到节点信息,请检查路由器是否能够访问网络,或者订阅链接是否正确')
local add, del = 0, 0
ucic:foreach(
name,
@ -453,7 +453,7 @@ if subscribe_url and #subscribe_url > 0 then
execute,
function(e)
log(e)
log(debug.traceback())
-- log(debug.traceback())
log('发生错误, 正在恢复服务')
log('END SUBSCRIBE')
local firstServer = ucic:get_first(name, uciType)

View File

@ -622,7 +622,12 @@ footer.mobile-hide {
left: 0;
top: 0;
background: rgba(255, 255, 255, 0.8);
display: none;
transition: all 0.2s;
}
.modals-bg.hide{
visibility: hidden;
opacity: 0;
}
.modals {
@ -642,6 +647,14 @@ footer.mobile-hide {
/* Firefox */
-webkit-box-sizing: border-box;
/* Safari */
transition: all 0.3s ease-in-out;
transform: scale(1);
}
.modals.hide{
visibility: hidden;
opacity: 0;
transform: scale(0.5);
}
.modals h2 {

View File

@ -1,65 +0,0 @@
####
# File: /spdlog/Makefile
# Project: ootoc-OpenWRT
# File Created: Thursday, 12th March 2020 11:09:54 pm
# Author: ElonH[EH](elonhhuang@gmail.com)
# License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html)
# Copyright (C) 2020 [ElonH]
####
include $(TOPDIR)/rules.mk
PKG_NAME:=spdlog
PKG_VERSION:=1.7.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/gabime/spdlog.git
PKG_MIRROR_HASH:=777dff5e8755d942159406c82d6e568f4fd5beda6c37a47eaf839222fdcd0e04
PKG_SOURCE_VERSION:=616caa5d30172b65cc3a06800894c575d70cb8e6
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=ElonH <elonhhuang@gmail.com>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_OPTIONS+= -DSPDLOG_BUILD_EXAMPLE:BOOL=OFF \
-DSPDLOG_BUILD_TESTS:BOOL=OFF -DSPDLOG_BUILD_SHARED:BOOL=ON \
-DSPDLOG_FMT_EXTERNAL:BOOL=ON -DSPDLOG_FMT_EXTERNAL_HO:BOOL=OFF
define Package/spdlog
SECTION:=lib
CATEGORY:=Libraries
URL:=https://github.com/gabime/spdlog
TITLE:=Fast C++ logging library.
DEPENDS:=+libfmt
MENU:=1
endef
define Package/spdlog/description
Very fast, header-only/compiled, C++ logging library.
endef
define Build/InstallDev
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/include/spdlog/fmt/bundled
$(CP) $(PKG_BUILD_DIR)/include/spdlog/fmt/bundled $(PKG_INSTALL_DIR)/usr/include/spdlog/fmt
$(Build/InstallDev/cmake)
endef
define Package/spdlog/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libspdlog.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,spdlog))

View File

@ -0,0 +1,58 @@
#
# Copyright (c) 2017 Yu Wang <wangyucn@gmail.com>
#
# This is free software, licensed under the MIT.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=tinyfecVPN
PKG_VERSION:=20180820.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/wangyu-/tinyfecVPN.git
PKG_SOURCE_VERSION:=e8364ba8ff94415ee3bedcbdb9557bfe5994a469
PKG_MIRROR_HASH:=30fd808b0203c70e8e6cfe8ca55b907faaea6a8be12a7a7fef6658f4ddbb523c
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_LICENSE:=MIT
PKG_MAINTAINER:=Yu Wang
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/tinyfecVPN
SECTION:=net
CATEGORY:=Network
SUBMENU:=VPN
TITLE:=A Network Improving Tool
URL:=https://github.com/wangyu-/tinyfecVPN
DEPENDS:=+libpthread +libstdcpp +kmod-tun
endef
define Package/tinyfecVPN/description
A Lightweight VPN with Build-in Forward Error Correction Support (or A Network Improving Tool
which works at VPN mode). Improves your Network Quality on a High-latency Lossy Link.
endef
MAKE_FLAGS += cross
define Build/Prepare
$(PKG_UNPACK)
sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile
echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h
endef
define Package/tinyfecVPN/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tinyvpn_cross $(1)/usr/bin/tinyvpn
endef
$(eval $(call BuildPackage,tinyfecVPN))

View File

@ -0,0 +1,57 @@
#
# Copyright (c) 2017 Yu Wang <wangyucn@gmail.com>
#
# This is free software, licensed under the MIT.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=tinyPortMapper
PKG_VERSION:=20200818.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/wangyu-/tinyPortMapper.git
PKG_SOURCE_VERSION:=b6c5c05ba9a9db00571d185edcd534434f41b50a
PKG_MIRROR_HASH:=93946ec018ef515d0f443fd9a6e6510ce3ceb1be373a2393fe2daeeb5e7ced95
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_LICENSE:=MIT
PKG_MAINTAINER:=Yu Wang
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/tinyPortMapper
SECTION:=net
CATEGORY:=Network
TITLE:=A High-Performance Port Mapping/Forwarding Utility
URL:=https://github.com/wangyu-/tinyPortMapper
DEPENDS:=+libstdcpp +librt
endef
define Package/tinyPortMapper/description
A Lightweight High-Performance Port Mapping/Forwarding Utility
using epoll/libev, supports IPv4 and IPv6 for both TCP and UDP.
endef
MAKE_FLAGS += cross
define Build/Prepare
$(PKG_UNPACK)
sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile
echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h
endef
define Package/tinyPortMapper/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tinymapper_cross $(1)/usr/bin/tinymapper
endef
$(eval $(call BuildPackage,tinyPortMapper))

View File

@ -0,0 +1,86 @@
#
# Copyright (C) 2021 KFERMercer <KFER.Mercer@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.
#
#
# to get the latest version & md5 checksum:
# curl -L -s -k -H "Accept:text/plain" "http://router.uu.163.com/api/plugin?type=openwrt-$(UU_ARCH)"
#
include $(TOPDIR)/rules.mk
PKG_NAME:=uugamebooster
PKG_VERSION:=v2.7.2
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
DEPENDS:=@(aarch64||arm||mips||mipsel||x86_64) +kmod-tun
TITLE:=NetEase UU Game Booster
URL:=https://uu.163.com
endef
define Package/$(PKG_NAME)/description
NetEase's UU Game Booster Accelerates Triple-A Gameplay and Market
endef
ifeq ($(ARCH),x86_64)
UU_ARCH:=x86_64
PKG_MD5SUM:=07bf06131528276e7d4b8e3992fa2e8d
endif
ifeq ($(ARCH),mipsel)
UU_ARCH:=mipsel
PKG_MD5SUM:=3f11af92eb7abf2af2cce8102fea7499
endif
ifeq ($(ARCH),mips)
UU_ARCH:=mipsel
PKG_MD5SUM:=3f11af92eb7abf2af2cce8102fea7499
endif
ifeq ($(ARCH),arm)
UU_ARCH:=arm
PKG_MD5SUM:=5fce2b60df66ea8a8db4ddd55da3c6b4
endif
ifeq ($(ARCH),aarch64)
UU_ARCH:=aarch64
PKG_MD5SUM:=bc0e513cfce113c69b068e198e936100
endif
PKG_SOURCE_URL:=http://uu.gdl.netease.com/openwrt-$(UU_ARCH)/$(PKG_VERSION)/uu.tar.gz?
PKG_SOURCE:=$(PKG_NAME)-$(UU_ARCH)-$(PKG_VERSION).tar.gz
STRIP:=true
UNTAR_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-$(UU_ARCH)-bin
define Build/Prepare
mkdir -vp $(UNTAR_DIR)
tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(UNTAR_DIR)
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uugamebooster
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)
$(INSTALL_BIN) $(UNTAR_DIR)/uuplugin $(1)/usr/share/$(PKG_NAME)/uuplugin
$(INSTALL_CONF) $(UNTAR_DIR)/uu.conf $(1)/usr/share/$(PKG_NAME)/uu.conf
# not finish yet:
# $(INSTALL_DIR) $(1)/usr/bin
# $(INSTALL_BIN) ./files/uugamebooster-update $(1)/usr/bin/$(PKG_NAME)
# $(LN) $(1)/usr/bin/$(PKG_NAME)/uugamebooster-update $(1)/usr/bin/uugamebooster-update
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,18 @@
#!/bin/sh
# Return: 0 means update flag is set.
check_update() {
if [ -f "/usr/bin/uugamebooster/uu.update" ];then
return 0
else
return 1
fi
}
check_update
if [ "$?" != "0" ];then
exit 0
return
fi
exit 0

View File

@ -0,0 +1,18 @@
#!/bin/sh /etc/rc.common
START=99
STOP=10
USE_PROCD=1
NAME="uugamebooster"
UU_BIN="/usr/share/uugamebooster/uuplugin"
UU_CONF="/usr/share/uugamebooster/uu.conf"
UU_LOGFILE="/tmp/uugamebooster.log"
start_service() {
procd_open_instance
procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1
procd_set_param respawn
procd_close_instance
}

View File

@ -9,13 +9,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=xray
PKG_VERSION:=1.2.1
PKG_VERSION:=1.2.2
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/Xray-core-$(PKG_VERSION)
PKG_SOURCE:=xray-core-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/XTLS/xray-core/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=eebea67d9176cc016d21de2d8123b0a6ab795ec82af2c6b8d7467212841bdc56
PKG_HASH:=b9b38bc69e660d3a6d0545efea4d0891ee81a2d55c83a6fa893cbd680a071023
PKG_LICENSE:=MPL
PKG_LICENSE_FILES:=LICENSE

View File

@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=4
PKG_RELEASE:=6
PKG_DATE:=20210104
PKG_RELEASE:=7
PKG_DATE:=20210111
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

View File

@ -174,7 +174,7 @@ if node_section then
listen = "0.0.0.0",
port = tonumber(socks_proxy_port),
protocol = "socks",
settings = {auth = "noauth", udp = true, ip = "127.0.0.1"}
settings = {auth = "noauth", udp = true}
})
network = "tcp,udp"
end

View File

@ -322,6 +322,9 @@ o = s:taboption("tips", DummyValue, "")
o.template = appname .. "/global/tips"
-- [[ Socks Server ]]--
o = s:taboption("Main", Flag, "socks_enabled", "Socks" .. translate("Main switch"))
o.rmempty = false
s = m:section(TypedSection, "socks", translate("Socks Config"))
s.anonymous = true
s.addremove = true

View File

@ -72,6 +72,10 @@ local auto_switch = api.uci_get_type("auto_switch", "enable", 0)
var socks = document.getElementById("cbi-passwall-socks");
if (socks) {
var socks_enabled_dom = document.getElementById(global_id + "-socks_enabled");
socks_enabled_dom.parentNode.removeChild(socks_enabled_dom);
var descr = socks.getElementsByClassName("cbi-section-descr")[0];
descr.outerHTML = socks_enabled_dom.outerHTML;
rows = socks.getElementsByClassName("cbi-section-table-row");
for (var i = 0; i < rows.length; i++) {
var row = rows[i];

View File

@ -12,7 +12,7 @@ Copyright 2013 Yahoo!
Licensed under the BSD License.
https://github.com/pure-css/pure/blob/master/LICENSE.md
*/
.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-5-5{width:100%}
.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) {table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-5-5{width:100%}
.block {
margin: 0.5rem;
padding: 0;
@ -237,67 +237,35 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
var status_haproxy = document.getElementById('status_haproxy');
var status_kcptun = document.getElementById('status_kcptun');
if (data) {
var tcp_node_num = 1;
if (tcp_node_num >= 1) {
if (true) {
var status_tcp_node = document.getElementById('status_tcp_node');
if (status_tcp_node) {
var text = 'TCP<br />';
if (tcp_node_num == 1) {
if (data["tcp_node_status"])
text += '<span class="green"><%:RUNNING%></span>';
else
text += '<span class="red"><%:NOT RUNNING%></span>';
} else {
for(var i = 0; i < tcp_node_num; i++) {
var k = i + 1;
if (data["tcp_node" + k + "_status"])
text += '<span class="green"></span>';
else
text += '<span class="red"> X</span>';
}
}
if (data["tcp_node_status"])
text += '<span class="green"><%:RUNNING%></span>';
else
text += '<span class="red"><%:NOT RUNNING%></span>';
status_tcp_node.innerHTML = text;
}
var status_kcptun = document.getElementById('status_kcptun');
if (status_kcptun) {
var text = 'Kcptun<br />';
if (tcp_node_num == 1) {
if (data["kcptun_tcp_node_status"])
text += '<span class="green"><%:RUNNING%></span>';
else
text += '<span class="red"><%:NOT RUNNING%></span>';
} else {
for(var i = 0; i < tcp_node_num; i++) {
var k = i + 1;
if (data["kcptun_tcp_node" + k + "_status"])
text += '<span class="green"></span>';
else
text += '<span class="red"> X</span>';
}
}
if (data["kcptun_tcp_node_status"])
text += '<span class="green"><%:RUNNING%></span>';
else
text += '<span class="red"><%:NOT RUNNING%></span>';
status_kcptun.innerHTML = text;
}
}
var udp_node_num = 1;
if (udp_node_num >= 1) {
if (true) {
var status_udp_node = document.getElementById('status_udp_node');
if (status_udp_node) {
var text = 'UDP<br />';
if (udp_node_num == 1) {
if (data["udp_node_status"])
text += '<span class="green"><%:RUNNING%></span>';
else
text += '<span class="red"><%:NOT RUNNING%></span>';
} else {
for(var i = 0; i < udp_node_num; i++) {
var k = i + 1;
if (data["udp_node" + k + "_status"])
text += '<span class="green"></span>';
else
text += '<span class="red"> X</span>';
}
}
if (data["udp_node_status"])
text += '<span class="green"><%:RUNNING%></span>';
else
text += '<span class="red"><%:NOT RUNNING%></span>';
status_udp_node.innerHTML = text;
}
}

View File

@ -161,65 +161,33 @@ local status = api.uci_get_type("global_other", "status", "")
if (x && x.status == 200) {
var tcp_node_status = document.getElementById('_tcp_node_status');
if (tcp_node_status) {
var tcp_node_num = 1;
if (tcp_node_num >= 1) {
if (true) {
var text = '';
if (tcp_node_num == 1) {
if (json["tcp_node_status"])
text += '<font color="green"><%:RUNNING%> ✓</font>';
else
text += '<font color="red"><%:NOT RUNNING%> X</font>';
} else {
for(var i = 0; i < tcp_node_num; i++) {
var k = i + 1;
if (json["tcp_node" + k + "_status"])
text += '<font color="green" size="3"></font>';
else
text += '<font color="red" size="3"> X</font>';
}
}
if (json["tcp_node_status"])
text += '<font color="green"><%:RUNNING%> ✓</font>';
else
text += '<font color="red"><%:NOT RUNNING%> X</font>';
tcp_node_status.innerHTML = text;
var kcptun_tcp_node_status = document.getElementById('_kcptun_tcp_node_status');
text = "";
if (tcp_node_num == 1) {
if (json["kcptun_tcp_node_status"])
text += '<font color="green"><%:RUNNING%> ✓</font>';
else
text += '<font color="red"><%:NOT RUNNING%> X</font>';
} else {
for(var i = 0; i < tcp_node_num; i++) {
var k = i + 1;
if (json["tcp_node" + k + "_status"])
text += '<font color="green" size="3"></font>';
else
text += '<font color="red" size="3"> X</font>';
}
}
if(kcptun_tcp_node_status)
if (json["kcptun_tcp_node_status"])
text += '<font color="green"><%:RUNNING%> ✓</font>';
else
text += '<font color="red"><%:NOT RUNNING%> X</font>';
if (kcptun_tcp_node_status)
kcptun_tcp_node_status.innerHTML = text;
}
}
var udp_node_status = document.getElementById('_udp_node_status');
if (udp_node_status) {
var udp_node_num = 1;
if (udp_node_num >= 1) {
if (true) {
var text = '';
if (udp_node_num == 1) {
if (json["udp_node_status"])
text += '<font color="green"><%:RUNNING%> ✓</font>';
else
text += '<font color="red"><%:NOT RUNNING%> X</font>';
} else {
for(var i = 0; i < udp_node_num; i++) {
var k = i + 1;
if (json["udp_node" + k + "_status"])
text += '<font color="green" size="3"></font>';
else
text += '<font color="red" size="3"> X</font>';
}
}
if (json["udp_node_status"])
text += '<font color="green"><%:RUNNING%> ✓</font>';
else
text += '<font color="red"><%:NOT RUNNING%> X</font>';
udp_node_status.innerHTML = text;
}
}
@ -251,20 +219,18 @@ local status = api.uci_get_type("global_other", "status", "")
} else {
color = "red";
}
//s.setAttribute("color", color);
btn.setAttribute("style","color: " + color + " !important");
btn.value = use_time + " ms";;
s.setAttribute("color", color);
s.innerHTML = use_time + " ms";
} else if (rv.status) {
btn.setAttribute("style","color: green !important");
btn.value = "<%:Working...%>";
s.setAttribute("color", "green");
s.innerHTML = "<%:Working...%>";
} else {
//s.setAttribute("color", "red");
btn.setAttribute("style","color: red !important");
btn.value = '<%:Problem detected!%> X';
s.setAttribute("color", "red");
s.innerHTML = '<%:Problem detected!%> X';
}
}
btn.disabled = false;
//btn.value = '<%:Check%>';
btn.value = '<%:Check%>';
}
);
return false;

View File

@ -2,8 +2,6 @@
-- Copyright (C) 2018-2020 L-WRT Team
local api = require "luci.model.cbi.passwall.api.api"
local dsp = require "luci.dispatcher"
local nodes_display = api.uci_get_type("global_other", "nodes_display", "")
-%>
<style>
@ -30,11 +28,11 @@ table td, .table .td {
}
._select {
background: #dad8d8;
background: #dad8d8 !important;
}
._now_use {
background: #94e1ff;
background: #94e1ff !important;
}
.ping a:hover{
@ -225,26 +223,22 @@ table td, .table .td {
function get_now_use_node() {
XHR.get('<%=dsp.build_url("admin/services/passwall/get_now_use_node")%>', null,
function(x, result) {
for (var i = 1; i <= result.udp; i++) {
var id = result["UDP" + i];
if (id) {
var dom = document.getElementById("cbi-passwall-" + id);
if (dom) {
dom.classList.add("_now_use");
dom.title = "当前UDP" + i + "节点";
}
var id = result["TCP"];
if (id) {
var dom = document.getElementById("cbi-passwall-" + id);
if (dom) {
dom.classList.add("_now_use");
dom.title = "当前TCP节点";
//var v = "<a style='color: red'>当前TCP节点</a>" + document.getElementById("cbid.passwall." + id + ".remarks").value;
//document.getElementById("cbi-passwall-" + id + "-remarks").innerHTML = v;
}
}
for (var i = 1; i <= result.tcp; i++) {
var id = result["TCP" + i];
if (id) {
var dom = document.getElementById("cbi-passwall-" + id);
if (dom) {
dom.classList.add("_now_use");
dom.title = "当前TCP" + i + "节点";
//var v = "当前使用:" + document.getElementById("cbid.passwall." + id + ".remarks").value;
//document.getElementById("cbi-passwall-" + id + "-remarks").innerHTML = v;
}
id = result["UDP"];
if (id) {
var dom = document.getElementById("cbi-passwall-" + id);
if (dom) {
dom.classList.add("_now_use");
dom.title = "当前UDP节点";
}
}
}
@ -430,7 +424,7 @@ table td, .table .td {
<div style="display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;">
<div id="set_node_div">
<div class="cbi-value"><%:You choose node is:%><span id="set_node_name"></span></div>
<div class="cbi-value"><%:You choose node is:%><a style="color: red" id="set_node_name"></a></div>
<div class="cbi-value">
<input class="cbi-button cbi-button-edit" type="button" onclick="set_node('tcp')" value="TCP" />
<input class="cbi-button cbi-button-edit" type="button" onclick="set_node('udp')" value="UDP" />

View File

@ -1,6 +1,7 @@
config global
option enabled '0'
option socks_enabled '0'
option tcp_node 'nil'
option udp_node 'nil'
option dns_mode 'pdnsd'

View File

@ -225,7 +225,7 @@ check_port_exists() {
get_new_port() {
port=$1
[ "$port" == "auto" ] && port=2082
protocol=$2
protocol=$(echo $2 | tr 'A-Z' 'a-z')
result=$(check_port_exists $port $protocol)
if [ "$result" != 0 ]; then
temp=
@ -264,6 +264,7 @@ ln_start_bin() {
}
ENABLED=$(config_t_get global enabled 0)
SOCKS_ENABLED=$(config_t_get global socks_enabled 0)
TCP_REDIR_PORT=1041
TCP_NODE=$(config_t_get global tcp_node nil)
@ -603,14 +604,13 @@ node_switch() {
}
start_redir() {
eval num=\$${1}_NODE_NUM
eval node=\$${1}_NODE
[ "$node" != "nil" ] && {
TYPE=$(echo $(config_n_get $node type) | tr 'A-Z' 'a-z')
local config_file=$TMP_PATH/${1}.json
local log_file=$TMP_PATH/${1}.log
eval current_port=\$${1}_REDIR_PORT
local port=$(echo $(get_new_port $current_port $2))
local port=$(echo $(get_new_port $current_port $1))
eval ${1}_REDIR=$port
run_redir $node "0.0.0.0" $port $config_file $1 $log_file
#eval ip=\$${1}_NODE_IP
@ -1234,11 +1234,13 @@ start() {
#加锁防止并发开启服务
set_lock
load_config
start_socks
start_haproxy
[ "$SOCKS_ENABLED" = "1" ] && {
start_socks
}
[ "$NO_PROXY" == 1 ] || {
start_redir TCP tcp
start_redir UDP udp
start_redir TCP
start_redir UDP
start_dns
add_dnsmasq
source $APP_PATH/iptables.sh start

View File

@ -498,26 +498,28 @@ add_firewall_rule() {
fi
# 过滤Socks节点
local ids=$(uci show $CONFIG | grep "=socks" | awk -F '.' '{print $2}' | awk -F '=' '{print $1}')
echolog "分析 Socks 服务所使用节点..."
local id enabled node port msg num
for id in $ids; do
enabled=$(config_n_get $id enabled 0)
[ "$enabled" == "1" ] || continue
node=$(config_n_get $id node nil)
port=$(config_n_get $id port 0)
msg="Socks 服务 [:${port}]"
if [ "$node" == "nil" ] || [ "$port" == "0" ]; then
msg="${msg} 未配置完全,略过"
elif [ "$(echo $node | grep ^tcp)" ]; then
eval "node=\${TCP_NODE}"
msg="${msg} 使用与 TCP 代理自动切换${num} 相同的节点,延后处理"
else
filter_node $node TCP
filter_node $node UDP
fi
echolog " - ${msg}"
done
[ "$SOCKS_ENABLED" = "1" ] && {
local ids=$(uci show $CONFIG | grep "=socks" | awk -F '.' '{print $2}' | awk -F '=' '{print $1}')
echolog "分析 Socks 服务所使用节点..."
local id enabled node port msg num
for id in $ids; do
enabled=$(config_n_get $id enabled 0)
[ "$enabled" == "1" ] || continue
node=$(config_n_get $id node nil)
port=$(config_n_get $id port 0)
msg="Socks 服务 [:${port}]"
if [ "$node" == "nil" ] || [ "$port" == "0" ]; then
msg="${msg} 未配置完全,略过"
elif [ "$(echo $node | grep ^tcp)" ]; then
eval "node=\${TCP_NODE}"
msg="${msg} 使用与 TCP 代理自动切换${num} 相同的节点,延后处理"
else
filter_node $node TCP
filter_node $node UDP
fi
echolog " - ${msg}"
done
}
# 处理轮换节点的分流或套娃
local node port stream switch

View File

@ -264,6 +264,9 @@
42.242.0.0/15
42.244.0.0/14
42.248.0.0/13
43.136.0.0/13
43.144.0.0/12
43.160.0.0/11
43.224.12.0/22
43.224.24.0/22
43.224.44.0/22
@ -953,7 +956,6 @@
43.251.232.0/22
43.251.236.0/22
43.251.244.0/22
43.252.40.0/22
43.252.48.0/22
43.252.56.0/22
43.252.224.0/22
@ -1112,7 +1114,6 @@
45.120.164.0/22
45.120.220.0/22
45.120.240.0/22
45.121.20.0/22
45.121.52.0/22
45.121.64.0/22
45.121.68.0/22
@ -1223,7 +1224,6 @@
45.125.16.0/22
45.125.24.0/22
45.125.28.0/22
45.125.32.0/22
45.125.44.0/22
45.125.52.0/22
45.125.56.0/22
@ -1249,7 +1249,6 @@
45.127.12.0/22
45.127.96.0/22
45.127.116.0/22
45.127.124.0/22
45.127.128.0/22
45.127.144.0/22
45.127.148.0/22
@ -1289,7 +1288,6 @@
45.249.36.0/22
45.249.92.0/22
45.249.112.0/22
45.249.180.0/22
45.249.188.0/22
45.249.192.0/22
45.249.196.0/22
@ -1471,8 +1469,6 @@
45.253.236.0/22
45.253.240.0/22
45.253.244.0/22
45.253.248.0/22
45.253.252.0/22
45.254.0.0/22
45.254.4.0/22
45.254.8.0/22
@ -1784,7 +1780,9 @@
61.29.128.0/18
61.29.192.0/19
61.29.224.0/20
61.29.240.0/20
61.29.240.0/21
61.29.248.0/22
61.29.254.0/23
61.45.128.0/18
61.45.224.0/20
61.47.128.0/18
@ -2080,7 +2078,6 @@
103.18.208.0/22
103.18.212.0/22
103.18.224.0/22
103.19.0.0/22
103.19.12.0/22
103.19.40.0/22
103.19.44.0/22
@ -3269,7 +3266,6 @@
103.86.32.0/22
103.86.44.0/22
103.86.60.0/22
103.86.68.0/22
103.86.80.0/22
103.86.84.0/22
103.86.88.0/22
@ -3399,7 +3395,6 @@
103.93.28.0/22
103.93.76.0/22
103.93.84.0/22
103.93.121.0/24
103.93.152.0/22
103.93.180.0/22
103.93.204.0/22
@ -3774,7 +3769,6 @@
103.119.224.0/22
103.120.52.0/22
103.120.72.0/22
103.120.76.0/24
103.120.88.0/22
103.120.96.0/22
103.120.100.0/22
@ -3915,9 +3909,7 @@
103.141.58.0/23
103.141.128.0/23
103.141.186.0/23
103.141.190.0/23
103.141.242.0/23
103.142.0.0/23
103.142.28.0/23
103.142.58.0/23
103.142.82.0/23
@ -4083,6 +4075,47 @@
103.155.48.0/23
103.155.76.0/23
103.155.100.0/23
103.155.110.0/23
103.155.120.0/23
103.155.214.0/23
103.155.248.0/23
103.156.24.0/23
103.156.28.0/23
103.156.68.0/23
103.156.78.0/23
103.156.104.0/23
103.156.158.0/23
103.156.166.0/23
103.156.174.0/23
103.156.186.0/23
103.156.228.0/23
103.157.30.0/23
103.157.138.0/23
103.157.174.0/23
103.157.212.0/23
103.157.234.0/23
103.157.254.0/23
103.158.0.0/23
103.158.8.0/23
103.158.13.0/24
103.158.16.0/23
103.158.190.0/23
103.158.200.0/23
103.158.224.0/23
103.159.80.0/23
103.159.122.0/23
103.159.124.0/23
103.159.134.0/23
103.159.142.0/23
103.160.32.0/23
103.160.34.0/23
103.160.112.0/23
103.160.114.0/23
103.160.244.0/23
103.160.254.0/23
103.161.14.0/23
103.161.102.0/23
103.161.138.0/23
103.192.0.0/22
103.192.4.0/22
103.192.8.0/22
@ -4119,7 +4152,6 @@
103.193.124.0/22
103.193.140.0/22
103.193.144.0/22
103.193.148.0/22
103.193.160.0/22
103.193.188.0/22
103.193.192.0/22
@ -4138,8 +4170,6 @@
103.195.148.0/22
103.195.152.0/22
103.195.160.0/22
103.195.192.0/22
103.196.60.0/22
103.196.64.0/22
103.196.72.0/22
103.196.88.0/22
@ -4172,7 +4202,6 @@
103.199.248.0/22
103.199.252.0/22
103.200.28.0/22
103.200.32.0/22
103.200.52.0/22
103.200.64.0/22
103.200.68.0/22
@ -4318,7 +4347,6 @@
103.203.24.0/22
103.203.28.0/22
103.203.32.0/22
103.203.52.0/22
103.203.56.0/22
103.203.96.0/22
103.203.100.0/22
@ -4551,7 +4579,6 @@
103.218.84.0/22
103.218.88.0/22
103.218.92.0/22
103.218.184.0/22
103.218.192.0/22
103.218.196.0/22
103.218.200.0/22
@ -4799,7 +4826,6 @@
103.227.212.0/22
103.227.228.0/22
103.228.12.0/22
103.228.28.0/22
103.228.88.0/22
103.228.128.0/22
103.228.136.0/22
@ -5090,7 +5116,6 @@
103.251.160.0/22
103.251.192.0/22
103.251.204.0/22
103.251.236.0/22
103.251.240.0/22
103.252.28.0/22
103.252.36.0/22
@ -5302,7 +5327,6 @@
113.208.128.0/17
113.209.0.0/16
113.212.0.0/18
113.212.64.0/22
113.212.88.0/22
113.212.100.0/22
113.212.184.0/21
@ -5330,7 +5354,8 @@
114.111.160.0/19
114.112.0.0/14
114.116.0.0/16
114.117.0.0/16
114.117.0.0/17
114.117.128.0/17
114.118.0.0/16
114.119.0.0/17
114.119.192.0/21
@ -5444,7 +5469,6 @@
116.204.168.0/22
116.204.216.0/22
116.204.232.0/22
116.204.236.0/22
116.205.0.0/16
116.206.92.0/22
116.206.176.0/22

View File

@ -33,10 +33,7 @@
2001:df0:bf80::/48
2001:df0:d180::/48
2001:df0:d880::/48
2001:df1:680::/48
2001:df1:c80::/48
2001:df1:2080::/48
2001:df1:3d00::/48
2001:df1:4180::/48
2001:df1:4580::/48
2001:df1:5280::/48
@ -90,10 +87,14 @@
2001:df4:a680::/48
2001:df4:a980::/48
2001:df4:c180::/48
2001:df4:c580::/48
2001:df4:c780::/48
2001:df4:cf00::/48
2001:df4:de80::/48
2001:df5:2080::/48
2001:df5:5f80::/48
2001:df5:7800::/48
2001:df6:100::/48
2001:df6:f00::/48
2001:df6:1c00::/48
2001:df6:3d00::/48
2001:df6:5d00::/48
@ -319,7 +320,6 @@
2400:d1c0::/32
2400:d200::/32
2400:d300::/32
2400:d380::/32
2400:d440::/32
2400:d600::/32
2400:d6c0::/32
@ -340,7 +340,6 @@
2400:eec0::/32
2400:ef40::/32
2400:f480::/32
2400:f540::/32
2400:f5c0::/32
2400:f7c0::/32
2400:f840::/32
@ -638,7 +637,6 @@
2402:6a00::/32
2402:6b40::/32
2402:6bc0::/32
2402:6dc0::/32
2402:6e00::/32
2402:6e80::/32
2402:6ec0::/32
@ -657,7 +655,6 @@
2402:7d00::/32
2402:7d80::/32
2402:8180::/32
2402:8280::/32
2402:8300::/32
2402:8380::/32
2402:85c0::/32
@ -1403,7 +1400,6 @@
2405:8a40::/32
2405:8a80::/32
2405:8ac0::/32
2405:8b40::/32
2405:8b80::/32
2405:8c80::/32
2405:8d80::/32
@ -1638,10 +1634,12 @@
2406:7a80::/32
2406:7b80::/32
2406:7c80::/32
2406:7cc0::/32
2406:7d00::/32
2406:7d80::/32
2406:7e80::/32
2406:7f80::/32
2406:7fc0::/32
2406:8080::/32
2406:8180::/32
2406:8280::/32
@ -1654,17 +1652,22 @@
2406:8980::/32
2406:8a80::/32
2406:8b80::/32
2406:8bc0::/32
2406:8c80::/32
2406:8d80::/32
2406:8e80::/32
2406:8f40::/32
2406:8f80::/32
2406:9180::/32
2406:9200::/32
2406:9280::/32
2406:9380::/32
2406:9480::/32
2406:94c0::/32
2406:96c0::/32
2406:9780::/32
2406:9d80::/32
2406:9e40::/32
2406:9e80::/32
2406:9f80::/32
2406:a080::/32
@ -1675,26 +1678,36 @@
2406:a580::/32
2406:a680::/32
2406:a780::/32
2406:a7c0::/32
2406:a880::/32
2406:a8c0::/32
2406:a980::/32
2406:aa80::/32
2406:aac0::/32
2406:ab80::/32
2406:abc0::/32
2406:ac80::/32
2406:acc0::/32
2406:ad40::/32
2406:ad80::/32
2406:ae80::/32
2406:af80::/32
2406:b080::/32
2406:b640::/32
2406:b880::/32
2406:b980::/32
2406:ba80::/32
2406:bb80::/32
2406:bc80::/32
2406:bd40::/32
2406:bd80::/32
2406:bdc0::/32
2406:be80::/32
2406:bf80::/32
2406:c080::/32
2406:c180::/32
2406:c280::/32
2406:c340::/32
2406:c480::/32
2406:c580::/32
2406:c680::/32
@ -1703,6 +1716,7 @@
2406:c900::/32
2406:c980::/32
2406:ca80::/32
2406:cac0::/32
2406:cb80::/32
2406:cc80::/32
2406:cd80::/32
@ -1712,9 +1726,12 @@
2406:cf02::/31
2406:cf80::/32
2406:d080::/32
2406:d140::/32
2406:d180::/32
2406:d280::/32
2406:d2c0::/32
2406:d380::/32
2406:d440::/32
2406:d480::/32
2406:d580::/32
2406:d680::/32
@ -1730,13 +1747,19 @@
2406:e080::/32
2406:e180::/32
2406:e280::/32
2406:e2c0::/32
2406:e380::/32
2406:e3c0::/32
2406:e500::/32
2406:e580::/32
2406:e680::/32
2406:e780::/32
2406:e8c0::/32
2406:ea40::/28
2406:f280::/32
2406:f300::/32
2406:f4c0::/32
2406:f7c0::/32
2406:f980::/32
2406:fc80::/32
2406:fd80::/32
@ -1868,7 +1891,9 @@
2408:8400::/22
2408:8800::/21
2409:2000::/21
2409:6000::/20
2409:8000::/20
240a:2000::/24
240a:4000::/21
240a:8000::/21
240a:c000::/20

View File

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=owipcalc
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_LICENSE:=Apache-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -361,11 +361,11 @@ static struct cidr * cidr_parse6(const char *s)
if (!addr || (strlen(s) >= sizeof(addr->buf.v6)))
goto err;
snprintf(addr->buf.v4, sizeof(addr->buf.v6), "%s", s);
snprintf(addr->buf.v6, sizeof(addr->buf.v6), "%s", s);
addr->family = AF_INET6;
if ((p = strchr(addr->buf.v4, '/')) != NULL)
if ((p = strchr(addr->buf.v6, '/')) != NULL)
{
*p++ = 0;
@ -379,9 +379,9 @@ static struct cidr * cidr_parse6(const char *s)
addr->prefix = 128;
}
if (p == addr->buf.v4+1)
if (p == addr->buf.v6+1)
memset(&addr->addr.v6, 0, sizeof(addr->addr.v6));
else if (inet_pton(AF_INET6, addr->buf.v4, &addr->addr.v6) != 1)
else if (inet_pton(AF_INET6, addr->buf.v6, &addr->addr.v6) != 1)
goto err;
return addr;

View File

@ -1,65 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=syncthing
PKG_VERSION:=1.9.0
PKG_RELEASE:=1
PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)
PKG_HASH:=a4e3e5997b2c4c76512ed9b32a067b2a90e26c0d445f8c3c62af65d2b93d4d8b
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)
PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
PKG_LICENSE:=MPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:syncthing:syncthing
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/syncthing/syncthing/
GO_PKG_BUILD_PKG:=github.com/syncthing/syncthing/cmd/syncthing/
GO_PKG_INSTALL_EXTRA:=^gui/
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/syncthing
SECTION:=net
CATEGORY:=Network
SUBMENU:=File Transfer
TITLE:=Continuous file synchronization program
URL:=https://syncthing.net
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
GO_PKG_LDFLAGS:= -s -w
GO_PKG_LDFLAGS_X:= \
github.com/syncthing/syncthing/lib/build.Version=v$(PKG_VERSION) \
github.com/syncthing/syncthing/lib/build.Stamp=$(SOURCE_DATE_EPOCH) \
github.com/syncthing/syncthing/lib/build.User=ctcgfw \
github.com/syncthing/syncthing/lib/build.Host=project-openwrt \
github.com/syncthing/syncthing/lib/build.Program=syncthing
GO_PKG_TAGS:=noupgrade
define Build/Compile
$(call GoPackage/Build/Compile)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/syncthing
endef
define Package/syncthing/description
Syncthing replaces proprietary sync and cloud services with something
open, trustworthy and decentralized. Your data is your data alone and
you deserve to choose where it is stored, if it is shared with some
third party and how it's transmitted over the Internet.
endef
define Package/syncthing/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/syncthing $(1)/usr/bin/syncthing
endef
$(eval $(call GoBinPackage,syncthing))
$(eval $(call BuildPackage,syncthing))

View File

@ -1,17 +0,0 @@
config TVHEADEND_NDMS_CWC_SUPPORT
bool "NewCamd support"
default y
config TVHEADEND_NDMS_LINUXDVB_SUPPORT
bool "Linux DVB support"
default y
config TVHEADEND_NDMS_DVBSCAN_SUPPORT
bool "Fetch DVB-scan data"
depends on TVHEADEND_NDMS_LINUXDVB_SUPPORT
default TVHEADEND_NDMS_LINUXDVB_SUPPORT
config TVHEADEND_NDMS_AVAHI_SUPPORT
bool "Avahi client support"
select PACKAGE_libavahi-client
default n

View File

@ -1,132 +0,0 @@
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=tvheadend
PKG_VERSION:=4.3
PKG_RELEASE:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=d91f71cfbe0016350dbb3853a42ac4b226d8d47b
# This is stable git version...
# PKG_SOURCE_VERSION:=1a0262f5870e4fabd6b9c70a7bf2ebe420bc956e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/505575853/tvheadend.git
PKG_MIRROR_HASH:=2e6de0ddcad68da14a6b07217b06b233eea2e9440f2f3e7f136123fcfd6a5b7b
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE.md
PKG_FIXUP:=autoreconf
PKG_USE_MIPS16:=0
SHORT_GIT_VER:=$(shell echo $(PKG_SOURCE_VERSION) | cut -b -7)
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/tvheadend
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE:=Tvheadend is a TV streaming server for Linux
DEPENDS:=+libopenssl +librt +zlib +libpcre +libpcre2 +libdvbcsa +TVHEADEND_AVAHI_SUPPORT:libavahi-client $(ICONV_DEPENDS)
URL:=https://tvheadend.org
MAINTAINER:=Jan Čermák <jan.cermak@nic.cz>
endef
define Package/tvheadend/description
Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android
supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP and HDHomeRun as input sources.
Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming.
endef
define Package/tvheadend/config
menu "Configuration"
depends on PACKAGE_tvheadend
source "$(SOURCE)/Config.in"
endmenu
endef
ifeq ($(CONFIG_TVHEADEND_CWC_SUPPORT),)
CONFIGURE_ARGS += --disable-cwc
endif
ifeq ($(CONFIG_TVHEADEND_LINUXDVB_SUPPORT),)
CONFIGURE_ARGS += --disable-linuxdvb
endif
ifeq ($(CONFIG_TVHEADEND_DVBSCAN_SUPPORT),)
CONFIGURE_ARGS += --disable-dvbscan
endif
ifeq ($(CONFIG_TVHEADEND_AVAHI_SUPPORT),)
CONFIGURE_ARGS += --disable-avahi
else
CONFIGURE_ARGS += --enable-avahi
endif
CONFIGURE_ARGS += \
--arch=$(ARCH) \
--disable-dbus_1 \
--disable-libav \
--enable-bundle \
--enable-dvben50221 \
--enable-tvhcsa \
--enable-dvbcsa \
--enable-inotify \
--enable-epoll \
--enable-trace \
--nowerror \
--disable-dvbscan \
--disable-avahi \
--disable-hdhomerun_static \
--disable-pie \
--disable-imagecache \
--disable-ffmpeg_static \
--disable-libx264 \
--disable-libx264_static \
--disable-libx265 \
--disable-libx265_static \
--disable-libvpx \
--disable-libvpx_static \
--disable-libtheora \
--disable-libtheora_static \
--disable-libvorbis \
--disable-libvorbis_static \
--disable-libfdkaac \
--disable-libfdkaac_static \
--disable-nvenc \
--disable-libmfx_static \
--disable-timeshift
define Build/Prepare
$(call Build/Prepare/Default)
echo 'Tvheadend $(shell echo $(PKG_VERSION)~$(SHORT_GIT_VER)-$(PKG_RELEASE))' \
> $(PKG_BUILD_DIR)/debian/changelog
endef
define Package/conffiles
/etc/config/tvheadend
endef
define Package/tvheadend/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/tvheadend.config $(1)/etc/config/tvheadend
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build.linux/tvheadend $(1)/usr/bin/
endef
$(eval $(call BuildPackage,tvheadend))

View File

@ -1,13 +0,0 @@
#config tvheadend service
# option nosyslog '0'
# option use_temp_epgdb '0'
# option config_path '/etc/tvheadend'
config tvheadend server
option ipv6 '1'
# option bindaddr '0.0.0.0'
# option http_port '9981'
# option http_root '/tvheadend'
# option htsp_port '9982'
# option htsp_port2 '9983'
# option xspf '0'

View File

@ -1,71 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
STOP=00
USE_PROCD=1
PROG=/usr/bin/tvheadend
TEMP_CONFIG=/tmp/tvheadend
PERSISTENT_CONFIG=/etc/tvheadend
execute_first_run() {
"$PROG" -C "$1" -B -C -A >/dev/null 2>&1
}
ensure_config_exists() {
local config_path
config_load tvheadend
config_get config_path service config_path
if [ -z "$config_path" ]; then
[ -d "$PERSISTENT_CONFIG" ] || execute_first_run "$PERSISTENT_CONFIG"
else
# if the configuration directory is empty, empty config with grant-all ACL is created
[ -d "$config_path" ] && [ "$(ls -A $config_path)" ] || execute_first_run "$config_path"
fi
# if use_temp_epgdb is enabled (default), most of the config is put to config_path
# (or /etc/config), except for epgdb.v2, which grows quite large and is write-heavy,
# so it's put into volatile tmpfs
# epgdb.v2 is created and symlinked to main config dir upon each start (if it doesn't exist)
config_get_bool use_temp_epgdb service use_temp_epgdb 1
if [ "$use_temp_epgdb" == "1" ]; then
TEMP_EPG="${TEMP_CONFIG}/epgdb.v2"
[ ! -f "$TEMP_EPG" ] && mkdir -p "$TEMP_CONFIG" && touch "$TEMP_EPG" && chmod 700 "$TEMP_EPG"
[ -z "$config_path" ] && config_path="$PERSISTENT_CONFIG"
ln -sf "$TEMP_EPG" "${config_path}/epgdb.v2"
fi
}
load_uci_config() {
config_load tvheadend
config_get config_path service config_path "$PERSISTENT_CONFIG"
[ -n "$config_path" ] && procd_append_param command -c "$config_path"
config_get_bool nosyslog service nosyslog 0
[ "$nosyslog" -eq 1 ] && procd_append_param command --nosyslog
config_get_bool ipv6 server ipv6 0
[ "$ipv6" -eq 1 ] && procd_append_param command --ipv6
config_get bindaddr server bindaddr
[ -n "$bindaddr" ] && procd_append_param command --bindaddr "$bindaddr"
config_get http_port server http_port
[ -n "$http_port" ] && procd_append_param command --http_port "$http_port"
config_get http_root server http_root
[ -n "$http_root" ] && procd_append_param command --http_root "$http_root"
config_get htsp_port server htsp_port
[ -n "$htsp_port" ] && procd_append_param command --htsp_port "$htsp_port"
config_get htsp_port2 server htsp_port2
[ -n "$htsp_port2" ] && procd_append_param command --htsp_port "$htsp_port2"
config_get xspf server xspf 0
[ "$xspf" -eq 1 ] && procd_append_param command --xspf
}
start_service() {
ensure_config_exists
procd_open_instance
procd_set_param file /etc/config/tvheadend
procd_set_param command "$PROG" -B -C
load_uci_config
procd_close_instance
}

View File

@ -1,28 +0,0 @@
diff --git a/src/input.h b/src/input.h
index 516f850ef..378996a80 100644
--- a/src/input.h
+++ b/src/input.h
@@ -129,8 +129,8 @@ void tvh_hardware_delete ( tvh_hardware_t *th );
extern const idclass_t tvh_input_class;
extern const idclass_t tvh_input_instance_class;
-tvh_input_list_t tvh_inputs;
-tvh_hardware_list_t tvh_hardware;
+extern tvh_input_list_t tvh_inputs;
+extern tvh_hardware_list_t tvh_hardware;
#define TVH_INPUT_FOREACH(x) LIST_FOREACH(x, &tvh_inputs, ti_link)
#define TVH_HARDWARE_FOREACH(x) LIST_FOREACH(x, &tvh_hardware, th_link)
diff --git a/src/input/mpegts.h b/src/input/mpegts.h
index 9d29d56ca..fd46e4f9e 100644
--- a/src/input/mpegts.h
+++ b/src/input/mpegts.h
@@ -1144,7 +1144,7 @@ typedef struct mpegts_listener
void (*ml_mux_delete) (mpegts_mux_t *mm, void *p);
} mpegts_listener_t;
-LIST_HEAD(,mpegts_listener) mpegts_listeners;
+static LIST_HEAD(,mpegts_listener) mpegts_listeners;
#define mpegts_add_listener(ml)\
LIST_INSERT_HEAD(&mpegts_listeners, ml, ml_link)

View File

@ -427,7 +427,8 @@ sub gen_profile_mk() {
my @targets = parse_target_metadata($file);
foreach my $cur (@targets) {
next unless $cur->{id} eq $target;
print "PROFILE_NAMES = ".join(" ", map { $_->{id} } @{$cur->{profiles}})."\n";
my @profile_ids_unique = do { my %seen; grep { !$seen{$_}++} map { $_->{id} } @{$cur->{profiles}}};
print "PROFILE_NAMES = ".join(" ", @profile_ids_unique)."\n";
foreach my $profile (@{$cur->{profiles}}) {
print $profile->{id}.'_NAME:='.$profile->{name}."\n";
print $profile->{id}.'_HAS_IMAGE_METADATA:='.$profile->{has_image_metadata}."\n";

View File

@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=glibc
PKG_VERSION:=2.32
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=0d9793e82a19bcef10ef7d73a26cd44b7ad30753
PKG_MIRROR_HASH:=edb3e1f8792f3f10d6ade9ac35837e8b0b65ee12219f3580e1ac8ba363ef9e8f
PKG_SOURCE_VERSION:=4c619b3eed558172198790f842740abb9af1989d
PKG_MIRROR_HASH:=b662bceabc5a077c5be8a582aaf1567450fd774df5e31f91928272c1e4e572de
PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz

View File

@ -23,11 +23,9 @@ provides them.
sunrpc/des_soft.c | 2 +-
13 files changed, 305 insertions(+), 90 deletions(-)
diff --git a/conform/data/stdlib.h-data b/conform/data/stdlib.h-data
index 6913828196..d8fcccc2fb 100644
--- a/conform/data/stdlib.h-data
+++ b/conform/data/stdlib.h-data
@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (unsigned short int[3])
@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (u
#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98
function int setenv (const char*, const char*, int)
#endif
@ -37,8 +35,6 @@ index 6913828196..d8fcccc2fb 100644
#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008
function {char*} setstate (char*)
#endif
diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data
index aa070528e8..ddf4f25132 100644
--- a/conform/data/unistd.h-data
+++ b/conform/data/unistd.h-data
@@ -437,6 +437,9 @@ function int chroot (const char*)
@ -61,8 +57,6 @@ index aa070528e8..ddf4f25132 100644
function int execl (const char*, const char*, ...)
function int execle (const char*, const char*, ...)
function int execlp (const char*, const char*, ...)
diff --git a/crypt/cert.c b/crypt/cert.c
index e070ca398d..80029e9078 100644
--- a/crypt/cert.c
+++ b/crypt/cert.c
@@ -10,22 +10,6 @@
@ -102,8 +96,6 @@ index e070ca398d..80029e9078 100644
-}
-
-#endif
diff --git a/crypt/crypt-entry.c b/crypt/crypt-entry.c
index 502b5846f0..09332c690a 100644
--- a/crypt/crypt-entry.c
+++ b/crypt/crypt-entry.c
@@ -35,7 +35,6 @@
@ -114,7 +106,7 @@ index 502b5846f0..09332c690a 100644
/* Prototypes for local functions. */
#ifndef __GNU_LIBRARY__
@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt)
@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt
return __crypt_r (key, salt, &_ufc_foobar);
}
@ -134,8 +126,6 @@ index 502b5846f0..09332c690a 100644
+ return crypt (key, salt);
+}
#endif
diff --git a/crypt/crypt.h b/crypt/crypt.h
index ca8ad456cc..7d0de95018 100644
--- a/crypt/crypt.h
+++ b/crypt/crypt.h
@@ -36,6 +36,14 @@ __BEGIN_DECLS
@ -168,8 +158,6 @@ index ca8ad456cc..7d0de95018 100644
#endif
__END_DECLS
diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c
index 4b2f0a89cb..b012cde6bd 100644
--- a/crypt/crypt_util.c
+++ b/crypt/crypt_util.c
@@ -34,7 +34,6 @@
@ -196,7 +184,7 @@ index 4b2f0a89cb..b012cde6bd 100644
/*
* This is the final
@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, ufc_long v2, const char *salt,
@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, u
__data->crypt_3_buf[13] = 0;
}
@ -204,7 +192,7 @@ index 4b2f0a89cb..b012cde6bd 100644
/*
* UNIX encrypt function. Takes a bitvector
@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag,
@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag
}
}
weak_alias (__encrypt_r, encrypt_r)
@ -219,7 +207,7 @@ index 4b2f0a89cb..b012cde6bd 100644
/*
@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct crypt_data * __restrict __data)
@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct cr
_ufc_mk_keytab_r((char *) ktab, __data);
}
weak_alias (__setkey_r, setkey_r)
@ -235,11 +223,9 @@ index 4b2f0a89cb..b012cde6bd 100644
void
__b64_from_24bit (char **cp, int *buflen,
diff --git a/manual/conf.texi b/manual/conf.texi
index f959b00bb6..51fb2f5aa1 100644
--- a/manual/conf.texi
+++ b/manual/conf.texi
@@ -780,8 +780,6 @@ Inquire about the parameter corresponding to @code{_XOPEN_LEGACY}.
@@ -780,8 +780,6 @@ Inquire about the parameter correspondin
@item _SC_XOPEN_CRYPT
@standards{X/Open, unistd.h}
Inquire about the parameter corresponding to @code{_XOPEN_CRYPT}.
@ -248,11 +234,9 @@ index f959b00bb6..51fb2f5aa1 100644
@item _SC_XOPEN_ENH_I18N
@standards{X/Open, unistd.h}
diff --git a/manual/crypt.texi b/manual/crypt.texi
index af23dd7847..1b151f2d74 100644
--- a/manual/crypt.texi
+++ b/manual/crypt.texi
@@ -16,8 +16,19 @@ subject to them, even if you do not use the functions in this chapter
@@ -16,8 +16,19 @@ subject to them, even if you do not use
yourself. The restrictions vary from place to place and are changed
often, so we cannot give any more specific advice than this warning.
@ -272,7 +256,7 @@ index af23dd7847..1b151f2d74 100644
* Unpredictable Bytes:: Randomness for cryptographic purposes.
@end menu
@@ -190,6 +201,199 @@ unpredictable as possible; @pxref{Unpredictable Bytes}.
@@ -190,6 +201,199 @@ unpredictable as possible; @pxref{Unpred
@include genpass.c.texi
@end smallexample
@ -472,8 +456,6 @@ index af23dd7847..1b151f2d74 100644
The next program demonstrates how to verify a passphrase. It checks a
hash hardcoded into the program, because looking up real users' hashed
passphrases may require special privileges (@pxref{User Database}).
diff --git a/manual/string.texi b/manual/string.texi
index 23f516439a..5586b52dee 100644
--- a/manual/string.texi
+++ b/manual/string.texi
@@ -36,8 +36,8 @@ too.
@ -487,7 +469,7 @@ index 23f516439a..5586b52dee 100644
* Encode Binary Data:: Encoding and Decoding of Binary Data.
* Argz and Envz Vectors:: Null-separated string vectors.
@end menu
@@ -2426,73 +2426,73 @@ functionality under a different name, such as @code{explicit_memset},
@@ -2426,73 +2426,73 @@ functionality under a different name, su
systems it may be in @file{strings.h} instead.
@end deftypefun
@ -538,22 +520,11 @@ index 23f516439a..5586b52dee 100644
-@node Obfuscating Data
-@section Obfuscating Data
-@cindex Rot13
+@node Trivial Encryption
+@section Trivial Encryption
+@cindex encryption
-The @code{memfrob} function reversibly obfuscates an array of binary
-data. This is not true encryption; the obfuscated data still bears a
-clear relationship to the original, and no secret key is required to
-undo the obfuscation. It is analogous to the ``Rot13'' cipher used on
-Usenet for obscuring offensive jokes, spoilers for works of fiction,
-and so on, but it can be applied to arbitrary binary data.
-Programs that need true encryption---a transformation that completely
-obscures the original and cannot be reversed without knowledge of a
-secret key---should use a dedicated cryptography library, such as
-@uref{https://www.gnu.org/software/libgcrypt/,,libgcrypt}.
+
+
+The @code{memfrob} function converts an array of data to something
+unrecognizable and back again. It is not encryption in its usual sense
+since it is easy for someone to convert the encrypted data back to clear
@ -561,8 +532,20 @@ index 23f516439a..5586b52dee 100644
+method for obscuring offensive jokes from sensitive eyes and such.
+Unlike Rot13, @code{memfrob} works on arbitrary binary data, not just
+text.
+@cindex Rot13
@cindex Rot13
-The @code{memfrob} function reversibly obfuscates an array of binary
-data. This is not true encryption; the obfuscated data still bears a
-clear relationship to the original, and no secret key is required to
-undo the obfuscation. It is analogous to the ``Rot13'' cipher used on
-Usenet for obscuring offensive jokes, spoilers for works of fiction,
-and so on, but it can be applied to arbitrary binary data.
-
-Programs that need true encryption---a transformation that completely
-obscures the original and cannot be reversed without knowledge of a
-secret key---should use a dedicated cryptography library, such as
-@uref{https://www.gnu.org/software/libgcrypt/,,libgcrypt}.
-
-Programs that need to @emph{destroy} data should use
-@code{explicit_bzero} (@pxref{Erasing Sensitive Data}), or possibly
-@code{strfry} (@pxref{Shuffling Bytes}).
@ -579,13 +562,14 @@ index 23f516439a..5586b52dee 100644
-beginning at @var{mem}, in place. Each byte is bitwise xor-ed with
-the binary pattern 00101010 (hexadecimal 0x2A). The return value is
-always @var{mem}.
-
-@code{memfrob} a second time on the same data returns it to
-its original state.
+@code{memfrob} transforms (frobnicates) each byte of the data structure
+at @var{mem}, which is @var{length} bytes long, by bitwise exclusive
+oring it with binary 00101010. It does the transformation in place and
+its return value is always @var{mem}.
-@code{memfrob} a second time on the same data returns it to
-its original state.
+
+Note that @code{memfrob} a second time on the same data structure
+returns it to its original state.
+
@ -600,8 +584,6 @@ index 23f516439a..5586b52dee 100644
@end deftypefun
@node Encode Binary Data
diff --git a/posix/unistd.h b/posix/unistd.h
index 32b8161619..6fac59999f 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -107,6 +107,9 @@ __BEGIN_DECLS
@ -614,7 +596,7 @@ index 32b8161619..6fac59999f 100644
/* The enhanced internationalization capabilities according to XPG4.2
are present. */
#define _XOPEN_ENH_I18N 1
@@ -1129,17 +1132,25 @@ ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
@@ -1129,17 +1132,25 @@ ssize_t copy_file_range (int __infd, __o
extern int fdatasync (int __fildes);
#endif /* Use POSIX199309 */
@ -643,11 +625,9 @@ index 32b8161619..6fac59999f 100644
/* Swab pairs bytes in the first N bytes of the area pointed to by
FROM and copy the result to TO. The value of TO must not be in the
range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 3aa27a9d25..67e5e66f94 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -962,6 +962,12 @@ extern int getsubopt (char **__restrict __optionp,
@@ -962,6 +962,12 @@ extern int getsubopt (char **__restrict
#endif
@ -660,11 +640,9 @@ index 3aa27a9d25..67e5e66f94 100644
/* X/Open pseudo terminal handling. */
#ifdef __USE_XOPEN2KXSI
diff --git a/sunrpc/des_crypt.c b/sunrpc/des_crypt.c
index 9b4bd2d5dd..a4d8b2936b 100644
--- a/sunrpc/des_crypt.c
+++ b/sunrpc/des_crypt.c
@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, register unsigned len,
@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, regi
return desdev == DES_SW ? DESERR_NONE : DESERR_NOHWDEVICE;
}
@ -674,7 +652,7 @@ index 9b4bd2d5dd..a4d8b2936b 100644
/*
* CBC mode encryption
*/
@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigned int len, unsigned int mode,
@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigne
COPY8 (dp.des_ivec, ivec);
return err;
}
@ -683,14 +661,12 @@ index 9b4bd2d5dd..a4d8b2936b 100644
/*
* ECB mode encryption
@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigned int len, unsigned int mode)
@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigne
dp.des_mode = ECB;
return common_crypt (key, buf, len, mode, &dp);
}
-hidden_nolink (ecb_crypt, libc, GLIBC_2_1)
+libc_hidden_nolink_sunrpc (ecb_crypt, GLIBC_2_1)
diff --git a/sunrpc/des_soft.c b/sunrpc/des_soft.c
index a87de96cc7..f884f8f21b 100644
--- a/sunrpc/des_soft.c
+++ b/sunrpc/des_soft.c
@@ -71,4 +71,4 @@ des_setparity (char *p)
@ -699,6 +675,3 @@ index a87de96cc7..f884f8f21b 100644
}
-hidden_nolink (des_setparity, libc, GLIBC_2_1)
+libc_hidden_nolink_sunrpc (des_setparity, GLIBC_2_1)
--
2.25.1

View File

@ -33,3 +33,4 @@
+typedef char *caddr_t;
# define __daddr_t_defined
#endif

View File

@ -0,0 +1,55 @@
--- a/sysdeps/arc/atomic-machine.h
+++ b/sysdeps/arc/atomic-machine.h
@@ -64,6 +64,10 @@ typedef uintmax_t uatomic_max_t;
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
mem, new, old, __ATOMIC_ACQUIRE)
+#ifdef __ARC700__
+#define atomic_full_barrier() ({ asm volatile ("sync":::"memory"); })
+#else
#define atomic_full_barrier() ({ asm volatile ("dmb 3":::"memory"); })
+#endif
#endif /* _ARC_BITS_ATOMIC_H */
--- a/sysdeps/unix/sysv/linux/arc/syscall.S
+++ b/sysdeps/unix/sysv/linux/arc/syscall.S
@@ -24,8 +24,13 @@ ENTRY (syscall)
mov_s r1, r2
mov_s r2, r3
mov_s r3, r4
+#ifdef __ARC700__
+ mov r4, r5
+ mov r5, r6
+#else
mov_s r4, r5
mov_s r5, r6
+#endif
ARC_TRAP_INSN
brhi r0, -4096, L (call_syscall_err)
--- a/sysdeps/unix/sysv/linux/arc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arc/sysdep.h
@@ -128,7 +128,11 @@ L (call_syscall_err): ASM_LINE_SEP \
mov r8, __NR_##syscall_name ASM_LINE_SEP \
ARC_TRAP_INSN ASM_LINE_SEP
+# ifdef __ARC700__
+# define ARC_TRAP_INSN trap0
+# else
# define ARC_TRAP_INSN trap_s 0
+# endif
#else /* !__ASSEMBLER__ */
@@ -139,7 +143,11 @@ extern long int __syscall_error (long in
hidden_proto (__syscall_error)
# endif
+# ifdef __ARC700__
+# define ARC_TRAP_INSN "trap0 \n\t"
+# else
# define ARC_TRAP_INSN "trap_s 0 \n\t"
+#endif
# undef INTERNAL_SYSCALL_NCS
# define INTERNAL_SYSCALL_NCS(number, nr_args, args...) \

View File

@ -25,7 +25,23 @@
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
#endif /* HAVE_SYS_ACL_H */
@@ -1911,7 +1918,7 @@ ssize_t fremovexattr(int fd, const char
@@ -188,6 +195,15 @@ extern int unsetenv (const char *name);
#undef __lxstat64
#undef _FILE_OFFSET_BITS
+
+#ifndef AT_EMPTY_PATH
+#define AT_EMPTY_PATH 0
+#endif
+
+#ifndef AT_NO_AUTOMOUNT
+#define AT_NO_AUTOMOUNT 0
+#endif
+
/*
// next_wrap_st:
// this structure is used in next_wrap, which is defined in
@@ -1911,7 +1927,7 @@ ssize_t fremovexattr(int fd, const char
}
#endif /* HAVE_FREMOVEXATTR */
@ -34,7 +50,7 @@
if (fakeroot_disabled)
return next_setpriority(which, who, prio);
next_setpriority(which, who, prio);
@@ -2520,3 +2527,19 @@ int sysinfo(int command, char *buf, long
@@ -2520,3 +2536,19 @@ int sysinfo(int command, char *buf, long
}
}
#endif

View File

@ -4,7 +4,8 @@ PKG_NAME:=zstd
PKG_VERSION:=1.4.4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GITHUB/facebook/zstd/releases/download/v$(PKG_VERSION)
PKG_SOURCE_URL_FILE:=v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/facebook/zstd/archive/
PKG_HASH:=a364f5162c7d1a455cc915e8e3cf5f4bd8b75d09bc0f53965b0c9ca1383c52c8
PKG_LICENSE:=BSD-3-Clause