Skip to content

CLI Configuration Reference

This page is the reference for dtaas.toml, the configuration file that every DTaaS CLI command reads. Generate a template with dtaas config generate, fill it in, and check it with dtaas config validate before running any other command. The installation workflow is covered in Install with DTaaS CLI.

Which sections does my deployment need?

Server deployments

Section localhost insecure-server secure-server secure-server-gitlab
[common] Required Required Required Required
[common.security] Not used Optional (tls = false) Required Required
[common.resources] Optional Optional Optional Optional
[gitlab] Optional Optional Optional Optional
[[users]] Optional Required Required Required
[frontend] Not used Required Required Required
[localhost] Required Not used Not used Not used
[insecure-server] Not used Required Not used Not used
[secure-server] Not used Not used Required Not used
[secure-server-gitlab] Not used Not used Not used Required

dtaas user add reads [common.security].tls for every deployment type to choose the per-user compose template. For insecure-server, leave the section out or set tls = false; tls = true gives the new users the HTTPS template, which the HTTP-only deployment does not serve.

Workspace deployments

Section workspace-localhost workspace-secure-server
[common] Required Required
[common.security] Not used Required
[common.resources] Optional Optional
[gitlab] Optional Optional
[[users]] Optional Required
[workspace-localhost] Required Not used
[workspace-secure-server] Not used Required

Annotated dtaas.toml

The file below shows every key with inline comments. Copy it as a starting point and delete the sections that your deployment type does not use (see the tables above).

# ── Metadata (top level) ──────────────────────────────────────────────────────
# Describes the instance. git-repo, the URL of the DTaaS repository, is
# required for all deployment types; validate checks no other key here.
name     = "Digital Twin as a Service (DTaaS)"
version  = "2.4.0"
owner    = "The INTO-CPS-Association"
git-repo = "https://github.com/into-cps-association/DTaaS.git"

# ── Common settings (all deployment types) ────────────────────────────────────
[common]
# Public hostname of the server. Use "localhost" for local deployments,
# a fully-qualified domain name (e.g. "dtaas.example.com") for servers,
# or a bare IP address.
server-dns = "dtaas.example.com"

# Absolute path to the DTaaS installation directory on the deployment host.
# Must exist before running validate.
path = "/opt/dtaas"

# ── TLS settings (required for: secure-server, secure-server-gitlab,
#                               workspace-secure-server) ──────────────────────
[common.security]
tls = true

# Absolute path to the directory containing fullchain.pem and privkey.pem.
# Used by deployment generate (seeds certs/) and platform update --certs.
certs-src = "/etc/letsencrypt/live/dtaas.example.com"

# ── Per-user container resource limits (optional, all types) ──────────────────
[common.resources]
# Enforce the limits below. Set to false to add users without any caps.
# The 4 fields are then optional and ignored. Defaults to true when omitted.
set_limits = true
cpus       = 4        # CPU cores; may be fractional, e.g. 0.5
mem_limit  = "4G"     # memory limit unit required: G, m, k …
pids_limit = 4960     # maximum number of processes per container (integer)
shm_size   = "512m"   # shared memory unit required

# ── Starting users (all deployment types) ─────────────────────────────────────
# One self-contained [[users]] block per user, hand-edited once at install
# time. Presence in this file is the desired state there are no add/delete
# lists. Additional users added later with `dtaas user add` live in the
# CLI-owned dtaas.users.registry.json instead.
# Usernames must match GitLab accounts and be unique across the array.
#
# email enables traefik-forward-auth routing rules automatically;
# groups/load_balance carry per-user tags. password is optional: it is the
# initial GitLab password when `dtaas user add <username>` provisions this
# starting user's account. Avoid committing a real secret here; prefer
# supplying it at runtime instead.
[[users]]
username     = "alice"
email        = "alice@example.com"
groups       = ["default", "dtaas"]
load_balance = true

[[users]]
username     = "bob"
email        = "bob@example.com"
groups       = ["default", "dtaas"]
load_balance = false
# password   = "Kq7v-Rm3x-Zt9w"   # initial GitLab password, see above

