HIGHLY IN DEVELOPMENT: Do not use for production
This importer harvests episodes and series (lecture recordings) from Opencast instances and pushes them as external references to an Edu-Sharing instance.
npm install
.env.template
file to .env
.env
file as described in the comments.
# (Required) Edu-Sharing host
ES_HOST_PROTO=http
ES_HOST_DOMAIN=localhost
ES_USER=opencast ES_PASSWORD=opencast
4. Rename `config.oc-instances.js.template` to `config.oc-instances.js` in folder `./src/config/`
5. Edit `./src/config/config.oc-instances.js` and add Opencast instances as JSON objects (orgName, orgUrl, protocol, domain). Keys with org Prefix are nescessary for a minimal metadata set of Edu-Sharing nodes. Optionally, the ROR can be specified.<br />
```js
{
orgName: 'Opencast',
orgUrl: 'https://opencast.org',
protocol: 'https',
domain: 'develop.opencast.org',
blacklistedIds: []
}
List Ids of oc-records you don't want to import into edu-sharing in blacklistedIds.
npm start
in repository directory.
npm start
// or directly
node src/index.js
Config file can be found in src/config/config.js
. It contains four JSON objects each for Edu-Sharing, Opencast, Logger and Filter functionalities.
config.es = {
// Edu-Sharing instance config from .env file
host: {
// [...]
},
// Edu-Sharing http requests settings
settings: {
// Maximal number of http requests send to Edu-Sharing instance at once.
// Reduce value to reduce Edu-Sharing load.
// Increase carefully: In some cases Edu-Sharing was not able to process more than 2 requests parallel.
maxPendingPromises: 2
},
// Edu-Sharing API routes
routes: {
// [...]
}
}
config.oc = {
// Force update episodes and series from Opencast instances
forceUpdate: false,
// Opencast instances from /src/config/config.oc-instances.js
instances: ocInstances,
// Opencast http requests settings
settings: {
maxPendingPromises: 2, // Maximal number of simultaneous https requests
requestOffset: 5 // Number of requested episodes and series (like pagination)
},
// Opencast API routes
routes: {
// [...]
},
// Storage file names
filenames: {
episodes: 'ocEpisodes.json',
series: 'ocSeries.json',
episodesData: 'episodesData.json',
seriesData: 'seriesData.json'
}
}
// Logger settings
config.logger = {
folderPath: './logs/',
dateBasedFileNaming: true,
fileNamePrefix: 'es-oc-importer_',
fileNameExtension: '.log',
timeZone: 'Europe/Berlin',
dateFormat: 'YYYY-MM-DD',
timeFormat: 'HH:mm:ss',
logLevel: 'debug',
onlyFileLogging: false
}
// Filter settings (only harvest episodes with allowed licences)
// Mind the formatting if you add new licences like CC-BY-NC-ND
config.filter = {
allowedLicences: ['CC0', 'CC-BY', 'CC-BY-SA', 'PD', 'PDM']
}
Define mapping of opencast-values to edu-sharing-values in src/config/mapping.js
.
npm run dev
Linting and formatting is run by a husky-hook with every commit. See package.json
file for config.
You can also run linting and formatting via this commands:
npm run format
npm run lint
npm run lint:fix
💻 virtUOS (University Osnabrück)
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator