Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNSAPI per-domain conf wrapper funcs #3085

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

senseisimple
Copy link

This is meant as an example to address Per-domain api auth setting #799 and related improvement to #2091

@auto-comment
Copy link

auto-comment bot commented Aug 4, 2020

First, NEVER send a PR to master branch, it will NEVER be accepted. Please send to the dev branch instead.
If this is a PR to support new DNS API or new notification API, please read this guide first: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide
Please check the guide items one by one.
Then add your usage here: https://github.com/acmesh-official/acme.sh/wiki/dnsapi

Or some other wiki pages:
https://github.com/acmesh-official/acme.sh/wiki/deployhooks
https://github.com/acmesh-official/acme.sh/wiki/notify

Update to acmesh-official#799 for per-domain auth conf storage.

_readdnsapiconf() <Item Key>
- Prefers the values stored in the domainconf over the accountconf[_mutable] if it exists in both places.
- After first new/update save with _savednsapiconf() it will be stored in the domainconf (and the original acctconf* location if applicable) that's where this function will find the value and the entry in the accountconf* will be obsolete/unused.

_savednsapiconf() <Item Key> <Item Value>
- "Migrate"/save the auth provided by env var or from accountconf[_mutable] to domainconf for future use. Update it in the original account location for backward compatibility if necessary.

1. These wrappers don't update the environment variable like the _getdeployconf(), they read from arg, emit text.
2. The keys saved through the save wrapper are named in mutable form with "SAVED_" prefix.
3. The DNS API Dev Guide (https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide) will need to be updated for the new functions

dns_cf.sh dnsapi script for cloudflare updated as an example.
@senseisimple senseisimple changed the title Store Rackspace DNSAPI in domain conf DNSAPI per-domain conf wrapper funcs Aug 4, 2020
@senseisimple
Copy link
Author

COMMIT 1 3df276c (dns_rackspace.sh) Shows a simplistic and functional update to a single dnsapi script using existing read/save domainconf functions in acme.sh

COMMIT 2 716b9b8 Provides a solution and migration path for existing dnsapi scripts to eliminate issues switching from accountconf storage to domainconf storage allowing for backward compatibility with existing configurations. It updates acme.sh and the dns_cf.sh scripts, which would also necessitate an update to the wiki page at https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide

@Neilpang
Copy link
Member

Neilpang commented Aug 21, 2020

Yes, we need a unique way to do that.

We should save them into account.conf by default to keep compatibility.

export xxxx=xxx
export cccc=ddddd

acme.sh --issue xxxxx   --dns  dns_cf

We need another new option to save it in domain conf

export xxx=xxx
export ccc=ddd

acme.sh --issue  xxxx    --dns dns_cf    --dns-save-per-cert

When renewal, we should check domain conf first, then fallback to accont.conf.

I think we need two functions:

#  name   value
_savednsconf () {

}

# name
_readdnsconf() {

}

They should work similarly to the deplohhook functions.

@Neilpang Neilpang deleted the branch acmesh-official:dev January 19, 2022 12:57
@Neilpang Neilpang closed this Jan 19, 2022
@Neilpang Neilpang reopened this Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants