Skip to Content
CustomizeConfigureOverview

Configuration

InvenioRDM comes with a set of configuration options that can be adjusted to modify the behavior of various features and components. On top of that, NRP introduces additional configuration options that are specific to NRP-based repositories through various extension packages.

Here is an overview of what could be achieved through configuration in NRP-based repositories.

Invenio.cfg file

Invenio RDM configuration is based on Flask application configuration system. For more details on how to configure an InvenioRDM application, please refer to the InvenioRDM Configuration Documentation .

NRP-based repositories use the same mechanisms for configuration as InvenioRDM applications. You can set configuration values in the primary Invenio configuration file — invenio.cfg, via environment variables (prefixed by INVENIO_), or variables file located in the root of your repository project.

On top of that, a helper config module  is available for you to use in your invenio.cfg file to help you configure NRP-specific features by a preset-based configuration approach.

An example invenio.cfg file using the helper config module might be as simple as:

# invenio.cfg from invenio_i18n import lazy_gettext as _ from oarepo import config # localization / internationalization config.initialize_i18n() config.configure_generic_parameters() config.configure_ui( code="myrepo", name=_("My NRP Repository"), description=_("My NRP-based repository for research data."), ) config.configure_cron() config.configure_stats() import os os.environ["DYLD_FALLBACK_LIBRARY_PATH"]="/opt/homebrew/lib" # datasets model registration from mymodel import mymodel_model mymodel_model.register() DASHBOARD_RECORD_CREATE_URL = "/mymodel/uploads/new"

Or as complex as you need it to be. The invenio.cfg is a regular Python script, so you can use any Python code you need to set up your repository configuration.

Configuration helpers (configure_*)

Configuration helpers are utility functions that simplify the process of setting up common configuration options in NRP-based repositories. They can be used in your invenio.cfg file to quickly configure various aspects of your repository without needing to manually set each configuration constant.

Common helpers are provided for NRP repositories by the oarepo.config  Python module.

All helpers set configuration constants in the caller module (typically invenio.cfg) using oarepo.config.base.set_constants_in_caller and read environment/variables via oarepo.config.base.load_configuration_variables where applicable.


Last updated on