Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Bulkrax is a batteries included importer for Samvera applications. It currently includes support for OAI-PMH (DC and Qualified DC) and CSV out of the box. It is also designed to be extensible, allowing you to easily add new importers in to your application or to include them with other gems. Bulkrax provides a full admin interface including creating, editing, scheduling and reviewing imports.
Add this line to your application's Gemfile:
gem 'bulkrax'
# or if using from github
gem 'bulkrax', git: 'https://github.com/samvera/bulkrax.git', branch: 'main'
And then execute:
$ bundle install
$ rails generate bulkrax:install
$ rails db:migrate
If using Sidekiq, set up queues for import
and export
.
Add this line to your application's Gemfile:
gem 'bulkrax'
And then execute:
$ bundle install
$ rails db:migrate
Mount the engine in your routes file
mount Bulkrax::Engine, at: '/'
If using Sidekiq, set up queues for import
and export
.
# in config/sidekiq.yml
:queues:
- default
- import # added
- export # added
# your other queues ...
# in app/assets/javascripts/application.js - before //= require_tree .
//= require bulkrax/application
# in app/assets/stylesheets/application.css - before *= require_self
*= require 'bulkrax/application'
You'll want to add an initializer to configure the importer to your needs:
# config/initializers/bulkrax.rb
Bulkrax.setup do |config|
# some configuration
end
The configuration guide provides detailed instructions on the various available configurations.
Example:
Bulkrax.setup do | config |
# If the work type isn't provided during import, use Image
config.default_work_type = 'Image'
# Setup a field mapping for the OaiDcParser
# Your application metadata fields are the key
# from: fields in the incoming source data
config.field_mappings = {
"Bulkrax::OaiDcParser" => {
"contributor" => { from: ["contributor"] },
"creator" => { from: ["creator"] },
"date_created" => { from: ["date"] },
"description" => { from: ["description"] },
"identifier" => { from: ["identifier"] },
"language" => { from: ["language"], parsed: true },
"publisher" => { from: ["publisher"] },
"related_url" => { from: ["relation"] },
"rights_statement" => { from: ["rights"] },
"source" => { from: ["source"], source_identifier: true },
"subject" => { from: ["subject"], parsed: true },
"title" => { from: ["title"] },
"resource_type" => { from: ["type"], parsed: true },
"remote_files" => { from: ["thumbnail_url"], parsed: true }
}
}
end
An Import needs to know what Work Type to create. The importer looks for:
If it does not find either of these, or the data they contain is not a valid Work Type in the repository, the default_work_type
will be used.
The install generator sets default_work_type
to the first Work Type returned by Hyrax.config.curation_concerns
(stringified), but this can be overwritten by setting default_work_type
in config/initializer/bulkrax.rb
as shown above.
It's unlikely that the incoming import data has fields that exactly match those in your repository. Field mappings allow you to tell bulkrax how to map field in the incoming data to a field in your application.
By default, a mapping for the OAI parser has been added to map standard oai_dc fields to Hyrax basic_metadata. The other parsers have no default mapping, and will map any incoming fields to Hyrax properties with the same name. Configurations can be added in config/initializers/bulkrax.rb
Configuring field mappings is documented in the Bulkrax Configuration Guide.
HasLocalProcessing
class injected by the generator.For example:
module Bulkrax::HasLocalProcessing
def add_local
parsed_metadata['file'] = image_paths
end
# Files are in a folder called files, relative to the import file
# with a sub-folder that matches the system_identifier_field
def image_paths
import_path = importerexporter.parser_fields['import_file_path']
import_path = File.dirname(import_path) if File.file?(import_path)
real_path = File.join(import_path, 'files', "#{parsed_metadata[Bulkrax.system_identifier_field].first}")
Dir.glob(real_path)
end
end
For further information on how to extend and customize Bulkrax, please see the Bulkrax Customization Guide.
Once you have Bulkrax installed, you will have access to an easy to use interface with which you are able to create, edit, delete, run, and re-run imports and exports.
Imports can be scheduled to run once or on a daily, monthly or yearly interval.
Import and export is available to admins via the Importers tab on the dashboard. Export currently supports CSV only.
From the admin dashboard, select the "Importers" tab. You will see a list of previously created importers with details of last run, next run, number of records enqueued and processed, failures, deleted upstream records, and total records. From this page you can create a new importer, edit an importer or delete an importer.
From the admin dashboard, select the "Exporters" tab. You will see a list of previously created exporters with details of last run, number of records enqueued and processed, failures, deleted upstream records, and total records. From this page you can create a new exporter, edit an exporter or delete an exporter.
To create a new importer, select the "New" button on the Importers or Exporters page and complete the form. Name and, for Importer, Administrative set are required. When you select a parser, you will see a set of specific fields to complete.
To edit an importer or exporter, select the edit icon (pencil) and complete the form.
To delete an importer or exporter, select the delete (x) icon.
Once your the exporter has run, a download icon will appear on the exporters menu page.
If you're working on a PR for this project, create a feature branch off of main
.
This repository follows the Samvera Community Code of Conduct and language recommendations. Please do not create a branch called master
for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository.
See CONTRIBUTING.md for contributing guidelines.
We encourage everyone to help improve this project. Bug reports and pull requests are welcome on GitHub at https://github.com/samvera/bulkrax.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
Questions can be sent to support@notch8.com. Please make sure to include "Bulkrax" in the subject line of your email.
The gem is available as open source under the terms of the Apache 2.0 License.
FAQs
Unknown package
We found that bulkrax demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.