Merge branch 'release/v2.6.0' into develop

This commit is contained in:
Alexey Safronov 2024-07-29 15:24:35 +04:00
commit c11d0f6123

View File

@ -46,17 +46,18 @@ if ( $args.Count -ge 2 )
}
else {
$letsencrypt_mail = $args[0]
$letsencrypt_domain = $args[1]
$letsencrypt_mail = $args[0] -JOIN ","
$letsencrypt_domain = $args[1] -JOIN ","
$letsencrypt_main_domain = $letsencrypt_domain.Split(',')[0]
[void](New-Item -ItemType "directory" -Path "${root_dir}\Logs" -Force)
"certbot certonly --expand --webroot -w `"${root_dir}`" --key-type rsa --noninteractive --agree-tos --email ${letsencrypt_mail} -d ${letsencrypt_domain}" > "${app}\letsencrypt\Logs\le-start.log"
cmd.exe /c "certbot certonly --expand --webroot -w `"${root_dir}`" --key-type rsa --noninteractive --agree-tos --email ${letsencrypt_mail} -d ${letsencrypt_domain}" > "${app}\letsencrypt\Logs\le-new.log"
pushd "${letsencrypt_root_dir}\${letsencrypt_domain}"
$ssl_cert = (Resolve-Path -Path (Get-Item "${letsencrypt_root_dir}\${letsencrypt_domain}\fullchain.pem").Target).ToString().Replace('\', '/')
$ssl_key = (Resolve-Path -Path (Get-Item "${letsencrypt_root_dir}\${letsencrypt_domain}\privkey.pem").Target).ToString().Replace('\', '/')
pushd "${letsencrypt_root_dir}\${letsencrypt_main_domain}"
$ssl_cert = (Resolve-Path -Path (Get-Item "${letsencrypt_root_dir}\${letsencrypt_main_domain}\fullchain.pem").Target).ToString().Replace('\', '/')
$ssl_key = (Resolve-Path -Path (Get-Item "${letsencrypt_root_dir}\${letsencrypt_main_domain}\privkey.pem").Target).ToString().Replace('\', '/')
popd
}
@ -68,7 +69,7 @@ if ( $args.Count -ge 2 )
if ($letsencrypt_domain)
{
$acl = Get-Acl -Path "$env:SystemDrive\Certbot\archive\${letsencrypt_domain}"
$acl = Get-Acl -Path "$env:SystemDrive\Certbot\archive\${letsencrypt_main_domain}"
$acl.SetSecurityDescriptorSddlForm('O:LAG:S-1-5-21-4011186057-2202358572-2315966083-513D:PAI(A;;0x1200a9;;;WD)(A;;FA;;;SY)(A;OI;0x1200a9;;;LS)(A;;FA;;;BA)(A;;FA;;;LA)')
Set-Acl -Path $acl.path -ACLObject $acl
}
@ -107,6 +108,8 @@ else
Write-Output " comma to register multiple emails, ex: "
Write-Output " u1@example.com,u2@example.com. "
Write-Output " DOMAIN Domain name to apply "
Write-Output " Use comma to register multiple domains, ex: "
Write-Output " example.com,s1.example.com,s2.example.com. "
Write-Output " "
Write-Output " Using your own certificates via the -f parameter: "
Write-Output " usage: "