Commit Graph

19 Commits

Author SHA1 Message Date
Fabian Grünbichler
122626b3d5 plugins: unify extract_challenge
we have a list of supported challenge types per plugin, so we only need
one generic implementation.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-17 14:33:41 +02:00
Fabian Grünbichler
f00829fd60 plugins: refactor setup/teardown signatures
and move handling of tokens/key_auths to plugins, since it's not bound
to be identical for all challenge types forever.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-17 14:29:43 +02:00
Fabian Grünbichler
9ea3c3d9de dns plugin: use non-usrmerged path for bash
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-17 09:44:09 +02:00
Fabian Grünbichler
13b638827a dns plugin: make data optional
it might be hard-coded in a (modified) plugin, or not needed

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-17 09:44:09 +02:00
Fabian Grünbichler
109fc3fda9 protocol: request validation with empty body
including the key authorization is deprecated and will be removed at
some point, might as well clean that up now to be prepared.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-17 09:44:09 +02:00
Fabian Grünbichler
c82603c9b5 config: always define a 'standalone' plugin instance
so that consumers can fallback to it

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-17 09:44:09 +02:00
Wolfgang Link
169250014f Implement function to resolve all subplugins
This function helps to retrieve all subplugins
that are supported by the plugins.
This will later be used as an enumeration for entering parameters.
2020-04-16 08:44:20 +02:00
Wolfgang Link
54fd0088c1 Add debug mode
This can be used at setup time to get feedback on the DNS plugin parameters.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-16 08:44:20 +02:00
Wolfgang Link
98b96d9ee7 Add DNSChallenge Plugin
This plugin calls the custom script acme.sh and uses the implementation of the DNS API.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-16 08:44:18 +02:00
Wolfgang Link
d18383f0d3 Use the caller's data instead of extracting it yourself.
Add the server in the data structure to return it.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-16 08:43:23 +02:00
Wolfgang Link
435e1726d1 Create the plugin config.
At the moment, Proxmox has two different configurations that require different properties.
DNSChallange requires credentials for the DNSAPI.
Standalone has no settings because Letsencrypt only supports port 80 with the http-01 challenge.
This configuration is registered in the pve-manager.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-15 17:48:14 +02:00
Wolfgang Link
762af3b15c Refactor extract_callenge for code reuse.
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-15 15:00:37 +02:00
Wolfgang Link
5460050ded Move code from pve-common
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-15 14:58:32 +02:00
Wolfgang Link
2056960537 Add submodule acme.sh for DNS plugins
Copy the DNS plugins form acme.sh

The project acme.sh can be found here.
https://github.com/Neilpang/acme.sh

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-15 14:58:32 +02:00
Wolfgang Link
ece42f2f76 Implement feature setup and teardown functionality.
We use these functions to add and remove a txt record via the dnsapi.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-15 14:58:24 +02:00
Wolfgang Link
216d4f1df6 Add funtion to set DNSAPI variable
acme.sh DNS plugins expect a configuration in which the login information
is stored.
We pass the credentials with the command.
This function supports the expected behavior of the plugins.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-15 14:56:39 +02:00
Wolfgang Link
bb2e086404 Remove unnecessary Code and fixes.
This Code is not required in the Proxmox environment.
We know in our environment what we have as a tool-change.

Fix Code what does not work because variable or functions are missing.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-02 14:29:19 +02:00
Wolfgang Link
92b88a9e26 Copy the needed function form acme.sh
For the thin wrapper around acme.sh DNS plugins, the required functions are copied.
The project acme.sh can be found here.
https://github.com/Neilpang/acme.sh

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-02 14:29:19 +02:00
Wolfgang Link
9ce00d2fbc Add Debian Buildsystem config
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-04-02 14:29:16 +02:00