# ── React web client OAuth app (insecure-server, secure-server,
#                                secure-server-gitlab) ────────────────────────
# This is a SEPARATE OAuth application from the traefik-forward-auth app
# configured in [insecure-server] / [secure-server] below.
# Redirect URI: https://<server-dns>/Library
# Scopes: api read_user read_repository openid profile   Type: not Confidential
[frontend]
react-app-client-id = "dtaas-client"
react-app-oauth-url = "https://gitlab.example.com"
# Logger microservice URL, with the /logger route prefix ("" turns remote
# logging off). Without the key, the logger of this installation is used,
# http(s)://<server-dns>/logger (see "Remote logging" below).
logger-url          = "https://logs.example.com/logger"

# ── GitLab user provisioning (optional, all types) ───────────────────────────
# Off by default. When provision = true, `dtaas user add` also creates
# each new user's GitLab account and a Personal Access Token (see
# "Add Users" in cli.md), and with both *_template keys set, two private
# projects, common and user, cloned from them with git on this host and
# pushed. Remove both template keys for accounts and tokens only. The
# provisioning token must belong to an
# administrator and carry the api scope (plus admin_mode on an instance with
# Admin Mode enabled); supply it via the DTAAS_GITLAB_PAT environment variable
# rather than committing it here. A [gitlab].pat key is the fallback when the
# variable is unset or empty. ssl_verify may be a CA-bundle path for a GitLab
# behind an internal CA; false disables verification (a warning is printed)
# and true (default) uses the system trust store.
[gitlab]
provision  = false
api_url    = "https://gitlab.example.com"
template_host  = "https://gitlab.com"   # with template_group: the
template_group = "dtaas"                # public common and user1 templates
# pat      = "glpat-xxxxxxxxxxxxxxxxxxxx"   # prefer DTAAS_GITLAB_PAT
# ssl_verify = "/etc/ssl/certs/corp-ca.pem" # or true (default) / false

# ── localhost deployment (dev / demo only) ────────────────────────────────────
# GitLab OAuth app for the web client; auth-authority is the GitLab URL.
[localhost]
default-user   = "alice"
client-id      = "dtaas-local"
auth-authority = "https://gitlab.example.com"

# ── insecure-server deployment (HTTP, demo only not internet-facing) ─────────
# GitLab OAuth app for traefik-forward-auth.
# Redirect URI: http://<server-dns>/_oauth
# Scopes: openid profile read_user   Type: Confidential
[insecure-server]
oauth-url           = "https://gitlab.example.com"
oauth-client-id     = "abc123"
oauth-client-secret = "s3cr3t"
oauth-secret        = "random-signing-string"   # random; used to sign session cookies

# ── secure-server deployment (HTTPS/TLS production-ready) ───────────────────
# Same GitLab OAuth app as insecure-server, with Redirect URI using https.
[secure-server]
oauth-url           = "https://gitlab.example.com"
oauth-client-id     = "abc123"
oauth-client-secret = "s3cr3t"
oauth-secret        = "random-signing-string"

# ── secure-server-gitlab deployment (bundled GitLab production-ready) ───────
# oauth-url points at the bundled GitLab, served under /gitlab.
[secure-server-gitlab]
oauth-url           = "https://dtaas.example.com/gitlab"
oauth-client-id     = "abc123"
oauth-client-secret = "s3cr3t"
oauth-secret        = "random-signing-string"

# ── workspace-localhost deployment (Dex on localhost dev / demo only) ───────
[workspace-localhost]
default-user   = "alice"
client-id      = "workspace-local"
auth-authority = "http://localhost:5556/dex"

# ── workspace-secure-server deployment (Keycloak production-ready) ──────────
[workspace-secure-server]
keycloak-admin          = "admin"
keycloak-admin-password = "change-me"
keycloak-realm          = "dtaas"
keycloak-issuer-url     = "https://keycloak.example.com/realms/dtaas"
keycloak-client-id      = "workspace"
keycloak-client-secret  = "s3cr3t"
oauth-secret            = "random-signing-string"
# Not written to config/client.js (auth-authority is only checked to be
# a URL). Set REACT_APP_CLIENT_ID and REACT_APP_AUTH_AUTHORITY there by hand.
client-id               = "dtaas-frontend"
auth-authority          = "https://keycloak.example.com/realms/dtaas"

