From 64aed2b44eee1ba1916d4946a30e38ab830c74cd Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 2 Dec 2024 09:57:27 -0500 Subject: [PATCH 1/8] Add deployment gems --- Gemfile | 5 +++ Gemfile.lock | 56 ++++++++++++++++++++---------- app/views/front/dashboard.html.erb | 2 +- 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/Gemfile b/Gemfile index 3edb5c9..a138ad8 100644 --- a/Gemfile +++ b/Gemfile @@ -120,3 +120,8 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] + +gem 'bcrypt_pbkdf', '~> 1.0', '>= 1.0.0' +gem 'ed25519', '~> 1.2', '>= 1.2.4' +gem 'net-ssh', '>= 6.0.0' + diff --git a/Gemfile.lock b/Gemfile.lock index 099d7cc..bea35c5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -69,6 +69,9 @@ GEM execjs (~> 2) base64 (0.2.0) bcrypt (3.1.20) + bcrypt_pbkdf (1.1.1) + bcrypt_pbkdf (1.1.1-arm64-darwin) + bcrypt_pbkdf (1.1.1-x86_64-darwin) bigdecimal (3.1.8) bindex (0.8.1) bootsnap (1.18.4) @@ -118,7 +121,7 @@ GEM concurrent-ruby (1.3.4) crass (1.0.6) csv (3.3.0) - date (3.4.0) + date (3.4.1) devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -132,6 +135,7 @@ GEM dotenv (= 3.1.4) railties (>= 6.1) drb (2.2.1) + ed25519 (1.3.0) erubi (1.13.0) execjs (2.10.0) factory_bot (6.5.0) @@ -140,11 +144,15 @@ GEM factory_bot (~> 6.5) railties (>= 5.0.0) ffi (1.17.0-aarch64-linux-gnu) + ffi (1.17.0-aarch64-linux-musl) ffi (1.17.0-arm-linux-gnu) + ffi (1.17.0-arm-linux-musl) ffi (1.17.0-arm64-darwin) ffi (1.17.0-x86-linux-gnu) + ffi (1.17.0-x86-linux-musl) ffi (1.17.0-x86_64-darwin) ffi (1.17.0-x86_64-linux-gnu) + ffi (1.17.0-x86_64-linux-musl) globalid (1.2.1) activesupport (>= 6.1) gritter (1.2.0) @@ -159,7 +167,7 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.7.6) + json (2.8.2) language_server-protocol (3.17.0.3) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) @@ -176,14 +184,13 @@ GEM matrix (0.4.2) method_source (1.1.0) mini_mime (1.1.5) - minitest (5.25.1) - msgpack (1.7.3) + minitest (5.25.2) + msgpack (1.7.5) mysql2 (0.5.6) - net-imap (0.5.0) + net-imap (0.5.1) date net-protocol net-pop (0.1.2) - net-protocol net-protocol (0.2.2) timeout net-scp (4.0.0) @@ -207,16 +214,16 @@ GEM nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) - ostruct (0.6.0) + ostruct (0.6.1) parallel (1.26.3) - parser (3.3.5.1) + parser (3.3.6.0) ast (~> 2.4.1) racc petergate (3.0.0) activerecord (> 4.0.0) popper_js (2.11.8) public_suffix (6.0.1) - puma (6.4.3) + puma (6.5.0) nio4r (~> 2.0) racc (1.8.1) rack (2.2.10) @@ -260,8 +267,8 @@ GEM rb-inotify (0.11.1) ffi (~> 1.0) rb-readline (0.5.5) - recaptcha (5.17.0) - regexp_parser (2.9.2) + recaptcha (5.17.1) + regexp_parser (2.9.3) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) @@ -285,17 +292,17 @@ GEM rspec-support (3.13.1) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.68.0) + rubocop (1.69.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + rubocop-ast (>= 1.36.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.34.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.36.2) parser (>= 3.3.1.0) rubocop-rails (2.27.0) activesupport (>= 4.2.0) @@ -365,7 +372,7 @@ GEM ostruct thor (1.3.2) tilt (2.4.0) - timeout (0.4.1) + timeout (0.4.2) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -373,7 +380,9 @@ GEM concurrent-ruby (~> 1.0) uglifier (4.2.1) execjs (>= 0.3.0, < 3) - unicode-display_width (2.6.0) + unicode-display_width (3.1.2) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.1) @@ -391,13 +400,22 @@ GEM PLATFORMS aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl arm-linux + arm-linux-gnu + arm-linux-musl arm64-darwin x86-linux + x86-linux-gnu + x86-linux-musl x86_64-darwin x86_64-linux + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES + bcrypt_pbkdf (~> 1.0, >= 1.0.0) bigdecimal bootsnap (>= 1.1.0) bootstrap (~> 5.3.3) @@ -416,6 +434,7 @@ DEPENDENCIES devise dotenv-rails drb + ed25519 (~> 1.2, >= 1.2.4) factory_bot_rails gritter groupdate @@ -425,6 +444,7 @@ DEPENDENCIES mysql2 net-pop (~> 0.1.2) net-protocol + net-ssh (>= 6.0.0) nokogiri (>= 1.16.5) petergate puma (>= 6.4.3) @@ -456,4 +476,4 @@ RUBY VERSION ruby 3.3.3p89 BUNDLED WITH - 2.5.11 + 2.5.23 diff --git a/app/views/front/dashboard.html.erb b/app/views/front/dashboard.html.erb index 43cb451..4103c26 100644 --- a/app/views/front/dashboard.html.erb +++ b/app/views/front/dashboard.html.erb @@ -6,7 +6,7 @@
<% if @indesign_count != 0 %> - +
-
<%= sortable "title", "Software Record" %> From 518e913ad9fa7acae6ccaf1dd2d72f9480ca3505 Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 2 Dec 2024 10:09:54 -0500 Subject: [PATCH 2/8] Update Uglifier gem --- Gemfile | 6 +++++- Gemfile.lock | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index a138ad8..e0ca7ce 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ gem 'sass-rails', '~> 5.0' # Use Devise for authentication gem 'devise' # Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 1.3.0' +gem 'uglifier', '~> 2.7', '>= 2.7.2' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby # Use CoffeeScript for .coffee assets and views @@ -121,7 +121,11 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] +# Required by net-ssh for supporting ssh-ed25519 keys during deployment gem 'bcrypt_pbkdf', '~> 1.0', '>= 1.0.0' gem 'ed25519', '~> 1.2', '>= 1.2.4' gem 'net-ssh', '>= 6.0.0' +# Required for mutex_m since Ruby 3.4.0 will not include it by default +gem 'mutex_m' + diff --git a/Gemfile.lock b/Gemfile.lock index bea35c5..10b9e53 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -186,6 +186,7 @@ GEM mini_mime (1.1.5) minitest (5.25.2) msgpack (1.7.5) + mutex_m (0.3.0) mysql2 (0.5.6) net-imap (0.5.1) date @@ -378,8 +379,9 @@ GEM turbolinks-source (5.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (4.2.1) - execjs (>= 0.3.0, < 3) + uglifier (2.7.2) + execjs (>= 0.3.0) + json (>= 1.8.0) unicode-display_width (3.1.2) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) @@ -441,6 +443,7 @@ DEPENDENCIES jbuilder (~> 2.5) jquery-rails listen (>= 3.0.5, < 3.2) + mutex_m mysql2 net-pop (~> 0.1.2) net-protocol @@ -469,7 +472,7 @@ DEPENDENCIES sqlite3 (~> 1.4) turbolinks (~> 5) tzinfo-data - uglifier (>= 1.3.0) + uglifier (~> 2.7, >= 2.7.2) web-console (>= 3.3.0) RUBY VERSION From 5cb2a299d79c5d76acd3c7d31adbdd62de56a001 Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 2 Dec 2024 10:14:08 -0500 Subject: [PATCH 3/8] Update Uglifier gem to >=4.2.1 --- Gemfile | 2 +- Gemfile.lock | 7 +++---- config/deploy/qa.rb | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index e0ca7ce..2b9b6ca 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ gem 'sass-rails', '~> 5.0' # Use Devise for authentication gem 'devise' # Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '~> 2.7', '>= 2.7.2' +gem 'uglifier', '~> 4.2', '>= 4.2.1' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby # Use CoffeeScript for .coffee assets and views diff --git a/Gemfile.lock b/Gemfile.lock index 10b9e53..0ab5f00 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -379,9 +379,8 @@ GEM turbolinks-source (5.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) + uglifier (4.2.1) + execjs (>= 0.3.0, < 3) unicode-display_width (3.1.2) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) @@ -472,7 +471,7 @@ DEPENDENCIES sqlite3 (~> 1.4) turbolinks (~> 5) tzinfo-data - uglifier (~> 2.7, >= 2.7.2) + uglifier (~> 4.2, >= 4.2.1) web-console (>= 3.3.0) RUBY VERSION diff --git a/config/deploy/qa.rb b/config/deploy/qa.rb index 63cc16f..64ccd57 100644 --- a/config/deploy/qa.rb +++ b/config/deploy/qa.rb @@ -2,7 +2,7 @@ set :rails_env, :production set :bundle_without, %w[development test].join(' ') -set :branch, 'qa' +set :branch, 'fix_qa_deploy_via_capistrano' set :default_env, path: '$PATH:/usr/local/bin' set :bundle_path, -> { shared_path.join('vendor/bundle') } append :linked_dirs, 'tmp', 'log' From 091a2f5396120ba701e5ef695174809f8a1a9513 Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 2 Dec 2024 10:59:56 -0500 Subject: [PATCH 4/8] WIP --- .env.development | 41 +++++++++++++++++---------- .gitignore | 6 +++- app/assets/javascripts/application.js | 2 +- bin/yarn | 11 ------- config/deploy.rb | 2 +- package.json | 5 ---- 6 files changed, 33 insertions(+), 34 deletions(-) delete mode 100755 bin/yarn delete mode 100644 package.json diff --git a/.env.development b/.env.development index d257f5f..52dd549 100644 --- a/.env.development +++ b/.env.development @@ -1,20 +1,31 @@ -APP_PORTFOLIO_DEVISE_KEY = "04df95945691e59c493829316335a454f1b50706a68a2c9ae1fe0084c62d98acc8d1166b984b43beec108b3f756f7c27308f0451b0031ff085e674125639ffe7" +#reCaptcha settings +APP_PORTFOLIO_reCAPTCHA_SITE_KEY=6Lf0bwAVAAAAANKF5ZbjqY-2wTO2HhOnBePLqf3z +APP_PORTFOLIO_reCAPTCHA_SECRET_KEY=6Lf0bwAVAAAAAC9ypnph7cVrCVKxoGvYniMSSll4 + +# Admin Variables +ADMIN_USERNAME=manager +ADMIN_PASSWORD=Pub1ication$ + +# Mail Variables +MAIL_SENDER='Melissa Norris ' # Database settings -APP_PORTFOLIO_DATABASE_ADAPTER=sqlite3 -APP_PORTFOLIO_DATABASE_HOST= -APP_PORTFOLIO_DATABASE_NAME=db/development.sqlite3 -APP_PORTFOLIO_DATABASE_PASSWORD= -APP_PORTFOLIO_DATABASE_POOL=5 -APP_PORTFOLIO_DATABASE_PORT= -APP_PORTFOLIO_DATABASE_TIMEOUT=5000 -APP_PORTFOLIO_DATABASE_USERNAME= +AAEC_DATABASE_ADAPTER=mysql2 +AAEC_DATABASE_HOST=libitdbtest.libraries.uc.edu +AAEC_DATABASE_NAME=lotm +AAEC_DATABASE_PASSWORD=Y9joPskKX2 +AAEC_DATABASE_POOL=5 +AAEC_DATABASE_PORT= +AAEC_DATABASE_TIMEOUT=5000 +AAEC_DATABASE_USERNAME=lotm_admin -APP_PORTFOLIO_PRODUCTION_MAILER_URL=localhost:3000 +RAILS_ENV=production +RAILS_RELATIVE_URL_ROOT=/aaec +RAILS_MASTER_KEY=4e9a1edbef0e3a45e650d99d7912c9d6 -#reCaptcha settings -APP_PORTFOLIO_reCAPTCHA_SITE_KEY="" -APP_PORTFOLIO_reCAPTCHA_SECRET_KEY="" +# Publication year +AAEC_PUBLICATION_YEAR_START="January 2020" +AAEC_PUBLICATION_YEAR_END="December 2020" -#mailer settings -MAIL_SMTP_ADDRESS='localhost' +# Expiration Date +EXPIRATION_DATE="Jul 15 2021" \ No newline at end of file diff --git a/.gitignore b/.gitignore index cd1fddc..44e357c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,7 @@ /coverage # Ignore yarn.lock auto-generated file -yarn.lock +#yarn.lock # Ignore .DS_Store files generated in MAC OS .DS_Store @@ -51,3 +51,7 @@ yarn.lock #Ignore Rubymine files .idea/ + +# Ignore production .env files +.env.production +.env.production.local \ No newline at end of file diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b909f6c..a447c5a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,7 +12,7 @@ // //= require rails-ujs //= require jquery3 -//= require bootstrap-sprockets +//= require bootstrap //= require gritter //= require activestorage //= require turbolinks diff --git a/bin/yarn b/bin/yarn deleted file mode 100755 index 4cac416..0000000 --- a/bin/yarn +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -APP_ROOT = File.expand_path('..', __dir__) -Dir.chdir(APP_ROOT) do - exec 'yarnpkg', *ARGV -rescue Errno::ENOENT - warn 'Yarn executable was not detected in the system.' - warn 'Download Yarn at https://yarnpkg.com/en/docs/install' - exit 1 -end diff --git a/config/deploy.rb b/config/deploy.rb index 13722a8..bcb0b14 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -62,7 +62,7 @@ WARN ask :value, "Sure you want to continue deploying `#{branch}` on #{stage}? (Y)" - if fetch(:value) != 'Y' + if fetch(:value).to_s.downcase != 'y' puts "\nDeploy cancelled!" exit end diff --git a/package.json b/package.json deleted file mode 100644 index 38f1827..0000000 --- a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "application_portfolio", - "private": true, - "dependencies": {} -} From a7e396a9fd7087e642a219b4cfc2850d37da82bf Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 2 Dec 2024 12:07:04 -0500 Subject: [PATCH 5/8] WIP add more tracing capabilities --- app/views/front/dashboard.html.erb | 2 +- config/deploy.rb | 18 ++++++++++++++++++ config/environments/production.rb | 10 +++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/app/views/front/dashboard.html.erb b/app/views/front/dashboard.html.erb index 4103c26..089255f 100644 --- a/app/views/front/dashboard.html.erb +++ b/app/views/front/dashboard.html.erb @@ -28,7 +28,7 @@ <% end %> Status<%= sortable "production_url", "URL" %> + <%= sortable "production_url", "URL" %> <% if params[:direction] == "asc" || params[:direction] == nil %> <% else %> diff --git a/config/deploy.rb b/config/deploy.rb index bcb0b14..b0fcc4a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -69,6 +69,24 @@ end end +Rake::Task["deploy:assets:precompile"].clear_actions + +namespace :deploy do + namespace :assets do + desc 'Precompile assets locally and then rsync to web servers' + task :precompile do + on roles(fetch(:assets_roles)) do + within release_path do + with rails_env: fetch(:rails_env) do + execute :bundle, 'exec rake assets:precompile --trace' + end + end + end + end + end +end + + Capistrano::DSL.stages.each do |stage| after stage, 'deploy:confirmation' end diff --git a/config/environments/production.rb b/config/environments/production.rb index 7d6f22b..dbbbf21 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -112,5 +112,13 @@ config.active_record.dump_schema_after_migration = false # Change the Uglifier parsing engine - config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.js_compressor = Uglifier.new( + harmony: true, + mangle: false, + compress: false, + output: { + beautify: true, + comments: :all + } + ) end From 0eb3407481d0a596a0a5a7f208cda7952a88c055 Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 2 Dec 2024 12:10:13 -0500 Subject: [PATCH 6/8] WIP --- config/deploy.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index b0fcc4a..dc4a46c 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -71,20 +71,20 @@ Rake::Task["deploy:assets:precompile"].clear_actions -namespace :deploy do - namespace :assets do - desc 'Precompile assets locally and then rsync to web servers' - task :precompile do - on roles(fetch(:assets_roles)) do - within release_path do - with rails_env: fetch(:rails_env) do - execute :bundle, 'exec rake assets:precompile --trace' - end - end - end - end - end -end +# namespace :deploy do +# namespace :assets do +# desc 'Precompile assets locally and then rsync to web servers' +# task :precompile do +# on roles(fetch(:assets_roles)) do +# within release_path do +# with rails_env: fetch(:rails_env) do +# execute :bundle, 'exec rake assets:precompile --trace' +# end +# end +# end +# end +# end +# end Capistrano::DSL.stages.each do |stage| From f9fb5d2ff589a5a75b9594287d76b7eadf0d2580 Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 2 Dec 2024 12:11:22 -0500 Subject: [PATCH 7/8] WIP --- config/deploy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index dc4a46c..300916f 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -69,7 +69,7 @@ end end -Rake::Task["deploy:assets:precompile"].clear_actions +# Rake::Task["deploy:assets:precompile"].clear_actions # namespace :deploy do # namespace :assets do From 3407fa7dbecda9393fb7121d18a7da5905e6321f Mon Sep 17 00:00:00 2001 From: Janell-Huyck Date: Mon, 2 Dec 2024 12:12:19 -0500 Subject: [PATCH 8/8] WIP - deploying --- config/deploy.rb | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index 300916f..bcb0b14 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -69,24 +69,6 @@ end end -# Rake::Task["deploy:assets:precompile"].clear_actions - -# namespace :deploy do -# namespace :assets do -# desc 'Precompile assets locally and then rsync to web servers' -# task :precompile do -# on roles(fetch(:assets_roles)) do -# within release_path do -# with rails_env: fetch(:rails_env) do -# execute :bundle, 'exec rake assets:precompile --trace' -# end -# end -# end -# end -# end -# end - - Capistrano::DSL.stages.each do |stage| after stage, 'deploy:confirmation' end