Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Move db username/password out of config file.

  • Loading branch information...
commit a24bc78ebbd141f07e4d92e9c7c462e04d153278 1 parent aa3a7fe
Dave Cross authored January 25, 2014
4  PoliticalWeb/config.yml
@@ -38,8 +38,6 @@ plugins:
38 38
     servers: [ '127.0.0.1:11211' ]
39 39
 
40 40
   DBIC:
41  
-    politicalweb:
  41
+    default:
42 42
       schema_class: PoliticalWeb::Schema
43 43
       dsn: dbi:mysql:database=politicalweb
44  
-      user: politicalweb
45  
-      pass: p0l171c4lw3b
9  PoliticalWeb/lib/PoliticalWeb.pm
@@ -11,6 +11,13 @@ our $VERSION = '0.1';
11 11
 
12 12
 # check_page_cache;
13 13
 
  14
+$ENV{PW_USER} && $ENV{PW_PASS}
  15
+  or die 'Must set PW_USER and PW_PASS';
  16
+
  17
+my $cfg = dancer_app->config;
  18
+$cfg->{plugins}{DBIC}{default}{user} = $ENV{PW_USER};
  19
+$cfg->{plugins}{DBIC}{default}{pass} = $ENV{PW_PASS};
  20
+
14 21
 get '/' => sub {
15 22
   return template 'index' unless keys %{ +params };
16 23
 
@@ -61,7 +68,7 @@ get '/constituencies/' => sub {
61 68
   my $page = template 'constituencies/index', {
62 69
     constits => [ $con_rs->search({}, { order_by => 'name'} )->all ]
63 70
   };
64  
-  cache_page $page;
  71
+  # cache_page $page;
65 72
   return $page;
66 73
 };
67 74
 

0 notes on commit a24bc78

Please sign in to comment.
Something went wrong with that request. Please try again.