切换导航条
此项目
正在载入...
登录
周海龙
/
globalso-v6-c-customer
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
刘锟
3 months ago
提交
04701bcd9879b143f60f91ee18de44c52bb7c6ad
1 个父辈
5ae253ec
update
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
15 行增加
和
1 行删除
app/Console/Commands/SelfSiteSsl.php
app/Console/Commands/SelfSiteSsl.php
查看文件 @
04701bc
...
...
@@ -57,7 +57,7 @@ public function checkDomainSsl()
$site_domain_list
=
$this
->
bt
->
WebDoaminList
(
$site_id
);
$apply_ssl_domain_list
=
[];
foreach
(
$site_domain_list
as
$val
)
{
if
(
strpos
(
$val
[
'name'
],
'*'
)
===
false
&&
$this
->
check_domain_record
(
$val
[
'name'
],
[
'domain'
=>
''
,
'ip'
=>
$site_ip
]))
{
if
(
strpos
(
$val
[
'name'
],
'*'
)
===
false
&&
$this
->
check_domain_record
(
$val
[
'name'
],
[
'domain'
=>
''
,
'ip'
=>
$site_ip
]))
{
$apply_ssl_domain_list
[]
=
$val
[
'name'
];
}
}
...
...
@@ -96,9 +96,23 @@ public function checkDomainSsl()
$amp_site_id
=
$amp_site_list
[
'data'
][
0
][
'id'
];
$amp_host
=
$amp_site_list
[
'data'
][
0
][
'name'
];
//申请证书之前,还原主站配置
$amp_config_before
=
file_get_contents
(
public_path
(
'amp_site_default.txt'
));
$re_amp_config_before
=
$this
->
bt
->
SaveFileBody
(
'/www/server/panel/vhost/nginx/'
.
$amp_host
.
'.conf'
,
$amp_config_before
,
'utf-8'
,
1
);
if
(
!
(
$re_amp_config_before
[
'status'
]
??
false
))
{
throw
new
\Exception
(
$re_amp_config_before
[
'msg'
]
??
'还原AMP站nginx配置失败'
);
}
//设置站点证书
$this
->
setDomainSsl
(
$amp_site_id
,
$amp_host
,
[
$amp_host
]);
//申请证书之后,更新主站配置
$amp_config_after
=
file_get_contents
(
public_path
(
'amp_site_config.txt'
));
$re_amp_config_after
=
$this
->
bt
->
SaveFileBody
(
'/www/server/panel/vhost/nginx/'
.
$amp_host
.
'.conf'
,
$amp_config_after
,
'utf-8'
,
1
);
if
(
!
(
$re_amp_config_after
[
'status'
]
??
false
))
{
throw
new
\Exception
(
$re_amp_config_after
[
'msg'
]
??
'更新AMP站nginx配置失败'
);
}
$this
->
output
(
'AMP站证书更新成功'
);
}
}
...
...
请
注册
或
登录
后发表评论