mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-08-30 19:59:36 +02:00
Update to 7.7.0
Since version 7.7.0, we recommend yours update python to 3.12. [+] Using nginx technology to load static files improves access speed [+] Refactor homepage, website, FTP, and database using vue3 [+] Table loading changed to skeleton screen [+] Add Website statistics-v2 professional plug-in [+] Add Home page - top 5 resource occupancy [+] Add protection for Files management (requires Tamper-proof for Enterprise 3.7) [+] Website, FTP, Databases page add program status [+] Add FTP log analysis (only supports Centos) [+] Add password-free login to phpMyAdmin [+] Add Proxy Project in Website (Supported when web service uses Nginx) [+] Add WP Toolkit (Pro version only) [+] Redesigned Docker module [+] Add WP Toolkit Protection [+] Add WP Toolkit Backup and Restore [+] Add WP Toolkit Migrated [+] Add WP Toolkit Clone site (supports new domain and subdomain) [+] Add WP Toolkit Create site from backup of other panel [+] Add WP Toolkit support for Cron automatic backup (only save Local disk) [+] Add WP Toolkit operation log [+] Add Integrity check for WP Toolkit [+] Add WP Toolkit plug-in management and themes management [*] Optimize phpMyAdmin formula access method [*] Optimize Home page PHP display problem [*] Optimize jump to the login interface after the login expires [*] Optimize automatic renewal of SSL at some times [*] Optimize Let's Encrypt to increase application success rate [-] Fix Logs Audit cannot be opened [-] Fix apache URL rewrite issue [-] Fix phpmyadmin installation problem [-] Fix the problem that some servers cannot install software [-] Fix upload file error [-] Fix left menu hiding problem [-] Fix aaPanel Mobile QR code display problem [-] Fix problem that third-party plug-ins are not displayed in the App Store [-] Fix issue where the menu bar is blank when opening new tabs [-] Fixed panel not being accessible in some cases [-] Fix the issue where Curl warning caused the inability to apply for SSL [-] Fix Quota issues for Website, FTP, Databases [-] Fix file interface display problem on mobile terminal
This commit is contained in:
Binary file not shown.
+4
-3
@@ -1,12 +1,15 @@
|
||||
#!/usr/bin/python
|
||||
#coding: utf-8
|
||||
#-----------------------------
|
||||
# 宝塔Linux面板网站备份工具
|
||||
# aaPanel
|
||||
# 网站备份工具
|
||||
#-----------------------------
|
||||
|
||||
import sys,os
|
||||
os.chdir('/www/server/panel')
|
||||
sys.path.append("./")
|
||||
sys.path.append("class/")
|
||||
sys.path.append("class_v2/")
|
||||
if sys.version_info[0] == 2:
|
||||
reload(sys)
|
||||
sys.setdefaultencoding('utf-8')
|
||||
@@ -24,11 +27,9 @@ class backupTools(panelBackup.backup):
|
||||
def backupPath(self,path,count,echo_id=None):
|
||||
self.backup_path(path,save=count,echo_id=echo_id)
|
||||
|
||||
|
||||
def backupSiteAll(self,save,echo_id=None):
|
||||
self.backup_site_all(save,echo_id=echo_id)
|
||||
|
||||
|
||||
def backupDatabaseAll(self,save,echo_id=None):
|
||||
self.backup_database_all(save,echo_id=echo_id)
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ data = msgObj.get_messages()
|
||||
for x in data:
|
||||
if x['level'] in ['danger', 'error'] and not x['send'] and x['retry_num'] < 5:
|
||||
msg = '服务器IP【{}】: {}'.format(
|
||||
public.GetLocalIp(), re.sub(',?<a\s*.+</a>', '', x['msg']))
|
||||
public.GetLocalIp(), re.sub(r',?<a\s*.+</a>', '', x['msg']))
|
||||
is_send = False
|
||||
|
||||
ret = public.return_is_send_info()
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/python
|
||||
# coding: utf-8
|
||||
# -----------------------------
|
||||
# docker container log cutting script
|
||||
# -----------------------------
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import datetime
|
||||
|
||||
os.chdir("/www/server/panel")
|
||||
sys.path.append('class/')
|
||||
import public
|
||||
|
||||
|
||||
class DkLogSpilt:
|
||||
task_list = []
|
||||
|
||||
def __init__(self):
|
||||
if not public.M('sqlite_master').db('docker_log_split').where('type=? AND name=?', ('table', 'docker_log_split')).count():
|
||||
self.task_list = []
|
||||
else:
|
||||
self.task_list = public.M('docker_log_split').select()
|
||||
|
||||
def run(self):
|
||||
if not self.task_list:
|
||||
print('No docker log cutting task')
|
||||
for task in self.task_list:
|
||||
try:
|
||||
if task['split_type'] == 'day':
|
||||
self.day_split(task)
|
||||
elif task['split_type'] == 'size':
|
||||
self.size_split(task)
|
||||
except:
|
||||
print('{} Failed to cut log!'.format(task['name']))
|
||||
|
||||
def day_split(self, task):
|
||||
now_time = int(time.time())
|
||||
exec_time = int(self.get_timestamp_of_hour_minute(task['split_hour'], task['split_minute']))
|
||||
if now_time <= exec_time <= now_time + 300:
|
||||
print("{} container starts log cutting".format(task['name']))
|
||||
split_path = '/var/lib/docker/containers/history_logs/{}/'.format(task['pid'])
|
||||
if not os.path.exists(split_path):
|
||||
os.makedirs(split_path)
|
||||
os.rename(task['log_path'], split_path + task['pid'] + "-json.log" + '_' + str(int(time.time())))
|
||||
public.writeFile(task['log_path'], '')
|
||||
print("{} log has been cut to:{}".format(task['name'],split_path + task['pid'] + "-json.log" + '_' + str(int(time.time()))))
|
||||
self.check_save(task)
|
||||
else:
|
||||
print('{}container log has not reached the cutting time'.format(task['name']))
|
||||
|
||||
|
||||
def size_split(self, task):
|
||||
if not os.path.exists(task['log_path']):
|
||||
print('Log file does not exist')
|
||||
return
|
||||
if os.path.getsize(task['log_path']) >= task['split_size']:
|
||||
print("{} container starts log cutting".format(task['name']))
|
||||
split_path = '/var/lib/docker/containers/history_logs/{}/'.format(task['pid'])
|
||||
if not os.path.exists(split_path):
|
||||
os.makedirs(split_path)
|
||||
os.rename(task['log_path'], split_path + task['pid'] + "-json.log" + '_' + str(int(time.time())))
|
||||
public.writeFile(task['log_path'], '')
|
||||
print("{} log has been cut to:{}".format(task['name'],split_path + task['pid'] + "-json.log" + '_' + str(int(time.time()))))
|
||||
self.check_save(task)
|
||||
else:
|
||||
print('{} container log has not reached cutting size'.format(task['name']))
|
||||
|
||||
def check_save(self, task):
|
||||
split_path = '/var/lib/docker/containers/history_logs/{}/'.format(task['pid'])
|
||||
file_count = len(os.listdir(split_path))
|
||||
if file_count > task['save']:
|
||||
file_list = os.listdir(split_path)
|
||||
file_list.sort()
|
||||
for i in range(file_count - task['save']):
|
||||
os.remove(split_path + file_list[i])
|
||||
print('Delete log files:{}'.format(split_path + file_list[i]))
|
||||
print('The latest {} logs have been retained'.format(task['save']))
|
||||
|
||||
def get_timestamp_of_hour_minute(self, hour, minute):
|
||||
"""获取当天指定时刻的时间戳。
|
||||
Args:
|
||||
hour: 小时。
|
||||
minute: 分钟。
|
||||
Returns:
|
||||
时间戳。
|
||||
"""
|
||||
current_time = datetime.datetime.now()
|
||||
timestamp = current_time.replace(hour=hour, minute=minute, second=0, microsecond=0)
|
||||
return int(timestamp.timestamp())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
dk = DkLogSpilt()
|
||||
dk.run()
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/python
|
||||
#coding: utf-8
|
||||
#-----------------------------
|
||||
#宝塔Linux面板网站日志切割脚本
|
||||
#aaPanel
|
||||
# 网站日志切割脚本
|
||||
#-----------------------------
|
||||
import sys
|
||||
import os
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/python
|
||||
#coding: utf-8
|
||||
#-----------------------------
|
||||
#宝塔Linux面板网站日志切割脚本
|
||||
#aaPanel
|
||||
# 网站日志切割脚本
|
||||
#-----------------------------
|
||||
import sys
|
||||
import os
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#coding: utf-8
|
||||
# +-------------------------------------------------------------------
|
||||
# | 宝塔Linux面板
|
||||
# | aaPanel
|
||||
# +-------------------------------------------------------------------
|
||||
# | Copyright (c) 2015-2099 宝塔软件(http://bt.cn) All rights reserved.
|
||||
# | Copyright (c) 2015-2099 aaPanel(www.aapanel.com) All rights reserved.
|
||||
# +-------------------------------------------------------------------
|
||||
# | Author: hwliang <hwl@bt.cn>
|
||||
# | Author: hwliang <hwl@aapanel.com>
|
||||
# +-------------------------------------------------------------------
|
||||
|
||||
#--------------------------------
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#coding: utf-8
|
||||
#-------------------------------------------------------------------
|
||||
# 宝塔Linux面板
|
||||
# aaPanel
|
||||
#-------------------------------------------------------------------
|
||||
# Copyright (c) 2015-2099 宝塔软件(http://bt.cn) All rights reserved.
|
||||
# Copyright (c) 2015-2099 aaPanel(www.aapanel.com) All rights reserved.
|
||||
#-------------------------------------------------------------------
|
||||
# Author: hwliang<hwl@bt.cn>
|
||||
# Author: hwliang<hwl@aapanel.com>
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#coding: utf-8
|
||||
#-------------------------------------------------------------------
|
||||
# 宝塔Linux面板
|
||||
# aaPanel
|
||||
#-------------------------------------------------------------------
|
||||
# Copyright (c) 2015-2099 宝塔软件(http:#bt.cn) All rights reserved.
|
||||
# Copyright (c) 2015-2099 aaPanel(www.aapanel.com) All rights reserved.
|
||||
#-------------------------------------------------------------------
|
||||
# Author: hwliang <hwl@bt.cn>
|
||||
# Author: hwliang <hwl@aapanel.com>
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
#------------------------------
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
#!/bin/bash
|
||||
action=$1
|
||||
panel_path="/www/server/panel" # 面板路径
|
||||
webserver_bin="$panel_path/webserver/sbin/webserver" # nginx二进制文件
|
||||
webserver_conf="$panel_path/webserver/conf/webserver.conf" # nginx配置文件
|
||||
webserver_pid="$panel_path/webserver/logs/webserver.pid" # nginx pid文件
|
||||
|
||||
|
||||
PID=0
|
||||
|
||||
|
||||
|
||||
get_pid() {
|
||||
if [ ! -f "$webserver_pid" ]; then
|
||||
PID=0
|
||||
else
|
||||
PID=$(cat $webserver_pid)
|
||||
if [ "$PID" == "" ]; then
|
||||
PID=0
|
||||
else
|
||||
PID=$(ps aux | grep "$PID" | grep -v grep | awk '{print $2}')
|
||||
PID_11=$(ps aux | grep "$webserver_bin" | grep -v grep | awk '{print $2}')
|
||||
if [ "$PID" != "$PID_11" ]; then
|
||||
PID=0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
PID=$(ps aux | grep "$webserver_bin" | grep -v grep | awk '{print $2}')
|
||||
if [ -z "$PID" ]; then
|
||||
PID=0
|
||||
else
|
||||
PID="$PID"
|
||||
fi
|
||||
|
||||
if [ -z "$PID" ]; then
|
||||
PID=0
|
||||
fi
|
||||
}
|
||||
|
||||
validate_server_files() {
|
||||
if [ ! -f "$webserver_conf" ]; then
|
||||
echo "BaoTa Web server configuration not found: $webserver_conf"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$webserver_bin" ]; then
|
||||
echo "BaoTa Web server binary not found: $webserver_bin"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
validate_server_files
|
||||
get_pid
|
||||
|
||||
if [ $PID -gt 0 ]; then
|
||||
echo "BaoTa Web server is already running with PID ($PID)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "Starting BaoTa web server..."
|
||||
if [ -f "$webserver_pid" ]; then
|
||||
rm -f $webserver_pid
|
||||
fi
|
||||
chmod 700 $webserver_bin
|
||||
$webserver_bin -c $webserver_conf
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to start BaoTa web server"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " Started"
|
||||
}
|
||||
|
||||
stop() {
|
||||
validate_server_files
|
||||
get_pid
|
||||
if [ $PID -eq 0 ]; then
|
||||
echo "BaoTa Web server is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "Stopping BaoTa web server..."
|
||||
$webserver_bin -c $webserver_conf -s stop
|
||||
|
||||
pids=$(lsof -c webserver|grep LISTEN|awk '{print $2}'|sort -u)
|
||||
for pid in $pids; do
|
||||
kill -9 $pid
|
||||
done
|
||||
|
||||
echo " Stopped"
|
||||
}
|
||||
|
||||
restart() {
|
||||
validate_server_files
|
||||
get_pid
|
||||
echo -n "Restarting BaoTa web server..."
|
||||
if [ $PID -eq 0 ]; then
|
||||
$webserver_bin -c $webserver_conf
|
||||
else
|
||||
$webserver_bin -c $webserver_conf -s reopen
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to restart BaoTa web server"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " Restarted"
|
||||
}
|
||||
|
||||
status() {
|
||||
validate_server_files
|
||||
get_pid
|
||||
if [ $PID -eq 0 ]; then
|
||||
echo "BaoTa Web server is not running"
|
||||
else
|
||||
cmdline=/proc/$PID/cmdline
|
||||
if [ ! -f $cmdline ]; then
|
||||
echo "BaoTa Web server is not running"
|
||||
rm -f $webserver_pid
|
||||
exit 1
|
||||
fi
|
||||
echo "BaoTa Web server is running with PID ($PID)"
|
||||
fi
|
||||
}
|
||||
|
||||
reload() {
|
||||
validate_server_files
|
||||
get_pid
|
||||
if [ $PID -eq 0 ]; then
|
||||
echo "BaoTa Web server is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "Reloading BaoTa web server..."
|
||||
$webserver_bin -c $webserver_conf -s reload
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to reload BaoTa web server"
|
||||
exit 1
|
||||
fi
|
||||
echo " Reloaded"
|
||||
}
|
||||
|
||||
configtest() {
|
||||
validate_server_files
|
||||
# 检查配置文件正确性,检查程序自动输出检查结果
|
||||
$webserver_bin -c $webserver_conf -t
|
||||
|
||||
}
|
||||
|
||||
download() {
|
||||
tip_file=$panel_path/data/download.pl
|
||||
if [ -f $tip_file ]; then
|
||||
echo "BaoTa web server binary has been downloaded"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 标记已下载
|
||||
echo "1" > $tip_file
|
||||
|
||||
# 获取machine
|
||||
machine=$(uname -m)
|
||||
zip_file=$panel_path/data/webserver-$machine.zip
|
||||
wget -O $zip_file https://node.aapanel.com/webserver/webserver-$machine.zip
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to download BaoTa web server binary"
|
||||
rm -f $zip_file
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 验证文件hash
|
||||
hash256=$(sha256sum $zip_file | awk '{print $1}')
|
||||
cloud_hash256=$(wget -q -O - https://node.aapanel.com/webserver/webserver-$machine.txt)
|
||||
if [ "$hash256" != "$cloud_hash256" ]; then
|
||||
echo "Failed to verify BaoTa web server binary"
|
||||
rm -f $zip_file
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 解压文件
|
||||
unzip -o $zip_file -d $panel_path/
|
||||
if [ ! -f $webserver_bin ]; then
|
||||
echo "Failed to extract BaoTa web server binary"
|
||||
rm -f $zip_file
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 删除临时文件
|
||||
rm -f $zip_file
|
||||
# 设置权限
|
||||
chmod 700 $webserver_bin
|
||||
echo "BaoTa web server binary has been downloaded"
|
||||
bash /www/server/panel/init.sh reload
|
||||
}
|
||||
|
||||
|
||||
case "$action" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
reload)
|
||||
reload
|
||||
;;
|
||||
configtest)
|
||||
configtest
|
||||
;;
|
||||
test)
|
||||
configtest
|
||||
;;
|
||||
download)
|
||||
download
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status|reload|configtest|test|download}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user