From 0a967d4235c04709b7b239b9d4adf58aab319149 Mon Sep 17 00:00:00 2001 From: Didier Lafforgue Date: Sat, 14 Sep 2024 00:38:15 +0200 Subject: [PATCH] new version of Maglev + upgrade to Rails 7.2.1 + fix JS errors + deployment to a new server --- .github/workflows/deploy.yml | 2 +- .gitignore | 5 +- Gemfile | 6 +- Gemfile.lock | 205 +++++++++++----------- README.md | 13 ++ app/assets/images/{logo2.png => logo.png} | Bin app/assets/images/logo.svg | 4 - app/views/layouts/application.html.erb | 2 +- app/views/layouts/authentication.html.erb | 4 +- config/Caddyfile | 4 +- config/deploy.yml | 32 ++-- config/initializers/maglev.rb | 4 +- 12 files changed, 144 insertions(+), 137 deletions(-) rename app/assets/images/{logo2.png => logo.png} (100%) delete mode 100644 app/assets/images/logo.svg diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 803d41a..72c97d3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -88,7 +88,7 @@ jobs: - name: Install dependencies run: | - gem install kamal -v 1.3.1 + gem install kamal -v 1.8.3 - name: Run deploy command run: | diff --git a/.gitignore b/.gitignore index cc6b569..2f892d6 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,7 @@ /app/assets/builds/* !/app/assets/builds/.keep -TODO.md \ No newline at end of file +doc + +TODO.md + diff --git a/Gemfile b/Gemfile index 5737c94..80d90ec 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" ruby "3.2.3" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem "rails", "~> 7.1.2" +gem "rails", "~> 7.2.1" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem "sprockets-rails" @@ -78,11 +78,11 @@ end # 🚨 PRODUCTION gem 'maglevcms', github: 'maglevhq/maglev-core', branch: 'master', require: false -gem "maglevcms-pro", git: "https://github.com/maglevhq/maglev-pro.git", branch: 'master', require: 'maglev/pro' +# gem "maglevcms-pro", git: "https://github.com/maglevhq/maglev-pro.git", branch: 'master', require: 'maglev/pro' source 'https://packages.nocoffee.fr/private' do # MaglevCMS PRO: multi-sites, multi-themes - # gem 'maglevcms-pro', '~> 0.4.0', require: 'maglev/pro' + gem 'maglevcms-pro', '~> 0.5.0', require: 'maglev/pro' # NoCoffee UIKit to build sleek and consistent UI gem 'ncuikit', '~> 0.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index dcdb026..a882dea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,33 +1,27 @@ GIT remote: https://github.com/maglevhq/maglev-core.git - revision: c78cc97392a158abd7d51c036b9d2da571d7f32f + revision: 55cdcb08eda900b6b185728f45601bb098847e74 branch: master specs: - maglevcms (1.6.1) - jbuilder (~> 2.11.2) + maglevcms (1.7.2) + jbuilder (~> 2.12.0) kaminari (~> 1.2.1) maglev-injectable (~> 2.1.1) - rails (>= 6, < 7.2) + rails (>= 6, < 7.3) vite_rails (>= 3, < 4) vite_ruby (>= 3.5) -GIT - remote: https://github.com/maglevhq/maglev-pro.git - revision: aa73968b2177c6cb0fd71a4102c56f08f141929c - branch: master +GEM + remote: https://packages.nocoffee.fr/private/ specs: - maglevcms-pro (0.4.0) + maglevcms-pro (0.5.0) concurrent-ruby faraday haikunator (= 1.1.0) - jbuilder (~> 2.11.2) + jbuilder (~> 2.12.0) kaminari liquid (~> 5.4) rails (>= 6.1.6) - -GEM - remote: https://packages.nocoffee.fr/private/ - specs: ncuikit (0.2.1) importmap-rails (~> 2.0, >= 2.0.1) rails (>= 7.1.3.2) @@ -37,80 +31,76 @@ GEM GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + actioncable (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) + actionmailer (7.2.1) + actionpack (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.3.4) - actionview (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionpack (7.2.1) + actionview (= 7.2.1) + activesupport (= 7.2.1) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + useragent (~> 0.16) + actiontext (7.2.1) + actionpack (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.4) - activesupport (= 7.1.3.4) + actionview (7.2.1) + activesupport (= 7.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3.4) - activesupport (= 7.1.3.4) + activejob (7.2.1) + activesupport (= 7.2.1) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) + activemodel (7.2.1) + activesupport (= 7.2.1) + activerecord (7.2.1) + activemodel (= 7.2.1) + activesupport (= 7.2.1) timeout (>= 0.4.0) - activestorage (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.4) + activestorage (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activesupport (= 7.2.1) marcel (~> 1.0) - activesupport (7.1.3.4) + activesupport (7.2.1) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) base64 (0.2.0) @@ -129,7 +119,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.3.2) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) date (3.3.4) @@ -139,11 +129,11 @@ GEM drb (2.2.1) dry-cli (1.1.0) error_highlight (0.6.0) - erubi (1.12.0) - faraday (2.10.1) - faraday-net_http (>= 2.0, < 3.2) + erubi (1.13.0) + faraday (2.11.0) + faraday-net_http (>= 2.0, < 3.4) logger - faraday-net_http (3.1.1) + faraday-net_http (3.3.0) net-http ffi (1.16.3) globalid (1.2.1) @@ -160,10 +150,10 @@ GEM activesupport (>= 6.0.0) railties (>= 6.0.0) io-console (0.7.2) - irb (1.13.1) + irb (1.14.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - jbuilder (2.11.5) + jbuilder (2.12.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) kaminari (1.2.2) @@ -179,7 +169,7 @@ GEM kaminari-core (= 1.2.2) kaminari-core (1.2.2) liquid (5.5.1) - logger (1.6.0) + logger (1.6.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -194,12 +184,11 @@ GEM method_source (1.1.0) mini_magick (4.12.0) mini_mime (1.1.5) - minitest (5.23.1) + minitest (5.25.1) msgpack (1.7.2) - mutex_m (0.2.0) net-http (0.4.1) uri - net-imap (0.4.12) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) @@ -209,17 +198,17 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.5-aarch64-linux) + nokogiri (1.16.7-aarch64-linux) racc (~> 1.4) - nokogiri (1.16.5-arm-linux) + nokogiri (1.16.7-arm-linux) racc (~> 1.4) - nokogiri (1.16.5-arm64-darwin) + nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86-linux) + nokogiri (1.16.7-x86-linux) racc (~> 1.4) - nokogiri (1.16.5-x86_64-darwin) + nokogiri (1.16.7-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) pg (1.5.4) psych (5.1.2) @@ -227,8 +216,8 @@ GEM public_suffix (5.0.4) puma (6.4.2) nio4r (~> 2.0) - racc (1.8.0) - rack (3.0.11) + racc (1.8.1) + rack (3.1.7) rack-proxy (0.7.7) rack rack-session (2.0.0) @@ -238,20 +227,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + rails (7.2.1) + actioncable (= 7.2.1) + actionmailbox (= 7.2.1) + actionmailer (= 7.2.1) + actionpack (= 7.2.1) + actiontext (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activemodel (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) bundler (>= 1.15.0) - railties (= 7.1.3.4) + railties (= 7.2.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -259,10 +248,10 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) - irb + railties (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -276,12 +265,13 @@ GEM redis-client (0.19.1) connection_pool regexp_parser (2.9.0) - reline (0.5.8) + reline (0.5.10) io-console (~> 0.5) rexml (3.2.6) ruby-vips (2.2.1) ffi (~> 1.12) rubyzip (2.3.2) + securerandom (0.3.1) selenium-webdriver (4.17.0) base64 (~> 0.2) rexml (~> 3.2, >= 3.2.5) @@ -296,7 +286,7 @@ GEM sprockets (>= 3.0.0) stimulus-rails (1.3.3) railties (>= 6.0.0) - stringio (3.1.0) + stringio (3.1.1) tailwindcss-rails (2.3.0) railties (>= 6.0.0) tailwindcss-rails (2.3.0-aarch64-linux) @@ -309,7 +299,7 @@ GEM railties (>= 6.0.0) tailwindcss-rails (2.3.0-x86_64-linux) railties (>= 6.0.0) - thor (1.3.1) + thor (1.3.2) timeout (0.4.1) turbo-rails (1.5.0) actionpack (>= 6.0.0) @@ -317,7 +307,8 @@ GEM railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uri (0.13.0) + uri (0.13.1) + useragent (0.16.10) view_component (3.12.1) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) @@ -325,7 +316,7 @@ GEM vite_rails (3.0.17) railties (>= 5.1, < 8) vite_ruby (~> 3.0, >= 3.2.2) - vite_ruby (3.8.0) + vite_ruby (3.8.2) dry-cli (>= 0.7, < 2) rack-proxy (~> 0.6, >= 0.6.1) zeitwerk (~> 2.2) @@ -341,7 +332,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.15) + zeitwerk (2.6.18) PLATFORMS aarch64-linux @@ -362,11 +353,11 @@ DEPENDENCIES importmap-rails jbuilder maglevcms! - maglevcms-pro! + maglevcms-pro (~> 0.5.0)! ncuikit (~> 0.2.1)! pg (~> 1.1) puma (>= 5.0) - rails (~> 7.1.2) + rails (~> 7.2.1) redcarpet (~> 3.6) redis (>= 4.0.1) selenium-webdriver diff --git a/README.md b/README.md index 9328b69..d2c5706 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,19 @@ bundle exec rails db:migrate ./bin/dev ``` +### Kamal + +On the server + +``` +docker network create --driver bridge private +``` + +``` +mkdir -p /var/local/data/storage +chown 1000:1000 /var/local/data/storage +``` + ## License The source code of this application without the Maglev PRO gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/app/assets/images/logo2.png b/app/assets/images/logo.png similarity index 100% rename from app/assets/images/logo2.png rename to app/assets/images/logo.png diff --git a/app/assets/images/logo.svg b/app/assets/images/logo.svg deleted file mode 100644 index 959b575..0000000 --- a/app/assets/images/logo.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d45c494..f008119 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -31,7 +31,7 @@
<%= link_to sites_path, class: 'flex flex-shrink-0 items-center' do %> - <%= image_tag "logo2.png", class: 'h-8', alt: 'Website Builder demo' %> + <%= image_tag "logo.png", class: 'h-8', alt: 'Website Builder demo' %> <% end %> <%= render 'shared/menu' %> diff --git a/app/views/layouts/authentication.html.erb b/app/views/layouts/authentication.html.erb index 595973d..797580d 100644 --- a/app/views/layouts/authentication.html.erb +++ b/app/views/layouts/authentication.html.erb @@ -15,6 +15,8 @@ <%= javascript_import_module_tag "ncuikit/application" %> + <%= javascript_include_tag "activestorage" %> +