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 | Not used | 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 |
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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
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 |
| 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
platform update --config checks only the section of the installed
deployment type, plus [frontend].
path and certs-src are checked against the local filesystem, so
run validate on the deployment host. 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 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.
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.
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.tomlis written by a person and never rewritten by the CLI, so its comments and reviewed values stay as they are.dtaas.users.registry.jsonis a database that the CLI owns and updates atomically, the wayuseraddowns/etc/passwd. Change its users withdtaas user add --file users.csv,delete,pause,stopandresume, not by hand. Theusers.csvwritten bydtaas config generateis the bulk input foraddanddelete.desired_statusisrunningfor a user who has never been paused or stopped, anduser addandconfig reconcile --fixdo not start any user whosedesired_statusis something else..dtaas.state.jsonis 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 account provisioning for
dtaas user add. For what the command does and prints in each case,
see GitLab provisioning.
| 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 |
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.
Initial passwords
Each new account needs an initial password. The CLI takes the first one it finds:
--passwordon the command line, or thepasswordcolumn of theusers.csvgiven with--file.[[users]].passwordindtaas.toml, for a starting user.- 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:
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 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) and whether a token was issued
(gitlab_pat_issued). 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,
and a user with a token gets nothing more. Starting users carry the
same two markers in the separate starting_users section, since they
have no entry under users:
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.