Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Changes
=======

Version 0.13.0

- config: new variables for invenio-app-rdm v13 in invenio.cfg, update nginx.conf
- uv: update uv.lock with newest versions supported by invenio-app-rdm v13
- pipfiles: deleted
- dockerfiles: changed npm to pnpm, added environment variable for invenio-assets
- actions: install invenio-override with preferred branch

Version 0.12.0 (released 2025-02-10)

- initial release
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ COPY pyproject.toml uv.lock ./

RUN uv sync --frozen

# to use rspack
ENV INVENIO_WEBPACKEXT_PROJECT="invenio_assets.webpack:rspack_project"

COPY ./app_data/ ${INVENIO_INSTANCE_PATH}/app_data/
COPY ./assets/ ${INVENIO_INSTANCE_PATH}/assets/
Expand All @@ -15,8 +17,9 @@ COPY ./templates ${INVENIO_INSTANCE_PATH}/templates/
RUN invenio collect --verbose && invenio webpack create

WORKDIR ${INVENIO_INSTANCE_PATH}/assets
RUN npm install --legacy-peer-deps
RUN npm run build
RUN pnpm install
RUN pnpm run build


# STAGE 2
FROM ghcr.io/tu-graz-library/docker-invenio-base:main-frontend AS frontend
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.mug
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ COPY pyproject.toml uv.lock ./

RUN uv sync --frozen

# to use rspack
ENV INVENIO_WEBPACKEXT_PROJECT="invenio_assets.webpack:rspack_project"

COPY ./app_data/ ${INVENIO_INSTANCE_PATH}/app_data/
COPY ./assets/ ${INVENIO_INSTANCE_PATH}/assets/
Expand All @@ -18,8 +20,8 @@ COPY themes/MUG/variables.less /opt/env/lib/python3.12/site-packages/invenio_ove
RUN invenio collect --verbose && invenio webpack create

WORKDIR ${INVENIO_INSTANCE_PATH}/assets
RUN npm install --legacy-peer-deps
RUN npm run build
RUN pnpm install
RUN pnpm run build

# STAGE 2
FROM ghcr.io/tu-graz-library/docker-invenio-base:main-frontend AS frontend
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.theme
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ COPY pyproject.toml uv.lock ./

RUN uv sync --frozen

# to use rspack
ENV INVENIO_WEBPACKEXT_PROJECT="invenio_assets.webpack:rspack_project"

COPY ./app_data/ ${INVENIO_INSTANCE_PATH}/app_data/
COPY ./assets/ ${INVENIO_INSTANCE_PATH}/assets/
Expand All @@ -15,8 +17,8 @@ COPY ./templates ${INVENIO_INSTANCE_PATH}/templates/
RUN invenio collect --verbose && invenio webpack create

WORKDIR ${INVENIO_INSTANCE_PATH}/assets
RUN npm install --legacy-peer-deps
RUN npm run build
RUN pnpm install
RUN pnpm run build

# STAGE 2
FROM ghcr.io/tu-graz-library/docker-invenio-base:main-frontend AS frontend
Expand Down
15 changes: 0 additions & 15 deletions Pipfile

This file was deleted.

3,524 changes: 0 additions & 3,524 deletions Pipfile.lock

This file was deleted.