Validation rules

dtaas config validate reads dtaas.toml (from --output-dir first, then the current directory) and reports all problems at once:

Field Rule
git-repo Must be an http(s) URL
[common].server-dns Must be localhost, an IP, or a fully qualified hostname
[common].path Must be an absolute path to an existing directory
[common.security].certs-src When present, must be an absolute path to an existing directory
[common.resources].set_limits false turns the limits off; any other value, or no key, keeps them on
[common.resources].cpus Positive number (e.g. 4 or 0.5)
[common.resources].pids_limit Integer
[common.resources].mem_limit, shm_size Byte size with required unit (e.g. 4G, 512m)
[[users]] When present, must be an array of tables; usernames must be unique
[[users]].username Required, valid username
[[users]].email Required, valid RFC 5321/5322 address (no DNS lookup)
[[users]].groups When present, must be a list of strings
[[users]].load_balance When present, must be true or false
[[users]].password When present, must be a string (the starting user's initial GitLab password, used when user add names them)
[gitlab].provision When present, true or false (default false)
[gitlab].api_url Must be an http(s) URL; required when provision is true, optional otherwise
[gitlab].pat When present, must be non-empty (remove the key to use DTAAS_GITLAB_PAT)
[gitlab].ssl_verify When present, true, false, or a CA-bundle path string
[gitlab].template_group/template_host When present, a GitLab group path (subgroups with /) and an http(s) URL; set both, or leave both out
[frontend].logger-url When present, an http(s) URL, or "" to turn remote logging off
Deployment-section URLs When present, must be http(s) URLs
Deployment-section default-user When present, must be a valid username

Deployment-section URLs are react-app-oauth-url, oauth-url, auth-authority and keycloak-issuer-url in [frontend], [localhost], [insecure-server], [secure-server], [secure-server-gitlab], [workspace-localhost] and [workspace-secure-server]. Each is checked only when its section is present. config validate checks every section in the file, while deployment generate and platform update --config check only the section of the type they write, plus [frontend]. Both list every problem and stop before they write a file.

config validate also prints warnings, which do not make the file invalid: a [frontend] section whose logger-url is missing, empty, still the template's example, or a URL whose path does not end in /logger gets one, see Remote logging.

For workspace-secure-server, no command writes client-id or auth-authority into config/client.js; auth-authority is only checked to be a URL. Edit REACT_APP_CLIENT_ID and REACT_APP_AUTH_AUTHORITY in that file by hand.

path and certs-src are checked against the local filesystem, so run validate and deployment generate on the deployment host. A fresh dtaas.toml fails both until path names an existing directory, and certs-src does too or is removed. If a check fails with a permission error (for example, certs-src under the root-owned /etc/letsencrypt), the CLI prints the command to re-run with sudo.

The [common.resources] limit fields (cpus, pids_limit, mem_limit, shm_size) are required only when set_limits is true, the default. With set_limits = false they are optional and ignored, but any value that is present is still validated.

Configuration substitution

When dtaas.toml is present, deployment generate validates it for --type (see Validation rules), then substitutes its values into the generated files. platform update --config repeats the same substitution on an installed deployment. Each --type reads from its matching top-level section in dtaas.toml. Depending on the type, values go into the dotenv files (config/.env, config/conf.server), the React client config (config/client.js, or config/env.local.js for workspace-localhost) and the Dex config (config/dex-config.yaml for workspace-localhost).

For the server types, the [frontend] section supplies REACT_APP_CLIENT_ID and REACT_APP_AUTH_AUTHORITY for the DTaaS web client. That is a separate OAuth application from the traefik-forward-auth credentials in [insecure-server], [secure-server] and [secure-server-gitlab]. The redirect URIs in config/client.js are built from [common].server-dns, and the first two [[users]] records fill USERNAME1 and USERNAME2.

If dtaas.toml is not found, the command prints a note and the generated files keep their placeholder values.

Remote logging

The website sends workflow logs to the logger microservice at LOGGER_URL in config/client.js. For the server types, [frontend].logger-url sets it:

[frontend] LOGGER_URL
No logger-url http(s)://<server-dns>/logger, the logger every server type runs
logger-url = "<url>" <url>, which must include the /logger route prefix
logger-url = "" Empty: remote logging is off, and the website hides the option

The template ships logger-url = "https://intocps.org/logger", an example to replace. deployment generate and config validate warn while the key is missing, empty, still that example, or a URL whose path does not end in /logger, so you know what the website does. deployment generate also warns when secure-server or secure-server-gitlab get an http:// logger, which browsers block as mixed content:

Warning: frontend.logger-url is not set
  LOGGER_URL is https://dtaas.example.com/logger, the logger of this installation.
  Set logger-url in dtaas.toml to choose it explicitly.

Warning: frontend.logger-url is empty
  Remote logging is off: LOGGER_URL is empty and the website hides
  the option. Set logger-url in dtaas.toml to turn it on.

Warning: frontend.logger-url is the template example
  Logs go to https://intocps.org/logger, which is not your logger.
  Set logger-url to your logger, or to "" to turn remote logging off.

Warning: frontend.logger-url does not end in /logger
  The logger serves its routes under /logger, so https://logs.example.com/ may
  not reach it. Ignore this if a proxy in front of it adds the path.

Warning: frontend.logger-url is http on an https site
  Browsers block the website's requests to http://logs.example.com/logger (mixed
  content), so no logs arrive. Use an https URL for the logger.

