Commit Graph

174 Commits

Author SHA1 Message Date
Lorenz Stechauner
17711ff849 api: nodes: add query_url_metadata method
metadata is gained using a HEAD request.

Due to the ability of this api endpoint to request files on internal
networks (which would not be visible/accessible from outside) it is
restricted to users with permissions `Sys.Audit` and `Sys.Modify` on
`/`. Users with these permissions are able to alter node (network)
config anyway, so this should not create any further security risk.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
2021-07-03 00:36:20 +02:00
Fabian Ebner
0a7de3377b nodes: startall: correctly handle warning status for delayed task
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-24 08:50:38 +02:00
Thomas Lamprecht
0d213945f1 api: nodes: simplify appliance list code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 18:57:30 +02:00
Thomas Lamprecht
aee25c2ed1 api: nodes: simplify appliance download code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 18:57:23 +02:00
Thomas Lamprecht
c3020cf230 api: nodes: fix re-defined rpcenv/user variables regression
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 18:40:34 +02:00
Lorenz Stechauner
fac5d57e5b api: nodes: refactor aplinfo to use common download function
a common function to download arbitrary files from urls has been
defined as PVE::Tools::download_file_from_url and is now used.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-06-18 18:36:06 +02:00
Thomas Lamprecht
0e68b116f3 api: nodes: fix typo
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-17 16:27:55 +02:00
Fabian Ebner
05d5446df8 api: move cpu path into qemu/capabilities
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 11:29:34 +02:00
Fabian Ebner
0c8e509eb5 api: nodes: remove deprecated upgrade parameter for vncshell
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 11:29:32 +02:00
Fabian Ebner
b270a6b4ea api: nodes: remove deprecated upgrade parameter for spiceshell
The change not to pass the 'upgrade' parameter in the frontend was made in
953f6e9bb3 (the commit doesn't talk about it, it's
likely an accidental squash of two changes)

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 10:51:53 +02:00
Fabian Ebner
5489ea5278 api: nodes: remove deprecated upgrade parameter for xtermjs
The switch to 'cmd' was made by commit af39a6f09651e15d1c83536e25493a2212efd7d3
in the pve-xtermjs repo and is included in 4.7.0

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 10:51:46 +02:00
Thomas Lamprecht
6110ed0348 api: nodes: whitespace cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-04 11:58:55 +02:00
Thomas Lamprecht
c6c4b2788d api: node: add capabilities path and move qemu machines over
avoid further crowding the top-level node API path with such
"what can some part of the node currently do" stuff, rather move it
down.

The QEMU cpu stuff should move also down there.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
5a378425b8 api: nodes: sort use statements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Stefan Reiter
32ad9758a2 api: register Qemu::Machine call
as 'machine-types', so it is clear this refers to QEMU machines, not the
local machine (as one might think, this being a 'node' API call).

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
784d6ee9b4 api: nodes: sort index
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-05 21:31:32 +01:00
Thomas Lamprecht
f5b6ccb1d5 api: fixup: commit change to storage module
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-02 11:45:33 +01:00
Thomas Lamprecht
f24be7e72d api: nodes: allow root to pass arbitrary arguments to commands
If the command itself allows it, which normally means it has good
verification of passed arguments.

