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
|
# 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
|
# 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.
|
# 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 DATABASE_URL="postgresql://localhost/danbooru2"
|
||||||
# export ARCHIVE_DATABASE_URL="postgresql://localhost/archive_development"
|
# export ARCHIVE_DATABASE_URL="postgresql://localhost/archive_development"
|
||||||
# export RO_DATABASE_URL="$DATABASE_URL"
|
# export RO_DATABASE_URL="$DATABASE_URL"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
set :user, "danbooru"
|
||||||
set :rails_env, "staging"
|
set :rails_env, "staging"
|
||||||
server "testbooru.donmai.us", :roles => %w(web app db), :primary => true, :user => "danbooru"
|
server "testbooru.donmai.us", :roles => %w(web app db), :primary => true, :user => "danbooru"
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
require File.expand_path('../../state_checker', __FILE__)
|
require File.expand_path('../../state_checker', __FILE__)
|
||||||
|
|
||||||
StateChecker.check!
|
StateChecker.instance.check!
|
||||||
|
|
||||||
Rails.application.config.action_dispatch.session = {
|
Rails.application.config.action_dispatch.session = {
|
||||||
:key => '_danbooru2_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.
|
# instead read values from the environment.
|
||||||
production:
|
production:
|
||||||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||||
|
|
||||||
|
staging:
|
||||||
|
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
module StateChecker
|
class StateChecker
|
||||||
module_function
|
include Singleton
|
||||||
|
|
||||||
def check!
|
def check!
|
||||||
ENV["SECRET_TOKEN"].present? || check_secret_token
|
ENV["SECRET_TOKEN"].present? || check_secret_token
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ user 'danbooru', 'danbooru'
|
|||||||
working_directory app_path
|
working_directory app_path
|
||||||
|
|
||||||
# Should be 'production' by default, otherwise use other env
|
# 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
|
# Log everything to one file
|
||||||
stderr_path "log/unicorn.log"
|
stderr_path "log/unicorn.log"
|
||||||
|
|||||||
Reference in New Issue
Block a user