Set logger-url to a URL of your own to silence the warning. platform update --config writes the same value without a warning. A deployment generated by a CLI older than 2.3.0 still has the intocps.org logger of the old template in config/client.js; its next platform update --config replaces it, and any hand edit of LOGGER_URL, with the value from this table. localhost keeps the http://localhost/logger of its template, and the workspace types keep their empty LOGGER_URL.

TLS certificate placement

For the TLS types (secure-server, secure-server-gitlab, workspace-secure-server), deployment generate also fills the certs/ directory in the output. It reads [common.security].certs-src from dtaas.toml and copies the latest fullchain.pem and privkey.pem from there.

File modes

On Linux and macOS, deployment generate sets the mode of the config files it copies, on every run and also for files that already exist:

File Mode Why
config/.env, config/conf.server 0600 They hold the OAuth secrets
config/client.js 0644 The website container reads it as uid 1000; it holds no secrets

The website container (intocps/dtaas-web 1.7.2 and later) runs as uid 1000 and serves config/client.js to every browser as env.js. When it cannot read the file, the website does not load: its scripts fail in the browser and env.js returns 502 Bad Gateway.

platform update --config sets the mode of each file it writes values into. It writes none into config/client.js for workspace-secure-server, so it leaves that file's mode as it is.

A deployment generated by a CLI older than 2.3.0 has config/client.js at 0600, which breaks the website once the deployment runs the 1.7.2 image. Run chmod 644 config/client.js (or platform update --config, for the types it writes the file for); no restart is needed.

User files

User management spans three files, each with a single owner. The split follows the one Terraform makes between .tf and terraform.tfstate files:

File Owner Contents Git
dtaas.toml [[users]] Human, at install time Starting users: one self-contained record per user (username, email, groups, load_balance, optional password) Hand-edited; keep out of Git, as it can hold credentials
dtaas.users.registry.json CLI (user add / delete / pause / stop / resume) Additional users under users: the same fields, plus desired_status (running/paused/stopped) and any GitLab markers. Its starting_users section holds the GitLab markers alone, for starting users that user add has provisioned on GitLab Tracked, CLI-written, never hand-edited
.dtaas.state.json CLI, at provisioning time Observed runtime facts: container id, status, provisioned-at, config hash Ignored, runtime cache
  • dtaas.toml is written by a person and never rewritten by the CLI, so its comments and reviewed values stay as they are.
  • dtaas.users.registry.json is a database that the CLI owns and updates atomically, the way useradd owns /etc/passwd. Change its users with dtaas user add --file users.csv, delete, pause, stop and resume, not by hand. The users.csv written by dtaas config generate is the bulk input for add and delete. desired_status is running for a user who has never been paused or stopped, and user add and config reconcile --fix do not start any user whose desired_status is something else.
  • .dtaas.state.json is a disposable cache of what is running, refreshed on every add and delete. It is git-ignored and safe to delete.

