acme.sh
acme.sh copied to clipboard
Added Selfhost DNS API
+ShellCheck +ACME v2 compatible
Example usage:
- Fist create 2 new TXT records on _acme-challenge.example.com
- Now note the ID in (...) from the edit page behind "_acme-challenge.example.com"
- For optional Multi SAN please fill an export SELFHOSTDNS_MAP like:
sub.domain.net:<RID> sub2.domain.net:<RID> sub3.domain.net:<RID>
Note: For myname
you have to use your account / customer number. You can find them in any invoice or on the right top of the selfhost dashboard.
export SELFHOSTDNS_USERNAME=myname
export SELFHOSTDNS_PASSWORD=mypass
export SELFHOSTDNS_RID=id_of_txt_record
export SELFHOSTDNS_RID2=id_of_second_txt_record
acme.sh --issue -d example.com --dns dns_selfhost
fix the CI check first: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test
Sorry that i pushed an empty line. I figured out a problem with fedora, i try to debug and fix it.
Now the CI test has passed, I don't now why first time it sucks on fedora. I have debugged it in a VM and all looks good.
@Neilpang please check again, all is passed. Please let me know when I should do everything.
@Neilpang why did you close it, without merging?
It was closed automatically.
@Neilpang can you merge it? Some other projects wait for it: https://lists.proxmox.com/pipermail/pve-devel/2022-February/051782.html
if SELFHOSTDNS_RID can not be created by the api, it will be a problem to support multiple domains.
for example, if you have 3 domains hosted there, and you need to issue a cert including all the three domains.
how can you accomplish that?
I think we can create a mapping list for multi SAN certificates like:
test.domain:<RID> second.domain:<RID> third.domain:<RID>
The current code works fine for wildcards and single domains, even for test.domain and www.test.domain (Tested with Lets Encrypt). I'm not the owner of the selfhost api, so we must use, what we get.
Do you think that is a good way?
@Neilpang can you rerun? I don't think that is failed on a script issue.
Error: The process '/usr/bin/ssh' failed with exit code 1
@Neilpang now all have passed, can you merge it?
@Neilpang please re run.
We moved the RIDs to the domain.conf. Thanks to @AlvinSchiller
@Neilpang any news when this could be merged?
remove SELFHOSTDNS_RID , SELFHOSTDNS_RID2 and SELFHOSTDNS_LAST_SLOT
Just SELFHOSTDNS_MAP should be enough.
It can be format: sub.domain.net:<RID> sub2.domain.net:<RID> sub3.domain.net:<RID>
or sub.domain.net:<RID>:<RID2> sub2.domain.net:<RID>:<rid2> sub3.domain.net:<RID>:<rid2>
remove SELFHOSTDNS_RID , SELFHOSTDNS_RID2 and SELFHOSTDNS_LAST_SLOT
Just SELFHOSTDNS_MAP should be enough.
It can be format:
sub.domain.net:<RID> sub2.domain.net:<RID> sub3.domain.net:<RID>
or
sub.domain.net:<RID>:<RID2> sub2.domain.net:<RID>:<rid2> sub3.domain.net:<RID>:<rid2>
We have a Solution to eliminate the additional parameter. Nevertheless do we need an internal storage field to support the rotation of RIDs for wildcarddomains. -> https://github.com/Marvo2011/acme.sh/pull/6#issue-1347096747
- SELFHOSTDNS_RID and SELFHOSTDNS_RID2 variables have been removed as suggested. All entries must be contained in SELFHOSTDNS_MAP. Up to two RIDs per fulldomain are supported but at least one must be set, e.g.
prefix.sub.domain.net:<RID>:<RID2> prefix.sub2.domain.net:<RID> prefix.sub3.domain.net:<RID>:<RID2>
- SELFHOSTDNS_LAST_SLOT has been removed. For wildcard support the last used RID per domain will be stored internally (SELFHOSTDNS_MAP_LAST_USED_INTERNAL) to switch between them (if two RIDs are defined). The domain and last used RID will be stored in the format
;fulldomainA:lastUsedRidForFulldomainA;;fulldomainB:lastUsedRidForFulldomainB;;fulldomainC:lastUsedRidForFulldomainC;
@AlvinSchiller Github Actions / Testing DNS always failing on ubuntu
[Thu Aug 25 12:45:04 UTC 2022] fulldomain='acmetestXyzRandomName.***'
[Thu Aug 25 12:45:04 UTC 2022] txtvalue='acmeTestTxtRecord'
[Thu Aug 25 12:45:04 UTC 2022] config file is empty, can not read ***_LAST_USED_INTERNAL
[Thu Aug 25 12:45:04 UTC 2022] mapEntry
[Thu Aug 25 12:45:04 UTC 2022] *** must contain the fulldomain incl. prefix and at least one RID
Run Failed
the latest run was not passing?
https://github.com/Marvo2011/acme.sh/actions/runs/2961394624
@Neilpang There was a problem with a secret which caused the failure. All changes are made, usage is up to date and the tests are passing now. You could review again.
https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide
https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide
Please copy dnsapi wiki, I get 403 permission denied. https://github.com/Marvo2011/acme.sh/wiki/dnsapi
#4291
you can edit the wiki page now.
you can edit the wiki page now.
Thanks, I had to split the dnsapi wiki page, because github does not render "a to large page"
https://github.com/acmesh-official/acme.sh/wiki/dnsapi https://github.com/acmesh-official/acme.sh/wiki/dnsapi2