Skip to content

Client configuration ​

Dopbase keeps client connection state and an optional run default in a machine-global configuration. It does not create configuration inside an application repository.

Default local server ​

When no server is configured, the CLI uses:

text
http://localhost:8840

This default is implicit. Client commands can use it without a configuration file. Setup and startup create a missing config.toml with commented examples. Startup also recreates missing reference files for an initialized instance. The examples leave the implicit local connection and unset default environment unchanged.

If a configured remote server is unavailable, Dopbase fails clearly. It never falls back to localhost, Cloud, or another endpoint.

Configuration file ​

The per-user locations are:

text
macOS and Linux: ~/.dopbase/config.toml

Use the global --data-dir <dir> option or DOPBASE_DATA_DIR to relocate this file together with the default server data. The CLI option takes precedence over the environment variable.

The generated file describes every client setting with commented examples. Existing files stay untouched during setup and server startup. When client connect or env default saves settings, Dopbase writes the reference at the top and the active settings below # Saved client settings. Edit active settings there instead of uncommenting an example for the same key.

The v0.2.3 schema contains only non-secret client state:

toml
version = 1
server_url = "https://dopbase.example.com"

[default_environment]
server_url = "https://dopbase.example.com"
environment_id = "env_482731"

server_url is omitted when the implicit local server is active. Dopbase writes configuration atomically and restricts file permissions to the current user where the platform supports them.

The optional default contains only an immutable environment ID and the server URL that owns it. The file never stores secret values or authentication tokens.

Select a server ​

Select a self-hosted or Cloud endpoint with:

bash
dopbase client connect https://dopbase.example.com

connect accepts an absolute URL. Remote endpoints must use HTTPS, HTTP is limited to localhost and loopback IP addresses. Dopbase normalizes the URL, rejects embedded credentials, query strings, and fragments, then verifies that the endpoint is a compatible server. The new server is saved only after validation succeeds. A failed connection leaves the previous configuration and credential unchanged.

After validation, Dopbase asks for confirmation. A successful switch removes the previous encrypted CLI session and key, and clears the previous default environment. When the current endpoint is a local server running from the same data directory, connect refuses to switch away from it until you stop that server. Connecting to a running local server needs no such step. connect never stops a server. Authenticate separately against the new endpoint:

bash
dopbase login

Return to the implicit local server with:

bash
dopbase client connect local
dopbase login

The local alias resolves to the public URL of the instance in the same data directory, which is http://localhost:8840 by default. On that default URL Dopbase removes the server_url override; any other public URL is saved. The previous server's credential is removed either way. The local server can be stopped when you switch: if nothing answers at its URL, Dopbase switches anyway and asks you to start it. Something that answers but isn't a compatible Dopbase server is still refused.

Persistent switching is rejected while DOPBASE_URL is set because that environment variable would override the newly saved endpoint.

Credentials ​

dopbase login stores a human session token in an encrypted extensionless session file beside config.toml, scoped to the normalized server URL. dopbase login --token reads an existing runner token from a masked prompt or standard input and stores it in the same file. Its random 32-byte key is stored separately in session-key. The token is never written to config.toml or a Dopbase server's SQLite database.

The encrypted payload also caches the normalized administrator email so dopbase client status can identify the login without contacting the server. Older sessions remain valid but show an unknown email until the next login.

Remote server URLs must use HTTPS. HTTP is limited to localhost and loopback IP addresses, and the client does not follow redirects.

Only one saved connection is active in v0.2.3. Logging in again, with a human account or runner token, replaces the saved credential. dopbase logout ends a saved login on the server, removes the active credential, and leaves the selected server unchanged. Both login and logout stop while DOPBASE_TOKEN is set, because the variable takes priority over anything saved here.

On macOS and Linux, the data directory is mode 0700 and both session files are mode 0600. Separating the key protects a copied session file by itself, but an attacker that can read both files can decrypt the token. Use DOPBASE_TOKEN when a deployment platform or CI system manages the credential.

Encrypted run cache ​

dopbase run stores its latest successfully fetched runtime environments under run-cache/ beside config.toml. Cache payloads use authenticated XChaCha20-Poly1305 encryption and an independent random key in run-cache-key. Server-derived cache filenames and lock files contain no secret values. Cache files and the key are mode 0600 inside mode 0700 directories on Unix.

The encryption key for each server cache is derived from the local cache key, the normalized server URL, and the exact active session or DOPBASE_TOKEN. Consequently, another credential cannot unlock an existing cache, even if it can access the same environment. A successful live run under a new credential replaces the inaccessible cache for that server.

