natsumesou/gyazo_server — Issue #1: The way of setting 'session secret' is too bad.
Author: Shinnya
Created: 2012-02-19 07:07:12+00:00
State: open

To store a secret key, you should use something like pit. I made a patch to fix this.

diff --git Gemfile Gemfile
index e47bdeb..83fd9e4 100644
--- Gemfile
+++ Gemfile
@@ -13,6 +13,7 @@ gem 'rake'
gem 'sinatra-flash', :require => 'sinatra/flash'
#gem 'shared-mime-info'
gem 'ruby-filemagic', '~> 0.4.2'
+gem 'pit'

# Component requirements

diff --git config/apps.rb config/apps.rb
index 7b23d7c..5572840 100644
--- config/apps.rb
+++ config/apps.rb
@@ -25,9 +25,13 @@
# Setup global project settings for your apps. These settings are inherited by every subapp. You can
# override these settings in the subapps as needed.
#
+require 'pit'
Padrino.configure_apps do
# enable :sessions
- set :session_secret, '7afcbd713f88aa30b33a6c26d328e4f857aba114fd1fe1814b627aa246c33c78'
+ config = Pit.get("gyazo_server", require => {
+ "session_secret" => "Enter session secret key",
+ })
+ set :session_secret, config["session_secret"]
end

# Mounts the core application for this project