From 09829a25b8d0a60d4c014ac6ebed35f0cf233a56 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 3 Jun 2013 20:07:31 +0100 Subject: [PATCH] local plugins site_plugins dir --- Netdisco/Changes | 1 + Netdisco/lib/App/Netdisco/Web.pm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Netdisco/Changes b/Netdisco/Changes index 7e407e88..0f99ffd3 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -26,6 +26,7 @@ * User icon color indicates port_control/admin ability * Buttons for discover/macsuck/arpnip on device details page * Support 'path' config option as alternative to --path /mountpoint + * Local plugins can be placed in ${NETDISCO_HOME}/site_plugins/... [BUG FIXES] diff --git a/Netdisco/lib/App/Netdisco/Web.pm b/Netdisco/lib/App/Netdisco/Web.pm index 98c885e7..8781cb08 100644 --- a/Netdisco/lib/App/Netdisco/Web.pm +++ b/Netdisco/lib/App/Netdisco/Web.pm @@ -8,6 +8,7 @@ use Dancer::Plugin::DBIC; use Socket6 (); # to ensure dependency is met use HTML::Entities (); # to ensure dependency is met use URI::QueryParam (); # part of URI, to add helper methods +use Path::Class 'dir'; use App::Netdisco::Web::AuthN; use App::Netdisco::Web::Static; @@ -38,6 +39,7 @@ if (setting('web_plugins') and ref [] eq ref setting('web_plugins')) { } if (setting('extra_web_plugins') and ref [] eq ref setting('extra_web_plugins')) { + unshift @INC, dir(($ENV{NETDISCO_HOME} || $ENV{HOME}), 'site_plugins')->stringify; _load_web_plugins( setting('extra_web_plugins') ); }