[pve-devel] [PATCH manager] pveproxy: allow to request debug sources directly over GET parameter

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jul 10 09:38:00 CEST 2019


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 at proxmox.com>
---

note: PMG has similar functionallity already, just that the convenience for
"debug" without parameter misses. Also the server debug flag cannot be
overwritten there.

 PVE/Service/pveproxy.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index 4a515707..a07330c4 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -220,6 +220,11 @@ sub get_index {
 	$wtversion = $1;
     };
 
+    my $debug = $server->{debug};
+    if (exists $args->{debug}) {
+	$debug = !defined($args->{debug}) || $args->{debug};
+    }
+
     my $vars = {
 	lang => $lang,
 	langfile => $langfile,
@@ -227,7 +232,7 @@ sub get_index {
 	token => $token,
 	console => $args->{console},
 	nodename => $nodename,
-	debug => $server->{debug},
+	debug => $debug,
 	version => "$version",
 	wtversion => $wtversion,
     };
-- 
2.20.1





More information about the pve-devel mailing list