Commit Graph

1396 Commits

Author SHA1 Message Date
Thomas Lamprecht
83b0b7d185 buildsys: clean more
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-03 16:39:10 +01:00
Thomas Lamprecht
a8a8dd847b bump version to 6.3-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-27 15:30:25 +01:00
Alexandre Derumier
9ca89b8722 Inotify: delete vlan-id for "iface.X" vlan iface.
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-11-27 15:26:25 +01:00
Thomas Lamprecht
63d0f1ff3e subscription: use more specific machine repo definition for PVE/PMG
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-27 15:22:38 +01:00
Thomas Lamprecht
1d15203cfa inotify: apt auth: sort longest machine entry first and allow deletion
plus a few code cleanups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-27 15:21:40 +01:00
Thomas Lamprecht
7f4dcc9239 bump version to 6.2-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 16:22:25 +01:00
Thomas Lamprecht
dfc8643d65 rest: register method: allow minus in path template parameter names
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 16:20:54 +01:00
Thomas Lamprecht
a6766fedf3 rest: register method: non-capturing group for path regex outer group
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 16:20:15 +01:00
Thomas Lamprecht
76b0577cbd bump version to 6.2-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 14:29:25 +01:00
Thomas Lamprecht
6674eb1e3d PBS client: backup tree: avoid over generic param has
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:04:53 +01:00
Thomas Lamprecht
2113c7e8e9 PBS client: get snapshots: avoid over generic param has
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:04:43 +01:00
Thomas Lamprecht
69a3a5858f PBS client: cannot use normal method call style for private subs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 13:03:50 +01:00
Thomas Lamprecht
8b88b2f6e5 pbs: restore pxar: add required parameters explicitly in method signature
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:39:03 +01:00
Thomas Lamprecht
ad6b323758 pbs: code cleanup param array assembly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:38:28 +01:00
Thomas Lamprecht
0cc6c7e01b pbs: autogen key: adapt recent changes in storage module
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:12:31 +01:00
Thomas Lamprecht
243568ca26 PBS client: use our normal blessed method call style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-17 09:12:02 +01:00
Stoiko Ivanov
0904f388a7 add PBSClient module
PBSClient.pm contains methods for:
* handling (sensitive) config-information (passwords, encryption keys)
* creating/restoring/forgetting/listing backups

code is mostly based on the current PBSPlugin in pve-storage

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-11-17 08:57:22 +01:00
Alexandre Derumier
39bf4956d4 systemd: add CPUWeight encoding 2020-11-06 09:31:11 +01:00
Alexandre Derumier
6d7c306596 bugfix: cpushares : default value is 1024 for cgroup v1
Currently if we delete cpuunit (undef), the default value is 100
2020-11-06 09:31:11 +01:00
Alexandre Derumier
9465abe251 Cgroups: remove specific lxc code 2020-11-06 09:31:11 +01:00
Alexandre Derumier
86dff11ce6 move PVE::LXC::CGroup to PVE::CGroup 2020-11-06 09:31:11 +01:00
Thomas Lamprecht
ad3e420bf0 bump version to 6.2-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-05 10:56:03 +01:00
Fabian Grünbichler
eeafe02d81 fix 3108: properly check IPv6 addr
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-11-02 08:33:51 +01:00
Stoiko Ivanov
e65624a3fa Systemd: add helpers for parsing unit files
taken from pve-storage/PVE/API2/Disks/Directory.pm (and made available as
public sub)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-10-30 09:26:02 +01:00
Dominic Jäger
a8f9333441 Make configid regex public
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2020-10-29 15:20:40 +01:00
Dominic Jäger
e37d592413 Add tests for verify_configid
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2020-10-29 15:20:40 +01:00
Thomas Lamprecht
a7886364a7 sendmail: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-29 15:20:21 +01:00
Thomas Lamprecht
87ff065c98 network: fix conditional variable declaration
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-23 21:09:23 +02:00
Thomas Lamprecht
329dfb6488 network: cleanup "check bond" code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-23 21:08:38 +02:00
Alexandre Derumier
000a5a6bcb Inotify: allow bond of bond
for example,some users need to do active-backup bond, on top of 2 lacp bond.
2020-10-23 21:02:00 +02:00
Alexandre Derumier
8387420212 ProcFSTools: add read_pressure
read new /proc/pressure/(cpu,disk,io) introduced in kernel 4.20.

This give more granular informations than loadaverage.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-10-13 07:32:42 +02:00
Thomas Lamprecht
d421e5b522 bump version to 6.2-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-18 17:35:58 +02:00
Fabian Grünbichler
99d02523f6 properly encode YAML via YAML::XS
otherwise we get strange errors when formatting data that was originally
JSON, and can thus contain JSON::true/JSON::false.

