Commit Graph

27 Commits (master)

Author SHA1 Message Date
Roland Giesler 30ed4af38d
Revert TXT add update
The change was needed for Power-Mailinabox and broke Mail-in-a-box, so a new API for Power-Mailinabox has been added
4 months ago
neil e0381dd757 fix format 4 months ago
Lifeboy 02fb40c507 Syntax corrections, previous change broke script 5 months ago
Lifeboy dc6ea97877 Syntax corrections, previous change broke script 5 months ago
Lifeboy 031d53b04f Syntax corrections suggested by testing script 5 months ago
Lifeboy 3006c90fb8 Syntax corrections suggested by testing script 5 months ago
Lifeboy 9cec2688ed Syntax corrections suggested by testing script 5 months ago
Lifeboy 65c3dc21f4 Added comments 5 months ago
Lifeboy fab292d2de correct a typo 5 months ago
Lifeboy fa3591f4f2 TXT record ADD test successfully 5 months ago
Lifeboy 42e78f9a3e changes not yet tested 5 months ago
Roland Giesler 0122eabd44
Update dns_miab.sh
Corrected typo
5 months ago
Roland Giesler 435bb3f1d3
Update dns_miab.sh
The MIAB API requires that the txtvlaue to a TXT record includes the "value=" and "ttl=" components as part of the TXT record when adding a new record.
5 months ago
Sergey Ponomarev 6b7b5caf54 DNS provider API: structured description
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 <authoremail@example.com>, 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 <stokito@gmail.com>
9 months ago
Bill Gertz f91aeea91c
Update dns_miab.sh
Added an explicit no error (0) return on the internal _retrieve_miab_env() function. This was causing errors when acme.sh was not run with a debug level.
3 years ago
neilpang d795fac37a update repo name 5 years ago
Bill Gertz 933d49b0b0
Style space change
Extra space on empty line 27.
5 years ago
Bill Gertz 9af85f5a7e
Updated to use _H1 Authorization: Basic
Updated to use suggested export _H1 env var to supply Authorization Basic credentials. This undocumented support for Basic Authorization, ContentType, etc. needs to be documented in DNSAPI Dev Guide. Removed two stray debugging lines.
5 years ago
Bill Gertz 7ec52145e8
Space style changes.
Local copy of shellcheck somehow missed these, odd.
5 years ago
Bill Gertz aa6112482d
Rewrite to conform to Dev guide
Created _get_root() that tests the requested host is a subdomain to the domains hosted on MailinaBox (MIAB) DNS Server. Created common _miab_rest() used with dns_miab_add(), dns_miab_rm() and _get_root(). Also created barbaric _is_json() to test the response given by the MIAB Custom DNS API at least looks like a JSON file. We should add a hint to use _normalizeJson with JSON responses so _startswith, _endswith won't perplexingly fail.
5 years ago
Bill Gertz f64b061a28
Style issue
Spaces on blank line on line 133.
5 years ago
Bill Gertz f323ced4ca
Style issues and orphan _postContentType debug fix
Fixed spacing and removed unneeded debug for _postContenetType
5 years ago
Bill Gertz c06ec7c6ba
Removed parameters and unused code for _miab_post
Ok, should have noticed earlier that the calls to the private function _miab_post() never used the _needbase64_ or the __postContentType parameters. Parameters and code to handle them has been factored out.
5 years ago
Bill Gertz 835f9aad91
Um that's a wee bit of nit pick.
'Errant' space removed on blank line on line 147.
5 years ago
Bill Gertz a4ec9f8b44
Fixed weird spacing on line 180
Um, fixed.
5 years ago
Bill Gertz 47c33d0344
Cleanup/ removed private function _get_root
Function _get_root() copied from acme.sh and is not needed here. Other cleanup as recommended by acme.sh test bot.
5 years ago
Bill Gertz f500c7abcb
dnsapi/dns_miab.sh MIAB DNS-01 Validation
Know I'm new to contorting to this project. I i've broke conventions please let me know what I've screwed up and I'll set it right as quickly as possible.

Propose this as a new DNS-01 validation script to dynamically add challenge DNS records to MailinaBox (MIAB) DNS. MIAB uses a custom DNS API to manage external DNS records.

The script was originally written by Darven Dissek and can be found in his repository: https://framagit.org/DarvenDissek/acme.sh-MIAB-DNS-API/). This has been forked and some slight cleanup applied and change shebang to UNIx shell. The forked repository can be found here: https://github.com/billgertz/MIAB_dns_api.

Wrote to Darven but received no reply. Support for this script has been submitted to the OPNsense project via this pull request: https://github.com/opnsense/plugins/pull/1531
5 years ago