Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move db username/password out of config file.

  • Loading branch information...
commit a24bc78ebbd141f07e4d92e9c7c462e04d153278 1 parent aa3a7fe
@davorg authored
Showing with 9 additions and 4 deletions.
  1. +1 −3 PoliticalWeb/config.yml
  2. +8 −1 PoliticalWeb/lib/PoliticalWeb.pm
View
4 PoliticalWeb/config.yml
@@ -38,8 +38,6 @@ plugins:
servers: [ '127.0.0.1:11211' ]
DBIC:
- politicalweb:
+ default:
schema_class: PoliticalWeb::Schema
dsn: dbi:mysql:database=politicalweb
- user: politicalweb
- pass: p0l171c4lw3b
View
9 PoliticalWeb/lib/PoliticalWeb.pm
@@ -11,6 +11,13 @@ our $VERSION = '0.1';
# check_page_cache;
+$ENV{PW_USER} && $ENV{PW_PASS}
+ or die 'Must set PW_USER and PW_PASS';
+
+my $cfg = dancer_app->config;
+$cfg->{plugins}{DBIC}{default}{user} = $ENV{PW_USER};
+$cfg->{plugins}{DBIC}{default}{pass} = $ENV{PW_PASS};
+
get '/' => sub {
return template 'index' unless keys %{ +params };
@@ -61,7 +68,7 @@ get '/constituencies/' => sub {
my $page = template 'constituencies/index', {
constits => [ $con_rs->search({}, { order_by => 'name'} )->all ]
};
- cache_page $page;
+ # cache_page $page;
return $page;
};
Please sign in to comment.
Something went wrong with that request. Please try again.