Configuration
Installation directory
Section titled “Installation directory”Everything belonging to the installation lives in one directory. Create it
somewhere with enough space, for example /opt/rap:
sudo mkdir -p /opt/rapcd /opt/rapBy the end of the installation it looks like this:
/opt/rap/├── .env # values the Compose file needs├── rap.config.sh # values used during installation├── docker-compose.yml├── 3240-abcd-1234-acme.cl # license file├── config/ # AI middleware configuration│ ├── credentials.yaml│ └── api_keys.yaml├── rw/ # application state: ktbs.cl, license.cl, logs│ ├── ktbs.cl│ └── license.cl├── rwshared/ # disk pool for file blobs — grows large└── data/aimiddleware/ # AI middleware runtime dataDirectories and ownership
Section titled “Directories and ownership”The containers do not run as root. The application runs as UID/GID 1234, the
AI middleware as 6000, and both need to write into their directories:
sudo mkdir -p rw rwshared/pool data/aimiddleware sqlsudo chown -R 1234:1234 rw rwshared sqlsudo chown -R 6000:6000 data/aimiddlewareInstallation variables
Section titled “Installation variables”rap.config.sh holds the values for your installation. It is used in the
following steps to generate the application configuration and to set up the
database. It is not read at runtime.
Download it into the installation directory — Rulemapping Solutions may have pre-filled parts of it for you:
chmod 0600 rap.config.shThis is its content:
#!/bin/bash
# Provided by Rulemapping SolutionsPREFIX=acmeLICENSE=3240-abcd-1234-acme.cl
DOMAIN=example.comADMIN_EMAIL=admin@example.com
# DatabaseDB_HOST=db.example.comDB_PORT=5432DB_NAME=ktbs_$PREFIX
DB_SUPERUSER=postgresDB_SUPERUSER_DB_NAME=postgres
DB_ADMIN_PASSWORD=admin_mysecretDB_SERVER_PASSWORD=server_mysecretDB_RO_PASSWORD=ro_mysecret
# MailSMTP_HOST=smtp.example.comSMTP_USER=smtp-userSMTP_PASSWORD=smtp-password
FROM_ADDRESS=support@$DOMAINREPLY_ADDRESS=no-reply@$DOMAINReplace every placeholder value — see the table below for what each one means:
$EDITOR rap.config.shOnly then load the values into your shell:
source ./rap.config.shCheck that what got loaded is yours and not the template:
echo "$PREFIX | $DOMAIN | $DB_HOST | $DB_NAME | $ADMIN_EMAIL"| Variable | Description |
|---|---|
PREFIX |
Project name, provided by Rulemapping Solutions. Letters and digits only. Determines the URL path, the database name and the role names. |
LICENSE |
Filename of your license file; will be copied to /rw/license.cl |
DOMAIN |
Your domain; used when links are generated |
ADMIN_EMAIL |
Email address of the first admin user, created during installation; you can login to the platform with this user |
DB_HOST, DB_PORT |
Database host and port |
DB_SUPERUSER |
Existing account allowed to create roles and databases. Used only during installation, not at runtime. On managed database services this is rarely called postgres — use the master user of your instance. |
DB_SUPERUSER_DB_NAME |
An already existing database to connect to while creating the new one — CREATE DATABASE cannot run from inside the database being created. Usually the postgres maintenance database. |
DB_NAME |
Name of the application database |
DB_ADMIN_PASSWORD |
Password for the admin_<PREFIX> role, which owns the schema |
DB_SERVER_PASSWORD |
Password for the server_<PREFIX> role, which the application connects as |
DB_RO_PASSWORD |
Password for the read-only ro_<PREFIX> role |
SMTP_HOST, SMTP_USER, SMTP_PASSWORD |
SMTP server and credentials |
FROM_ADDRESS, REPLY_ADDRESS |
Sender and reply-to address of outgoing mail |
Compose variables
Section titled “Compose variables”.env holds the two values the Compose file needs. Compose reads this file
automatically.
cat > .env <<EOFPREFIX=$PREFIXTZ=Europe/BerlinEOFApplication configuration
Section titled “Application configuration”The application reads its configuration from rw/ktbs.cl. Generate it from the
variables you just set:
sudo tee rw/ktbs.cl > /dev/null <<EOF:process-offset 0:prefix "$PREFIX":listen-port 8080:proxy-protocol-scheme "https":proxy-host-name "$PREFIX.$DOMAIN":extra-tabs (:pfe :tabd14 :dcpr :mandanten :deadlines :adressen :rvg):database-specification (:host "$DB_HOST" :port $DB_PORT :database "$DB_NAME" :user-name "server_$PREFIX" :password "$DB_SERVER_PASSWORD"):from-address "$FROM_ADDRESS":reply-address "$REPLY_ADDRESS":smtp-server (:host "$SMTP_HOST" :username "$SMTP_USER" :password "$SMTP_PASSWORD")EOF
sudo chown 1234:1234 rw/ktbs.clsudo chmod 0600 rw/ktbs.cl
# check the result — the placeholders must all be substitutedsudo cat rw/ktbs.cl:proxy-host-name is the host name under which users reach the application. It
is the host the application puts into absolute URLs whenever the reverse proxy
does not send an X-Forwarded-Host header.
Setting it also matters for :proxy-protocol-scheme: the application only uses
that scheme for absolute URLs when it knows it is behind a proxy — either from
X-Forwarded-Host or from this value. With neither, it falls back to the scheme
and port of the incoming request, which is plain HTTP.
License file
Section titled “License file”The application expects the license at rw/license.cl:
sudo cp "$LICENSE" rw/license.clsudo chown 1234:1234 rw/license.clsudo chmod 0400 rw/license.cl
sudo cat rw/license.clKeep the original file in the installation directory as well — the filename records which version the license is bound to.