Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Read password and username from environment

  • Loading branch information...
commit 4cafefd78156b40d33bc6b547880ff639cda9ac0 1 parent 1f0c494
@smgt smgt authored
Showing with 5 additions and 2 deletions.
  1. +2 −1  README.md
  2. +3 −1 admin.rb
View
3  README.md
@@ -15,7 +15,8 @@ Requirements:
* Ruby 1.9.3
* Mongo
-The default username and password are `guard` / `llama`. Change these in `config.yml`, unless you want everybody to access your test results. SSL is required in an production environment by default.
+The default username and password are `guard` / `llama`. Change these in `config.yml` or set the environment variables `ABBA_USERNAME` and `ABBA_PASSWORD`, unless you want everybody to access your test results.
+The environment variables have precedence over the config file. SSL is required in an production environment by default.
To run locally:
View
4 admin.rb
@@ -30,6 +30,8 @@
set :sprockets, env
set :views, 'app/views'
set :erb, :escape_html => true
+ set :username, ENV["ABBA_USERNAME"] unless ENV["ABBA_USERNAME"].nil?
+ set :password, ENV["ABBA_PASSWORD"] unless ENV["ABBA_PASSWORD"].nil?
end
helpers do
@@ -160,4 +162,4 @@ def ssl_enforce!
get '/' do
redirect '/admin/experiments'
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.