Configuration Reference
This document provides a detailed reference for every configuration file in this package. For the quick-start installation guide, see install.md.
[!IMPORTANT] The hostname
intocps.orgis used for illustration throughout this guide. Replace it with the actual server hostname of the installation.
Table of Contents
Configuration Reference
- :page_facing_up: Table of Contents
config/.env — Docker Compose Environment
- :globe_with_meridians: config/client.js — DTaaS Web Client
config/conf.server — Traefik Forward-Auth Rules
certs/ — TLS Certificates
- :file_folder: files/ — User Workspace Directories
- :closed_lock_with_key: OAuth 2.0 Application Setup
- :busts_in_silhouette: Adding More Users
Troubleshooting
config/.env — Docker Compose Environment
Source: config/.env.example
This file provides environment variables consumed by docker-compose.yml.
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
These are populated after the GitLab instance is running and OAuth 2.0 applications have been created (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 |
traefik, client, 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 |
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_WORKBENCHLINK_LIBRARY_PREVIEW |
/preview/library |
Library preview page |
REACT_APP_WORKBENCHLINK_DT_PREVIEW |
/preview/digitaltwins |
Digital Twins preview page |
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 |
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 to match the actual
GitLab accounts.
Important Rules
[!WARNING] Usernames must be consistent. The usernames in
config/.env(USERNAME1,USERNAME2) must match thePathPrefixvalues inconfig/conf.server. Mismatches cause 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).
Obtain certificates via:
If the certificate files are absent or invalid, Traefik runs with self-signed certificates. Browsers will show a security warning.
files/ — User Workspace Directories
Each user workspace container mounts a directory from files/ as
its /workspace volume. The files/common/ directory is shared
across all workspaces and mounted to /workspace/common in each
container.
Create directories for each user:
The UID 1000 and GID 100 match the default user inside the
workspace container.
OAuth 2.0 Application Setup
After the GitLab instance is running, two OAuth 2.0 applications must be registered 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 full 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_SECRET:openssl rand -base64 32and set it inconfig/.env.
For full details, see the server auth documentation.
Reload After Configuration
After updating the OAuth 2.0 tokens in the configuration files, reload the affected services:
Adding More Users
To add a third user:
- Add service to
docker-compose.yml:
- Add to
config/.env:
- Create workspace directory:
- Add 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 requires significant resources. The first startup may take
5–10 minutes. Monitor with docker compose --env-file config/.env logs -f gitlab.
Ensure the host has at least 4 GB RAM available for GitLab.
Authentication Redirect Loop
- Verify
OAUTH_URLinconfig/.envmatches the URL accessible from the user's browser (e.g.https://intocps.org/gitlab). - Verify
REACT_APP_AUTH_AUTHORITYinconfig/client.jsmatches the same URL. - Clear browser cookies for the domain.
- Check traefik-forward-auth logs:
docker compose --env-file config/.env logs traefik-forward-auth
404 on User Workspace
- Ensure
USERNAME1/USERNAME2inconfig/.envmatches thePathPrefixinconfig/conf.server. - Ensure a corresponding service exists in
docker-compose.yml.
GitLab "502 Bad Gateway"
GitLab is still initializing. Wait until docker ps shows the
container as healthy.
Self-Signed Certificate Warning in Browser
TLS certificate files are missing or invalid in certs/. Replace them
with valid certificates for the domain.