From 462289d6ef42b0d287bba8fe5fcd5244afc2c8b1 Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Mon, 19 Sep 2022 07:58:17 +0200 Subject: [PATCH 1/3] Update to Rails 7 Signed-off-by: Mateusz Gozdek --- Gemfile | 5 +- Gemfile.lock | 220 ++++++++++++++++++++++++++++----------------------- 2 files changed, 123 insertions(+), 102 deletions(-) diff --git a/Gemfile b/Gemfile index fee92c8..7ca25ca 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 6.1' +gem 'rails', '~> 7.0' # Use sqlite3 as the database for Active Record gem 'sqlite3', '~> 1.4' # Use Puma as the app server @@ -78,3 +78,6 @@ gem 'oj_mimic_json' gem 'activerecord-import' gem "rdoc", "~> 6.4" + +gem "strscan", "3.0.1" +gem "stringio", "3.0.1" diff --git a/Gemfile.lock b/Gemfile.lock index 7009bd3..60419d6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,89 +19,96 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.1.4.4) - actionpack (= 6.1.4.4) - activesupport (= 6.1.4.4) + actioncable (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.4.4) - actionpack (= 6.1.4.4) - activejob (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + actionmailbox (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) mail (>= 2.7.1) - actionmailer (6.1.4.4) - actionpack (= 6.1.4.4) - actionview (= 6.1.4.4) - activejob (= 6.1.4.4) - activesupport (= 6.1.4.4) + net-imap + net-pop + net-smtp + actionmailer (7.0.4) + actionpack (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activesupport (= 7.0.4) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.4.4) - actionview (= 6.1.4.4) - activesupport (= 6.1.4.4) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.4) + actionview (= 7.0.4) + activesupport (= 7.0.4) + rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.4.4) - actionpack (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + actiontext (7.0.4) + actionpack (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.4.4) - activesupport (= 6.1.4.4) + actionview (7.0.4) + activesupport (= 7.0.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_model_serializers (0.10.12) - actionpack (>= 4.1, < 6.2) - activemodel (>= 4.1, < 6.2) + active_model_serializers (0.10.13) + actionpack (>= 4.1, < 7.1) + activemodel (>= 4.1, < 7.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (6.1.4.4) - activesupport (= 6.1.4.4) + activejob (7.0.4) + activesupport (= 7.0.4) globalid (>= 0.3.6) - activemodel (6.1.4.4) - activesupport (= 6.1.4.4) - activerecord (6.1.4.4) - activemodel (= 6.1.4.4) - activesupport (= 6.1.4.4) - activerecord-import (1.3.0) + activemodel (7.0.4) + activesupport (= 7.0.4) + activerecord (7.0.4) + activemodel (= 7.0.4) + activesupport (= 7.0.4) + activerecord-import (1.4.0) activerecord (>= 4.2) - activestorage (6.1.4.4) - actionpack (= 6.1.4.4) - activejob (= 6.1.4.4) - activerecord (= 6.1.4.4) - activesupport (= 6.1.4.4) - marcel (~> 1.0.0) + activestorage (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activesupport (= 7.0.4) + marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.4.4) + activesupport (7.0.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) - bcrypt (3.1.16) + bcrypt (3.1.18) builder (3.2.4) - bullet (7.0.0) + bullet (7.0.3) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) case_transform (0.2) activesupport - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) crass (1.0.6) - erubi (1.10.0) - ffi (1.15.4) + digest (3.1.0) + erubi (1.11.0) + ffi (1.15.5) globalid (1.0.0) activesupport (>= 5.0) - i18n (1.8.11) + i18n (1.12.0) concurrent-ruby (~> 1.0) - io-console (0.5.9) + io-console (0.5.11) irb (1.4.1) reline (>= 0.3.0) jbuilder (2.11.5) @@ -112,11 +119,11 @@ GEM listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - lol_dba (2.2.0) - actionpack (>= 3.0, < 7.0) - activerecord (>= 3.0, < 7.0) - railties (>= 3.0, < 7.0) - loofah (2.13.0) + lol_dba (2.4.0) + actionpack + activerecord + railties + loofah (2.19.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) @@ -124,62 +131,76 @@ GEM marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) - mini_portile2 (2.7.1) + mini_portile2 (2.8.0) minitest (5.10.3) multi_json (1.15.0) + net-imap (0.2.3) + digest + net-protocol + strscan + net-pop (0.1.1) + digest + net-protocol + timeout + net-protocol (0.1.3) + timeout + net-smtp (0.3.1) + digest + net-protocol + timeout nio4r (2.5.8) - nokogiri (1.12.5-x86_64-linux) + nokogiri (1.13.8-x86_64-linux) racc (~> 1.4) - oj (3.13.10) + oj (3.13.21) oj_mimic_json (1.0.1) - paper_trail (12.1.0) + paper_trail (13.0.0) activerecord (>= 5.2) request_store (~> 1.1) - psych (4.0.3) + psych (4.0.5) stringio - puma (4.3.10) + puma (4.3.12) nio4r (~> 2.0) racc (1.6.0) - rack (2.2.3) + rack (2.2.4) rack-cors (1.1.1) rack (>= 2.0.0) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (6.1.4.4) - actioncable (= 6.1.4.4) - actionmailbox (= 6.1.4.4) - actionmailer (= 6.1.4.4) - actionpack (= 6.1.4.4) - actiontext (= 6.1.4.4) - actionview (= 6.1.4.4) - activejob (= 6.1.4.4) - activemodel (= 6.1.4.4) - activerecord (= 6.1.4.4) - activestorage (= 6.1.4.4) - activesupport (= 6.1.4.4) + rack-test (2.0.2) + rack (>= 1.3) + rails (7.0.4) + actioncable (= 7.0.4) + actionmailbox (= 7.0.4) + actionmailer (= 7.0.4) + actionpack (= 7.0.4) + actiontext (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activemodel (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) bundler (>= 1.15.0) - railties (= 6.1.4.4) - sprockets-rails (>= 2.0.0) + railties (= 7.0.4) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) + rails-html-sanitizer (1.4.3) loofah (~> 2.3) - railties (6.1.4.4) - actionpack (= 6.1.4.4) - activesupport (= 6.1.4.4) + railties (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) method_source - rake (>= 0.13) + rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rake (13.0.6) - rb-fsevent (0.11.0) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rdoc (6.4.0) psych (>= 4.0.0) - reline (0.3.0) + reline (0.3.1) io-console (~> 0.5) - request_store (1.5.0) + request_store (1.5.1) rack (>= 1.4) simple_enum (2.3.2) activesupport (>= 4.0.0) @@ -187,24 +208,19 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.0.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - sqlite3 (1.4.2) + sqlite3 (1.5.0-x86_64-linux) stringio (3.0.1) + strscan (3.0.1) table_print (1.5.7) - thor (1.1.0) - tzinfo (2.0.4) + thor (1.2.1) + timeout (0.3.0) + tzinfo (2.0.5) concurrent-ruby (~> 1.0) - uniform_notifier (1.14.2) + uniform_notifier (1.16.0) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.5.2) + zeitwerk (2.6.0) PLATFORMS x86_64-linux @@ -229,13 +245,15 @@ DEPENDENCIES puma (~> 4.3) query_trail! rack-cors - rails (~> 6.1) + rails (~> 7.0) rdoc (~> 6.4) simple_enum spring spring-watcher-listen (~> 2.0.0) sqlite3 (~> 1.4) + stringio (= 3.0.1) + strscan (= 3.0.1) table_print BUNDLED WITH - 2.3.1 + 2.3.7 From 4834584ee4af74089f3c511c7a1d7d58b301f60d Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Mon, 19 Sep 2022 07:58:33 +0200 Subject: [PATCH 2/3] docker/nginx.conf: use Ruby 3.0 Signed-off-by: Mateusz Gozdek --- docker/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/nginx.conf b/docker/nginx.conf index a195594..7ee8a72 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -3,7 +3,7 @@ server { root /home/app/public; passenger_enabled on; passenger_user app; - passenger_ruby /usr/bin/ruby2.6; + passenger_ruby /usr/bin/ruby; passenger_env_var SECRET_KEY_BASE REPLACEME; passenger_min_instances 1; } From 4a56bc1abc9b1b96220057e9f902a57a3dcc84a2 Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Mon, 19 Sep 2022 07:58:54 +0200 Subject: [PATCH 3/3] docker-compose.yml: initial commit So it is easy to run contenerized version of API locally. Signed-off-by: Mateusz Gozdek --- docker-compose.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..18893e0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3.9" +services: + api: + build: . + ports: + - 3000:80 + environment: + SECRET_KEY_BASE: REPLACEME + volumes: + - ./db:/home/app/db