Skip to main content
Version: 1.1

Further Customization Guide

Inventory

The inventory is your main source for customizing the platform. This file and all of its content are described in the Inventory Customization Guide.

Customization Files

This section shows file-based customizations regarding specific components.

Keycloak

With Keycloak it is possible to use a custom theme, which is then applied for the realm and its clients. The files below show where for example email-text and the background image can be customized.

  • /templates/keycloak/customization/email/messages_de.properties: This file contains the German templates for email content. It is placed inside the keycloak instances during the deployment.
  • /templates/keycloak/customization/custom-theme/theme/login/resources/img/keycloak-bg.png: This file contains the background image of the Keycloak login screen. The file needs to be a png in order to get displayed. Its target resolution should be 1920x1080. It is placed inside the Keycloak instances during the deployment.

In order to use your changes, a jar file containing the ocp-custom folder has to be created and a URL to it has to be provided within the inventory alongside the name of the theme:

inv_idm:
keycloak:
theme: "<theme_name>" # Use "keycloak" for basic theme
theme_url: "<theme_url>"

To create the jar file, you can use Fastjar:

sudo apt install fastjar
jar cvf theme.jar .

Customize Geo-data content

For customized geodata content, fork and modify the repository as needed.

The current default content is loaded from geoportal-components.

Fork the repository and check the content in the different folders to adjust it.

The repository contains a pre-configured CI/CD pipeline to create the needed images. After the first build, you can copy the needed path for the inventory from the container registry in gitlab.

Dump and Restore Geo-data

Once a new platform has been deployed, the need to transfer geodata from one instance to the new one might arise. To this end, a dump of the old data must be created and restored in the new database, and access rights might have to be adjusted. You can use the following snippets for your reference:

  • Dump
# USER most likely is the `postgres` user
pg_dumpall -h {DOMAIN} -p 31876 -U {USER} -W -c > db.out
  • Restore
# The database for geodata is a postgis, so the DATABASE_POD is something like geodata-postgis-{...}
kubectl exec -i {{DATABASE_POD}} -- /bin/bash -c "PGPASSWORD={USER_PASS} psql --username {USER} {DATABASE_NAME}" < db.out
  • Adjust permissions

If the username of the database user has changed, the database-owner has to be set to the new one by executing the following SQL command:

ALTER DATABASE {DATABASE_NAME} OWNER TO {NEW_DATABASE_USER}

Note: Restoring a dump also recreates users with the same username alongside with adjusting the password. The easiest way to resolve this is to log in to PgAdmin and update the usernames as needed. For the system to work properly, the passwords for the two users WEBGIS_POSTGRES_ADMIN and MAPSERVER_POSTGIS_USER (found in the inventory) must be set properly.