Configuration Reference
This document provides a detailed reference for each configuration file in this package.
For the quick-start installation guide, see install.md.
Table of Contents
- Configuration Reference
- Table of Contents
- config/.env - Docker Compose Environment
- config/client.js - DTaaS Web Client
- config/conf.server - Traefik Forward-Auth Rules
- certs - TLS Certificates
- files - User Workspace Directories
- OAuth 2.0 Application Setup
- 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 |
OAuth 2.0 Settings
These are set from the external GitLab OAuth 2.0 applications.
| Variable | Example | Description |
|---|---|---|
OAUTH_URL |
https://gitlab.com |
GitLab base URL used by traefik-forward-auth |
OAUTH_CLIENT_ID |
(from GitLab) | Application ID from the DTaaS Server Authorization OAuth app |
OAUTH_CLIENT_SECRET |
(from GitLab) | Secret from the DTaaS Server Authorization OAuth app |
OAUTH_SECRET |
(random string) | Encryption key for OAuth session cookies. Example generation: openssl rand -base64 32 |
How Variables Map to Services
| Variable | Used by |
|---|---|
SERVER_DNS |
traefik, client, user1, user2, libms, traefik-forward-auth |
USERNAME1 / USERNAME2 |
user1, user2 (routing and workspace volumes) |
OAUTH_URL |
traefik-forward-auth (authorize, token, userinfo endpoints) |
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 DTaaS web behaviour at runtime.
Variable Reference
| Variable | Example | Description |
|---|---|---|
REACT_APP_ENVIRONMENT |
prod |
Environment name |
REACT_APP_URL |
https://intocps.org |
Base URL of the DTaaS web application |
REACT_APP_URL_BASENAME |
'' |
Optional URL base path |
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 DTaaS Client Authorization OAuth app |
REACT_APP_AUTH_AUTHORITY |
https://gitlab.com |
OAuth issuer URL |
REACT_APP_REDIRECT_URI |
https://intocps.org/Library |
Redirect URI after sign-in |
REACT_APP_LOGOUT_REDIRECT_URI |
https://intocps.org/ |
Redirect URI after sign-out |
REACT_APP_GITLAB_SCOPES |
openid profile read_user read_repository api |
Requested OAuth scopes |
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 email addresses.
Format
Default Rules
Replace usernames and email addresses to match the actual users.
Important Rules
- Usernames in
config/.env(USERNAME1,USERNAME2) must matchPathPrefixvalues inconfig/conf.server. - If a route exists in
docker-compose.ymlbut has no rule inconfig/conf.server, the default behaviour allows any signed-in user. - If a rule exists in
config/conf.serverbut no router serves that path, the URL returns 404.
certs - TLS Certificates
Place these TLS certificate files in certs/:
Certificates must be valid for SERVER_DNS.
files - User Workspace Directories
Each user workspace container mounts a directory from files/ as
its /workspace volume. files/common/ is shared across all workspaces.
Create user directories:
OAuth 2.0 Application Setup
Two OAuth 2.0 applications are needed in the external GitLab instance.
DTaaS Client Authorization (React Frontend)
- In GitLab, open Applications.
- Create an application:
- Name: DTaaS Client Authorization
- Redirect URI:
https://<SERVER_DNS>/Library - Confidential: unticked (public SPA client)
- Scopes:
openid,profile,read_user,read_repository,api - Save the Application ID and set
REACT_APP_CLIENT_IDinconfig/client.js. - Set
REACT_APP_AUTH_AUTHORITYinconfig/client.jsto the GitLab URL.
DTaaS Server Authorization (Traefik Forward-Auth)
- In GitLab, create another application:
- Name: DTaaS Server Authorization
- Redirect URI:
https://<SERVER_DNS>/_oauth - Confidential: ticked
- Scopes:
read_user - Save Application ID and Secret.
- Set
OAUTH_CLIENT_ID,OAUTH_CLIENT_SECRET,OAUTH_URLinconfig/.env. - Generate
OAUTH_SECRETand set it inconfig/.env.
Reload After Configuration
Adding More Users
To add a third user:
- Add service
user3indocker-compose.ymlbased onuser1/user2. - Add
USERNAME3=<name>inconfig/.env. - Create
files/<name>directory. - Add matching authorisation rule in
config/conf.server. - Restart:
Troubleshooting
Authentication redirect loop
- Verify
OAUTH_URLinconfig/.env. - Verify
REACT_APP_AUTH_AUTHORITYinconfig/client.js. - Clear browser cookies for the domain.
- Check logs:
404 on user workspace
- Verify usernames are consistent across:
config/.envconfig/conf.serverdocker-compose.yml
TLS warning in browser
- Replace
certs/fullchain.pemandcerts/privkey.pemwith valid certificates.