Checking for drift

dtaas config reconcile compares dtaas.users.registry.json (the users who should be provisioned) with the live compose.users.yml services (the users who are provisioned). It reports missing, unexpected, drifted, absent and desired-status drift; see config reconcile for what each means. When everything matches, it prints In sync: no drift detected.

Without --fix, the command is read-only. --fix reprovisions missing and drifted users, restarts absent users' containers, and pauses, stops or starts every provisioned user to match its desired_status. It never touches unexpected services; remove those with dtaas user delete.

Pausing or stopping a user with dtaas user pause or stop is recorded as that user's desired_status. A later reconcile treats the suspension as the desired state instead of reporting it as drift.

GitLab provisioning settings

The [gitlab] section turns on GitLab provisioning for dtaas user add: each user's account, token and two private projects. For what the command does and prints in each case, see GitLab provisioning.

1
2
3
4
5
6
7
[gitlab]
provision  = true
api_url    = "https://gitlab.example.com"
template_host  = "https://gitlab.com"
template_group = "dtaas"
# pat      = "glpat-xxxxxxxxxxxxxxxxxxxx"   # prefer DTAAS_GITLAB_PAT
# ssl_verify = "/etc/ssl/certs/corp-ca.pem" # or true (default) / false
Key Default Meaning
provision false true makes user add create each user's GitLab account and token
api_url none The GitLab instance; required when provision is true
pat none The admin token, used only when DTAAS_GITLAB_PAT is unset or empty
ssl_verify true true uses the system trust store, a path uses that CA bundle, false turns verification off
template_group none Public group holding the templates common and user1, such as dtaas; set with template_host
template_host none GitLab http(s) URL that holds template_group, such as https://gitlab.com; set with the group

The generated dtaas.toml sets template_host = "https://gitlab.com" and template_group = "dtaas", so the templates are https://gitlab.com/dtaas/common.git and https://gitlab.com/dtaas/user1.git. To use your own copies, put both repositories in a public group and name that group.

Admin token

The CLI uses DTAAS_GITLAB_PAT whenever it is exported and not empty, and [gitlab].pat otherwise, so a rotated token needs no edit to a dtaas.toml the whole installation shares. When both are set to different tokens, a Note: line says the exported one is used. The token must belong to a GitLab administrator and carry the api scope, plus admin_mode on an instance with Admin Mode enabled.

For a self-hosted GitLab behind an internal CA, point ssl_verify at the CA bundle rather than turning it off. With ssl_verify = false, the admin token and every user's initial password cross the network without certificate checks, and the CLI prints a warning on each run. ssl_verify also applies to git for every URL on the api_url host, the project pushes and a template kept on that same GitLab included.

Projects

