diff --git a/class/core/config_api.py b/class/core/config_api.py index 13a88c001..625aa85fd 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -42,7 +42,7 @@ class config_api: 'bind_domain' : 'data/bind_domain.pl', # 面板域名绑定 'unauth_status' : 'data/unauthorized_status.pl', # URL路径未成功显示状态 'auth_secret': 'data/auth_secret.pl', # 二次验证密钥 - 'ssl':'data/ssl.pl', # ssl设置 + 'ssl':'ssl/choose.pl', # ssl设置 'hook_database' : 'data/hook_database.json', # 数据库钩子 'hook_menu' : 'data/hook_menu.json', # 菜单钩子 'hook_global_static' : 'data/hook_global_static.json', # 静态文件钩子 @@ -363,17 +363,18 @@ class config_api: def getPanelSslData(self): cert = {} - keyPath = 'ssl/private.pem' - certPath = 'ssl/cert.pem' + keyPath = 'ssl/local/private.pem' + certPath = 'ssl/local/cert.pem' + if not os.path.exists(certPath): # 不再自动生成证书 - # mw.createSSL() + mw.createLocalSSL() cert['privateKey'] = '' cert['is_https'] = '' cert['certPem'] = '' - cert['rep'] = os.path.exists('ssl/input.pl') - cert['info'] = {'endtime': 0, 'subject': '无', - 'notAfter': '无', 'notBefore': '无', 'issuer': '无'} + cert['rep'] = os.path.exists('ssl/local/input.pl') + cert['info'] = mw.getCertName(certPath) + # cert['info'] = {'endtime': 0, 'subject': '无','notAfter': '无', 'notBefore': '无', 'issuer': '无'} return cert panel_ssl = mw.getServerDir() + "/web_conf/nginx/vhost/panel.conf" @@ -390,6 +391,26 @@ class config_api: cert['info'] = mw.getCertName(certPath) return cert + # 面板本地SSL设置 + def setPanelLocalSslApi(self): + cert = {} + keyPath = 'ssl/local/private.pem' + certPath = 'ssl/local/cert.pem' + + if not os.path.exists(certPath): + mw.createLocalSSL() + + choose_file = self.__file['ssl'] + mw.writeFile(choose_file, 'local') + return mw.returnJson(True, '设置成功') + + # 关闭SSL + def closePanelSslApi(self): + choose_file = self.__file['ssl'] + if os.path.exists(choose_file): + os.remove(choose_file) + return mw.returnJson(True, '关闭SSL成功') + # 保存面板证书 def savePanelSslApi(self): keyPath = 'ssl/private.pem' diff --git a/route/static/img/phpmyadmin.png b/route/static/img/phpmyadmin.png deleted file mode 100755 index 56fbf2c9b..000000000 Binary files a/route/static/img/phpmyadmin.png and /dev/null differ diff --git a/route/static/img/pure-ftpd.png b/route/static/img/pure-ftpd.png deleted file mode 100755 index 8ac61bb45..000000000 Binary files a/route/static/img/pure-ftpd.png and /dev/null differ diff --git a/route/static/img/pureftpd.png b/route/static/img/pureftpd.png deleted file mode 100755 index 8ac61bb45..000000000 Binary files a/route/static/img/pureftpd.png and /dev/null differ diff --git a/route/static/img/soft_ico/ico-apache.png b/route/static/img/soft_ico/ico-apache.png deleted file mode 100755 index 3772caf0a..000000000 Binary files a/route/static/img/soft_ico/ico-apache.png and /dev/null differ diff --git a/route/static/img/soft_ico/ico-pure-ftpd.png b/route/static/img/soft_ico/ico-pure-ftpd.png deleted file mode 100755 index 8ec5eb803..000000000 Binary files a/route/static/img/soft_ico/ico-pure-ftpd.png and /dev/null differ diff --git a/route/static/img/soft_ico/ico-pureftpd.png b/route/static/img/soft_ico/ico-pureftpd.png deleted file mode 100755 index 93a29253b..000000000 Binary files a/route/static/img/soft_ico/ico-pureftpd.png and /dev/null differ diff --git a/route/static/img/soft_ico/ico-yunsuo.png b/route/static/img/soft_ico/ico-yunsuo.png deleted file mode 100755 index fdd86754a..000000000 Binary files a/route/static/img/soft_ico/ico-yunsuo.png and /dev/null differ diff --git a/route/templates/default/config.html b/route/templates/default/config.html index 900251c67..655630e3c 100755 --- a/route/templates/default/config.html +++ b/route/templates/default/config.html @@ -54,7 +54,7 @@
面板端口 - + 建议端口范围7200 - 65535
diff --git a/setting.py b/setting.py index cf91aeb78..07e0e3e62 100755 --- a/setting.py +++ b/setting.py @@ -59,11 +59,14 @@ if os.path.exists('data/ipv6.pl'): else: bind.append('0.0.0.0:%s' % mw_port) -# if os.path.exists('data/ssl.pl'): -# certfile = 'ssl/certificate.pem' -# keyfile = 'ssl/privateKey.pem' -# ciphers = 'TLSv1 TLSv1.1 TLSv1.2 TLSv1.3' -# ssl_version = 2 +ssl_choose_file = 'ssl/choose.pl' +if os.path.exists(ssl_choose_file): + ssl_choose = mw.readFile(ssl_choose_file).strip() + if mw.inArray(['local','nginx'],ssl_choose): + certfile = 'ssl/'+ssl_choose+'/cert.pem' + keyfile = 'ssl/'+ssl_choose+'/private.pem' + ciphers = 'TLSv1 TLSv1.1 TLSv1.2 TLSv1.3' + ssl_version = 2 # 初始安装时,自动生成安全路径 if not os.path.exists('data/admin_path.pl'):