Configuration Reference
This page describes every configuration file in this package. For the quick-start installation guide, see install.md.
Important
This guide uses the hostname intocps.org as an example. Replace it
with the hostname of your server.
config/.env - Docker Compose Environment
Source: config/.env.example
This file holds the environment variables that docker-compose.yml reads.
Server Settings
| Variable | Example | Description |
|---|---|---|
SERVER_DNS |
intocps.org |
Domain name or IP address of the server. Do not include https://. |
USERNAME1 |
user1 |
Path prefix and workspace name for the first user |
USERNAME2 |
user2 |
Path prefix and workspace name for the second user |
COMPOSE_PROJECT_NAME |
dtaas |
Docker Compose project name (rarely needs changing) |
OAuth 2.0 Settings
Fill these in after the GitLab instance is running and the OAuth 2.0 applications exist (see OAuth 2.0 Application Setup).
| Variable | Example | Description |
|---|---|---|
OAUTH_URL |
https://intocps.org/gitlab |
GitLab instance URL used for browser-side authorisation redirects. No trailing slash. |
OAUTH_CLIENT_ID |
(from GitLab) | Application ID from the DTaaS Server Authorization OAuth 2.0 application |
OAUTH_CLIENT_SECRET |
(from GitLab) | Secret from the DTaaS Server Authorization OAuth 2.0 application |
OAUTH_SECRET |
(random string) | Encryption key for OAuth session cookies. Generate with: openssl rand -base64 32 |
How Variables Map to Services
| Variable | Used by |
|---|---|
SERVER_DNS |
client, logger-ms, user1, user2, libms, traefik-forward-auth, gitlab |
USERNAME1 / USERNAME2 |
user1, user2 (routing and workspace volumes) |
OAUTH_URL |
traefik-forward-auth (browser redirect URL) |
OAUTH_CLIENT_ID / OAUTH_CLIENT_SECRET |
traefik-forward-auth |
OAUTH_SECRET |
traefik-forward-auth |
traefik-forward-auth reaches the token and user endpoints over the
internal Docker network (http://gitlab/gitlab/...), so only the
authorisation redirect uses OAUTH_URL.
config/client.js - DTaaS Web Client
Source: config/client.js.example
This JavaScript file is mounted into the React client container and configures the DTaaS web application at runtime.
Variable Reference
| Variable | Example | Description |
|---|---|---|
REACT_APP_ENVIRONMENT |
prod |
Environment name. Use prod for production. |
REACT_APP_URL |
https://intocps.org |
Base URL of the DTaaS web application |
REACT_APP_URL_BASENAME |
'' |
Optional URL base path (leave empty for root hosting) |
REACT_APP_URL_DTLINK |
/lab |
URL path for the Digital Twin workbench |
REACT_APP_URL_LIBLINK |
'' |
URL path for the Library |
REACT_APP_CLIENT_ID |
(from GitLab) | Application ID from the DTaaS Client Authorization OAuth 2.0 application |
REACT_APP_AUTH_AUTHORITY |
https://intocps.org/gitlab |
URL of the GitLab instance (OAuth 2.0 issuer) |
REACT_APP_REDIRECT_URI |
https://intocps.org/Library |
Where GitLab sends users after sign-in |
REACT_APP_LOGOUT_REDIRECT_URI |
https://intocps.org/ |
Where users land after sign-out |
REACT_APP_GITLAB_SCOPES |
openid profile read_user read_repository api |
OAuth 2.0 scopes requested during sign-in |
LOGGER_URL |
https://intocps.org/logger |
URL of the logger service |
Example
config/conf.server - Traefik Forward-Auth Rules
Source: config/conf.server.example
This file defines per-path authorisation rules for traefik-forward-auth. Each rule restricts a URL path to specific GitLab email addresses.
Format
Default Rules
Replace user1, user2 and the email addresses with those of the
actual GitLab accounts.
Important Rules
Warning
The usernames in config/.env (USERNAME1, USERNAME2) must match
the PathPrefix values in config/conf.server. A mismatch causes
routing or authorisation failures.
| Scenario | Behaviour |
|---|---|
Route in config/.env but missing from config/conf.server |
Any signed-in user can access the route (default forward-auth behaviour) |
Route in config/conf.server but missing from config/.env |
Traefik returns 404 (route not served) |
The /lib rule has no whitelist |
Any signed-in user can access the library service |
certs/ - TLS Certificates
Place the TLS certificate files here:
The certificates must be valid for SERVER_DNS (e.g. intocps.org
or *.intocps.org).
To obtain certificates with certbot:
If the certificate files are absent or invalid, Traefik uses self-signed certificates and browsers show a security warning.
files/ - User Workspace Directories
Each user workspace container mounts a directory from files/ as
its /workspace volume. All workspaces share the files/common/
directory, which is mounted at /workspace/common in each container.
Create a directory for each user:
UID 1000 and GID 100 match the default user inside the
workspace container.
logs/logger/ - Logger Microservice Events
The logger microservice writes the captured events to
logs/logger/workflow-logs.jsonl. Create the directory and give it to
uid 1000, the user that runs the logger:
logs/ itself holds the GitLab logs, so change the owner of
logs/logger only.
OAuth 2.0 Application Setup
Once the GitLab instance is running, register two OAuth 2.0 applications to connect DTaaS and Traefik forward-auth to the integrated GitLab.
DTaaS Client Authorization (React Frontend)
- In GitLab, go to Admin Area → Applications (or the user's Edit Profile → Applications).
- Create a new application:
- Name: DTaaS Client Authorization
- Redirect URI:
https://intocps.org/Library - Confidential: unticked (public SPA client)
- Scopes:
openid,profile,read_user,read_repository,api - Save the Application ID.
- Set
REACT_APP_CLIENT_IDinconfig/client.jsto this Application ID. - Set
REACT_APP_AUTH_AUTHORITYinconfig/client.jstohttps://intocps.org/gitlab.
For details, see the client auth documentation.
DTaaS Server Authorization (Traefik Forward-Auth)
- In GitLab, go to Admin Area → Applications.
- Create a new application:
- Name: DTaaS Server Authorization
- Redirect URI:
https://intocps.org/_oauth - Confidential: ticked
- Scopes:
read_user - Save the Application ID and Secret.
- Set
OAUTH_CLIENT_IDandOAUTH_CLIENT_SECRETinconfig/.env. - Set
OAUTH_URLinconfig/.envtohttps://intocps.org/gitlab. - Generate
OAUTH_SECRETwithopenssl rand -base64 32and set it inconfig/.env.
For details, see the server auth documentation.
Reload After Configuration
After putting the OAuth 2.0 credentials into the configuration files, reload the affected services:
Adding More Users
To add a third user:
- Add a service to
docker-compose.yml:
- Add to
config/.env:
- Create the workspace directory:
- Add an authorisation rule to
config/conf.server:
-
Create a GitLab account for
alicein the integrated GitLab instance. -
Restart:
Troubleshooting
GitLab Takes Too Long to Start
GitLab CE needs substantial resources, and the first startup can take
5 to 10 minutes. Follow progress with
docker compose --env-file config/.env logs -f gitlab.
Make sure the host has at least 4 GB of RAM available for GitLab.
Authentication Redirect Loop
- Check that
OAUTH_URLinconfig/.envmatches the URL that the user's browser can reach (e.g.https://intocps.org/gitlab). - Check that
REACT_APP_AUTH_AUTHORITYinconfig/client.jsmatches the same URL. - Clear the browser cookies for the domain.
- Check the traefik-forward-auth logs:
docker compose --env-file config/.env logs traefik-forward-auth
404 on User Workspace
- Make sure
USERNAME1/USERNAME2inconfig/.envmatch thePathPrefixvalues inconfig/conf.server. - Make sure a matching service exists in
docker-compose.yml.
GitLab "502 Bad Gateway"
GitLab is still initialising. Wait until docker ps shows the
container as healthy.
Self-Signed Certificate Warning in Browser
The TLS certificate files in certs/ are missing or invalid. Replace
them with valid certificates for the domain.