diff --git a/.env.example b/.env.example index 16075c2b..7e808735 100644 --- a/.env.example +++ b/.env.example @@ -12,7 +12,7 @@ DATABASE_USER=postgres DATABASE_NAME=timeoverflow_development -#RAILS CONFIG +# Rails settings RAILS_LOG_LEVEL=debug STORAGE_PROVIDER=amazon FORCE_SSL=true diff --git a/Gemfile b/Gemfile index 09e9249b..e8cf4a93 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ source 'https://rubygems.org' gem 'rails', '~> 7.0.8' gem 'rails-i18n', '~> 7.0' +gem 'puma', '~> 6.4' gem 'rdiscount', '~> 2.2.7' gem 'rubyzip', '~> 2.3.0' gem 'activeadmin', '~> 2.14' @@ -18,6 +19,7 @@ gem 'simple_form', '~> 5.0.2' gem 'rollbar', '~> 3.4' gem 'prawn', '~> 2.4.0' gem 'prawn-table', '~> 0.2.2' +gem 'matrix', '~> 0.4.1' # Ruby 3.1+ support for Prawn, see more: https://github.com/prawnpdf/prawn/issues/1195 gem 'pg_search', '~> 2.3.5' gem 'skylight', '~> 6.0' gem 'sidekiq', '~> 6.5' @@ -25,8 +27,6 @@ gem 'sidekiq-cron', '~> 1.9.1' gem 'aws-sdk-s3', '~> 1.94', require: false gem 'image_processing', '~> 1.12' gem 'active_storage_validations', '~> 1.1.3' -gem "puma", ">= 5.0.0" -gem 'matrix', '~> 0.4.1' # Assets gem 'jquery-rails', '~> 4.4.0' diff --git a/Gemfile.lock b/Gemfile.lock index b0d22f46..5c5ca68d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -228,7 +228,7 @@ GEM mime-types-data (3.2023.1205) mini_magick (4.12.0) mini_mime (1.1.5) - minitest (5.22.0) + minitest (5.22.2) msgpack (1.7.2) net-imap (0.4.10) date @@ -241,6 +241,8 @@ GEM net-protocol netrc (0.11.0) nio4r (2.7.0) + nokogiri (1.16.2-arm64-darwin) + racc (~> 1.4) nokogiri (1.16.2-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) @@ -425,9 +427,10 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.12) + zeitwerk (2.6.13) PLATFORMS + arm64-darwin-22 x86_64-linux DEPENDENCIES @@ -457,7 +460,7 @@ DEPENDENCIES pg_search (~> 2.3.5) prawn (~> 2.4.0) prawn-table (~> 0.2.2) - puma (>= 5.0.0) + puma (~> 6.4) pundit (~> 2.1.0) rails (~> 7.0.8) rails-controller-testing diff --git a/README.md b/README.md index 97bbc62e..bbb7da7a 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,8 @@ In order to configure the application you can use the following ENV variables: | `WEB_CONCURRENCY` | Number of web server processes to use | `2` | | `RUN_SIDEKIQ` | Run Sidekiq worker process in the docker instance (you might want to change this if want to run different docker instances for Sidekiq and Rails) | `true` | | `RUN_RAILS` | Run Rails web server process in the docker instance | `true` | -| `QUEUE_ADAPTER` | Adapter to use for background jobs (currently the application is using exclusively Sidekiq, so no other options here right now) | `sidekiq` | | `SIDEKIQ_CONCURRENCY` | Number of threads to use in Sidekiq | `5` | -| `STORAGE_PROVIDER` | Storage provider for the application (currently the application supports `local` and `amazon`) | `local` | +| `STORAGE_PROVIDER` | Storage provider for the application (currently the application supports `local` and `amazon`) | `amazon` | | `FORCE_SSL` | Force SSL connections | `false` | | `MAIL_LINK_HOST` | Host to use in the links sent by email (use your domain without protocol `mydomain.tld`) | | | `MAIL_LINK_PROTOCOL` | Protocol to use in the previous host defined for links sent by email | `https` | diff --git a/config/application.rb b/config/application.rb index b53ef22c..4a952c9c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,6 +23,9 @@ class Application < Rails::Application # SKYLIGHT_AUTHENTICATION env var for this to work. config.skylight.environments += ["staging"] + # ActiveJob configuration + config.active_job.queue_adapter = :sidekiq + # Use db/structure.sql with SQL as schema format # This is needed to store in the schema SQL statements not covered by the ORM config.active_record.schema_format = :sql diff --git a/config/environments/production.rb b/config/environments/production.rb index 5e21ce38..cb2154fd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,7 +46,7 @@ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = ENV.fetch("STORAGE_PROVIDER", :local) + config.active_storage.service = ENV.fetch("STORAGE_PROVIDER", :amazon) # Mount Action Cable outside main process or domain. # config.action_cable.mount_path = nil @@ -71,7 +71,7 @@ # config.cache_store = :mem_cache_store # Use a real queuing backend for Active Job (and separate queues per environment). - config.active_job.queue_adapter = :sidekiq + # config.active_job.queue_adapter = :sidekiq # config.active_job.queue_name_prefix = "timeoverflow_production" config.action_mailer.perform_caching = false