From 520a0cca4114752029ead5e5fd04b831bc2cd36f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 4 Mar 2019 17:56:08 +0800 Subject: [PATCH] Update site_api.py --- class/core/site_api.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/class/core/site_api.py b/class/core/site_api.py index 3dc1368c4..32b4fd6f0 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -533,7 +533,7 @@ class site_api: if siteConf.find('301-START') != -1: return public.returnJson(False, '检测到您的站点做了301重定向设置,请先关闭重定向!') - letpath = public.getServerDir() + '/letsencrypt/live/' + siteName + letpath = self.sslDir + siteName csrpath = letpath + "/fullchain.pem" # 生成证书路径 keypath = letpath + "/privkey.pem" # 密钥文件路径 @@ -591,8 +591,7 @@ class site_api: if domainCount == 0: return public.returnJson(False, '请选择域名(不包括IP地址与泛域名)!') - home_path = public.getServerDir() + '/openresty/nginx/conf/cert/' + \ - domains[0] + home_path = '/root/.acme.sh/' + domains[0] home_cert = home_path + '/fullchain.cer' home_key = home_path + '/' + domains[0] + '.key' @@ -601,11 +600,6 @@ class site_api: home_cert = home_path + '/fullchain.cer' home_key = home_path + '/' + domains[0] + '.key' - if not os.path.exists(home_cert): - home_path = '/root/.acme.sh/' + domains[0] - home_cert = home_path + '/fullchain.cer' - home_key = home_path + '/' + domains[0] + '.key' - if public.isAppleSystem(): user = public.execShell( "who | sed -n '2, 1p' |awk '{print $1}'")[0].strip() @@ -652,7 +646,6 @@ class site_api: # 写入配置文件 result = self.setSslConf(siteName) - # print result['msg'] if not result['status']: return public.getJson(result) result['csr'] = public.readFile(csrpath)