With both template keys set, every user whose account and token exist gets two private projects in their own namespace, common and user. The CLI clones each template with git into a temporary folder, creates the project empty with the admin token, and pushes the default branch as the user, with the token issued to them (this run's, or the one saved in gitlab_user_tokens.json), asking GitLab to start no CI pipeline (ci.skip). The push goes to the project path GitLab reports for the user's account. A user with no saved token gets no project, and a push GitLab refuses fails that project; the admin token never pushes. The machine running dtaas needs git 2.31 or later and network access to the template host and to GitLab.

  • Templates must be public http(s) repositories: they are cloned without a login.
  • A project that already exists, even an empty one, is never pushed to (a Warning:): its settings belong to its owner. One with content is then recorded as done, so the warning shows once; an empty one warns on every run until it is deleted.
  • Git LFS is not supported: a template holding LFS pointer files (small files in the pointer format) is refused. LFS rules in .gitattributes alone are not refused, since the files can still be stored whole. A template with no commits is refused too.
  • A failure is that user's alone. A template that cannot be cloned fails before the project is created. A failed push leaves the new project empty: delete it, then name the user again. A transfer under 1000 bytes a second for a minute, or a git command running for 15 minutes, fails.
  • Created projects, and projects found with content, are recorded in gitlab_projects (see Files written) and never looked at again.

Initial passwords

Each new account needs an initial password. The CLI takes the first one it finds:

  1. --password on the command line, or the password column of the users.csv given with --file.
  2. [[users]].password in dtaas.toml, for a starting user.
  3. A hidden prompt, asked twice, when a single user is added.

A password is used once, to create the account. The CLI never writes it to dtaas.users.registry.json, .dtaas.state.json or a log. A run in which a named user has no password and no account from an earlier run is refused before anything changes. --password is visible in shell history and in the process list, so prefer the prompt, or the CSV column with chmod 600 users.csv (the CLI sets that mode only on the sample users.csv that config generate writes).

[[users]].password and the CSV column hold passwords in plaintext. When a run takes a password from dtaas.toml or users.csv and that file is readable by other users, the CLI prints a warning with the chmod 600 command (on Linux and macOS; Windows file modes do not say who can read a file). Once a starting user's account exists, the CLI also reminds you to remove their [[users]].password: it stays a valid GitLab login until the user changes it.

Files written

gitlab_user_tokens.json holds the token issued to each user, keyed by username. It is written to the current directory, next to dtaas.toml (not to --output-dir), with mode 0600, and each user's token is added the moment it is issued:

1
2
3
4
{
  "alice": "glpat-xxxxxxxxxxxxxxxxxxxx",
  "bob": "glpat-yyyyyyyyyyyyyyyyyyyy"
}

A run adds to the file and never rewrites the other entries. Should a user's entry ever be replaced, the old token is kept under a "<username> (superseded <timestamp>)" key and a warning says to revoke it in GitLab if it is still active. user delete revokes the deleted users' tokens on GitLab, starting users' included, and then drops their entries; a token that could not be revoked keeps its entry. Their GitLab accounts and projects stay.

Before creating any account, user add checks that this file can be read and written, and removes a leftover gitlab_user_tokens.json.tmp from an interrupted run. A token that still cannot be saved is revoked on GitLab at once, and the run issues no further tokens.

dtaas.users.registry.json records, per user, the GitLab account id (gitlab_user_id), whether a token was issued (gitlab_pat_issued) and the projects done so far (gitlab_projects: created, or found with content). That is how a re-run knows what is already done: a user with an account id but no token gets a new token for that account, with no password needed, after any token an earlier run issued but never saved is revoked; a user with a token gets no second one, but does get any project not listed yet (one that already exists on GitLab gets only a warning); and a project listed there is never created or pushed again. Starting users carry the same markers in the separate starting_users section, since they have no entry under users:

{
  "users": {
    "alice": {
      "email": "alice@intocps.org",
      "groups": [
        "additional"
      ],
      "load_balance": true,
      "desired_status": "running",
      "gitlab_user_id": 42,
      "gitlab_pat_issued": true,
      "gitlab_projects": [
        "common",
        "user"
      ]
    }
  },
  "starting_users": {
    "username1": {
      "gitlab_user_id": 7,
      "gitlab_pat_issued": true,
      "gitlab_projects": [
        "common",
        "user"
      ]
    }
  }
}

A project found with content is listed after its one warning. An empty project found in place is not listed, so every run that names that user warns about it until it is deleted.

dtaas.toml, users.csv and gitlab_user_tokens.json are gitignored and written with mode 0600, since they can hold the admin token, user passwords and user tokens respectively.

The registry and gitlab_user_tokens.json are read and rewritten without a lock, so run one dtaas command at a time per installation: two user add runs at once can lose each other's changes.