diff --git a/.dockerignore b/.dockerignore index c5f500dd..8d5e1661 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,7 @@ README.md # Rails .env .env.prod +sample.env *.rbc capybara-*.html .rspec @@ -17,4 +18,10 @@ public/system coverage/ spec/tmp .rvmrc -scripts/ +.byebug_history + +# docker +docker-compose.yml +production-compose.yml + +.atom diff --git a/.gitignore b/.gitignore index 64c671b9..8acb9383 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,8 @@ /.bundle # Ignore the default SQLite database. -/db/*.sqlite3 -/db/*.sqlite3-journal +/db/**/*.sqlite3 +/db/**/*.sqlite3-journal # Ignore all logfiles and tempfiles. /log/* diff --git a/config/cable.yml b/config/cable.yml index 0bbde6f7..1b9f7a47 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -5,5 +5,4 @@ test: adapter: async production: - adapter: redis - url: redis://localhost:6379/1 + adapter: async diff --git a/config/database.yml b/config/database.yml index 1c1a37ca..406b2341 100644 --- a/config/database.yml +++ b/config/database.yml @@ -22,4 +22,4 @@ test: production: <<: *default - database: db/production.sqlite3 + database: db/production/production.sqlite3 diff --git a/config/environments/development.rb b/config/environments/development.rb index 9616a76b..ca3ea189 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -33,11 +33,8 @@ Rails.application.configure do config.active_job.queue_adapter = :async - # action cable socket URI - config.action_cable.url = "ws://localhost/cable" - # allowed action cable origins - config.action_cable.allowed_request_origins = ['http://localhost'] + Rails.application.config.action_cable.disable_request_forgery_protection = true # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/config/environments/production.rb b/config/environments/production.rb index 7b2ebfbc..7ccf92cc 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -16,7 +16,7 @@ Rails.application.configure do # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.enabled = ENV['DISABLE_RAILS_SERVE_STATIC_FILES'].blank? # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier @@ -63,11 +63,11 @@ Rails.application.configure do # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false - # action cable socket URI - config.action_cable.url = "ws://#{ENV['HOSTNAME']}/cable" # TODO this should use WSS protocol - - # allowed action cable origins - config.action_cable.allowed_request_origins = ["https://#{ENV['HOSTNAME']}", "http://#{ENV['HOSTNAME']}"] + # action cable origins + unless ENV["RAILS_ACTION_CABLE_FORGERY_PROTECTION"].present? + Rails.application.config.action_cable.disable_request_forgery_protection = true + end + # config.action_cable.allowed_request_origins = ["https://#{ENV['HOSTNAME']}", "http://#{ENV['HOSTNAME']}"] # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify @@ -79,7 +79,7 @@ Rails.application.configure do # require 'syslog/logger' # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - if ENV["RAILS_LOG_TO_STDOUT"].present? + if ENV["DISABLE_RAILS_LOG_TO_STDOUT"].blank? logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) diff --git a/config/puma.rb b/config/puma.rb index c5d935d1..54db1591 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -9,7 +9,7 @@ threads threads_count, threads_count # Specifies the `port` that Puma will listen on to receive requests, default is 3000. # -port ENV.fetch("PORT") { 9292 } +port ENV.fetch("PORT") { 80 } # Specifies the `environment` that Puma will run in. #