Configuration Reference
This page describes each configuration file in this package. For the quick-start installation guide, see install.md.
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 |
OAuth 2.0 Settings
These values come from the OAuth 2.0 applications on the external GitLab.
| 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 |
client, logger-ms, 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 the DTaaS web application 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_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 |
LOGGER_URL |
https://intocps.org/logger |
URL of the logger service |
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 the usernames and email addresses with those of 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, any signed-in user can open it. - 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/:
The certificates must be valid for SERVER_DNS.
files - User Workspace Directories
Each user workspace container mounts a directory from files/ as
its /workspace volume. All workspaces share files/common/.
Create the user directories:
logs - 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:
OAuth 2.0 Application Setup
The external GitLab instance needs two OAuth 2.0 applications.
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 the Application ID and Secret.
- Set
OAUTH_CLIENT_ID,OAUTH_CLIENT_SECRETandOAUTH_URLinconfig/.env. - Generate
OAUTH_SECRETand set it inconfig/.env.
Reload After Configuration
Adding More Users
To add a third user:
- Add a
user3service todocker-compose.yml, modelled onuser1anduser2. - Add
USERNAME3=<name>toconfig/.env. - Create the
files/<name>directory fromfiles/template. - Add a matching authorisation rule to
config/conf.server. - Restart:
Troubleshooting
Authentication redirect loop
- Check
OAUTH_URLinconfig/.env. - Check
REACT_APP_AUTH_AUTHORITYinconfig/client.js. - Clear the browser cookies for the domain.
- Check the logs:
404 on user workspace
- Check that the usernames are the same in:
config/.envconfig/conf.serverdocker-compose.yml
TLS warning in browser
- Replace
certs/fullchain.pemandcerts/privkey.pemwith valid certificates.