Skip to content

Commit

Permalink
Merge branch 'master' into tmp
Browse files Browse the repository at this point in the history
# Conflicts:
#	luci-app-ssr-plus/root/etc/init.d/shadowsocksr
#	luci-app-ssr-plus/root/usr/bin/ssr-rules
  • Loading branch information
Your Name committed Nov 4, 2024
2 parents 114b74f + 4bdd63d commit 19d8937
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 63 deletions.
4 changes: 2 additions & 2 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:=188
PKG_RELEASE:=9
PKG_VERSION:=189
PKG_RELEASE:=1

PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY \
Expand Down
7 changes: 5 additions & 2 deletions luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ o:depends("adblock", "1")
o.description = translate("Support AdGuardHome and DNSMASQ format list")

o = s:option(Button, "reset", translate("Reset to defaults"))
o.rawhtml = true
o.template = "shadowsocksr/reset"
o.inputstyle = "reload"
o.write = function()
luci.sys.call("/etc/init.d/shadowsocksr reset")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "servers"))
end

-- [[ SOCKS5 Proxy ]]--
s = m:section(TypedSection, "socks5_proxy", translate("Global SOCKS5 Proxy Server"))
Expand Down
68 changes: 14 additions & 54 deletions luci-app-ssr-plus/root/etc/init.d/shadowsocksr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ LOCK_FILE=/var/lock/ssrplus.lock
LOG_FILE=/var/log/ssrplus.log
TMP_PATH=/var/etc/ssrplus
TMP_BIN_PATH=$TMP_PATH/bin
TMP_DNSMASQ_PATH=/tmp/dnsmasq.d/dnsmasq-ssrplus.d
# Get the default DNSMasq config ID from the UCI configuration
DEFAULT_DNSMASQ_CFGID=$(uci show dhcp.@dnsmasq[0] | awk -F '.' '{print $2}' | awk -F '=' '{print $1}' | head -1)
# Locate the dnsmasq.conf file that contains the conf-dir option
DNSMASQ_CONF_PATH=$(grep -l "^conf-dir=" "/tmp/etc/dnsmasq.conf.${DEFAULT_DNSMASQ_CFGID}")
# Extract the directory path from the conf-dir line
DNSMASQ_CONF_DIR=$(grep '^conf-dir=' "$DNSMASQ_CONF_PATH" | cut -d'=' -f2 | head -n 1)
# Check if a conf-dir value was found and set variables accordingly
TMP_DNSMASQ_PATH=${DNSMASQ_CONF_DIR%*/}/dnsmasq-ssrplus.d

