proxy: cleanup getting index method - improve variable definition/use locality - avoid some if's for some (mostly boolean) assignments, just use an expression As long as we don't go overboard with code golfing it to extremely terse, shorter code is always more readable, especially if definition/use happens not dozens of lines apart. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
pveproxy/template: add support for switching themes load the dark theme only if requested through a cookie, also adds support for the "auto" theme that uses the dark theme based on a media query. this requires a bump of the widget toolkit so the dark-theme css file is available. Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
proxy: fix wildcard address use This patch fixes a regression for hosts disabling ipv6 via kernel commandline ('ipv6.disable=1')introduced in commit e224b7d2e6a729b48e9669e200fd7aeb1e9b5702 (disabling IPv6 via sysctl did not exhibit these problems) by hardcoding the address to '::', pveproxy and spiceproxy failed to start with: 'unable to create socket - Address family not supported by protocol' This patch depends on the commit in pve-common, which tries first binding to '::' and then falling back to '0.0.0.0', and needs a versioned dependency bump on libpve-common-perl. With this patch the listening addresses are (`ss -tlnp |grep 8006` output) * ipv6 disabled via kernel cmdline: '0.0.0.0:8006' * sysctl net.ipv6.conf.all.disable_ipv6=1: '*:8006' * sysctl net.ipv6.bindv6only=1: '[::]:8006' * else: '*:8006' Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
fix #417: proxy: allow settnig LISTEN_IP for pveproxy and spiceproxy The $host variable is set to "::0" by default to listen on wildcard (with 'Domain' => PF_INET6). If 'LISTEN_IP' is defined in /etc/default/pveproxy, that IP will be used instead. Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
pveproxy: allow to request debug sources directly over GET parameter Avoids the need to stop the current pveproxy and restart it in debug mode, if one wants to get the debug un-minified sources for ExtJS, for example. For a local PVE instance the following URL would ensure you load the debug sources: https://localhost:8006/?debug#v1:0:18:4:25:19::8:20:28 For convenience allow to omit the parameters value, and default to true, iow, ?debug and ?debug=1 are the same, one could force it off - even if the server was started in debug mode - by using ?debug=0 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
pvecfg: adapt version and release semantic Wit commit a74ba607d4b02c5734c5480de62700f52f96ac71 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>