We may want to re-evaluate security here if we allow execution for a
group of non-root users.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-22 17:59:36 +01:00
Thomas Lamprecht
ecddd2e231 Revert "Close #1623: replace apt-get to apt"
This reverts commit 19137ed620.
2020-07-08 10:55:56 +02:00
Moayad Almalat
19137ed620 Close #1623: replace apt-get to apt
Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
2020-07-07 18:52:28 +02:00
Thomas Lamprecht
d6e7fa0404 api nodes/netstat: cleanup indentation and refactor slightly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-03 08:06:44 +02:00
Thomas Lamprecht
677bee7c57 api/nodes: factor out getting VNC connection info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-01 09:02:49 +02:00
Stefan Reiter
01ac98c702 api: register /nodes/X/cpu call for CPU models
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-06-17 15:51:11 +02:00
Fabian Grünbichler
1a664b0f9d api: improve node index with missing/broken cert
since this API endpoint is used for the node selector in the GUI, which
causes quite widespread breakage.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-06-02 10:28:56 +02:00
Thomas Lamprecht
13411f9938 bulk migration: only pass 'with-local-disks' along if defined
To make it backward compaitble. NBo real harm without this, but lots
of ugly undefiend $val warnings...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-05 13:50:23 +01:00
Thomas Lamprecht
71fd3de92e migration worker: move params to own variable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-05 13:49:55 +01:00
Thomas Lamprecht
8e4bee65a3 api/bulk migrate: add comment regarding PID re-used
this needs to be fixed, maybe with pidfd's...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 17:13:36 +01:00
Thomas Lamprecht
49652c466f api/bulk migrate: warn if vmlist was empty, die if no worker got spawned
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 17:13:36 +01:00
Thomas Lamprecht
6f3d18dd32 api/bulk migrate: split long param list in multiple lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 17:06:40 +01:00
Thomas Lamprecht
0b54f653ca api/bulk migrate: rework pre-condition check outputs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 17:06:37 +01:00
Tim Marx
d8d1727191 api: add migrate precondition checks to bulk migrate api
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-11-30 15:25:18 +01:00
Tim Marx
fc6b77a1f6 api: add migrate with local disks to bulk migrate api
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-11-30 15:25:18 +01:00
Thomas Lamprecht
481816075e followup: add intermediate directory index for sdn/zones
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 17:58:01 +01:00
Alexandre Derumier
bb65469946 api2 : nodes : use zones api status
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-11-26 17:08:23 +01:00
Fabian Grünbichler
516a7948cd use PVE::RRD for RRD data
refactored from PVE::Cluster. same code, same semantics, different file.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
3ac3653e63 use PVE::DataCenterConfig
to make sure that the corresponding cfs_read_file works() works.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Alexandre Derumier
4be427a021 api2 : nodes : sdn status endpoint
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-09-03 10:28:55 +02:00
Thomas Lamprecht
a740deff88 fix typos all over the place
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-09-03 07:55:32 +02:00
Thomas Lamprecht
e1b5780906 api startall guest: improve descriptions
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-09-03 07:53:11 +02:00
Tim Marx
4a512d7a2e api: fix nodes stats memory return type description
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-08-26 13:36:48 +02:00
Thomas Lamprecht
7618913027 perl: fix some common typos found with codespell
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-15 10:40:20 +02:00
Thomas Lamprecht
180a86d39a pvecfg: adapt version and release semantic
Wit commit a74ba607d4 we switched over
to using the dpkg-dev provided helpers to set package version,
architecture and such in the buildsystem.

But unlike other repositories we used the version also for giving it
back over the API through the during build generated PVE::pvecfg
module, which wasn't fully updated to the new style.

This patch does that, and also cleans up semantics a bit, the
following two changed:

release is now the Debian release, instead of the "package release"
(i.e., the -X part of a full package version).
version is now simply the full (pve-manager) version, e.g., 6.0-1 or
the currently for testing used 6.0-0+1

This allows to do everything we used this information for even in a
slightly easier way (no  string concat needed anymore), and fits also
with the terminology we often used in our public channels (mailing
lists, forum, website)

Remove some cruft as we touch things.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-26 16:11:43 +02:00
Thomas Lamprecht
961399a308 api/nodes journal: fix parameter types and add minimum
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 16:12:20 +02:00
Thomas Lamprecht
a03cb8b89e partially revert "api/nodes journal: add and enforce parameter conflicts"
This partially reverts commit f9b08743a5
as we had some wrong assumptions about lastentries and the other
params, so just note conflicts in the description but let the tool
itself make the checks

This reverts commit f9b08743a5.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 16:05:19 +02:00
Thomas Lamprecht
f9b08743a5 api/nodes journal: add and enforce parameter conflicts
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 15:16:22 +02:00
Thomas Lamprecht
952280b49a api/nodes: add journal to index
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 15:15:51 +02:00
Dominik Csapak
1d397a8394 node: add journal api
this uses the new journalreader instead of journalctl, which is a bit
faster and can read from/to cursor and returns a start/end cursor

also you can give an unix epoch as time parameters

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-05-15 12:09:26 +02:00
Thomas Lamprecht
fc1da3b020 api: handle undefined shellcmd parameter better
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-24 11:27:52 +00:00
Thomas Lamprecht
57d56896c8 fix #263: only include node rrd stats if user has Sys.Audit
It makes sense to not give users without Sys.Audit permissions to
much information over a node and this is relatively easy and cheap to
check and enforce at those two points.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Oguz Bektas <o.bektas@proxmox.com>
2019-04-16 12:28:42 +00:00
Tim Marx
c3b04731bb add pveceph install to shell api
Signed-off-by: Tim Marx <t.marx@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-28 13:21:21 +01:00