|
@@ -10,7 +10,7 @@ require "set"
|
|
Envyable.load("config/env.yaml", ENV['RACK_ENV'])
|
|
Envyable.load("config/env.yaml", ENV['RACK_ENV'])
|
|
|
|
|
|
if ENV['RACK_ENV'] != "test"
|
|
if ENV['RACK_ENV'] != "test"
|
|
- DB = Sequel.connect(:adapter=>'postgres', :host=>ENV['PW_HOST'], :database=>ENV['PW_DB'], :user=>ENV['PW_USER'], :password=>ENV['PW_PASSWORD'], :sslmode => "require")
|
|
|
|
|
|
+ DB = Sequel.connect(:adapter=>'postgres', :host=>ENV['SV_HOST'], :database=>ENV['SV_DB'], :user=>ENV['SV_USER'], :password=>ENV['SV_PASSWORD'], :sslmode => "require")
|
|
end
|
|
end
|
|
|
|
|
|
class Schueler < Sequel::Model(:schueler);end
|
|
class Schueler < Sequel::Model(:schueler);end
|
|
@@ -24,7 +24,7 @@ class SV < Sinatra::Application
|
|
configure do
|
|
configure do
|
|
use Rack::Session::Cookie, :key => 'rack.session',
|
|
use Rack::Session::Cookie, :key => 'rack.session',
|
|
:path => '/',
|
|
:path => '/',
|
|
- :secret => (ENV['PW_SESSION_SECRET'] || 'your_secret'),
|
|
|
|
|
|
+ :secret => (ENV['SV_SESSION_SECRET'] || 'your_secret'),
|
|
:expire_after => 2592000
|
|
:expire_after => 2592000
|
|
Slim::Engine.set_options pretty: true
|
|
Slim::Engine.set_options pretty: true
|
|
enable :static
|
|
enable :static
|
|
@@ -44,7 +44,7 @@ class SV < Sinatra::Application
|
|
|
|
|
|
def authorized?
|
|
def authorized?
|
|
@auth ||= Rack::Auth::Basic::Request.new(request.env)
|
|
@auth ||= Rack::Auth::Basic::Request.new(request.env)
|
|
- @auth.provided? and @auth.basic? and @auth.credentials and @auth.credentials == [ENV['PW_BASIC_AUTH_USER'], ENV['PW_BASIC_AUTH_PASSWORD']]
|
|
|
|
|
|
+ @auth.provided? and @auth.basic? and @auth.credentials and @auth.credentials == [ENV['SV_BASIC_AUTH_USER'], ENV['SV_BASIC_AUTH_PASSWORD']]
|
|
end
|
|
end
|
|
|
|
|
|
def hashids
|
|
def hashids
|