Skip to content

Commit

Permalink
適配最新版 SSPanel-UIM:dev
Browse files Browse the repository at this point in the history
去除以下功能:
Shadowsocks中轉
數據庫連接方式
Speedtest
Autoexec
Cloudsafe
Antissattack

以及一些無效代碼清理
  • Loading branch information
AutisticShark committed May 7, 2021
1 parent ada898f commit 9b55184
Show file tree
Hide file tree
Showing 18 changed files with 144 additions and 2,577 deletions.
50 changes: 3 additions & 47 deletions apiconfig.py
Original file line number Diff line number Diff line change
@@ -1,58 +1,14 @@
# Config
NODE_ID = 0

# hour,set 0 to disable
SPEEDTEST = 6
CLOUDSAFE = 1
ANTISSATTACK = 0
AUTOEXEC = 0

MU_SUFFIX = 'zhaoj.in'
MU_REGEX = '%5m%id.%suffix'

SERVER_PUB_ADDR = '127.0.0.1' # mujson_mgr need this to generate ssr link
API_INTERFACE = 'modwebapi' # glzjinmod, modwebapi

WEBAPI_URL = 'https://zhaoj.in'
WEBAPI_TOKEN = 'glzjin'

# mudb
MUDB_FILE = 'mudb.json'

# Mysql
MYSQL_HOST = '127.0.0.1'
MYSQL_PORT = 3306
MYSQL_USER = 'ss'
MYSQL_PASS = 'ss'
MYSQL_DB = 'shadowsocks'

MYSQL_SSL_ENABLE = 0
MYSQL_SSL_CA = ''
MYSQL_SSL_CERT = ''
MYSQL_SSL_KEY = ''

# API
API_HOST = '127.0.0.1'
API_PORT = 80
API_PATH = '/mu/v2/'
API_TOKEN = 'abcdef'
API_INTERFACE = 'modwebapi' # modwebapi
WEBAPI_URL = 'https://demo.sspanel.host'
WEBAPI_TOKEN = 'sspanel'
API_UPDATE_TIME = 60

# Manager (ignore this)
MANAGE_PASS = 'ss233333333'
# if you want manage in other server you should set this value to global ip
MANAGE_BIND_IP = '127.0.0.1'
# make sure this port is idle
MANAGE_PORT = 23333

# edit this file and server will auto reload

# boolean, enable to print mysql query
PRINT_MYSQL_QUERY = False

# second
MYSQL_PUSH_DURATION = 60

"""
get port offset by node->name
HK 1 #9900
Expand Down
101 changes: 0 additions & 101 deletions asyncmgr.py

This file was deleted.

40 changes: 0 additions & 40 deletions auto_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,51 +37,11 @@ def auto_block_thread(self):

if configloader.get_config().API_INTERFACE == "modwebapi":
# 读取节点IP
# SELECT * FROM `ss_node` where `node_ip` != ''
node_ip_list = []
data = webapi.getApi("nodes")
for node in data:
temp_list = node["node_ip"].split(",")
node_ip_list.append(temp_list[0])
else:
import cymysql

if configloader.get_config().MYSQL_SSL_ENABLE == 1:
conn = cymysql.connect(
host=configloader.get_config().MYSQL_HOST,
port=configloader.get_config().MYSQL_PORT,
user=configloader.get_config().MYSQL_USER,
passwd=configloader.get_config().MYSQL_PASS,
db=configloader.get_config().MYSQL_DB,
charset="utf8",
ssl={
"ca": configloader.get_config().MYSQL_SSL_CA,
"cert": configloader.get_config().MYSQL_SSL_CERT,
"key": configloader.get_config().MYSQL_SSL_KEY,
},
)
else:
conn = cymysql.connect(
host=configloader.get_config().MYSQL_HOST,
port=configloader.get_config().MYSQL_PORT,
user=configloader.get_config().MYSQL_USER,
passwd=configloader.get_config().MYSQL_PASS,
db=configloader.get_config().MYSQL_DB,
charset="utf8",
)
conn.autocommit(True)

# 读取节点IP
# SELECT * FROM `ss_node` where `node_ip` != ''
node_ip_list = []
cur = conn.cursor()
cur.execute(
"SELECT `node_ip` FROM `ss_node` where `node_ip` != ''"
)
for r in cur.fetchall():
temp_list = str(r[0]).split(",")
node_ip_list.append(temp_list[0])
cur.close()

deny_file = open("/etc/hosts.deny")
fcntl.flock(deny_file.fileno(), fcntl.LOCK_EX)
Expand Down
Loading

0 comments on commit 9b55184

Please sign in to comment.