chain_config_file= #generate shadowtls chain proxy config file
tcp_config_file=
Expand Down Expand Up @@ -1096,8 +1103,8 @@ stop_mosdns(){
start() {
set_lock
echolog "----------start------------"
mkdir -p /var/run /var/lock /var/log /tmp/dnsmasq.d $TMP_BIN_PATH $TMP_DNSMASQ_PATH
echo "conf-dir=${TMP_DNSMASQ_PATH}" >"/tmp/dnsmasq.d/dnsmasq-ssrplus.conf"
mkdir -p /var/run /var/lock /var/log $DNSMASQ_CONF_DIR $TMP_BIN_PATH $TMP_DNSMASQ_PATH
echo "conf-dir=${TMP_DNSMASQ_PATH}" >"$DNSMASQ_CONF_DIR/dnsmasq-ssrplus.conf"
if load_config; then
Start_Run
start_rules
Expand Down Expand Up @@ -1131,7 +1138,7 @@ start() {

boot() {
echolog "boot!"
mkdir -p /var/run /var/lock /var/log /tmp/dnsmasq.d $TMP_BIN_PATH $TMP_DNSMASQ_PATH
mkdir -p /var/run /var/lock /var/log $DNSMASQ_CONF_DIR $TMP_BIN_PATH $TMP_DNSMASQ_PATH
start
}

Expand Down Expand Up @@ -1170,8 +1177,8 @@ stop() {
uci -q del "dhcp.@dnsmasq[0]._unused_ssrp_changed"
uci -q commit "dhcp"
fi
if [ -f "/tmp/dnsmasq.d/dnsmasq-ssrplus.conf" ]; then
rm -rf /tmp/dnsmasq.d/dnsmasq-ssrplus.conf $TMP_DNSMASQ_PATH $TMP_PATH/*-ssr-*.json $TMP_PATH/ssr-server*.json
if [ -f "$DNSMASQ_CONF_DIR/dnsmasq-ssrplus.conf" ]; then
rm -rf $DNSMASQ_CONF_DIR/dnsmasq-ssrplus.conf $TMP_DNSMASQ_PATH $TMP_PATH/*-ssr-*.json $TMP_PATH/ssr-server*.json
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
del_cron
Expand All @@ -1183,53 +1190,6 @@ reset() {
set_lock
rm -rf /etc/config/shadowsocksr $LOG_FILE
touch /etc/config/shadowsocksr $LOG_FILE
uci -q batch <<-EOF >/dev/null
add shadowsocksr global
set shadowsocksr.@global[0].global_server='nil'
set shadowsocksr.@global[0].netflix_server='nil'
set shadowsocksr.@global[0].netflix_proxy='0'
set shadowsocksr.@global[0].threads='0'
set shadowsocksr.@global[0].run_mode='dyn'
set shadowsocksr.@global[0].dports='1'
set shadowsocksr.@global[0].pdnsd_enable='0'
set shadowsocksr.@global[0].tunnel_forward='8.8.4.4:53'
set shadowsocksr.@global[0].monitor_enable='1'
set shadowsocksr.@global[0].enable_switch='1'
set shadowsocksr.@global[0].switch_time='667'
set shadowsocksr.@global[0].switch_timeout='5'
set shadowsocksr.@global[0].switch_try_count='3'
# set shadowsocksr.@global[0].default_packet_encoding='xudp'
set shadowsocksr.@global[0].shunt_dns='1'
set shadowsocksr.@global[0].gfwlist_url='https://fastly.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt'
set shadowsocksr.@global[0].chnroute_url='https://ispip.clang.cn/all_cn.txt'
set shadowsocksr.@global[0].nfip_url='https://fastly.jsdelivr.net/gh/QiuSimons/Netflix_IP/NF_only.txt'
set shadowsocksr.@global[0].adblock_url='https://anti-ad.net/anti-ad-for-dnsmasq.conf'
add shadowsocksr server_subscribe
set shadowsocksr.@server_subscribe[0].proxy='0'
set shadowsocksr.@server_subscribe[0].auto_update_time='2'
set shadowsocksr.@server_subscribe[0].auto_update='1'
set shadowsocksr.@server_subscribe[0].filter_words='过期时间/剩余流量/QQ群/官网/防失联地址/回国'
set shadowsocksr.@server_subscribe[0].save_words=''
add shadowsocksr access_control
set shadowsocksr.@access_control[0].lan_ac_mode='0'
set shadowsocksr.@access_control[0].router_proxy='1'
add_list shadowsocksr.@access_control[0].wan_fw_ips=149.154.160.0/20
add_list shadowsocksr.@access_control[0].wan_fw_ips=67.198.55.0/24
add_list shadowsocksr.@access_control[0].wan_fw_ips=91.108.4.0/22
add_list shadowsocksr.@access_control[0].wan_fw_ips=91.108.56.0/22
add_list shadowsocksr.@access_control[0].wan_fw_ips=109.239.140.0/24
add_list shadowsocksr.@access_control[0].wan_fw_ips=8.8.8.8
add_list shadowsocksr.@access_control[0].wan_fw_ips=1.1.1.1
add_list shadowsocksr.@access_control[0].Interface='lan'
add shadowsocksr socks5_proxy
set shadowsocksr.@socks5_proxy[0].server='nil'
set shadowsocksr.@socks5_proxy[0].local_port='1080'
add shadowsocksr server_global
set shadowsocksr.@server_global[0].enable_server='0'
add shadowsocksr global_xray_fragment
set shadowsocksr.@global_xray_fragment[0].fragment='0'
set shadowsocksr.@global_xray_fragment[0].noise='0'
commit shadowsocksr
EOF
cp /usr/share/shadowsocksr/shadowsocksr.config /etc/config/shadowsocksr
unset_lock
}
1 change: 0 additions & 1 deletion luci-app-ssr-plus/root/usr/bin/ssr-rules
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ ipset_r() {
$IPT -A SS_SPEC_WAN_AC -m set --match-set china dst -j RETURN
$IPT -A SS_SPEC_WAN_AC -m set --match-set gfwlist dst -j SS_SPEC_WAN_FW
$IPT -A SS_SPEC_WAN_AC -m set --match-set gmlan src -m set ! --match-set china dst -j SS_SPEC_WAN_FW
$IPT -A SS_SPEC_WAN_AC -j SS_SPEC_WAN_FW
[ -n "$(command -v ip6tables)" ] && . /etc/ssrplus/blockipv6.sh
;;
oversea)
Expand Down
51 changes: 51 additions & 0 deletions luci-app-ssr-plus/root/usr/share/shadowsocksr/shadowsocksr.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

config global
option global_server 'nil'
option netflix_server 'nil'
option netflix_proxy '0'
option threads '0'
option run_mode 'router'
option dports '2'
option custom_ports '80,443'
option pdnsd_enable '1'
option tunnel_forward '8.8.4.4:53'
option monitor_enable '1'
option enable_switch '1'
option switch_time '667'
option switch_timeout '5'
option switch_try_count '3'
option shunt_dns '1'
option gfwlist_url 'https://fastly.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt'
option chnroute_url 'https://ispip.clang.cn/all_cn.txt'
option nfip_url 'https://fastly.jsdelivr.net/gh/QiuSimons/Netflix_IP/NF_only.txt'
option adblock_url 'https://anti-ad.net/anti-ad-for-dnsmasq.conf'

config server_subscribe
option proxy '0'
option auto_update_time '2'
option auto_update '1'
option filter_words '过期时间/剩余流量/QQ群/官网/防失联地址/回国'

config access_control
option lan_ac_mode '0'
option router_proxy '1'
list wan_fw_ips '149.154.160.0/20'
list wan_fw_ips '67.198.55.0/24'
list wan_fw_ips '91.108.4.0/22'
list wan_fw_ips '91.108.56.0/22'
list wan_fw_ips '109.239.140.0/24'
list wan_fw_ips '8.8.8.8'
list wan_fw_ips '1.1.1.1'
list Interface 'lan'

config socks5_proxy
option server 'nil'
option local_port '1080'

config server_global
option enable_server '0'

config global_xray_fragment
option fragment '0'
option noise '0'

2 changes: 1 addition & 1 deletion luci-app-ssr-plus/root/usr/share/shadowsocksr/update.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require "luci.model.uci"
local icount = 0
local args = arg[1]
local uci = luci.model.uci.cursor()
local TMP_DNSMASQ_PATH = "/tmp/dnsmasq.d/dnsmasq-ssrplus.d"
local TMP_DNSMASQ_PATH = "${DNSMASQ_CONF_DIR%*/}/dnsmasq-ssrplus.d"
local TMP_PATH = "/var/etc/ssrplus"
-- match comments/title/whitelist/ip address/excluded_domain
local comment_pattern = "^[!\\[@]+"
Expand Down
6 changes: 3 additions & 3 deletions xray-core/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=xray-core
PKG_VERSION:=24.10.16
PKG_NAME:=Xray-core
PKG_VERSION:=24.10.31
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=2964cf0cc7cb1b631591cc49c49160d1a478d2f83e4f0a1081e0bc6cc38d8725
PKG_HASH:=b61102ce87c61fa97c001cb08bb3ad794ff7184e2457bc58fe71206e53dcee83

PKG_MAINTAINER:=Tianling Shen <[email protected]>
PKG_LICENSE:=MPL-2.0
Expand Down

0 comments on commit 19d8937

Please sign in to comment.