Skip to content

Commit 9b55184

Browse files
committed
適配最新版 SSPanel-UIM:dev
去除以下功能: Shadowsocks中轉 數據庫連接方式 Speedtest Autoexec Cloudsafe Antissattack 以及一些無效代碼清理
1 parent ada898f commit 9b55184

18 files changed

+144
-2577
lines changed

apiconfig.py

+3-47
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,14 @@
11
# Config
22
NODE_ID = 0
33

4-
# hour,set 0 to disable
5-
SPEEDTEST = 6
6-
CLOUDSAFE = 1
7-
ANTISSATTACK = 0
8-
AUTOEXEC = 0
9-
104
MU_SUFFIX = 'zhaoj.in'
115
MU_REGEX = '%5m%id.%suffix'
126

13-
SERVER_PUB_ADDR = '127.0.0.1' # mujson_mgr need this to generate ssr link
14-
API_INTERFACE = 'modwebapi' # glzjinmod, modwebapi
15-
16-
WEBAPI_URL = 'https://zhaoj.in'
17-
WEBAPI_TOKEN = 'glzjin'
18-
19-
# mudb
20-
MUDB_FILE = 'mudb.json'
21-
22-
# Mysql
23-
MYSQL_HOST = '127.0.0.1'
24-
MYSQL_PORT = 3306
25-
MYSQL_USER = 'ss'
26-
MYSQL_PASS = 'ss'
27-
MYSQL_DB = 'shadowsocks'
28-
29-
MYSQL_SSL_ENABLE = 0
30-
MYSQL_SSL_CA = ''
31-
MYSQL_SSL_CERT = ''
32-
MYSQL_SSL_KEY = ''
33-
34-
# API
35-
API_HOST = '127.0.0.1'
36-
API_PORT = 80
37-
API_PATH = '/mu/v2/'
38-
API_TOKEN = 'abcdef'
7+
API_INTERFACE = 'modwebapi' # modwebapi
8+
WEBAPI_URL = 'https://demo.sspanel.host'
9+
WEBAPI_TOKEN = 'sspanel'
3910
API_UPDATE_TIME = 60
4011

41-
# Manager (ignore this)
42-
MANAGE_PASS = 'ss233333333'
43-
# if you want manage in other server you should set this value to global ip
44-
MANAGE_BIND_IP = '127.0.0.1'
45-
# make sure this port is idle
46-
MANAGE_PORT = 23333
47-
48-
# edit this file and server will auto reload
49-
50-
# boolean, enable to print mysql query
51-
PRINT_MYSQL_QUERY = False
52-
53-
# second
54-
MYSQL_PUSH_DURATION = 60
55-
5612
"""
5713
get port offset by node->name
5814
HK 1 #9900

asyncmgr.py

-101
This file was deleted.

auto_block.py

-40
Original file line numberDiff line numberDiff line change
@@ -37,51 +37,11 @@ def auto_block_thread(self):
3737

3838
if configloader.get_config().API_INTERFACE == "modwebapi":
3939
# 读取节点IP
40-
# SELECT * FROM `ss_node` where `node_ip` != ''
4140
node_ip_list = []
4241
data = webapi.getApi("nodes")
4342
for node in data:
4443
temp_list = node["node_ip"].split(",")
4544
node_ip_list.append(temp_list[0])
46-
else:
47-
import cymysql
48-
49-
if configloader.get_config().MYSQL_SSL_ENABLE == 1:
50-
conn = cymysql.connect(
51-
host=configloader.get_config().MYSQL_HOST,
52-
port=configloader.get_config().MYSQL_PORT,
53-
user=configloader.get_config().MYSQL_USER,
54-
passwd=configloader.get_config().MYSQL_PASS,
55-
db=configloader.get_config().MYSQL_DB,
56-
charset="utf8",
57-
ssl={
58-
"ca": configloader.get_config().MYSQL_SSL_CA,
59-
"cert": configloader.get_config().MYSQL_SSL_CERT,
60-
"key": configloader.get_config().MYSQL_SSL_KEY,
61-
},
62-
)
63-
else:
64-
conn = cymysql.connect(
65-
host=configloader.get_config().MYSQL_HOST,
66-
port=configloader.get_config().MYSQL_PORT,
67-
user=configloader.get_config().MYSQL_USER,
68-
passwd=configloader.get_config().MYSQL_PASS,
69-
db=configloader.get_config().MYSQL_DB,
70-
charset="utf8",
71-
)
72-
conn.autocommit(True)
73-
74-
# 读取节点IP
75-
# SELECT * FROM `ss_node` where `node_ip` != ''
76-
node_ip_list = []
77-
cur = conn.cursor()
78-
cur.execute(
79-
"SELECT `node_ip` FROM `ss_node` where `node_ip` != ''"
80-
)
81-
for r in cur.fetchall():
82-
temp_list = str(r[0]).split(",")
83-
node_ip_list.append(temp_list[0])
84-
cur.close()
8545

8646
deny_file = open("/etc/hosts.deny")
8747
fcntl.flock(deny_file.fileno(), fcntl.LOCK_EX)

0 commit comments

Comments
 (0)