-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Structured DNS provider API info #4738
Conversation
@github-actions Done |
Hi @Neilpang sorry for pushing but please let me know if you'll accept the PR. I want to finish all opened tasks. |
It seems not bad, but you will have to update all the almost near 200 dns providers. Are you sure? |
No problem. |
fbc041c
to
a3e3de8
Compare
@Neilpang I added the structured info to all DNS providers. |
fba571b
to
09c19cc
Compare
@Neilpang I rebased on top of the dev branch and reviwed again. Now it should be better. |
Hi @Neilpang please have a look |
25ff12d
to
3003762
Compare
Hi @Neilpang sorry for pushing but this issue blocks me because I want to update GUI for acme in the luci-app-acme based on this functionality. #!/bin/ash
for f in ./dnsapi/dns_*.sh
do
filename=$(basename -- "$f")
dns_api="${filename%.*}"
echo "$dns_api"
dns_api_info_var="${dns_api}_info"
# shellcheck source=./dnsapi/dns_*.sh
. "$f"
info=""
eval info=\$$dns_api_info_var
echo "$info"
done I executed it and stored result to info.txt file:
The resulted file has size of 38kb bytes and gziped it's 9kb. Basically it would be really great to put the info a separate txt file. For now I'm going to just include the info.txt file into the luci-app-acme and parse it in JS on a broswer side. |
22555b1
to
7c572f1
Compare
Here I wrote a parser: https://gist.github.com/stokito/f0770d1967e7000bc0302b5556529fb1 |
8cb651a
to
f27294b
Compare
Hi @Neilpang I updated the PR and fixed merge conflict. Please merge it before new conflicts happen |
Instead of using comments declare info in a special variable. Then the variable can be used to print the DNS API provider usage. The usage can be parsed on UI and show all needed inputs for options. The info is stored in plain string that it's both human-readable and easy to parse: dns_example_info='API name An extended description. Multiline. Domains: list of alternative domains to find Site: the dns provider website e.g. example.com Docs: Link to ACME.sh wiki for the provider Options: VARIABLE1 Title for the option1. VARIABLE2 Title for the option2. Default "default value". VARIABLE3 Title for the option3. Description to show on UI. Optional. Issues: Link to a support ticket on https://github.com/acmesh-official/acme.sh Author: First Lastname <[email protected]>, Another Author <https://github.com/example>; ' Here: VARIABLE1 will be required. VARIABLE2 will be required too but will be populated with a "default value". VARIABLE3 is optional and can be empty. A DNS provider may have alternative options like CloudFlare may use API KEY or API Token. You can use a second section OptionsAlt: section. Some providers may have alternative names or domains e.g. Aliyun and AlibabaCloud. Add them to Domains: section. Signed-off-by: Sergey Ponomarev <[email protected]>
Hi @Neilpang I updated (yet again) the PR and fixed merge conflict. Please merge it before new conflicts happen |
Thank you! |
For the OpenWrt luci-app-acme we need to show on UI list of all DSN providers and their options. My goal is to make regular users to use it without knowing anything about console.
For now I just put a list of all providers into a select
https://github.com/openwrt/luci/blob/master/applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js#L97
And also I collected list of all options per provider and rendering input fields for them:
https://github.com/openwrt/luci/blob/master/applications/luci-app-acme/htdocs/luci-static/resources/view/acme.js#L243
This makes it fragile because once a new DNS provider is added or changed I have to update the LUCI app.
Instead we need a way to get list of all options.
So my idea is to make a new command like
acme.sh --dns-provider-info
that will print all options. Then I can parse them and render.The info is stored in plain string and it's both human readable and easy to parse.
Some providers may have alternative names or domains e.g.
Aliyun
andAlibabaCloud
so for them I added aDomains:
section.Please tell me if you will accept the PR and I will continue for other providers.