Commit Graph

131 Commits

Author SHA1 Message Date
Thomas Lamprecht
9bd9d7a72e buildsys: move submodule to src, cleanups
it's nicer as the build system is more coherent, i.e., I can do `make
install` from inside src and it actually works ;)

Use an atomic target for the build directory, else we can easily get
bogus builds.

Further use only one type of GNU make variable flavors, not both $()
and ${} mixed..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 17:00:49 +02:00
Thomas Lamprecht
c0c6720a65 buildsys: sort and cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 16:49:26 +02:00
Thomas Lamprecht
e39249369a allow to get full DNS plugins list
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 16:47:41 +02:00
Thomas Lamprecht
d93b0e879b acme: variable name cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-02 18:48:07 +02:00
Thomas Lamprecht
017d8f5c3d d/control: add ${perl:Depends} and require pve-common > 6~
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-30 12:14:41 +02:00
Fabian Grünbichler
3f11a21544 bump version to 1.0.0-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-20 10:47:38 +02:00
Fabian Grünbichler
8a68340096 d/control: add B+R libpve-common-perl
since we takeover the perl modules

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-20 10:47:38 +02:00
Fabian Grünbichler
433059825f d/control: wrap-and-sort 2020-04-20 10:47:38 +02:00
Fabian Grünbichler
1a8ba4f072 proxmox-acme: fix readaccountconf
by switching to bash and echoing the values passed in from the plugin
config.

plugins like the OVH config attempt to detect and handle changed config
by comparing set env variables and values stored in the config, leading
to confusing output otherwise.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-20 10:47:38 +02:00
Fabian Grünbichler
13bc64ea1d dns plugin: improve 'data' string encoding/passing
encode the full multi-line string as base64 single-line string on
each config write, and decode at config parse time. pass both the data
key/value pairs and the secret txtvalue via STDIN instead of as command
line arguments.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-20 10:47:38 +02:00
Fabian Grünbichler
f0ed07330c dns plugin: reset environment
in addition to switching to nobody:nogroup, to reduce things exposed to
the dnsapi plugins

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-17 14:42:26 +02:00
Fabian Grünbichler
bd6d81d468 plugins: remove get_subplugins
it's unused, and the only plugin that has such functionality already
encodes the possible values as enum in the schema anyway..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-17 14:33:41 +02:00
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