Commit Graph

30 Commits

Author SHA1 Message Date
Wolfgang Bumiller
9556af6134 nodeconfig: use common config parser
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-03-17 14:24:20 +01:00
Thomas Lamprecht
e466f896d5 node config: limit description/comment length to 64 KiB
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 13:14:34 +02:00
Fabian Grünbichler
b3fbf2ac10 node_config: followup s/domain/alias
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-06-25 10:28:14 +02:00
Fabian Möller
d1dd680b09 node_config: Allow leading underscore in ACME aliases 2020-06-25 10:25:45 +02:00
Fabian Grünbichler
4aa89cc0e8 fix #2784: always compare ACME domains in lower case
otherwise the ACME endpoint might return the ordered domain in lower
case and we fail to find our plugin config.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-06-17 14:00:43 +02:00
Dominik Csapak
b7def515e8 NodeConfig/get_acme_conf: make domains always a hash
on all call sites, we assume $cfg->{domains} is a hash, but if we do not
have any domains configured, that fails with
'Can't use an undefined value as a HASH reference at ...'

so always make domains a hash to avoid this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-05-07 12:54:30 +02:00
Thomas Lamprecht
85b275b1c9 node config: fix invalid domain error message
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-06 19:53:07 +02:00
Thomas Lamprecht
de9aa6782c node config: check if plugin is valid for acmedomain
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 18:46:12 +02:00
Thomas Lamprecht
667198c485 nodeconfig: allow up to 5 domains for now
20 was a bit overkill, and we can increase this easily, decreasing
isn't that easy at all...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 16:36:46 +02:00
Fabian Grünbichler
3c194d9e46 NodeConfig: ensure locked context has current view
similar to the recent changes for pve-guest-common - we start each API
call with a cfs_update, but while we were waiting for the flock another
R-M-W cycle might have happened, so we need to refresh after obtaining
the lock.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Thomas Lamprecht
75afd54a01 node config: verify abstract relations on write
for now mostly due to the "nice" property of the acmedomains which
do not use their property key as index but actually the doamain.

Without this one could set up duplicated domain entries just fine,
but once using them -> error.
This is not nice UX, so verify node config before writing an updated
one out, to catch those issues.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 14:10:17 +02:00
Thomas Lamprecht
a64b0ed59c node config: die on type failure
as else we'd continued with bogus data and possible write out
something stupid

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 14:10:17 +02:00
Thomas Lamprecht
7ffd15504e acme/node cfg: various code cleanups
just a small selection I already had done, avoid to much time
consuming cleanups for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
9d17b94502 nodeconfig: make ACME plugin optional
and default to the always available 'standalone' http-01 plugin

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
dcfb9f2c03 nodeconfig: make domain default key of acmedomain
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
ab53e139eb nodeconfig: drop '_additional_' from acme domain keys
each entry represents one domain, it could also be the only one.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
b456a0f31a nodeconfig: don't register unused formats
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
b232807dac acme: improve get_acme_conf
mixed bag of improvements:
- return hash based on domain
- check for duplicate domains, allow overlap between main and additional
keys otherwise

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
a3a9f9e0ba acme: fix account parsing
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Wolfgang Link
c30e112eff Adapt acme node config parser and rename the function.
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-05-03 14:10:17 +02:00
Wolfgang Link
f9a14ae347 Remove unused code
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-05-03 14:10:17 +02:00
Wolfgang Link
cc442d3ee2 Extend node config in the acme section.
Allow additional domains with different sub-plugins,
However, only one domain per additional entry is permitted.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-05-03 14:10:17 +02:00
Thomas Lamprecht
cc95254ea1 node config: allow - in config property keys
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 13:27:30 +01:00
Thomas Lamprecht
1ff3fef0b0 fix #844: allow to pre-delay start-all-marked guests on boot
Add a simple ExecStartPre command which reads the local node config,
and if a delay is set the helper sleeps that long then exists.

The systemd-unit approach was chosen as this ensures that we really
only delay when doing the startall on node boot. The pve-guests
service does not allows manual stops, starts or restarts, it can only
be pulled in by the multi-user.target

Mark this command with "-" to tell systemd that errors of it should
not cause an abort, it's a best-effort approach.

The journal from a 2 second delay would look like:
> Nov 19 13:13:48 dev6 systemd[1]: Starting PVE guests...
> Nov 19 13:13:48 dev6 pve-startall-delay[2318]: Delaying on-boot 'startall' command for 2 second(s).
> ...
> Nov 19 13:13:50 dev6 pve-guests[2339]: <root@pam> starting task UPID:dev6:00000924:00000529:5DD3DC7E:startall::root@pam:

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-20 20:20:58 +01:00
Christian Ebner
0f615ea9df pvenode: Return MAC address used for WoL call on success
Use the new format to verify the MAC addresses.
The wakeonlan API call now returns the MAC address of the node to wake on
successful sending of the WoL packet.
pvenode finally displays this MAC address to the user as feedback.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-01-22 12:05:47 +01:00
Christian Ebner
b3d8454221 implement basic wake on LAN functionality
Provides the basic functionality to provide a wake on LAN feature implementation
to start nodes in a cluster from other nodes.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-01-17 11:15:01 +01:00
Thomas Lamprecht
e79894ebd9 NodeConfig: support patterns in check_type
Add pattern support for the check_type method used by the
parse_config method. It would be much better to integrate the missing
stuff into either the JSONSchema check_prop or parse_config methods,
should be mostly the "description" assembly anyway, and if that is
not possible or to hacky it'd be still nice to have a common single
of those parser, not multiple ones (pve-container, qemu-server, ...)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-16 13:43:09 +01:00
Thomas Lamprecht
e61f1629e7 NodeConfig: simplify description parsing
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-15 18:34:17 +01:00
Thomas Lamprecht
4dab82e39a nodeconfig acme-domain: allow domains starting with numbers
they are valid

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-12 10:36:59 +02:00
Fabian Grünbichler
c4f78bb7c6 add node configuration file and API
this currently only contains a description and the node-specific ACME
configuration, but I am sure we can find other goodies to put there.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00