feat: Added new and renew powershell scripts
This commit is contained in:
parent
9963068905
commit
16b2e6ce96
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
acme-dns.json
|
46
new.ps1
Normal file
46
new.ps1
Normal file
@ -0,0 +1,46 @@
|
||||
# Install Certify The Web (if not already installed)
|
||||
#> Install-Module -Name Posh-ACME
|
||||
|
||||
$domain = 'example.com'
|
||||
# Will do wildcard for *.$domain in addition to root
|
||||
|
||||
# Make an HTTP POST request
|
||||
$response = Invoke-RestMethod -Uri "https://auth.acme-dns.io/register" -Method Post
|
||||
|
||||
|
||||
# Print Instructions
|
||||
Write-Host "Please add the following CNAME to your DNS:"
|
||||
Write-Host "Host: _acme-challenge"
|
||||
Write-Host "Target: "
|
||||
$response.fulldomain
|
||||
|
||||
# Save response to use later
|
||||
$response | ConvertTo-Json | Out-File -FilePath .\acme-dns.json
|
||||
|
||||
|
||||
# Wait for DNS to update
|
||||
Write-Host "Press any key after adding record..."
|
||||
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
|
||||
|
||||
|
||||
# Read file back in (if you closed the shell)
|
||||
# $response = Get-Content -Raw -Path .\acme-dns.json | ConvertFrom-Json
|
||||
|
||||
|
||||
$reg = @{
|
||||
"_acme-challenge.$domain" = @(
|
||||
# the array order of these values is important
|
||||
$response.subdomain
|
||||
$response.username
|
||||
$response.password
|
||||
$response.fulldomain
|
||||
)
|
||||
}
|
||||
|
||||
$pArgs = @{
|
||||
ACMEServer = 'auth.acme-dns.io'
|
||||
ACMERegistration = $reg
|
||||
}
|
||||
|
||||
$domains = '*.'+$domain,$domain
|
||||
New-PACertificate $domains -Plugin AcmeDns -PluginArgs $pArgs -Verbose
|
Loading…
Reference in New Issue
Block a user