mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:59:25 +08:00
update
This commit is contained in:
@@ -47,7 +47,7 @@ def create_acme():
|
||||
apply_type = request.form.get('apply_type', 'file')
|
||||
dnspai = request.form.get('dnspai','')
|
||||
dns_alias = request.form.get('dns_alias','')
|
||||
return MwSites.instance().createAcme(site_name, domains, force, renew, apply_type, dnspai, email, wildcard_domain)
|
||||
return MwSites.instance().createAcme(site_name, domains, force, renew, apply_type, dnspai, email, wildcard_domain,dns_alias)
|
||||
|
||||
|
||||
|
||||
|
||||
+11
-2
@@ -2312,6 +2312,11 @@ function opSSLAcme(type, id, siteName, callback){
|
||||
<span class="tname text-center">邮箱</span>\
|
||||
<input class="bt-input-text" style="width:240px;" type="text" name="admin_email" />\
|
||||
</div>\
|
||||
<div class="line mtb10" id="dns_alias" style="display:none;">\
|
||||
<span class="tname text-center">别名验证</span>\
|
||||
<input class="bt-input-text" style="width:240px;" type="text" name="dns_alias" />\
|
||||
<span> (可不填) <a class="btlink" target="_blank" href="https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mode#7-challenge-alias-or-domain-alias">文档说明</a><span>\
|
||||
</div>\
|
||||
<div class="line mtb10">\
|
||||
<span class="tname text-center">域名</span>\
|
||||
<ul id="ymlist" style="padding: 5px 10px;max-height:180px;overflow:auto; width:240px;border:#ccc 1px solid;border-radius:3px"></ul>\
|
||||
@@ -2334,9 +2339,11 @@ function opSSLAcme(type, id, siteName, callback){
|
||||
if (val == 'file'){
|
||||
$('#dnsapi_option').css('display','none');
|
||||
$('#wildcard_domain_block').css('display','none');
|
||||
$('#dns_alias').css('display','none');
|
||||
} else {
|
||||
$('#dnsapi_option').css('display','block');
|
||||
$('#wildcard_domain_block').css('display','block');
|
||||
$('#dns_alias').css('display','block');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2673,11 +2680,10 @@ function newAcmeHandApplyNotice(siteName, id, domains, data){
|
||||
<ul id="acme_hand_ssl_notice_help" class="help-info-text c6">\
|
||||
<li>解析域名需要一定时间来生效,完成所以上所有解析操作后,请等待1分钟后再点击【验证】按钮</li>\
|
||||
<li>可通过CMD命令来手动验证域名解析是否生效: nslookup -q=txt _acme-challenge.xx.cn</li>\
|
||||
<li>若您使用的是阿里云DNS,DnsPod作为DNS,可使用DNS接口自动解析</li>\
|
||||
<li>若您使用的是阿里云DNS,DnsPod等等作为DNS,可使用DNS接口自动解析</li>\
|
||||
</ul>\
|
||||
</div>',
|
||||
success:function(){
|
||||
|
||||
var list = '';
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
list += '<tr>';
|
||||
@@ -2720,6 +2726,8 @@ function newAcmeHandApplyNotice(siteName, id, domains, data){
|
||||
if (apply_type == 'dns'){
|
||||
pdata['dnspai'] = $('#dnsapi_option option:selected').val();
|
||||
}
|
||||
pdata['dns_alias'] = $("input[name='dns_alias']").val();
|
||||
|
||||
pdata['renew'] = 'true';
|
||||
$.post('/site/create_acme',pdata,function(rdata){
|
||||
showMsg(rdata.msg, function(){
|
||||
@@ -2755,6 +2763,7 @@ function newAcmeSSL(siteName, id, domains){
|
||||
pdata['dnspai'] = $('#dnsapi_option option:selected').val();
|
||||
}
|
||||
|
||||
pdata['dns_alias'] = $("input[name='dns_alias']").val();
|
||||
$.post('/site/create_acme',pdata,function(rdata){
|
||||
showMsg(rdata.msg, function(){
|
||||
if (rdata.status){
|
||||
|
||||
+12
-5
@@ -2282,7 +2282,7 @@ location ^~ {from} {\n\
|
||||
|
||||
# acme手动申请方式
|
||||
# https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode
|
||||
def createAcmeDnsTypeNone(self, site_name, domains, email, dnspai, wildcard_domain, force, renew):
|
||||
def createAcmeDnsTypeNone(self, site_name, domains, email, dnspai, wildcard_domain, force, renew, dns_alias):
|
||||
# print(site_name, domains, email, dnspai, wildcard_domain, force, renew)
|
||||
acme_dir = mw.getAcmeDir()
|
||||
log_file = self.acmeLogFile()
|
||||
@@ -2302,6 +2302,9 @@ export PATH
|
||||
cmd += "acme.sh --issue -d " + d + " "
|
||||
cmd += " --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please"
|
||||
|
||||
if dns_alias != '':
|
||||
cmd += ' --domain-alias '+str(dns_alias)
|
||||
|
||||
if renew == 'true':
|
||||
cmd += " --renew"
|
||||
cmd += ' > ' + log_file
|
||||
@@ -2341,7 +2344,7 @@ export PATH
|
||||
mw.restartWeb()
|
||||
return mw.returnData(True, '证书已更新!', result)
|
||||
|
||||
def createAcmeDns(self, site_name, domains, email, dnspai, wildcard_domain, force, renew):
|
||||
def createAcmeDns(self, site_name, domains, email, dnspai, wildcard_domain, force, renew, dns_alias):
|
||||
dnsapi_option = thisdb.getOptionByJson('dnsapi', default={})
|
||||
log_file = self.acmeLogFile()
|
||||
cmd = 'echo "..." > '+ log_file
|
||||
@@ -2349,7 +2352,7 @@ export PATH
|
||||
|
||||
# 手动方式申请
|
||||
if dnspai == 'none':
|
||||
return self.createAcmeDnsTypeNone(site_name, domains, email, dnspai, wildcard_domain, force, renew)
|
||||
return self.createAcmeDnsTypeNone(site_name, domains, email, dnspai, wildcard_domain, force, renew, dns_alias)
|
||||
|
||||
if not dnspai in dnsapi_option:
|
||||
return mw.returnData(False, '['+dnspai+']未设置!')
|
||||
@@ -2375,6 +2378,10 @@ export PATH
|
||||
d = top_domain
|
||||
else:
|
||||
cmd += 'acme.sh --issue --dns '+str(dnspai)+' -d '+d
|
||||
|
||||
if dns_alias != '':
|
||||
cmd += ' --domain-alias '+str(dns_alias)
|
||||
|
||||
cmd += ' > ' + log_file
|
||||
# print(cmd)
|
||||
result = mw.execShell(cmd)
|
||||
@@ -2424,7 +2431,7 @@ export PATH
|
||||
mw.restartWeb()
|
||||
return mw.returnData(True, '证书已更新!', result)
|
||||
|
||||
def createAcme(self, site_name, domains, force, renew, apply_type, dnspai, email, wildcard_domain):
|
||||
def createAcme(self, site_name, domains, force, renew, apply_type, dnspai, email, wildcard_domain, dns_alias):
|
||||
domains = json.loads(domains)
|
||||
if len(domains) < 1:
|
||||
return mw.returnData(False, '请选择域名')
|
||||
@@ -2452,7 +2459,7 @@ export PATH
|
||||
if apply_type == 'file':
|
||||
return self.createAcmeFile(site_name, domains, email,force,renew)
|
||||
elif apply_type == 'dns':
|
||||
return self.createAcmeDns(site_name, domains, email, dnspai, wildcard_domain,force, renew)
|
||||
return self.createAcmeDns(site_name, domains, email, dnspai, wildcard_domain,force, renew, dns_alias)
|
||||
return mw.returnData(False, '异常请求')
|
||||
|
||||
def createLet(self, site_name, domains, force, renew, apply_type, dnspai, email, wildcard_domain):
|
||||
|
||||
Reference in New Issue
Block a user