diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d00e7e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +acme-dns.json diff --git a/new.ps1 b/new.ps1 new file mode 100644 index 0000000..a139a77 --- /dev/null +++ b/new.ps1 @@ -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 \ No newline at end of file diff --git a/renew.ps1 b/renew.ps1 new file mode 100644 index 0000000..5144708 --- /dev/null +++ b/renew.ps1 @@ -0,0 +1 @@ +Submit-Renewal -AllAccounts \ No newline at end of file