import sample dev env settings file
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1 @@
|
||||
Netdisco/environments/development.yml
|
||||
test.pl
|
||||
|
||||
37
Netdisco/environments/development.yml
Normal file
37
Netdisco/environments/development.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
# configuration file for development environment
|
||||
|
||||
# the logger engine to use
|
||||
# console: log messages to STDOUT (your console where you started the
|
||||
# application server)
|
||||
# file: log message to a file in log/
|
||||
logger: "console"
|
||||
|
||||
# the log level for this environement
|
||||
# core is the lowest, it shows Dancer's core log messages as well as yours
|
||||
# (debug, warning and error)
|
||||
log: "core"
|
||||
|
||||
# should Dancer consider warnings as critical errors?
|
||||
warnings: 1
|
||||
|
||||
# should Dancer show a stacktrace when an error is caught?
|
||||
show_errors: 1
|
||||
|
||||
plugins:
|
||||
DBIC:
|
||||
netdisco:
|
||||
schema_class: 'Netdisco::DB'
|
||||
dsn: 'dbi:Pg:dbname=netdisco;host=localhost'
|
||||
user: 'netdisco'
|
||||
pass: 'netdisco'
|
||||
options:
|
||||
RaiseError: 1
|
||||
AutoCommit: 1
|
||||
|
||||
# for dev env only, this will force login so that a restarting server
|
||||
# doesn't persist in requiring reauth.
|
||||
# no_auth: 1
|
||||
|
||||
# will be stripped from fqdn when displayed in the web UI
|
||||
# don't forget the leading dot
|
||||
# domain_suffix: '.example.com'
|
||||
@@ -1,11 +1,13 @@
|
||||
package Netdisco::Web::AuthN;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use Dancer::Plugin::DBIC;
|
||||
|
||||
use Digest::MD5 ();
|
||||
|
||||
hook 'before' => sub {
|
||||
if (! session('user') && request->path !~ m{^/login}) {
|
||||
if (setting('environment') eq 'development') {
|
||||
if (setting('environment') eq 'development' and setting('no_auth')) {
|
||||
session(user => 'developer');
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user