hyrax 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -6
- data/.dassie/.env +1 -2
- data/.dassie/Gemfile +7 -3
- data/.dassie/app/models/user.rb +0 -2
- data/.dassie/config/analytics.yml +12 -5
- data/.dassie/config/environments/development.rb +2 -0
- data/.dassie/config/initializers/hyrax.rb +2 -0
- data/.dassie/db/migrate/20210921150120_enable_uuid_extension.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150121_create_orm_resources.valkyrie_engine.rb +19 -0
- data/.dassie/db/migrate/20210921150122_add_model_type_to_orm_resources.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150123_change_model_type_to_internal_model.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150124_create_path_gin_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150125_create_internal_resource_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150126_create_updated_at_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150127_add_optimistic_locking_to_orm_resources.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20211130181150_create_default_administrative_set.rb +8 -0
- data/.dassie/db/schema.rb +20 -1
- data/.env +7 -4
- data/.github/workflows/main.yml +17 -0
- data/.github/workflows/release.yml +17 -0
- data/.gitignore +1 -0
- data/.regen +1 -1
- data/CONTAINERS.md +13 -10
- data/README.md +37 -0
- data/app/assets/javascripts/hyrax/admin/graphs.es6 +34 -37
- data/app/assets/javascripts/hyrax/analytics_events.js +69 -0
- data/app/assets/javascripts/hyrax/collapse.js +24 -0
- data/app/assets/javascripts/hyrax/collections.js +1 -2
- data/app/assets/javascripts/hyrax/ga_events.js +2 -8
- data/app/assets/javascripts/hyrax/reports-buttons.js +33 -0
- data/app/assets/javascripts/hyrax.js +2 -1
- data/app/assets/stylesheets/_bootstrap-default-overrides.scss +9 -0
- data/app/authorities/qa/authorities/collections.rb +4 -5
- data/app/authorities/qa/authorities/find_works.rb +1 -1
- data/app/controllers/concerns/hyrax/breadcrumbs_for_collection_analytics.rb +26 -0
- data/app/controllers/concerns/hyrax/breadcrumbs_for_works_analytics.rb +26 -0
- data/app/controllers/concerns/hyrax/controller.rb +22 -0
- data/app/controllers/hyrax/admin/analytics/analytics_controller.rb +40 -0
- data/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +61 -0
- data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +122 -0
- data/app/controllers/hyrax/collections_controller.rb +4 -1
- data/app/controllers/hyrax/dashboard/collections_controller.rb +15 -6
- data/app/controllers/hyrax/dashboard_controller.rb +8 -0
- data/app/controllers/hyrax/stats_controller.rb +3 -1
- data/app/forms/hyrax/forms/pcdm_collection_form.rb +3 -0
- data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +1 -1
- data/app/jobs/characterize_job.rb +28 -1
- data/app/jobs/valkyrie_ingest_job.rb +56 -0
- data/app/models/concerns/hyrax/ability.rb +26 -5
- data/app/models/concerns/hyrax/solr_document/metadata.rb +1 -0
- data/app/models/file_download_stat.rb +4 -4
- data/app/models/hyrax/default_administrative_set.rb +42 -0
- data/app/models/hyrax/statistic.rb +31 -4
- data/app/presenters/hyrax/admin/dashboard_presenter.rb +8 -6
- data/app/presenters/hyrax/admin/repository_growth_presenter.rb +10 -5
- data/app/presenters/hyrax/admin/user_activity_presenter.rb +8 -12
- data/app/presenters/hyrax/file_set_presenter.rb +2 -0
- data/app/presenters/hyrax/menu_presenter.rb +4 -0
- data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +1 -1
- data/app/presenters/hyrax/work_show_presenter.rb +5 -2
- data/app/presenters/hyrax/work_usage.rb +1 -0
- data/app/search_builders/hyrax/README.md +1 -1
- data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +1 -1
- data/app/search_builders/hyrax/my/collections_search_builder.rb +1 -1
- data/app/services/hyrax/admin_set_create_service.rb +76 -14
- data/app/services/hyrax/analytics/google/events.rb +37 -0
- data/app/services/hyrax/analytics/google/events_daily.rb +72 -0
- data/app/services/hyrax/analytics/google/visits.rb +44 -0
- data/app/services/hyrax/analytics/google/visits_daily.rb +49 -0
- data/app/services/hyrax/analytics/google.rb +204 -0
- data/app/services/hyrax/analytics/matomo.rb +193 -0
- data/app/services/hyrax/analytics/results.rb +79 -0
- data/app/services/hyrax/analytics.rb +12 -82
- data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +134 -0
- data/app/services/hyrax/collections/nested_collection_query_service.rb +8 -3
- data/app/services/hyrax/listeners/acl_index_listener.rb +3 -1
- data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +3 -1
- data/app/services/hyrax/listeners/batch_notification_listener.rb +3 -1
- data/app/services/hyrax/listeners/file_metadata_listener.rb +19 -0
- data/app/services/hyrax/listeners/file_set_lifecycle_listener.rb +6 -2
- data/app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb +6 -2
- data/app/services/hyrax/listeners/member_cleanup_listener.rb +3 -0
- data/app/services/hyrax/listeners/metadata_index_listener.rb +9 -3
- data/app/services/hyrax/listeners/object_lifecycle_listener.rb +9 -3
- data/app/services/hyrax/listeners/proxy_deposit_listener.rb +3 -1
- data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +3 -0
- data/app/services/hyrax/listeners/workflow_listener.rb +3 -1
- data/app/services/hyrax/listeners.rb +8 -0
- data/app/services/hyrax/restriction_service.rb +4 -0
- data/app/services/hyrax/statistics/users/over_time.rb +8 -5
- data/app/services/hyrax/statistics/works/over_time.rb +10 -0
- data/app/services/hyrax/work_uploads_handler.rb +4 -1
- data/app/views/hyrax/admin/analytics/_date_range_form.html.erb +11 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_custom_range.html.erb +39 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_monthly_summary.html.erb +48 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_summary.html.erb +55 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +55 -0
- data/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +70 -0
- data/app/views/hyrax/admin/analytics/collection_reports/show.html.erb +94 -0
- data/app/views/hyrax/admin/analytics/work_reports/_custom_range.html.erb +43 -0
- data/app/views/hyrax/admin/analytics/work_reports/_monthly_summary.html.erb +35 -0
- data/app/views/hyrax/admin/analytics/work_reports/_summary.html.erb +60 -0
- data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +33 -0
- data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +40 -0
- data/app/views/hyrax/admin/analytics/work_reports/_work_counts.html.erb +18 -0
- data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +41 -0
- data/app/views/hyrax/admin/analytics/work_reports/index.html.erb +77 -0
- data/app/views/hyrax/admin/analytics/work_reports/show.html.erb +90 -0
- data/app/views/hyrax/admin/stats/show.html.erb +1 -1
- data/app/views/hyrax/base/_relationships_parent_row.html.erb +0 -1
- data/app/views/hyrax/base/show.html.erb +6 -0
- data/app/views/hyrax/collections/show.html.erb +4 -0
- data/app/views/hyrax/dashboard/_repository_growth.html.erb +5 -5
- data/app/views/hyrax/dashboard/_resource_type_graph.html.erb +41 -0
- data/app/views/hyrax/dashboard/_sidebar.html.erb +4 -1
- data/app/views/hyrax/dashboard/_tabs.html.erb +11 -0
- data/app/views/hyrax/dashboard/_user_activity.html.erb +17 -23
- data/app/views/hyrax/dashboard/_user_activity_graph.html.erb +55 -0
- data/app/views/hyrax/dashboard/_visibility_graph.html.erb +31 -0
- data/app/views/hyrax/dashboard/_work_type_graph.html.erb +41 -0
- data/app/views/hyrax/dashboard/collections/_form.html.erb +2 -1
- data/app/views/hyrax/dashboard/show_admin.html.erb +24 -45
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +22 -0
- data/app/views/hyrax/file_sets/_actions.html.erb +4 -3
- data/app/views/hyrax/file_sets/show.html.erb +6 -0
- data/app/views/hyrax/my/collections/index.html.erb +1 -1
- data/app/views/hyrax/stats/_downloads.html.erb +18 -0
- data/app/views/hyrax/stats/_pageviews.html.erb +18 -0
- data/app/views/hyrax/stats/work.html.erb +17 -9
- data/app/views/layouts/_head_tag_content.html.erb +7 -2
- data/app/views/{_ga.html.erb → shared/_ga.html.erb} +3 -7
- data/app/views/shared/_matomo.html.erb +15 -0
- data/chart/hyrax/Chart.yaml +1 -1
- data/chart/hyrax/values.yaml +1 -1
- data/config/i18n-tasks.yml +2 -2
- data/config/initializers/listeners.rb +5 -5
- data/config/locales/hyrax.de.yml +194 -0
- data/config/locales/hyrax.en.yml +190 -12
- data/config/locales/hyrax.es.yml +194 -0
- data/config/locales/hyrax.fr.yml +194 -0
- data/config/locales/hyrax.it.yml +194 -0
- data/config/locales/hyrax.pt-BR.yml +194 -0
- data/config/locales/hyrax.zh.yml +194 -0
- data/config/routes.rb +4 -0
- data/docker-compose.yml +3 -1
- data/documentation/developing-your-hyrax-based-app.md +2 -2
- data/documentation/legacyREADME.md +1 -1
- data/hyrax.gemspec +3 -1
- data/lib/generators/hyrax/templates/config/analytics.yml +13 -7
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +0 -13
- data/lib/generators/hyrax/templates/db/migrate/20211130181150_create_default_administrative_set.rb.erb +8 -0
- data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +3 -1
- data/lib/hyrax/configuration.rb +67 -5
- data/lib/hyrax/engine.rb +7 -6
- data/lib/hyrax/publisher.rb +4 -0
- data/lib/hyrax/transactions/admin_set_create.rb +22 -0
- data/lib/hyrax/transactions/container.rb +11 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/tasks/regenerate_derivatives.rake +1 -1
- data/lib/wings/setup.rb +15 -0
- data/lib/wings/valkyrie/persister.rb +16 -0
- data/template.rb +1 -1
- data/vendor/assets/javascripts/morris/morris.min.js +1 -7
- data/vendor/assets/stylesheets/morris.js/0.5.1/morris.css +1 -1
- metadata +87 -11
- data/app/views/hyrax/dashboard/_repository_objects.html.erb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95d9c34fb76fd8e3ac06d6605962c16bbdad32ffa2c1f5ab24958740fc175507
|
4
|
+
data.tar.gz: 8be6a02dc887f93076d84a5dc47b8e4cc7ecf916415e23fd00df24078f20ebbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6e519190cda4bdcdb4a68577b682ad6fd138756da25ce69228429755e3ee3a2fb3ac95d9140831d623f75e0aa8a9115d378abafe8f301850c200fb8080b9942
|
7
|
+
data.tar.gz: 90610095bd1b82e79bc7ebaa8de11a2f3c8452803a15d60a4595308b67ab85724b118c7343b2a46fb2bafb3a138365fdb94540e948965cc1a96d4259fd8b07d6
|
data/.circleci/config.yml
CHANGED
@@ -33,10 +33,9 @@ jobs:
|
|
33
33
|
fi
|
34
34
|
[[ -z "$(git branch --all --list master */master)" ]]
|
35
35
|
|
36
|
-
- samvera/
|
36
|
+
- samvera/bundle:
|
37
37
|
ruby_version: << parameters.ruby_version >>
|
38
38
|
bundler_version: << parameters.bundler_version >>
|
39
|
-
project: hyrax
|
40
39
|
|
41
40
|
# Run rubocop in parallel with caching
|
42
41
|
# This should get added to the orb once proven here
|
@@ -89,10 +88,9 @@ jobs:
|
|
89
88
|
at: ~/
|
90
89
|
- samvera/engine_cart_generate:
|
91
90
|
cache_key: v1-internal-test-app-{{ checksum "hyrax.gemspec" }}-{{ checksum ".regen" }}-{{ checksum ".circleci/config.yml" }}-<< parameters.rails_version >>-<< parameters.ruby_version >>
|
92
|
-
- samvera/
|
91
|
+
- samvera/bundle:
|
93
92
|
ruby_version: << parameters.ruby_version >>
|
94
93
|
bundler_version: << parameters.bundler_version >>
|
95
|
-
project: hyrax
|
96
94
|
- persist_to_workspace:
|
97
95
|
root: ~/
|
98
96
|
paths:
|
@@ -128,10 +126,9 @@ jobs:
|
|
128
126
|
solr_config_path: .internal_test_app/solr/conf
|
129
127
|
core_name: hyrax-valkyrie-test
|
130
128
|
# Rerun bundler in case this is a different ruby version than bundle and build steps
|
131
|
-
- samvera/
|
129
|
+
- samvera/bundle:
|
132
130
|
ruby_version: << parameters.ruby_version >>
|
133
131
|
bundler_version: << parameters.bundler_version >>
|
134
|
-
project: hyrax
|
135
132
|
- run:
|
136
133
|
command: bundle exec rake app:db:migrate
|
137
134
|
- samvera/parallel_rspec
|
data/.dassie/.env
CHANGED
data/.dassie/Gemfile
CHANGED
@@ -52,11 +52,15 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
|
52
52
|
|
53
53
|
gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
|
54
54
|
|
55
|
-
gem 'rsolr', '>= 1.0', '< 3'
|
56
55
|
gem 'bootstrap-sass', '~> 3.0'
|
57
|
-
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
|
58
|
-
gem 'jquery-rails'
|
59
56
|
gem 'devise'
|
60
57
|
gem 'devise-guests', '~> 0.6'
|
58
|
+
gem 'jquery-rails'
|
59
|
+
gem 'pry-byebug'
|
60
|
+
gem 'pry-doc'
|
61
|
+
gem 'pry-rails'
|
62
|
+
gem 'pry-rescue'
|
61
63
|
gem 'riiif', '~> 2.1'
|
64
|
+
gem 'rsolr', '>= 1.0', '< 3'
|
62
65
|
gem 'sidekiq', '~> 6.0'
|
66
|
+
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
|
data/.dassie/app/models/user.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
analytics:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
google:
|
3
|
+
analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
|
4
|
+
app_name: <%= ENV['GOOGLE_OAUTH_APP_NAME'] %>
|
5
|
+
app_version: <%= ENV['GOOGLE_OAUTH_APP_VERSION'] %>
|
6
|
+
privkey_path: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_PATH'] %>
|
7
|
+
privkey_secret: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_SECRET'] %>
|
8
|
+
client_email: <%= ENV['GOOGLE_OAUTH_CLIENT_EMAIL'] %>
|
9
|
+
matomo:
|
10
|
+
base_url: <%= ENV['MATOMO_BASE_URL'] %>
|
11
|
+
site_id: <%= ENV['MATOMO_SITE_ID'] %>
|
12
|
+
auth_token: <%= ENV['MATOMO_AUTH_TOKEN'] %>
|
13
|
+
|
@@ -29,6 +29,8 @@ Rails.application.configure do
|
|
29
29
|
config.cache_store = :null_store
|
30
30
|
end
|
31
31
|
|
32
|
+
config.web_console.whitelisted_ips = ['172.18.0.0/16', '172.27.0.0/16', '0.0.0.0/0']
|
33
|
+
|
32
34
|
# Store uploaded files on the local file system (see config/storage.yml for options)
|
33
35
|
config.active_storage.service = :local
|
34
36
|
|
@@ -5,6 +5,8 @@ Hyrax.config do |config|
|
|
5
5
|
# Defaults to false. See README for more info
|
6
6
|
config.arkivo_api = true
|
7
7
|
|
8
|
+
config.analytics = ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_ANALYTICS', 'false'))
|
9
|
+
config.analytics_provider = ENV.fetch('HYRAX_ANALYTICS_PROVIDER', 'google')
|
8
10
|
# Injected via `rails g hyrax:work GenericWork`
|
9
11
|
config.register_curation_concern :generic_work
|
10
12
|
# Injected via `rails g hyrax:work NamespacedWorks::NestedWork`
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This migration comes from valkyrie_engine (originally 20161007101725)
|
3
|
+
class CreateOrmResources < ActiveRecord::Migration[5.0]
|
4
|
+
def options
|
5
|
+
if ENV["VALKYRIE_ID_TYPE"] == "string"
|
6
|
+
{ id: :text, default: -> { '(uuid_generate_v4())::text' } }
|
7
|
+
else
|
8
|
+
{ id: :uuid }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def change
|
13
|
+
create_table :orm_resources, **options do |t|
|
14
|
+
t.jsonb :metadata, null: false, default: {}
|
15
|
+
t.timestamps
|
16
|
+
end
|
17
|
+
add_index :orm_resources, :metadata, using: :gin
|
18
|
+
end
|
19
|
+
end
|
data/.dassie/db/schema.rb
CHANGED
@@ -10,10 +10,11 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 2021_11_30_181150) do
|
14
14
|
|
15
15
|
# These are extensions that must be enabled in order to support this database
|
16
16
|
enable_extension "plpgsql"
|
17
|
+
enable_extension "uuid-ossp"
|
17
18
|
|
18
19
|
create_table "bookmarks", id: :serial, force: :cascade do |t|
|
19
20
|
t.integer "user_id", null: false
|
@@ -139,6 +140,12 @@ ActiveRecord::Schema.define(version: 2020_08_21_212903) do
|
|
139
140
|
t.index ["machine_id"], name: "index_hyrax_collection_types_on_machine_id", unique: true
|
140
141
|
end
|
141
142
|
|
143
|
+
create_table "hyrax_default_administrative_set", force: :cascade do |t|
|
144
|
+
t.string "default_admin_set_id", null: false
|
145
|
+
t.datetime "created_at", null: false
|
146
|
+
t.datetime "updated_at", null: false
|
147
|
+
end
|
148
|
+
|
142
149
|
create_table "hyrax_features", force: :cascade do |t|
|
143
150
|
t.string "key", null: false
|
144
151
|
t.boolean "enabled", default: false, null: false
|
@@ -225,6 +232,18 @@ ActiveRecord::Schema.define(version: 2020_08_21_212903) do
|
|
225
232
|
t.index ["namespace"], name: "index_minter_states_on_namespace", unique: true
|
226
233
|
end
|
227
234
|
|
235
|
+
create_table "orm_resources", id: :uuid, default: -> { "uuid_generate_v4()" }, force: :cascade do |t|
|
236
|
+
t.jsonb "metadata", default: {}, null: false
|
237
|
+
t.datetime "created_at", null: false
|
238
|
+
t.datetime "updated_at", null: false
|
239
|
+
t.string "internal_resource"
|
240
|
+
t.integer "lock_version"
|
241
|
+
t.index ["internal_resource"], name: "index_orm_resources_on_internal_resource"
|
242
|
+
t.index ["metadata"], name: "index_orm_resources_on_metadata", using: :gin
|
243
|
+
t.index ["metadata"], name: "index_orm_resources_on_metadata_jsonb_path_ops", opclass: :jsonb_path_ops, using: :gin
|
244
|
+
t.index ["updated_at"], name: "index_orm_resources_on_updated_at"
|
245
|
+
end
|
246
|
+
|
228
247
|
create_table "permission_template_accesses", force: :cascade do |t|
|
229
248
|
t.bigint "permission_template_id"
|
230
249
|
t.string "agent_type"
|
data/.env
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
+
ANALYTICS_START_DATE=2021-08-21
|
1
2
|
CHROME_HEADLESS_MODE=false
|
2
3
|
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
|
3
4
|
DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5
|
4
5
|
DATABASE_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax?pool=5
|
5
|
-
DB_PORT=5432
|
6
6
|
DB_HOST=postgres
|
7
|
-
|
7
|
+
DB_PORT=5432
|
8
8
|
FCREPO_HOST=fcrepo
|
9
|
+
FCREPO_PORT=8080
|
9
10
|
FCREPO_REST_PATH=rest
|
10
11
|
FCREPO_TEST_BASE_PATH=/test
|
11
12
|
HUB_URL=http://chrome:4444/wd/hub
|
13
|
+
HYRAX_ANALYTICS=false
|
14
|
+
HYRAX_ANALYTICS_PROVIDER=google
|
12
15
|
HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/
|
13
16
|
HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
|
14
17
|
HYRAX_UPLOAD_PATH=/app/samvera/hyrax-webapp/uploads/
|
@@ -17,9 +20,9 @@ RACK_ENV=development
|
|
17
20
|
RAILS_ENV=development
|
18
21
|
RAILS_ROOT=.dassie
|
19
22
|
REDIS_HOST=redis
|
20
|
-
SOLR_PORT=8983
|
21
23
|
SOLR_HOST=solr
|
24
|
+
SOLR_PORT=8983
|
22
25
|
SOLR_TEST_URL=http://solr:8983/solr/hyrax_test
|
23
26
|
SOLR_URL=http://solr:8983/solr/hyrax
|
24
|
-
VALKYRIE_SOLR_PORT=8983
|
25
27
|
VALKYRIE_SOLR_HOST=solr
|
28
|
+
VALKYRIE_SOLR_PORT=8983
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Trigger Nurax build
|
2
|
+
on:
|
3
|
+
workflow_dispatch:
|
4
|
+
push:
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
trigger:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: peter-evans/repository-dispatch@v1
|
11
|
+
with:
|
12
|
+
token: ${{ secrets.NURAX_ACCESS_TOKEN }}
|
13
|
+
event-type: push
|
14
|
+
repository: curationexperts/nurax
|
15
|
+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Trigger Nurax build
|
2
|
+
on:
|
3
|
+
workflow_dispatch:
|
4
|
+
release:
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
trigger:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: peter-evans/repository-dispatch@v1
|
11
|
+
with:
|
12
|
+
token: ${{ secrets.NURAX_ACCESS_TOKEN }}
|
13
|
+
event-type: release
|
14
|
+
repository: curationexperts/nurax
|
15
|
+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
16
|
+
|
17
|
+
|
data/.gitignore
CHANGED
data/.regen
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
40
|
data/CONTAINERS.md
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
Hyrax-in-a-Container
|
2
2
|
====================
|
3
3
|
|
4
|
-
Our goal is to provide a practical, reusable
|
5
|
-
on on-ramp for Hyrax engine development. Then providing help with Hyrax-based application development. Finally,
|
6
|
-
providing better guidance around deployment.
|
7
|
-
|
8
|
-
Where are we at? It's complicated. What we have below is experimental support, but one that we want to push
|
9
|
-
towards. We need your help to keep pushing in this direction. So dig in and prepare to get your hands dirty.
|
4
|
+
Our goal is to provide a practical, reusable reference environment for applications. The first step is providing an on-ramp for Hyrax engine development. Then providing help with Hyrax-based application development. Finally, providing better guidance around deployment.
|
10
5
|
|
11
6
|
The [Hyrax Engine Development](#hyrax-engine-development) is further along than the [Docker Image for Hyrax-based Applications](#docker-image-for-hyrax-based-applications) which is further along than [Deploying to Production](#deploying-to-production).
|
12
7
|
|
8
|
+
See the [Troubleshooting](#troubleshooting) section if you encounter any issues.
|
9
|
+
|
13
10
|
<!-- NOTE: This title is referenced in the top-level README.md. Keep that in mind if you change it. -->
|
14
11
|
## Hyrax Engine Development
|
15
12
|
|
@@ -42,8 +39,6 @@ To stop the containers for the Hyrax-based application, type <kbd>Ctrl</kbd>+<kb
|
|
42
39
|
|
43
40
|
_**Note:** Starting and stopping Docker in this way will preserve your data between restarts._
|
44
41
|
|
45
|
-
_**Note:** I (Jeremy) encountered a problem using `docker-compose build`. I ran `bundle update` in `./hyrax` as well as within `./hyrax/.dassie`. That appeared to clear up the problem of a failure to build a gem._
|
46
|
-
|
47
42
|
### Code Changes and Testing
|
48
43
|
|
49
44
|
With `docker-compose up` running, any changes you make to your cloned Hyrax code-base should show up in `http://localhost:3000`; There may be cases where you need to restart your test application (e.g. stop the containers and start them up again).
|
@@ -99,7 +94,7 @@ In the two examples, note the difference in the `-w` switch. In the first case,
|
|
99
94
|
|
100
95
|
### Debugging
|
101
96
|
|
102
|
-
|
97
|
+
If you are interested in running Hyrax in debug mode, this requires a somewhat different approach than running Hyrax bare-metal. You need to use `docker attach` to debug the running docker instance.
|
103
98
|
|
104
99
|
1. With `docker-compose up` running open a new Terminal session.
|
105
100
|
2. In that new Terminal session, using `docker container ls` find the "CONTAINER ID" for the `hyrax-engine-dev`.
|
@@ -127,6 +122,14 @@ cp: cannot create directory '/var/solr/data/hyrax_test': Permission denied
|
|
127
122
|
|
128
123
|
The solution that appears to work is to `docker-compose down --volumes`; This will tear down the docker instance, and remove the volumes. You can then run `docker-compose up` to get back to work. _**Note:** the `--volumes` switch will remove all custom data._
|
129
124
|
|
125
|
+
#### Errors building the Docker image
|
126
|
+
|
127
|
+
If you encounter errors running `docker-compose build`, try running `bundle update` in `./hyrax` as well as within `./hyrax/.dassie`. That can help clear up the problem of a failure to build a particular gem.
|
128
|
+
|
129
|
+
#### Containers do not all start
|
130
|
+
|
131
|
+
If any of the services fail to start on `docker-compose up`, try clearing out any `Gemfile.lock` files that might exist in `./hyrax` or `./hyrax/.dassie` and run `docker-compose build` again, then `docker-compose up` again.
|
132
|
+
|
130
133
|
<!-- NOTE: This title is referenced in the top-level documentation/developing-your-hyrax-based-app.md. Keep that in mind if you change it. -->
|
131
134
|
## Docker Image for Hyrax-based Applications
|
132
135
|
|
@@ -177,4 +180,4 @@ helm dependency update chart/hyrax
|
|
177
180
|
helm install -n hyrax --set image.tag=(git rev-parse HEAD) dassie chart/hyrax
|
178
181
|
```
|
179
182
|
|
180
|
-
[dockerhub-samveralabs]: https://hub.docker.com/r/samveralabs
|
183
|
+
[dockerhub-samveralabs]: https://hub.docker.com/r/samveralabs
|
data/README.md
CHANGED
@@ -77,6 +77,43 @@ This is where you work on the code-base that will be used by yours and other Hyr
|
|
77
77
|
<p>By moving to Docker, we are encoding the documentation steps for standing up a Hyrax-engine development environment.</p>
|
78
78
|
</aside>
|
79
79
|
|
80
|
+
### Installing Analytics
|
81
|
+
|
82
|
+
Hyrax supports your choice of either Google Analytics or Matomo. To enable analytics tracking and reporting features, follow the directions below.
|
83
|
+
|
84
|
+
Enable Analytics Features
|
85
|
+
|
86
|
+
Analytics can be enabled and configured using environment variables. Set HYRAX_ANALYTICS to true, set either 'google' or 'matomo' for HYRAX_ANALYTICS_PROVIDER, and set the date you would like reporting to start (ANALYTICS_START_DATE).
|
87
|
+
|
88
|
+
```
|
89
|
+
HYRAX_ANALYTICS=true
|
90
|
+
HYRAX_ANALYTICS_PROVIDER=google
|
91
|
+
ANALYTICS_START_DATE=2021-08-21
|
92
|
+
```
|
93
|
+
|
94
|
+
If using google, you'll also need the following ENV variables:
|
95
|
+
|
96
|
+
```
|
97
|
+
GOOGLE_ANALYTICS_ID=UA-111111-1 # Universal ID (Currently Hyrax Analytics only works with Univeral (UA) accounts)
|
98
|
+
GOOGLE_OAUTH_APP_NAME=
|
99
|
+
GOOGLE_OAUTHAPP_VERSION=
|
100
|
+
GOOGLE_OAUTH_PRIVATE_KEY_PATH= # store the .p12 file in the root of your application
|
101
|
+
GOOGLE_OAUTH_PRIVATE_KEY_SECRET=
|
102
|
+
GOOGLE_OAUTH_CLIENT_EMAIL=
|
103
|
+
```
|
104
|
+
|
105
|
+
Add these ENV variables if using Matomo:
|
106
|
+
|
107
|
+
```
|
108
|
+
MATOMO_SITE_ID=
|
109
|
+
MATOMO_BASE_URL=
|
110
|
+
MATOMO_AUTH_TOKEN=
|
111
|
+
```
|
112
|
+
|
113
|
+
#### Analytics Features
|
114
|
+
|
115
|
+
Once analytics is enabled, Hyrax will automatically install the JS tracking code. Page views and downloads of a file set are recorded and sent to the selected analytics provider. Admin users will have access to an expanded dashboard with details about how many vistors viewed a page, and how many visitors downloaded a file. Easily find the top works by views, and most popular file downloads!
|
116
|
+
|
80
117
|
#### Contributing
|
81
118
|
|
82
119
|
We'd love to accept your contributions. Please see our guide to [contributing to Hyrax](./.github/CONTRIBUTING.md).
|
@@ -1,46 +1,44 @@
|
|
1
1
|
export default class {
|
2
|
-
|
3
2
|
constructor(data) {
|
4
3
|
this.userSelector = 'user-activity'
|
5
4
|
this.growthSelector = 'dashboard-growth'
|
6
5
|
this.statusSelector = 'dashboard-repository-objects'
|
7
|
-
|
8
6
|
if (this.hasSelector(this.userSelector))
|
9
7
|
this.userActivity(data.userActivity);
|
10
8
|
if (this.hasSelector(this.growthSelector))
|
11
9
|
this.repositoryGrowth(data.repositoryGrowth);
|
12
10
|
if (this.hasSelector(this.statusSelector))
|
13
11
|
this.objectStatus(data.repositoryObjects);
|
14
|
-
|
15
12
|
}
|
16
|
-
|
17
13
|
// Don't attempt to initialize Morris if the selector is not on the page
|
18
14
|
// otherwise it raises a "Graph container element not found" error
|
19
15
|
hasSelector(selector) {
|
20
|
-
|
16
|
+
return $(`#${selector}`).length > 0;
|
21
17
|
}
|
22
|
-
|
23
18
|
// Draws a bar chart of new user signups
|
24
19
|
userActivity(data) {
|
25
|
-
if (typeof data ===
|
26
|
-
return
|
20
|
+
if (typeof data === 'undefined') return
|
27
21
|
Morris.Bar({
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
22
|
+
element: this.userSelector,
|
23
|
+
data: data,
|
24
|
+
xkey: 'y',
|
25
|
+
ykeys: ['new_users', 'new_visitors', 'returning_visitors', 'total_visitors'],
|
26
|
+
labels: ['New Users', 'New Visitors', 'Returning Visitors', 'Total Visitors'],
|
27
|
+
// TODO: use the ykeys and labels below when the returning_users method in
|
28
|
+
// user_activity_presenter.rb returns data
|
29
|
+
// ykeys: ['new_users', 'returning_users', 'new_visitors', 'returning_visitors', 'total_visitors'],
|
30
|
+
// labels: ['New Users', 'Returning Users', 'New Visitors', 'Returning Visitors', 'Total Visitors'],
|
31
|
+
barColors: [
|
32
|
+
'#001219','#005f73','#0a9396','#94d2bd','#e9d8a6',
|
33
|
+
'#ee9b00','#ca6702','#bb3e03','#ae2012','#9b2226'
|
34
|
+
],
|
35
|
+
gridTextSize: '12px',
|
36
|
+
hideHover: true,
|
37
|
+
resize: true,
|
38
|
+
gridLineColor: '#E5E5E5',
|
39
|
+
stacked: true
|
40
|
+
});
|
42
41
|
}
|
43
|
-
|
44
42
|
// Draws a donut chart of active/inactive objects
|
45
43
|
objectStatus(data) {
|
46
44
|
if (typeof data === "undefined")
|
@@ -48,28 +46,27 @@ export default class {
|
|
48
46
|
Morris.Donut({
|
49
47
|
element: this.statusSelector,
|
50
48
|
data: data,
|
51
|
-
colors: ['#
|
52
|
-
gridTextSize: '
|
49
|
+
colors: ['#001219','#005f73','#0a9396','#94d2bd','#e9d8a6','#ee9b00','#ca6702','#bb3e03','#ae2012','#9b2226'],
|
50
|
+
gridTextSize: '12px',
|
53
51
|
resize: true
|
54
52
|
});
|
55
53
|
}
|
56
|
-
|
57
54
|
// Creates a line graph of collections and object in the last 90 days
|
58
55
|
repositoryGrowth(data) {
|
59
56
|
if (typeof data === "undefined")
|
60
57
|
return
|
61
58
|
Morris.Line({
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
59
|
+
element: this.growthSelector,
|
60
|
+
data: data,
|
61
|
+
xkey: 'y',
|
62
|
+
ykeys: ['works','collections'],
|
63
|
+
labels: ['Works','Collections'],
|
64
|
+
resize: true,
|
65
|
+
hideHover: true,
|
66
|
+
xLabels: 'day',
|
67
|
+
gridTextSize: '12px',
|
68
|
+
lineColors: ['#001219','#005f73','#0a9396','#94d2bd','#e9d8a6','#ee9b00','#ca6702','#bb3e03','#ae2012','#9b2226'],
|
69
|
+
gridLineColor: '#E5E5E5'
|
73
70
|
});
|
74
71
|
}
|
75
72
|
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
class TrackingTags {
|
2
|
+
constructor(provider) {
|
3
|
+
this.provider = provider
|
4
|
+
}
|
5
|
+
|
6
|
+
analytics() {
|
7
|
+
if(this.provider === "matomo") {
|
8
|
+
return _paq;
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
return _gaq
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
pageView() {
|
16
|
+
if(this.provider === "matomo") {
|
17
|
+
return 'trackPageView'
|
18
|
+
} else {
|
19
|
+
return '_trackPageview'
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
trackEvent() {
|
24
|
+
if(this.provider === "matomo") {
|
25
|
+
return 'trackEvent'
|
26
|
+
} else {
|
27
|
+
return '_trackEvent'
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
function trackPageView() {
|
33
|
+
window.trackingTags.analytics().push([window.trackingTags.pageView()]);
|
34
|
+
}
|
35
|
+
|
36
|
+
function trackAnalyticsEvents() {
|
37
|
+
$('span.analytics-event').each(function(){
|
38
|
+
var eventSpan = $(this)
|
39
|
+
window.trackingTags.analytics().push([window.trackingTags.trackEvent(), eventSpan.data('category'), eventSpan.data('action'), eventSpan.data('name')]);
|
40
|
+
})
|
41
|
+
}
|
42
|
+
|
43
|
+
function setupTracking() {
|
44
|
+
var provider = $('meta[name="analytics-provider"]').prop('content')
|
45
|
+
window.trackingTags = new TrackingTags(provider)
|
46
|
+
trackPageView()
|
47
|
+
trackAnalyticsEvents()
|
48
|
+
}
|
49
|
+
|
50
|
+
if (typeof Turbolinks !== 'undefined') {
|
51
|
+
$(document).on('turbolinks:load', function() {
|
52
|
+
setupTracking()
|
53
|
+
})
|
54
|
+
} else {
|
55
|
+
$(document).on('ready', function() {
|
56
|
+
setupTracking()
|
57
|
+
})
|
58
|
+
}
|
59
|
+
|
60
|
+
$(document).on('click', '#file_download', function(e) {
|
61
|
+
var provider = $('meta[name="analytics-provider"]').prop('content')
|
62
|
+
window.trackingTags = new TrackingTags(provider)
|
63
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set', 'file-set-download', $(this).data('label')]);
|
64
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set-in-work', 'file-set-in-work-download', $(this).data('work-id')]);
|
65
|
+
$(this).data('collection-ids').forEach(function (collection) {
|
66
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set-in-collection', 'file-set-in-collection-download', collection]);
|
67
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'work-in-collection', 'work-in-collection-download', collection]);
|
68
|
+
});
|
69
|
+
});
|