Commit Graph

32 Commits (fcffe8beb9da574818ee6f53772fcd3bbe737d72)

Author SHA1 Message Date
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
Malte Rabenseifner 3b7be478aa
Fix stuff from tests
ShellCheck tests have brought up a couple of issues, that I was not aware of needed to be taken care. This should fix the tests.
2 years ago
Malte Rabenseifner 2014ca9feb
Fix the API calls that get the list of domains that PLESK can manage 2 years ago
lufi42 ca0981645f Fixed shfmt error 3 years ago
lufi42 bc7e02b47a Fixed removal of TXT record when subdomain is case-sensitive and improved debug logging
Plesk SPI return domain names always lower-case. Therefore the search for domain names in the API response must be case-insensitve. Set debug logging to the values that are reallys used for the spi calls.

added comment
3 years ago
lufi42 55a55e9f74 Fixed debug log to prevent globbing and word splitting. 3 years ago
lufi42 b41d40da40 Extended debug logging in dns_pleskxml_rm() 3 years ago
lufi42 ba3e088b23 Improved error handling
Improved error handling when result contains data-structure which might contain another status-flag that is related to the status of the related object and not the api call

Revert "Improved error handling"

This reverts commit fa6df1cfab134d38baad19fc1caa0842f00416d5.

Revert "Revert "Improved error handling""

This reverts commit 5a4b78392f063863ee9f56686f5c429e9376af1b.
3 years ago
lufi42 a6b58bc88d Corrected use of Plesk API calls to fetch all domain for all Plesk editions
This implementation of the Plesk API will add support for Plesk web admin edition and will now discover all domains ( of customers & administrative users) managed by the specific plesk instance.

The previous implementation of the Plesk API uses the customer API. This brings two problems:
1. The current API call only fetches the domains of resellers/customers and not the domains that are managed by administrative users.
compare:
https://docs.plesk.com/en-US/obsidian/api-rpc/about-xml-api/reference/managing-customer-accounts/retrieving-the-list-of-customer%E2%80%99s-domains.75309/
https://docs.plesk.com/en-US/obsidian/api-rpc/about-xml-api/reference/managing-plesk-server/getting-server-information/response-packet-structure-and-samples/list-of-domains.75294/

2. The customer API is only available in the web pro/host editions. The most common license on VPS/Dedicated Servers is nowadays the web admin edition. See: https://www.plesk.com/editions/

The correct way to get all domains in all Plesk editions is to use the Sites (Domains) API:
https://docs.plesk.com/en-US/obsidian/api-rpc/about-xml-api/reference/managing-sites-domains/getting-information-about-sites.66583/
This way is working for all plesk editions the same way.
3 years ago
neil 19c4345162 fix shfmt 5 years ago
neilpang d795fac37a update repo name 5 years ago
stilez 51cfd996eb
rmv space 5 years ago
stilez 6d0e4bed4b
remove \n in output messages 5 years ago
stilez 05247dc4a4
fix 5 years ago
stilez 43011f3bfa
enhance 5 years ago
stilez 38854bd876
bugfix 5 years ago
stilez a9726bd52f
bugfix 5 years ago
stilez 4216c9e8f7
rmv spaces 5 years ago
stilez a8d670fc0d
Rest of sed -r 5 years ago
stilez cbacc779fc
Fix some sed -r, and clean up some variable references ("$1" -> "$varname") 5 years ago
stilez 896778cead
Grep fixes and minor improvements 5 years ago
stilez 04b0c62bf9
basic regex's to use \+
Maybe BRE aren't as basic as they sound. But I'm sure `man grep` didn't list the extra syntax of "preceded by backslash" :)  So let's use it
5 years ago
stilez 63a779baa8
remove unnecessary \ 5 years ago
stilez 2d1a776db7
Replace egrep -> basic regex grep
(( ... isn't it annoying that basic regex has * but not + ..... ))
5 years ago
stilez 343d7df57c
shellcheck directive 5 years ago
stilez a32b95544b
[[:space:]] -> " " 5 years ago
stilez 2422e0b481
grep -E and sed -E 5 years ago
stilez 3441bd0e7c
improve _err message and remove a dubious _debug message. 5 years ago
stilez 05ced9fbc4
edit a comment 5 years ago
stilez b7c3df455e
travis fix 5 years ago
stilez d7affad059
various small improves 5 years ago
stilez bc291141b1
fix filename 5 years ago