fix for statechecker
This commit is contained in:
3
.env
3
.env
@@ -35,6 +35,9 @@
|
||||
# Put these in .env.production or .env.development to define your dev/prod
|
||||
# databases. Do not define it in .env or .env.local! It will be taken as your
|
||||
# test database too, and rails will wipe it if you run the test suite.
|
||||
#
|
||||
# If you are connecting to PostgreSQL via socket, omit the hostname (e.g.
|
||||
# postgresql:///danbooru2)
|
||||
# export DATABASE_URL="postgresql://localhost/danbooru2"
|
||||
# export ARCHIVE_DATABASE_URL="postgresql://localhost/archive_development"
|
||||
# export RO_DATABASE_URL="$DATABASE_URL"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
set :user, "danbooru"
|
||||
set :rails_env, "staging"
|
||||
server "testbooru.donmai.us", :roles => %w(web app db), :primary => true, :user => "danbooru"
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
require File.expand_path('../../state_checker', __FILE__)
|
||||
|
||||
StateChecker.check!
|
||||
StateChecker.instance.check!
|
||||
|
||||
Rails.application.config.action_dispatch.session = {
|
||||
:key => '_danbooru2_session',
|
||||
:secret => StateChecker.session_secret_key
|
||||
:secret => StateChecker.instance.session_secret_key
|
||||
}
|
||||
Rails.application.config.secret_token = StateChecker.secret_token
|
||||
Rails.application.config.secret_token = StateChecker.instance.secret_token
|
||||
|
||||
@@ -20,3 +20,7 @@ test:
|
||||
# instead read values from the environment.
|
||||
production:
|
||||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||
|
||||
staging:
|
||||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module StateChecker
|
||||
module_function
|
||||
class StateChecker
|
||||
include Singleton
|
||||
|
||||
def check!
|
||||
ENV["SECRET_TOKEN"].present? || check_secret_token
|
||||
|
||||
@@ -15,7 +15,7 @@ user 'danbooru', 'danbooru'
|
||||
working_directory app_path
|
||||
|
||||
# Should be 'production' by default, otherwise use other env
|
||||
rails_env = ENV['RAILS_ENV'] || 'production'
|
||||
rails_env = ENV['RAILS_ENV'] || 'staging'
|
||||
|
||||
# Log everything to one file
|
||||
stderr_path "log/unicorn.log"
|
||||
|
||||
Reference in New Issue
Block a user