From 7840ef2d1238ddf64c23509fc50cb038fb699fdc Mon Sep 17 00:00:00 2001 From: Thomas Scherz Date: Thu, 19 Dec 2024 15:05:17 -0500 Subject: [PATCH] Adds OKComputer. --- Gemfile | 3 +++ Gemfile.lock | 6 ++++-- config/initializers/okcomputer.rb | 2 ++ config/routes.rb | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 config/initializers/okcomputer.rb diff --git a/Gemfile b/Gemfile index bc90bd74..389a7c86 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,9 @@ gem 'rack', '2.2.3' gem 'sidekiq-limit_fetch' gem 'willow_sword', github: 'notch8/willow_sword' +# Hyrax improvements +gem "okcomputer", "~> 1.18.4" + # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.4.6' # Use sqlite3 as the database for Active Record diff --git a/Gemfile.lock b/Gemfile.lock index 9d8300ec..b3a20471 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -770,6 +770,7 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) + okcomputer (1.18.5) omniauth (1.9.2) hashie (>= 3.4.6) rack (>= 1.6.2, < 3) @@ -1178,7 +1179,7 @@ DEPENDENCIES brakeman browse-everything (= 1.1.0) bulkrax (~> 4.3.0) - bundler (~> 1.17) + bundler (= 2.4.22) bundler-audit byebug capistrano (~> 3.10) @@ -1209,6 +1210,7 @@ DEPENDENCIES kaltura (= 0.1.1) listen (~> 3.0.5) mysql2 (~> 0.4.10) + okcomputer (~> 1.18.4) omniauth-openid omniauth-shibboleth orcid! @@ -1244,4 +1246,4 @@ DEPENDENCIES willow_sword! BUNDLED WITH - 2.1.4 + 2.4.22 diff --git a/config/initializers/okcomputer.rb b/config/initializers/okcomputer.rb new file mode 100644 index 00000000..b4fdd6bb --- /dev/null +++ b/config/initializers/okcomputer.rb @@ -0,0 +1,2 @@ +# frozen_string_literal: true +OkComputer.mount_at = false diff --git a/config/routes.rb b/config/routes.rb index e91082c5..fd038eee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,6 +26,10 @@ mount Sidekiq::Web => '/sidekiq' end + authenticate :user, ->(u) { u.admin? } do + mount OkComputer::Engine, at: "/health" + end + devise_for :users, controllers: { omniauth_callbacks: 'callbacks', registrations: "registrations" } mount Hydra::RoleManagement::Engine => '/'