diff --git a/class/core/config_api.py b/class/core/config_api.py
index 4a93ad54f..531833c90 100755
--- a/class/core/config_api.py
+++ b/class/core/config_api.py
@@ -436,13 +436,13 @@ class config_api:
def savePanelSslApi(self):
+ certPem = request.form.get('certPem', '').strip()
+ privateKey = request.form.get('privateKey', '').strip()
+
keyPath = 'ssl/private.pem'
certPath = 'ssl/cert.pem'
checkCert = '/tmp/cert.pl'
- certPem = request.form.get('certPem', '').strip()
- privateKey = request.form.get('privateKey', '').strip()
-
if(privateKey.find('KEY') == -1):
return mw.returnJson(False, '秘钥错误,请检查!')
if(certPem.find('CERTIFICATE') == -1):
diff --git a/route/static/app/config.js b/route/static/app/config.js
index 9911048b6..d9bae793e 100755
--- a/route/static/app/config.js
+++ b/route/static/app/config.js
@@ -804,14 +804,17 @@ function getPanelSSL(){
$.post('/config/get_panel_ssl',{},function(cert){
layer.close(loadT);
- console.log(cert);
-
+ // console.log(cert);
var choose = cert['choose'];
+ var choose_local = '';
+ var choose_nginx = '';
if (choose == 'local'){
cert = cert['local'];
+ choose_local = 'selected="selected"';
} else if (choose == 'nginx') {
cert = cert['nginx'];
+ choose_nginx = 'selected="selected"';
} else {
cert = cert['local'];
}
@@ -852,6 +855,10 @@ function getPanelSSL(){
\
\
\
+ \
\
\
\
@@ -869,6 +876,10 @@ function getPanelSSL(){
content:certBody,
success:function(layero, layer_id){
+ $('select[name="choose"]').change(function(){
+
+ });
+
//保存SSL
$('.save-panel-ssl').click(function(){
var data = {
diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl
index 79a3f1f4c..d00afd601 100755
--- a/scripts/init.d/mw.tpl
+++ b/scripts/init.d/mw.tpl
@@ -209,6 +209,21 @@ mw_unbind_domain()
fi
}
+mw_unbind_ssl()
+{
+ if [ -f $mw_path/local ];then
+ rm -rf $mw_path/local
+ fi
+
+ if [ -f $mw_path/nginx ];then
+ rm -rf $mw_path/nginx
+ fi
+
+ if [ -f $mw_path/ssl/choose.pl ];then
+ rm -rf $mw_path/ssl/choose.pl
+ fi
+}
+
error_logs()
{
tail -n 100 $mw_path/logs/error.log
@@ -445,6 +460,7 @@ case "$1" in
'install_app') mw_install_app;;
'close_admin_path') mw_close_admin_path;;
'unbind_domain') mw_unbind_domain;;
+ 'unbind_ssl') mw_unbind_domain;;
'debug') mw_debug;;
'mirror') mw_mirror;;
'db') mw_connect_mysql;;
diff --git a/tools.py b/tools.py
index b268bd6a2..08bb7a47b 100755
--- a/tools.py
+++ b/tools.py
@@ -56,6 +56,7 @@ def mwcli(mw_input=0):
print("(11) 修改面板密码")
print("(12) 修改面板用户名")
print("(13) 显示面板错误日志")
+ print("(19) 关闭面板SSL绑定")
print("(20) 关闭BasicAuth认证")
print("(21) 解除域名绑定")
print("(22) 开启IPV6支持")
@@ -77,7 +78,7 @@ def mwcli(mw_input=0):
mw_input = 0
nums = [
- 1, 2, 3, 4, 5, 10, 11, 12, 13,
+ 1, 2, 3, 4, 5, 10, 11, 12, 13, 19
20, 21, 22, 23, 24, 25, 26,
100, 101,
200, 201
@@ -121,6 +122,12 @@ def mwcli(mw_input=0):
set_panel_username(input_user.strip())
elif mw_input == 13:
os.system('tail -100 ' + mw.getRunDir() + '/logs/error.log')
+ elif mw_input == 19:
+ ssl_choose = 'ssl/choose.pl'
+ if os.path.exists(ssl_choose):
+ os.remove(ssl_choose)
+ os.system(INIT_CMD + " unbind_ssl")
+ print("|-解除面板SSL绑定成功")
elif mw_input == 20:
basic_auth = 'data/basic_auth.json'
if os.path.exists(basic_auth):