hyrax 5.1.0.pre.beta1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dassie/.env +4 -0
- data/.dassie/Gemfile +11 -6
- data/.dassie/app/controllers/application_controller.rb +4 -0
- data/.dassie/app/helpers/hyrax_helper.rb +4 -0
- data/.dassie/app/models/ability.rb +4 -0
- data/.dassie/app/models/user.rb +11 -0
- data/.dassie/app/views/shared/_footer.html.erb +17 -0
- data/.dassie/config/database.yml +18 -0
- data/.dassie/config/environments/production.rb +1 -1
- data/.dassie/config/fedora.yml +6 -6
- data/.dassie/config/initializers/profiler.rb +5 -0
- data/.dassie/config/locales/hyrax.en.yml +1 -1
- data/.dassie/config/puma.rb +55 -5
- data/.dassie/config/routes.rb +2 -0
- data/.dassie/db/migrate/20250328100249_user_roles.rb +20 -0
- data/.dassie/db/schema.rb +14 -1
- data/.github/workflows/lint-build-test.yml +34 -5
- data/.github/workflows/main.yml +4 -4
- data/.koppie/.env +1 -1
- data/.koppie/Gemfile +10 -6
- data/.koppie/app/controllers/application_controller.rb +4 -0
- data/.koppie/app/helpers/hyrax_helper.rb +4 -0
- data/.koppie/app/models/ability.rb +4 -0
- data/.koppie/app/models/user.rb +10 -0
- data/.koppie/app/views/shared/_footer.html.erb +17 -0
- data/.koppie/config/database.yml +2 -9
- data/.koppie/config/environments/development.rb +9 -0
- data/.koppie/config/environments/production.rb +1 -1
- data/.koppie/config/initializers/1_valkyrie.rb +5 -5
- data/.koppie/config/initializers/profiler.rb +5 -0
- data/.koppie/config/locales/hyrax.en.yml +2 -2
- data/.koppie/config/puma.rb +26 -7
- data/.koppie/config/routes.rb +2 -0
- data/.koppie/db/schema.rb +109 -110
- data/Dockerfile +108 -50
- data/app/controllers/hyrax/file_sets_controller.rb +11 -0
- data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +1 -1
- data/bin/db-migrate-seed.sh +1 -1
- data/bin/dev-entrypoint.sh +3 -0
- data/docker-compose-dassie.yml +2 -2
- data/docker-compose-koppie.yml +2 -2
- data/docker-compose-sirenia.yml +2 -2
- data/documentation/developing-your-hyrax-based-app.md +1 -1
- data/hyrax.gemspec +1 -1
- data/lib/generators/hyrax/install_generator.rb +0 -5
- data/lib/generators/hyrax/templates/.env +1 -1
- data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +21 -19
- data/lib/generators/hyrax/templates/db/migrate/20170131142607_add_permission_template_to_sipity_workflow.rb.erb +1 -1
- data/lib/generators/hyrax/templates/db/migrate/20170810190549_update_collection_type_column_options.rb.erb +1 -1
- data/lib/generators/hyrax/templates/db/migrate/20230821153635_add_fields_to_counter_metric.rb.erb +1 -1
- data/lib/hyrax/version.rb +1 -1
- data/lib/tasks/workflow.rake +1 -2
- data/template.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddbf266b8b67364db933bf1b60129204b7f9055c3ff396d36bbfd5ba0a752868
|
4
|
+
data.tar.gz: a0f8fca6c5cfb7213ffaf321be7930e80a2a974ee4b33b5c8b3cc3ab24816409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ffab98229bd3ee47dc292dce9a71db483326125cc76419b386e7fc34c4698a9b288926f2f1bf572730f9f8249c205b2a5fce46a93f002e0d23fa47b97b89bf5
|
7
|
+
data.tar.gz: 47beca282a262f8016054dba544b273e0b7206d2e5f6dce83441189354fa1ef99188545fa270ce6449e8ce50019136e8b7b0cd02ab536f90d544c16c68a19841
|
data/.dassie/.env
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
ANALYTICS_START_DATE=2021-08-21
|
2
|
+
APP_NAME=dassie
|
2
3
|
BUNDLE_GEMFILE=Gemfile.dassie
|
3
4
|
BUNDLE_PATH=/app/bundle
|
4
5
|
CH12N_TOOL=fits_servlet
|
@@ -38,7 +39,10 @@ SOLR_TEST_URL=http://solr:8983/solr/hyrax_test
|
|
38
39
|
SOLR_URL=http://solr:8983/solr/hyrax
|
39
40
|
TB_RSPEC_OPTIONS=--force-color --format RspecJunitFormatter --out rspec.xml
|
40
41
|
TB_RSPEC_FORMATTER=progress
|
42
|
+
VALKYRIE_FCREPO_URL=http://fedoraAdmin:fedoraAdmin@fedora6:8080/fcrepo/rest
|
41
43
|
VALKYRIE_ID_TYPE=string
|
44
|
+
VALKYRIE_METADATA_ADAPTER=pg_metadata
|
42
45
|
VALKYRIE_SOLR_HOST=solr
|
43
46
|
VALKYRIE_SOLR_PORT=8983
|
47
|
+
VALKYRIE_STORAGE_ADAPTER=versioned_disk_storage
|
44
48
|
VALKYRIE_TRANSITION=false
|
data/.dassie/Gemfile
CHANGED
@@ -19,24 +19,29 @@ gem 'devise-guests', '~> 0.8'
|
|
19
19
|
# To install the package in Alpine: `apk add ruby-grpc`
|
20
20
|
# The pinned versions should match the version provided by the Alpine packages.
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
|
23
|
+
if RUBY_PLATFORM =~ /musl/
|
24
|
+
# # Disabled due to dependency mismatches in Alpine packages (grpc 1.62.1 needs protobuf ~> 3.25)
|
24
25
|
# path '/usr/lib/ruby/gems/3.3.0' do
|
25
|
-
|
26
|
-
|
26
|
+
gem 'google-protobuf', force_ruby_platform: true
|
27
|
+
gem 'grpc', force_ruby_platform: true
|
27
28
|
# end
|
28
|
-
|
29
|
+
end
|
29
30
|
|
31
|
+
gem 'hydra-role-management'
|
30
32
|
gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
|
31
33
|
gem 'jbuilder', '~> 2.5'
|
32
34
|
gem 'jquery-rails'
|
35
|
+
gem 'okcomputer'
|
33
36
|
gem 'pg', '~> 1.3'
|
34
37
|
gem 'puma'
|
38
|
+
gem 'rack-mini-profiler', require: ['prepend_net_http_patch']
|
35
39
|
gem 'rails', '~> 7.2', '< 8.0'
|
36
40
|
gem 'riiif', '~> 2.1'
|
37
41
|
gem 'rsolr', '>= 1.0', '< 3'
|
38
42
|
gem 'sass-rails', '~> 6.0'
|
39
|
-
gem 'sidekiq', '~>
|
43
|
+
gem 'sidekiq', '~> 7.0'
|
44
|
+
gem 'stackprof', require: false
|
40
45
|
gem 'turbolinks', '~> 5'
|
41
46
|
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
|
42
47
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
data/.dassie/app/models/user.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
class User < ApplicationRecord
|
2
2
|
# Connects this user object to Hydra behaviors.
|
3
3
|
include Hydra::User
|
4
|
+
|
5
|
+
# Connects this user object to Role-management behaviors.
|
6
|
+
include Hydra::RoleManagement::UserRoles
|
7
|
+
|
4
8
|
# Connects this user object to Hyrax behaviors.
|
5
9
|
include Hyrax::User
|
6
10
|
include Hyrax::UserUsageStats
|
@@ -18,4 +22,11 @@ class User < ApplicationRecord
|
|
18
22
|
def to_s
|
19
23
|
email
|
20
24
|
end
|
25
|
+
|
26
|
+
# Groups include roles and those set by #groups= (especially in specs)
|
27
|
+
def groups
|
28
|
+
g = roles.map(&:name)
|
29
|
+
g += group_service.fetch_groups(user: self)
|
30
|
+
g
|
31
|
+
end
|
21
32
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<footer class="navbar navbar-dark bg-dark site-footer">
|
2
|
+
<div class="container-fluid">
|
3
|
+
<div class="navbar-text text-left">
|
4
|
+
<p><%= t('hyrax.footer.service_html') %> <%= t('hyrax.product_name') %> v<%= Hyrax::VERSION %></p>
|
5
|
+
<p>Commit <%= link_to ENV.fetch('BUILD_GITSHA', "Unknown")[0..6],
|
6
|
+
"https://github.com/samvera/hyrax/commit/#{ENV.fetch('BUILD_GITSHA', 'main')}" %>
|
7
|
+
Built at <%= ENV.fetch('BUILD_TIMESTAMP', 'Unknown') %>
|
8
|
+
</p>
|
9
|
+
</div>
|
10
|
+
<div class="navbar-right">
|
11
|
+
<div class="navbar-text text-right">
|
12
|
+
<p><%= t('hyrax.footer.copyright_html', current_year: Time.current.year) %></p>
|
13
|
+
<p><%= t('hyrax.background_attribution_html') %></p>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</footer>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
default: &default
|
2
|
+
adapter: postgresql
|
3
|
+
url: <%= ENV.fetch('DATABASE_URL') %>
|
4
|
+
|
5
|
+
development:
|
6
|
+
<<: *default
|
7
|
+
|
8
|
+
# Warning: The database defined as "test" will be erased and
|
9
|
+
# re-generated from your development database when you run "rake".
|
10
|
+
# Do not set this db to the same as development or production.
|
11
|
+
test:
|
12
|
+
<<: *default
|
13
|
+
url: <%= ENV.fetch('DATABASE_TEST_URL') { ENV.fetch('DATABASE_URL') } %>
|
14
|
+
|
15
|
+
production:
|
16
|
+
<<: *default
|
17
|
+
encoding: unicode
|
18
|
+
pool: 50
|
@@ -53,7 +53,7 @@ Rails.application.configure do
|
|
53
53
|
|
54
54
|
# Use the lowest log level to ensure availability of diagnostic information
|
55
55
|
# when problems arise.
|
56
|
-
config.log_level = :debug
|
56
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :debug).to_sym
|
57
57
|
|
58
58
|
# Prepend all log lines with the following tags.
|
59
59
|
config.log_tags = [ :request_id ]
|
data/.dassie/config/fedora.yml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
development:
|
2
2
|
user: fedoraAdmin
|
3
3
|
password: fedoraAdmin
|
4
|
-
url:
|
5
|
-
base_path: <%= ENV['FCREPO_DEV_BASE_PATH'] || ENV['FCREPO_BASE_PATH'] || '/dev' %>
|
4
|
+
url: <%= ENV.fetch('FEDORA_URL') { "http://#{ENV['FCREPO_HOST'] || 'localhost'}:#{ENV['FCREPO_DEVELOPMENT_PORT'] || ENV['FCREPO_PORT'] || 8984 }/#{ENV['FCREPO_REST_PATH'] || 'rest'}" } %>
|
5
|
+
base_path: <%= ENV['FEDORA_BASE_PATH'] || ENV['FCREPO_DEV_BASE_PATH'] || ENV['FCREPO_BASE_PATH'] || '/dev' %>
|
6
6
|
test:
|
7
7
|
user: fedoraAdmin
|
8
8
|
password: fedoraAdmin
|
9
|
-
url:
|
10
|
-
base_path: <%= ENV['FCREPO_TEST_BASE_PATH'] || ENV['FCREPO_BASE_PATH'] || '/test' %>
|
9
|
+
url: <%= ENV.fetch('FEDORA_URL') { "http://#{ENV['FCREPO_HOST'] || 'localhost'}:#{ENV['FCREPO_DEVELOPMENT_PORT'] || ENV['FCREPO_PORT'] || 8986 }/#{ENV['FCREPO_REST_PATH'] || 'rest'}" } %>
|
10
|
+
base_path: <%= ENV['FEDORA_BASE_PATH'] || ENV['FCREPO_TEST_BASE_PATH'] || ENV['FCREPO_BASE_PATH'] || '/test' %>
|
11
11
|
production:
|
12
12
|
user: fedoraAdmin
|
13
13
|
password: fedoraAdmin
|
14
|
-
url:
|
15
|
-
base_path: <%= ENV['FCREPO_BASE_PATH'] || '/prod' %>
|
14
|
+
url: <%= ENV.fetch('FEDORA_URL') { "http://#{ENV['FCREPO_HOST'] || 'localhost'}:#{ENV['FCREPO_PORT'] || 8984 }/#{ENV['FCREPO_REST_PATH'] || 'rest'}" } %>
|
15
|
+
base_path: <%= ENV['FEDORA_BASE_PATH'] || ENV['FCREPO_BASE_PATH'] || '/prod' %>
|
@@ -50,7 +50,7 @@ en:
|
|
50
50
|
directory:
|
51
51
|
suffix: "@example.org"
|
52
52
|
footer:
|
53
|
-
copyright_html: "<strong>Copyright ©
|
53
|
+
copyright_html: "<strong>Copyright © %{current_year} Samvera</strong> Licensed under the Apache License, Version 2.0"
|
54
54
|
service_html: A service of <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a>.
|
55
55
|
institution_name: Institution
|
56
56
|
institution_name_full: The Institution Name
|
data/.dassie/config/puma.rb
CHANGED
@@ -1,6 +1,56 @@
|
|
1
|
-
|
2
|
-
threads
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
2
|
+
# The `threads` method setting takes two numbers: a minimum and maximum.
|
3
|
+
# Any libraries that use thread pools should be configured to match
|
4
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
|
+
# and maximum; this matches the default thread size of Active Record.
|
6
|
+
#
|
7
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS", 5).to_i
|
8
|
+
threads 1, threads_count - 2
|
9
|
+
|
10
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
11
|
+
#
|
12
|
+
port ENV.fetch("PORT", 3000)
|
13
|
+
|
14
|
+
# Specifies the `environment` that Puma will run in.
|
15
|
+
#
|
16
|
+
rails_env = ENV.fetch("RAILS_ENV", 'development')
|
17
|
+
environment rails_env
|
18
|
+
|
19
|
+
# Specifies the `pidfile` that Puma will use.
|
20
|
+
pidfile ENV.fetch("PIDFILE", 'tmp/pids/server.pid')
|
21
|
+
|
22
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
23
|
+
# Workers are forked webserver processes. If using threads and workers together
|
24
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
25
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
26
|
+
# processes).
|
27
|
+
#
|
28
|
+
workers ENV.fetch('WEB_CONCURRENCY', 1)
|
29
|
+
|
30
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
31
|
+
# This directive tells Puma to first boot the application and load code
|
32
|
+
# before forking the application. This takes advantage of Copy On Write
|
33
|
+
# process behavior so workers use less memory.
|
34
|
+
#
|
35
|
+
preload_app!
|
36
|
+
|
37
|
+
# Allow puma to be restarted by `rails restart` command.
|
6
38
|
plugin :tmp_restart
|
39
|
+
|
40
|
+
# Embedded Sidekiq https://github.com/sidekiq/sidekiq/wiki/Embedding
|
41
|
+
if ENV.fetch('SIDEKIQ_MODE', false) == 'embed'
|
42
|
+
embedded_sidekiq = nil
|
43
|
+
|
44
|
+
on_worker_boot do
|
45
|
+
embedded_sidekiq = Sidekiq.configure_embed do |config|
|
46
|
+
config.logger.level = ENV.fetch("RAILS_LOG_LEVEL", 'debug')
|
47
|
+
config.queues = %w[ingest batch default]
|
48
|
+
config.concurrency = ENV.fetch('SIDEKIQ_WORKERS', 2) # Adjust max `threads` above accordingly
|
49
|
+
end
|
50
|
+
embedded_sidekiq.run
|
51
|
+
end
|
52
|
+
|
53
|
+
on_worker_shutdown do
|
54
|
+
embedded_sidekiq&.stop
|
55
|
+
end
|
56
|
+
end
|
data/.dassie/config/routes.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class UserRoles < ActiveRecord::Migration[5.0]
|
4
|
+
def up
|
5
|
+
create_table :roles do |t|
|
6
|
+
t.string :name
|
7
|
+
end
|
8
|
+
create_table :roles_users, id: false do |t|
|
9
|
+
t.references :role
|
10
|
+
t.references :user
|
11
|
+
end
|
12
|
+
add_index :roles_users, %i[role_id user_id]
|
13
|
+
add_index :roles_users, %i[user_id role_id]
|
14
|
+
end
|
15
|
+
|
16
|
+
def down
|
17
|
+
drop_table :roles_users
|
18
|
+
drop_table :roles
|
19
|
+
end
|
20
|
+
end
|
data/.dassie/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema[7.2].define(version:
|
13
|
+
ActiveRecord::Schema[7.2].define(version: 2025_03_28_100249) do
|
14
14
|
# These are extensions that must be enabled in order to support this database
|
15
15
|
enable_extension "plpgsql"
|
16
16
|
enable_extension "uuid-ossp"
|
@@ -323,6 +323,19 @@ ActiveRecord::Schema[7.2].define(version: 2024_05_06_070809) do
|
|
323
323
|
t.index ["uri"], name: "index_qa_local_authority_entries_on_uri", unique: true
|
324
324
|
end
|
325
325
|
|
326
|
+
create_table "roles", id: :serial, force: :cascade do |t|
|
327
|
+
t.string "name"
|
328
|
+
end
|
329
|
+
|
330
|
+
create_table "roles_users", id: false, force: :cascade do |t|
|
331
|
+
t.integer "role_id"
|
332
|
+
t.integer "user_id"
|
333
|
+
t.index ["role_id", "user_id"], name: "index_roles_users_on_role_id_and_user_id"
|
334
|
+
t.index ["role_id"], name: "index_roles_users_on_role_id"
|
335
|
+
t.index ["user_id", "role_id"], name: "index_roles_users_on_user_id_and_role_id"
|
336
|
+
t.index ["user_id"], name: "index_roles_users_on_user_id"
|
337
|
+
end
|
338
|
+
|
326
339
|
create_table "searches", id: :serial, force: :cascade do |t|
|
327
340
|
t.binary "query_params"
|
328
341
|
t.integer "user_id"
|
@@ -17,6 +17,7 @@ on:
|
|
17
17
|
|
18
18
|
env:
|
19
19
|
REGISTRY: ghcr.io
|
20
|
+
IMAGE_NAME: ${{ github.repository }}-dev
|
20
21
|
DOCKER_BUILDKIT: 1
|
21
22
|
COMPOSE_DOCKER_CLI_BUILD: 1
|
22
23
|
|
@@ -47,22 +48,50 @@ jobs:
|
|
47
48
|
steps:
|
48
49
|
- name: Checkout
|
49
50
|
uses: actions/checkout@v4
|
51
|
+
- name: Auth to ghcr.io
|
52
|
+
uses: docker/login-action@v3
|
53
|
+
with:
|
54
|
+
registry: ${{ env.REGISTRY }}
|
55
|
+
username: ${{ github.actor }}
|
56
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
50
57
|
- name: Set up Docker Buildx
|
51
58
|
uses: docker/setup-buildx-action@v3
|
59
|
+
- name: Setup image tags
|
60
|
+
id: image-meta
|
61
|
+
uses: docker/metadata-action@v5
|
62
|
+
with:
|
63
|
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
64
|
+
tags: |
|
65
|
+
type=raw,value=latest,enable={{is_default_branch}}
|
66
|
+
type=ref,event=pr
|
67
|
+
type=sha,format=long,prefix=
|
52
68
|
- name: Build and export
|
53
69
|
uses: docker/build-push-action@v6
|
54
70
|
with:
|
71
|
+
build-args: |
|
72
|
+
BUILD_TIMESTAMP=${{ fromJSON(steps.image-meta.outputs.json).labels['org.opencontainers.image.created'] }}
|
73
|
+
BUILD_GITSHA=${{ github.sha }}
|
55
74
|
cache-from: type=gha
|
56
75
|
cache-to: type=gha, mode=max
|
57
76
|
context: .
|
58
77
|
target: hyrax-engine-dev
|
59
|
-
|
60
|
-
|
78
|
+
push: true # ${{ github.event_name != 'pull_request' }}
|
79
|
+
tags: ${{ steps.image-meta.outputs.tags }}
|
80
|
+
labels: ${{ steps.image-meta.outputs.labels }}
|
81
|
+
outputs: type=docker,dest=${{runner.temp}}/hyrax-dev-${{ github.sha }}.tar
|
82
|
+
- name: Trigger Nurax Deployment
|
83
|
+
uses: peter-evans/repository-dispatch@v3
|
84
|
+
if: ${{ github.ref == 'refs/heads/main' }}
|
85
|
+
with:
|
86
|
+
token: ${{ secrets.NURAX_ACCESS_TOKEN }}
|
87
|
+
event-type: deploy
|
88
|
+
repository: samvera-labs/nurax
|
89
|
+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
61
90
|
- name: Upload built image artifact
|
62
91
|
uses: actions/upload-artifact@v4
|
63
92
|
with:
|
64
93
|
name: hyrax-dev
|
65
|
-
path: /
|
94
|
+
path: ${{runner.temp}}/hyrax-dev-${{ github.sha }}.tar
|
66
95
|
|
67
96
|
test:
|
68
97
|
needs: build
|
@@ -86,10 +115,10 @@ jobs:
|
|
86
115
|
uses: actions/download-artifact@v4
|
87
116
|
with:
|
88
117
|
name: hyrax-dev
|
89
|
-
path:
|
118
|
+
path: ${{runner.temp}}
|
90
119
|
- name: Start containers
|
91
120
|
run: |
|
92
|
-
docker load --input /
|
121
|
+
docker load --input ${{runner.temp}}/hyrax-dev-${{ github.sha }}.tar
|
93
122
|
docker image ls -a
|
94
123
|
docker compose -f docker-compose-${{ matrix.ci_test_app }}.yml up -d --quiet-pull --pull missing --no-build
|
95
124
|
- name: RSpec
|
data/.github/workflows/main.yml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
name: Trigger Nurax build
|
2
2
|
on:
|
3
3
|
workflow_dispatch:
|
4
|
-
push:
|
5
|
-
branches:
|
6
|
-
- 'main'
|
4
|
+
# push:
|
5
|
+
# branches:
|
6
|
+
# - 'main'
|
7
7
|
|
8
8
|
jobs:
|
9
9
|
trigger:
|
10
10
|
runs-on: ubuntu-latest
|
11
11
|
steps:
|
12
|
-
- uses: peter-evans/repository-dispatch@
|
12
|
+
- uses: peter-evans/repository-dispatch@v3
|
13
13
|
with:
|
14
14
|
token: ${{ secrets.NURAX_ACCESS_TOKEN }}
|
15
15
|
event-type: push
|
data/.koppie/.env
CHANGED
@@ -11,7 +11,7 @@ DB_NAME=koppie
|
|
11
11
|
DB_PASSWORD=hyrax_password
|
12
12
|
DB_PORT=5432
|
13
13
|
DB_USERNAME=hyrax_user
|
14
|
-
|
14
|
+
FEDORA_URL=http://fedoraAdmin:fedoraAdmin@fcrepo:8080/fcrepo/rest
|
15
15
|
FITS_SERVLET_URL=http://fits:8080/fits
|
16
16
|
HUB_URL=http://chrome:4444/wd/hub
|
17
17
|
HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/
|
data/.koppie/Gemfile
CHANGED
@@ -19,24 +19,28 @@ gem 'devise-guests', '~> 0.8'
|
|
19
19
|
# To install the package in Alpine: `apk add ruby-grpc`
|
20
20
|
# The pinned versions should match the version provided by the Alpine packages.
|
21
21
|
|
22
|
-
|
23
|
-
#
|
22
|
+
if RUBY_PLATFORM =~ /musl/
|
23
|
+
# Disabled due to dependency mismatches in Alpine packages (grpc 1.62.1 needs protobuf ~> 3.25)
|
24
24
|
# path '/usr/lib/ruby/gems/3.3.0' do
|
25
|
-
|
26
|
-
|
25
|
+
gem 'google-protobuf', force_ruby_platform: true
|
26
|
+
gem 'grpc', force_ruby_platform: true
|
27
27
|
# end
|
28
|
-
|
28
|
+
end
|
29
29
|
|
30
|
+
gem 'hydra-role-management'
|
30
31
|
gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
|
31
32
|
gem 'jbuilder', '~> 2.5'
|
32
33
|
gem 'jquery-rails'
|
34
|
+
gem 'okcomputer'
|
33
35
|
gem 'pg', '~> 1.3'
|
34
36
|
gem 'puma'
|
37
|
+
gem 'rack-mini-profiler', require: ['prepend_net_http_patch']
|
35
38
|
gem 'rails', '~> 7.2', '< 8.0'
|
36
39
|
gem 'riiif', '~> 2.1'
|
37
40
|
gem 'rsolr', '>= 1.0', '< 3'
|
38
41
|
gem 'sass-rails', '~> 6.0'
|
39
|
-
gem 'sidekiq', '~>
|
42
|
+
gem 'sidekiq', '~> 7.0'
|
43
|
+
gem 'stackprof', require: false
|
40
44
|
gem 'turbolinks', '~> 5'
|
41
45
|
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
|
42
46
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
data/.koppie/app/models/user.rb
CHANGED
@@ -2,6 +2,9 @@ class User < ApplicationRecord
|
|
2
2
|
# Connects this user object to Hydra behaviors.
|
3
3
|
include Hydra::User
|
4
4
|
|
5
|
+
# Connects this user object to Role-management behaviors.
|
6
|
+
include Hydra::RoleManagement::UserRoles
|
7
|
+
|
5
8
|
# Connects this user object to Hyrax behaviors.
|
6
9
|
include Hyrax::User
|
7
10
|
include Hyrax::UserUsageStats
|
@@ -19,4 +22,11 @@ class User < ApplicationRecord
|
|
19
22
|
def to_s
|
20
23
|
email
|
21
24
|
end
|
25
|
+
|
26
|
+
# Groups include roles and those set by #groups= (especially in specs)
|
27
|
+
def groups
|
28
|
+
g = roles.map(&:name)
|
29
|
+
g += group_service.fetch_groups(user: self)
|
30
|
+
g
|
31
|
+
end
|
22
32
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<footer class="navbar navbar-dark bg-dark site-footer">
|
2
|
+
<div class="container-fluid">
|
3
|
+
<div class="navbar-text text-left">
|
4
|
+
<p><%= t('hyrax.footer.service_html') %> <%= t('hyrax.product_name') %> v<%= Hyrax::VERSION %></p>
|
5
|
+
<p>Commit <%= link_to ENV.fetch('BUILD_GITSHA', "Unknown")[0..6],
|
6
|
+
"https://github.com/samvera/hyrax/commit/#{ENV.fetch('BUILD_GITSHA', 'main')}" %>
|
7
|
+
Built at <%= ENV.fetch('BUILD_TIMESTAMP', 'Unknown') %>
|
8
|
+
</p>
|
9
|
+
</div>
|
10
|
+
<div class="navbar-right">
|
11
|
+
<div class="navbar-text text-right">
|
12
|
+
<p><%= t('hyrax.footer.copyright_html', current_year: Time.current.year) %></p>
|
13
|
+
<p><%= t('hyrax.background_attribution_html') %></p>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</footer>
|
data/.koppie/config/database.yml
CHANGED
@@ -1,23 +1,16 @@
|
|
1
1
|
default: &default
|
2
2
|
adapter: postgresql
|
3
|
-
|
4
|
-
timeout: <%= ENV.fetch('DB_TIMEOUT') { 5000 } %>
|
5
|
-
database: <%= ENV['APP_DB_NAME'] %>
|
6
|
-
username: <%= ENV['DB_USERNAME'] %>
|
7
|
-
password: <%= ENV['DB_PASSWORD'] %>
|
8
|
-
host: <%= ENV['DB_HOST'] %>
|
9
|
-
port: <%= ENV['DB_PORT'] %>
|
3
|
+
url: <%= ENV.fetch('DATABASE_URL') %>
|
10
4
|
|
11
5
|
development:
|
12
6
|
<<: *default
|
13
|
-
database: <%= ENV.fetch('APP_DB_NAME', 'nurax_pg_development') %>
|
14
7
|
|
15
8
|
# Warning: The database defined as "test" will be erased and
|
16
9
|
# re-generated from your development database when you run "rake".
|
17
10
|
# Do not set this db to the same as development or production.
|
18
11
|
test:
|
19
12
|
<<: *default
|
20
|
-
|
13
|
+
url: <%= ENV.fetch('DATABASE_TEST_URL') { ENV.fetch('DATABASE_URL') } %>
|
21
14
|
|
22
15
|
production:
|
23
16
|
<<: *default
|
@@ -29,6 +29,15 @@ Rails.application.configure do
|
|
29
29
|
config.cache_store = :null_store
|
30
30
|
end
|
31
31
|
|
32
|
+
# Logging
|
33
|
+
#
|
34
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", 'debug')
|
35
|
+
config.log_formatter = ::Logger::Formatter.new
|
36
|
+
# log to stdout
|
37
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
38
|
+
logger.formatter = config.log_formatter
|
39
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
40
|
+
|
32
41
|
# Store uploaded files on the local file system (see config/storage.yml for options)
|
33
42
|
config.active_storage.service = :local
|
34
43
|
|
@@ -56,7 +56,7 @@ Rails.application.configure do
|
|
56
56
|
|
57
57
|
# Use the lowest log level to ensure availability of diagnostic information
|
58
58
|
# when problems arise.
|
59
|
-
config.log_level = :debug
|
59
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :debug).to_sym
|
60
60
|
|
61
61
|
# Prepend all log lines with the following tags.
|
62
62
|
config.log_tags = [ :request_id ]
|
@@ -31,8 +31,8 @@ Valkyrie::MetadataAdapter.register(
|
|
31
31
|
Valkyrie::MetadataAdapter.register(
|
32
32
|
Valkyrie::Persistence::Fedora::MetadataAdapter.new(
|
33
33
|
connection: ::Ldp::Client.new(Hyrax.config.fedora_connection_builder.call(
|
34
|
-
ENV.fetch('
|
35
|
-
base_path: Rails.env,
|
34
|
+
ENV.fetch('FEDORA6_URL') { ENV.fetch('FEDORA_URL') { "http://localhost:8080/fcrepo/rest" } })),
|
35
|
+
base_path: ENV.fetch('FEDORA_BASE_PATH', Rails.env).gsub(/^\/|\/$/, ''),
|
36
36
|
schema: Valkyrie::Persistence::Fedora::PermissiveSchema.new(Hyrax::SimpleSchemaLoader.new.permissive_schema_for_valkrie_adapter),
|
37
37
|
fedora_version: 6.5,
|
38
38
|
fedora_pairtree_count: 4,
|
@@ -64,8 +64,8 @@ Valkyrie.config.metadata_adapter = ENV.fetch('VALKYRIE_METADATA_ADAPTER') { :pg_
|
|
64
64
|
Valkyrie::StorageAdapter.register(
|
65
65
|
Valkyrie::Storage::Fedora.new(
|
66
66
|
connection: ::Ldp::Client.new(Hyrax.config.fedora_connection_builder.call(
|
67
|
-
ENV.fetch('
|
68
|
-
base_path: Rails.env,
|
67
|
+
ENV.fetch('FEDORA6_URL') { ENV.fetch('FEDORA_URL') { "http://localhost:8080/fcrepo/rest" } })),
|
68
|
+
base_path: ENV.fetch('FEDORA_BASE_PATH', Rails.env).gsub(/^\/|\/$/, ''),
|
69
69
|
fedora_version: 6.5,
|
70
70
|
fedora_pairtree_count: 4,
|
71
71
|
fedora_pairtree_length: 2
|
@@ -73,7 +73,7 @@ Valkyrie::StorageAdapter.register(
|
|
73
73
|
)
|
74
74
|
|
75
75
|
Valkyrie::StorageAdapter.register(
|
76
|
-
Valkyrie::Storage::VersionedDisk.new(base_path: Rails.root.join("storage", "files"),
|
76
|
+
Valkyrie::Storage::VersionedDisk.new(base_path: ENV.fetch('HYRAX_STORAGE_PATH') { Rails.root.join("storage", "files") },
|
77
77
|
file_mover: FileUtils.method(:cp)),
|
78
78
|
:versioned_disk_storage
|
79
79
|
)
|