mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-08-20 06:35:47 +02:00
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
93 lines
3.7 KiB
Python
93 lines
3.7 KiB
Python
#!/www/server/panel/pyenv/bin/python3
|
|
# coding: utf-8
|
|
# -------------------------------------------------------------------
|
|
# aaPanel
|
|
# -------------------------------------------------------------------
|
|
# Copyright (c) 2015-2099 aaPanel(www.aapanel.com) All rights reserved.
|
|
# -------------------------------------------------------------------
|
|
# Author: wzz <wzz@aapanel.com>
|
|
# -------------------------------------------------------------------
|
|
# docker模型sock 封装库 镜像库
|
|
# -------------------------------------------------------------------
|
|
import os
|
|
import sys
|
|
import time
|
|
|
|
if "/www/server/panel/class" not in sys.path:
|
|
sys.path.insert(0, "/www/server/panel/class")
|
|
import public
|
|
|
|
if "/www/server/panel/class_v2" not in sys.path:
|
|
sys.path.insert(0, "/www/server/panel/class_v2")
|
|
import btdockerModelV2.dk_public as dp
|
|
|
|
db_file = '{}/class_v2/btdockerModelV2/config/docker_hub_repos.db'.format(public.get_panel_path())
|
|
last_update_pl = "{}/class_v2/btdockerModelV2/config/docker_hub_last_update.pl".format(public.get_panel_path())
|
|
|
|
|
|
# 2024/3/20 上午 9:47 获取docker hub最新的镜像排行数据
|
|
def get_docker_hub_repos():
|
|
'''
|
|
@name 获取docker hub最新的镜像排行数据
|
|
@author wzz <2024/3/20 上午 9:47>
|
|
@param "data":{"参数名":""} <数据类型> 参数描述
|
|
@return dict{"status":True/False,"msg":"提示信息"}
|
|
'''
|
|
try:
|
|
url = "{}/src/docker/docker_hub_repos.db".format(public.get_url())
|
|
dp.download_file(url, db_file)
|
|
if not os.path.exists(db_file):
|
|
return public.returnMsg(False, "info.json download failed")
|
|
|
|
# 写一个最后更新的标记文件,里面有时间戳
|
|
public.writeFile(last_update_pl, str(int(time.time())))
|
|
|
|
return
|
|
except Exception as e:
|
|
if os.path.exists('data/debug.pl'):
|
|
print(public.get_error_info())
|
|
public.print_log(public.get_error_info())
|
|
|
|
|
|
# 2024/3/20 上午 9:34 如果当前时间减去这个时间戳大于30天,就执行 get_docker_hub_repos
|
|
def check_last_update():
|
|
'''
|
|
@name 如果当前时间减去这个时间戳大于30天,就执行 get_docker_hub_repos
|
|
@author wzz <2024/3/20 上午 9:46>
|
|
@param "data":{"参数名":""} <数据类型> 参数描述
|
|
@return dict{"status":True/False,"msg":"提示信息"}
|
|
'''
|
|
try:
|
|
if os.path.exists(last_update_pl):
|
|
last_update_time = int(public.readFile(last_update_pl))
|
|
if int(time.time()) - last_update_time > 2592000:
|
|
public.ExecShell("rm -f {}".format(db_file))
|
|
public.ExecShell("rm -f {}".format(last_update_pl))
|
|
get_docker_hub_repos()
|
|
|
|
if os.path.exists(db_file) and (os.path.getsize(db_file) == 0 or os.path.getsize(db_file) < 80):
|
|
public.ExecShell("rm -f {}".format(db_file))
|
|
public.ExecShell("rm -f {}".format(last_update_pl))
|
|
get_docker_hub_repos()
|
|
|
|
if not os.path.exists(db_file):
|
|
public.ExecShell("rm -f {}".format(last_update_pl))
|
|
get_docker_hub_repos()
|
|
else:
|
|
if not os.path.exists(db_file):
|
|
get_docker_hub_repos()
|
|
|
|
if os.path.exists(db_file) and (os.path.getsize(db_file) == 0 or os.path.getsize(db_file) < 80):
|
|
public.ExecShell("rm -f {}".format(db_file))
|
|
public.ExecShell("rm -f {}".format(last_update_pl))
|
|
get_docker_hub_repos()
|
|
except Exception as e:
|
|
public.ExecShell("rm -f {}".format(db_file))
|
|
public.ExecShell("rm -f {}".format(last_update_pl))
|
|
if os.path.exists('data/debug.pl'):
|
|
print(public.get_error_info())
|
|
public.print_log(public.get_error_info())
|
|
|
|
|
|
check_last_update()
|