diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78f31d17..6ac73f21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest services: postgres: - image: postgres:9.4 + image: postgres:14.5 ports: ["5432:5432"] env: POSTGRES_USER: postgres diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index ad058acc..d5ace27f 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -10,7 +10,7 @@ jobs: - name: Build docker run: docker build . - name: Test docker compose - run: docker-compose up -d + run: docker compose up -d - run: sleep 15 # wait for the server to start - name: Check server is up run: curl -s http://localhost:3000 diff --git a/Gemfile b/Gemfile index 63850688..517af7c5 100644 --- a/Gemfile +++ b/Gemfile @@ -21,7 +21,7 @@ gem 'prawn', '~> 2.5.0' gem 'prawn-table', '~> 0.2.2' gem 'pg_search', '~> 2.3.5' gem 'sidekiq', '~> 6.5' -gem 'sidekiq-cron', '~> 1.9.1' +gem 'sidekiq-cron', '~> 1.12.0' gem 'aws-sdk-s3', '~> 1.94', require: false gem 'image_processing', '~> 1.12' gem 'active_storage_validations', '~> 1.1.3' diff --git a/Gemfile.lock b/Gemfile.lock index c36831f5..4bfc2335 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,47 +1,47 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.1) - actionpack (= 7.0.8.1) - activesupport (= 7.0.8.1) + actioncable (7.0.8.5) + actionpack (= 7.0.8.5) + activesupport (= 7.0.8.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.1) - actionpack (= 7.0.8.1) - activejob (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + actionmailbox (7.0.8.5) + actionpack (= 7.0.8.5) + activejob (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8.1) - actionpack (= 7.0.8.1) - actionview (= 7.0.8.1) - activejob (= 7.0.8.1) - activesupport (= 7.0.8.1) + actionmailer (7.0.8.5) + actionpack (= 7.0.8.5) + actionview (= 7.0.8.5) + activejob (= 7.0.8.5) + activesupport (= 7.0.8.5) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.8.1) - actionview (= 7.0.8.1) - activesupport (= 7.0.8.1) + actionpack (7.0.8.5) + actionview (= 7.0.8.5) + activesupport (= 7.0.8.5) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.1) - actionpack (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + actiontext (7.0.8.5) + actionpack (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.1) - activesupport (= 7.0.8.1) + actionview (7.0.8.5) + activesupport (= 7.0.8.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -60,22 +60,22 @@ GEM kaminari (~> 1.0, >= 1.2.1) railties (>= 6.1, < 7.1) ransack (>= 2.1.1, < 4) - activejob (7.0.8.1) - activesupport (= 7.0.8.1) + activejob (7.0.8.5) + activesupport (= 7.0.8.5) globalid (>= 0.3.6) - activemodel (7.0.8.1) - activesupport (= 7.0.8.1) - activerecord (7.0.8.1) - activemodel (= 7.0.8.1) - activesupport (= 7.0.8.1) - activestorage (7.0.8.1) - actionpack (= 7.0.8.1) - activejob (= 7.0.8.1) - activerecord (= 7.0.8.1) - activesupport (= 7.0.8.1) + activemodel (7.0.8.5) + activesupport (= 7.0.8.5) + activerecord (7.0.8.5) + activemodel (= 7.0.8.5) + activesupport (= 7.0.8.5) + activestorage (7.0.8.5) + actionpack (= 7.0.8.5) + activejob (= 7.0.8.5) + activerecord (= 7.0.8.5) + activesupport (= 7.0.8.5) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.8.1) + activesupport (7.0.8.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -113,7 +113,7 @@ GEM bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) - builder (3.2.4) + builder (3.3.0) byebug (11.1.3) capybara (3.40.0) addressable @@ -124,7 +124,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) database_cleaner (2.0.2) @@ -149,8 +149,8 @@ GEM dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) - erubi (1.12.0) - et-orbi (1.2.7) + erubi (1.13.0) + et-orbi (1.2.11) tzinfo execjs (2.9.1) fabrication (2.31.0) @@ -160,8 +160,8 @@ GEM formtastic (4.0.0) actionpack (>= 5.2.0) formtastic_i18n (0.7.0) - fugit (1.9.0) - et-orbi (~> 1, >= 1.2.7) + fugit (1.11.1) + et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) gli (2.21.1) globalid (1.2.1) @@ -173,7 +173,7 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) http_accept_language (2.1.1) - i18n (1.14.1) + i18n (1.14.6) concurrent-ruby (~> 1.0) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) @@ -223,30 +223,30 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) mini_magick (4.12.0) mini_mime (1.1.5) - minitest (5.22.2) + minitest (5.25.1) msgpack (1.7.2) - net-imap (0.4.10) + net-imap (0.5.0) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol netrc (0.11.0) - nio4r (2.7.0) - nokogiri (1.16.2-arm64-darwin) + nio4r (2.7.3) + nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.2-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) parallel (1.24.0) @@ -265,29 +265,29 @@ GEM prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) public_suffix (5.0.4) - puma (6.4.2) + puma (6.4.3) nio4r (~> 2.0) pundit (2.1.1) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.7.3) - rack (2.2.8.1) + racc (1.8.1) + rack (2.2.10) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8.1) - actioncable (= 7.0.8.1) - actionmailbox (= 7.0.8.1) - actionmailer (= 7.0.8.1) - actionpack (= 7.0.8.1) - actiontext (= 7.0.8.1) - actionview (= 7.0.8.1) - activejob (= 7.0.8.1) - activemodel (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + rails (7.0.8.5) + actioncable (= 7.0.8.5) + actionmailbox (= 7.0.8.5) + actionmailer (= 7.0.8.5) + actionpack (= 7.0.8.5) + actiontext (= 7.0.8.5) + actionview (= 7.0.8.5) + activejob (= 7.0.8.5) + activemodel (= 7.0.8.5) + activerecord (= 7.0.8.5) + activestorage (= 7.0.8.5) + activesupport (= 7.0.8.5) bundler (>= 1.15.0) - railties (= 7.0.8.1) + railties (= 7.0.8.5) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -302,15 +302,15 @@ GEM rails-i18n (7.0.8) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.8.1) - actionpack (= 7.0.8.1) - activesupport (= 7.0.8.1) + railties (7.0.8.5) + actionpack (= 7.0.8.5) + activesupport (= 7.0.8.5) method_source rake (>= 12.2) thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) ransack (3.2.1) activerecord (>= 6.1.5) activesupport (>= 6.1.5) @@ -326,7 +326,8 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.6) + rexml (3.3.6) + strscan rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) @@ -387,9 +388,10 @@ GEM connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) - sidekiq-cron (1.9.1) + sidekiq-cron (1.12.0) fugit (~> 1.8) - sidekiq (>= 4.2.1) + globalid (>= 1.0.1) + sidekiq (>= 6) simple_form (5.0.3) actionpack (>= 5.0) activemodel (>= 5.0) @@ -406,7 +408,8 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - thor (1.3.1) + strscan (3.1.0) + thor (1.3.2) tilt (2.3.0) timeout (0.4.1) ttfunk (1.8.0) @@ -429,7 +432,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.13) + zeitwerk (2.7.1) PLATFORMS arm64-darwin-22 @@ -477,7 +480,7 @@ DEPENDENCIES selenium-webdriver (~> 4.16) shoulda-matchers (~> 4.4) sidekiq (~> 6.5) - sidekiq-cron (~> 1.9.1) + sidekiq-cron (~> 1.12.0) simple_form (~> 5.0.2) simplecov (~> 0.22) uglifier (~> 4.2.0) diff --git a/README.md b/README.md index 8cc6d8fb..f651abb0 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ This site is ready to be deployed in production with an optimized Docker image w You can locally test the production deployment by the include docker-compose.yml file: ```bash -docker-compose up +docker compose up ``` The first time running it will build the image and setup the database along with some seeds in it (testing data). If the database already exists, it will run migrations (if needed) and just start the application. diff --git a/config/database.yml b/config/database.yml index 55bda3ad..157dc24d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -15,8 +15,6 @@ development: test: <<: *defaults database: timeoverflow_test - host: localhost - password: <%= ENV['DATABASE_PASSWORD'] || ENV["POSTGRES_PASSWORD"] %> production: <<: *defaults diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb deleted file mode 100644 index c90629cc..00000000 --- a/config/initializers/sidekiq.rb +++ /dev/null @@ -1,5 +0,0 @@ -schedule_file = 'config/schedule.yml' - -if File.exist?(schedule_file) && Sidekiq.server? - Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) -end diff --git a/config/schedule.yml b/config/schedule.yml index 7116ad52..7e85c3d5 100644 --- a/config/schedule.yml +++ b/config/schedule.yml @@ -1,8 +1,8 @@ send_push_notifications_job: - cron: '*/5 * * * *' + cron: 'every 5 minutes' class: 'SendPushNotificationsJob' queue: cron weekly_digest: - cron: '0 9 * * 1' # every monday at 9am + cron: 'every monday at 9am' class: 'OrganizationNotifierJob' queue: cron