one example is the QMP query-blockstats command, which gets called (and
the resulting values returned) by /nodes/NODE/qemu/VMID/status/current

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-09-18 13:40:55 +02:00
Thomas Lamprecht
09d47f9d47 tools: sync_mountpoint: throw actual error is syncfs fails
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-18 11:59:32 +02:00
Stoiko Ivanov
b260d4e320 sync_mountpoint: open path so that sync works
sync_mountpoint takes a path, gets an open filedescriptor and calls
syncfs(2) on it.
by opening with O_PATH the syncfs call fails with EBADF (see open(2)).

found by running:
```
pkill -f 'pvedaemon worker';
strace -yyttT -s 512 -o /tmp/trace -fp $(pgrep -f pvedaemon$)
```

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-09-18 11:53:50 +02:00
Fabian Grünbichler
00bcefa3f0 d/control: add missing libtimedate-perl to depends
Fixes: b18826ce61

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-09-17 13:00:35 +02:00
Fabian Grünbichler
e0f86f250c wrap-and-sort d/control
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-09-17 12:54:52 +02:00
Thomas Lamprecht
bed5b64ca4 d/copyright: update
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-08 18:30:28 +02:00
Thomas Lamprecht
2fc238c263 bump version to 6.2-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-07 10:01:09 +02:00
Thomas Lamprecht
3fe29ce6c9 get_options: allow no arguments if all are optional
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-07 09:59:07 +02:00
Stoiko Ivanov
a24d91ea08 sendmail helper: allow empty display name in from
This patch enables the sendmail helper sub to send emails with a non-existant
display name in the from address. This is used to replace the direct call to
the sendmail binary in pve-manager/PVE/API2/APT.pm.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-09-07 09:40:25 +02:00
Stoiko Ivanov
b18826ce61 sendmail-helper: only send multipart if necessary
PVE::Tools::sendmail currently always sends a multipart/alternative message
irrespective of the actual content of the mail (e.g. a plain-text only mail
need not be sent as multipart message).

Additionally a few small refactorings based on the discussion
in https://lists.proxmox.com/pipermail/pbs-devel/2020-August/000423.html
and commited in 66004f22c6475ceb0146cf2df1f380f9f0274be4 in the
rust proxmox repository git://git.proxmox.com/git/proxmox.git
were carried over.

tested by creating a backup of a VM and setting an e-mail address, having
ha-manager send a mail after fencing as well as sending a few small mails via
'perl -e'

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-09-07 09:40:25 +02:00
Thomas Lamprecht
804bc6219b get_options: allow optional arguments "arg_params" if no ambiguity
If we run out of passed arguments from the user but still had defined
"arg_params" (those params which went after the command in fixed
order without option -- dashes) we always errored out with "not
enough arguments". But, there are situations where the remaining
arg_params are all marked as optional in the schema, so we do not
need to error out in that case.

A prime (future) use case is "pvesm prune-backups". Currently the
usage is:
> pvesm prune-backups storeid --prune-backups keep-last=1,keep-...

Because the "prune-backups" keep retention property is optional as it
can fallback to the one defined in the storage configuration.
With this patch we can make it an argument and allow the following
two usages:

1. As above, but avoiding the extra ugly --prune-backups
> pvesm prune-backups storeid keep-last=1,keep-...

2. Fallback to storage config:
> pvesm prune-backups storeid

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-26 21:21:05 +02:00
Thomas Lamprecht
1e49f2e7be bump version to 6.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-19 12:29:13 +02:00
Thomas Lamprecht
ba104d6760 run command: fix matching \r\n and use non-capturing group for it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-19 08:54:08 +02:00
Dominik Csapak
cb9db10c1a run_command: improve performance for logging and long lines
to call out/err/logfunc with each line, we search for a newline and call
outfunc/logfunc with everything before that

since we do a select/read (with 4096 size) in a loop, this means
that if we have very long lines, we search for a newline in an
ever growing buffer (for which we know does not contain a newline)

so instead, only search the new data for newlines

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-08-19 07:39:39 +02:00
Fabian Grünbichler
8fb28ab914 safe_read_from: bump default size limit to 512k
this is (via file_get_contents and file_copy) used for reading from
pmxcfs, which has a file size limit of 512k. since quite a number of
call sites would need to explicitly override this (and then get updated
if we bump the limit on the pmxcfs side again in the future), making our
default file reader compatible by default seems the better solution.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-08-19 07:38:44 +02:00
Thomas Lamprecht
9025031b10 bump version to 6.1-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-07 19:27:26 +02:00
Oguz Bektas
216a3f4f13 sendmail: separate 'mailto' list from the rest of the parameters
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2020-07-07 17:07:16 +02:00
Stefan Reiter
d500c0381e JSONSchema: use validator in print_property_string too
Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-07-06 10:40:10 +02:00