The cache has no automatic expiry because it exists to support extended outages. Offline use can therefore inject values that were changed or revoked on the unavailable server. run always reports cached use, its UTC fetch time, and its age.

Use dopbase cache list to inspect the active server's cache without showing secret names or values. The command reports the server URL, project, environment, immutable environment ID, fetch time, age, and known aliases. It reads only the cache file derived from the active server URL and needs the same saved session or DOPBASE_TOKEN that created the cache.

dopbase cache clean removes entries older than 14 days by default. Pass --older-than <AGE> to choose another age, using s, m, h, or d, or pass --all to remove entries regardless of age. Cleanup requires confirmation unless --yes is present. --dry-run shows the matching entries without writing files. Both commands support global --json output.

Cleanup rewrites the encrypted document atomically while holding its lock. If the last entry is removed, Dopbase deletes that server's cache document but keeps the local cache key and lock file. The next successful live run creates a new document.

Inspect effective configuration ​

dopbase client status displays safe connection status:

text
Config file:     /home/alex/.dopbase/config.toml
Server:          https://dopbase.example.com
Server status:   connected (live)
Server source:   config
Authentication:  dopbase login (saved session)
Role:            Member
Email:           alex@dopbase.com
Environment:     env_482731 (default)

It never displays a token or secret value. dopbase --json client status returns the same safe fields for diagnostics and automation:

json
{
  "config_file": "/home/alex/.dopbase/config.toml",
  "server_url": "http://localhost:8840",
  "server_status": "offline",
  "status_source": "cache",
  "server_source": "default",
  "authentication": "none",
  "identity": "none",
  "role": null,
  "email": null,
  "environment": null
}

The server status is connected with a live source when the health check succeeds. It is offline with a cache source when Dopbase cannot be reached; the remaining fields still come from safe local configuration and session metadata. The health probe times out after three seconds.

The stable server-source values are argument, environment, config, and default.

Authentication says how the CLI signed in: dopbase login (a saved session), a runner, personal, or AI agent token saved with dopbase login --token, or a token in DOPBASE_TOKEN. In JSON, authentication is environment, encrypted_session, or none, and identity is the kind of credential: admin (a saved login session), human, runner, personal_token, ai_agent (an agent token from before personal tokens), unknown, or none. Dopbase reads the kind from the token prefix, so it does not confirm that the token is valid. Environment credentials have no email in status output.

Role is the account's role as the server names it, such as Root, Admin, Member, Auditor, AI agent, or a custom role. Dopbase asks the server, so the role is only shown while it is connected; offline, it reads unknown (server offline) and the JSON role is null. Runner tokens act for one environment and have no role. A personal token reaches at most what its role allows and often less, so run dopbase access to see what it reaches.

Resolution order ​

The effective server is resolved in this order:

  1. Global --server <url> argument
  2. DOPBASE_URL
  3. server_url in the global config
  4. http://localhost:8840

Authentication is resolved in this order:

  1. DOPBASE_TOKEN
  2. The encrypted credential matching the normalized active server

An empty or invalid DOPBASE_TOKEN stops the command instead of falling back. Runner exports use the same precedence and require a live server response; they never use the encrypted run cache.

The environment used by dopbase run is resolved in this order:

  1. Positional environment reference
  2. A non-empty DOPBASE_ENV
  3. The saved default when its server URL matches the effective server

A runner token skips this order. It always runs its own environment, ignores the saved default, and treats a positional reference or DOPBASE_ENV as a check: one that names another environment stops the run.

Set or clear the default with dopbase env default <ENVIRONMENT_REF> and dopbase env default --clear. A server override never reuses a default saved for another endpoint.

A stored credential is used only when its server matches the effective server. Dopbase never sends a saved token to an endpoint selected by an unrelated --server or DOPBASE_URL override.

Command-line and environment-variable overrides affect only the current process. They never rewrite the global configuration.

Multiple instances on one machine ​

Each Dopbase server instance has its own address and server-owned SQLite database. For example, two local instances might listen on ports 8840 and 8377.

Only one endpoint can be globally active. v0.2.3 does not retain named profiles or token history for previously selected servers:

bash
dopbase client connect http://localhost:8377

Other processes can target a different instance without changing global state:

bash
DOPBASE_URL=http://localhost:8840 \
DOPBASE_TOKEN=<token-for-8840> \
dopbase run env_482731 -- ./application

Client preferences never belong in a server database. The client must resolve its endpoint before it can know which local or remote server database exists.

Open-source secrets management for developers.