8 changes: 8 additions & 0 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@ http {

include /etc/nginx/conf.d/*.conf;
}

include /etc/nginx/mime.types;
default_type application/octet-stream;
types {
# Tell nginx that ECMAScript modules are also JS
application/javascript js mjs;
}

25 changes: 24 additions & 1 deletion invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SECRET_KEY = "CHANGE_ME"
# provided, the allowed hosts variable is set to localhost. In production it
# should be set to the correct host and it is strongly recommended to only
# route correct hosts to the application.
APP_ALLOWED_HOSTS = ["0.0.0.0", "localhost", "127.0.0.1"]
TRUSTED_HOSTS = ["0.0.0.0", "localhost", "127.0.0.1"]


# Flask-SQLAlchemy
Expand Down Expand Up @@ -239,6 +239,29 @@ I18N_LANGUAGES = [("de", _("German"))]
THEME_SHOW_FRONTPAGE_INTRO_SECTION = False
"""Set True for frontpage Intrp."""

RDM_USER_MODERATION_ENABLED = True
"""User moderation feature enabled."""

RDM_SEARCH_SORT_BY_VERIFIED = True
"""Enable the sorting of records by verified."""

USERS_RESOURCES_ADMINISTRATION_ENABLED = True
"""Enable user administration."""

USERS_RESOURCES_GROUPS_ENABLED = True
"""Config to enable features related to existence of groups."""

COMMUNITIES_ADMINISTRATION_DISABLED = False # this enables it
"""Enable communities administration."""

APP_RDM_SUBCOMMUNITIES_LABEL = "Projects"
"""Label for subcommunities in communities browse page."""

COMMUNITIES_SHOW_BROWSE_MENU_ENTRY = True
"""Toggle to show or hide the 'Browse' menu entry for communities."""

JOBS_ADMINISTRATION_ENABLED = True
"""Enable Jobs administration view."""

# Invenio-Override
# --------------
Expand Down
87 changes: 87 additions & 0 deletions migrations/migrate12to13/steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Migrate from v12 to v13

## set env variables

```bash
RDM_USER_MODERATION_ENABLED = True
"""User moderation feature enabled."""

RDM_SEARCH_SORT_BY_VERIFIED = True
"""Enable the sorting of records by verified."""

USERS_RESOURCES_ADMINISTRATION_ENABLED = True
"""Enable user administration."""

USERS_RESOURCES_GROUPS_ENABLED = True
"""Config to enable features related to existence of groups."""

COMMUNITIES_ADMINISTRATION_DISABLED = False # this enables it
"""Enable communities administration."""

APP_RDM_SUBCOMMUNITIES_LABEL = "Projects"
"""Label for subcommunities in communities browse page."""

COMMUNITIES_SHOW_BROWSE_MENU_ENTRY = True
"""Toggle to show or hide the 'Browse' menu entry for communities."""

JOBS_ADMINISTRATION_ENABLED = True
"""Enable Jobs administration view."""
```

## update env variables

- change from `APP_ALLOWED_HOSTS` to `TRUSTED_HOSTS` due flask >= 3

## Update Services


### Configuration change for nginx


The new PDF file previewer is based on pdfjs-dist v4, which uses ECMAScript
modules (.mjs) over CommonJS files (.js). These files are not registered in the
default configuration for nginx. This can result in the MIME type being reported
incorrectly, and thus being blocked by the browser, leading to a broken PDF
preview.

Luckily, this can be simply fixed by adding a custom types entry; e.g. in the
http block in nginx.conf (cf. this Cookiecutter PR).

```
include /etc/nginx/mime.types;
default_type application/octet-stream;
types {
# Tell nginx that ECMAScript modules are also JS
application/javascript js mjs;
}
```

## Data Migration

Because the new instance version will no longer mandatory depend on invenio-records-lom and invenio-records-marc21, some errors can appear when trying to run the database migration. The steps to resolve these are the following:

1. Login/enter the environment where the instance is deployed.
2. Access the database and run ```select * from alembic_version```.
3. In the invenio-records-lom and invenio-records-marc21 look for revisions id that are found in the results of the query at the second step.
4. Delete the migrations you do not need.

After that you can run the following commands:

```bash
invenio db create
```

run this to create any new table

```bash
invenio alembic upgrade
```

this has to be done to add maybe other small changes to the database too
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you had some issue with the database running invenio alembic upgrade - add that step as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already added in the first steps of Data Migration section



# reindex

```
invenio rdm rebuild-all-indices
```
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ authors = [
]

dependencies = [
"invenio-app-rdm[opensearch2] ~=12.0.0",
"invenio-assets >=3.1.0,<3.2.0",
"invenio-logging[sentry_sdk] ~=2.0",
"invenio-app-rdm[opensearch2] ~=13.0.0b3.dev2",
"invenio-logging[sentry_sdk]>=4.0.0,<5.0.0",
"uwsgi >=2.0",
"uwsgitop >=0.11",
"uwsgi-tools >=1.1.1",
"invenio-override ~=0.0.3"
"invenio-override[marc21] ~=0.0.4",
]

[tool.setuptools]
py-modules = []

[tool.uv.sources]
invenio-override = { git = "https://github.com/sharedRDM/invenio-override", branch = "main" }
#invenio-override = { path = "/Users/lpandath/Documents/work/rdm/invenio/invenio-instances/invenio-version-9/invenio-override", editable=true }
#invenio-override = { path = "/home/eduard/Schreibtisch/invenio-override", editable=true }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note - this is okay for now but should remove this once you have a release from instance v0.13.0.

#invenio-cli = { git = "https://github.com/utnapischtim/invenio-cli", branch = "move-to-uv-instead-of-pip" }
#invenio-theme-tugraz = { git = "https://github.com/tu-graz-library/invenio-theme-tugraz", branch = "master" }
33 changes: 25 additions & 8 deletions themes/MUG/invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SECRET_KEY="CHANGE_ME"
# provided, the allowed hosts variable is set to localhost. In production it
# should be set to the correct host and it is strongly recommended to only
# route correct hosts to the application.
APP_ALLOWED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1']
TRUSTED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1']


# ============================================================================
Expand Down Expand Up @@ -231,6 +231,30 @@ THEME_SHOW_FRONTPAGE_INTRO_SECTION = True
THEME_FOOTER_TEMPLATE = "invenio_override/footer_mug.html"
"""footer template"""

RDM_USER_MODERATION_ENABLED = True
"""User moderation feature enabled."""

RDM_SEARCH_SORT_BY_VERIFIED = True
"""Enable the sorting of records by verified."""

USERS_RESOURCES_ADMINISTRATION_ENABLED = True
"""Enable user administration."""

USERS_RESOURCES_GROUPS_ENABLED = True
"""Config to enable features related to existence of groups."""

COMMUNITIES_ADMINISTRATION_DISABLED = False # this enables it
"""Enable communities administration."""

APP_RDM_SUBCOMMUNITIES_LABEL = "Projects"
"""Label for subcommunities in communities browse page."""

COMMUNITIES_SHOW_BROWSE_MENU_ENTRY = True
"""Toggle to show or hide the 'Browse' menu entry for communities."""

JOBS_ADMINISTRATION_ENABLED = True
"""Enable Jobs administration view."""

# ============================================================================
# Invenio-override
# Configure theme elements, such as logos, icons, and footer templates.
Expand Down Expand Up @@ -288,13 +312,6 @@ OVERRIDE_SHOW_PUBLICATIONS_SEARCH = True
OVERRIDE_SHOW_EDUCATIONAL_RESOURCES = False
"""Enable or disable the educational resources global search feature."""

import invenio_records_lom.ext

def register_lom_dashboard_tab():
pass

invenio_records_lom.ext.register_lom_dashboard_tab = register_lom_dashboard_tab

GLOBAL_SEARCH_SCHEMAS = {
"rdm": {
"schema": "rdm",
Expand Down
Loading