From ffcf6ed0990c862a78f9391cb23f9c697e58ce71 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 21 May 2014 20:36:00 +0100 Subject: [PATCH] Support Dancer::Debug at runtime with DANCER_DEBUG=1 env var --- Netdisco/Changes | 1 + Netdisco/bin/netdisco-web-fg | 10 +++++++--- Netdisco/lib/App/Netdisco/Manual/Deployment.pod | 12 ++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index 94f55686..92ef0a81 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -3,6 +3,7 @@ [ENHANCEMENTS] * Support offline update of oui.txt and MIBs bundle + * Support Dancer::Debug at runtime with DANCER_DEBUG=1 env var [BUG FIXES] diff --git a/Netdisco/bin/netdisco-web-fg b/Netdisco/bin/netdisco-web-fg index f0d53bf7..7b31bf26 100755 --- a/Netdisco/bin/netdisco-web-fg +++ b/Netdisco/bin/netdisco-web-fg @@ -38,9 +38,13 @@ set plack_middlewares => [ pass_through => 1, )], # install Dancer::Debug for this... - #[ Debug => ( - # panels => [qw/Dancer::Settings Parameters Dancer::Version DBITrace/], - #)], + ( + $ENV{DANCER_DEBUG} ? + [ Debug => ( + panels => [qw/Dancer::Settings Parameters Dancer::Version DBITrace/], + )] + : () + ) ]; use App::Netdisco::Web; diff --git a/Netdisco/lib/App/Netdisco/Manual/Deployment.pod b/Netdisco/lib/App/Netdisco/Manual/Deployment.pod index 162c39e7..0ae7c5fa 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Deployment.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Deployment.pod @@ -136,6 +136,18 @@ You are instead recommended to run C behind a reverse proxy as described elsewhere in this document. Apache can easily act as an SSL reverse proxy. +=head1 Debug Tricks + +You can see what HTTP Headers are received by Netdisco, and other information +such as how it's parsing the config file, by enabling the Dancer debug plugin. +First download the plugin: + + ~/bin/localenv cpanm --notest Dancer::Debug + +Then run the web daemon with the environment variable to enable the feature: + + DANCER_DEBUG=1 ~/bin/netdisco-web restart + =head1 Further Reading... Other ways to run and host the web application can be found in the