Skip to content

Data Model ​

Talos stores all metadata in a SQLite database. This page documents the schema for each table.

Entity Relationship ​

Tables ​

users ​

Stores admin accounts for the Talos web UI.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique user ID
usernameTEXTNOT NULL UNIQUELogin username
password_hashTEXTNOT NULLBcrypt password hash
created_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPAccount creation time
updated_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPLast update time

apps ​

Stores application definitions and current state.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique app ID
nameTEXTNOT NULL UNIQUEApplication name (used in container names and URLs)
sourceTEXTNOT NULL DEFAULT 'github'Source type
repo_urlTEXTNOT NULLGit repository URL
branchTEXTNOT NULL DEFAULT 'main'Default branch
project_typeTEXTNOT NULL DEFAULT ''Build detection override: static, node, go, java, or '' for auto-detect
internal_portINTEGERNOT NULL DEFAULT 3000Port the app listens on inside the container
image_refTEXTNOT NULL DEFAULT ''Current container image reference
domainTEXTDEFAULT ''Custom domain (unique index, empty allowed)
fallback_portINTEGERDEFAULT 0External port for IP mode (unique index, 0 = not set)
access_modeTEXTNOT NULL DEFAULT 'port'domain or port
access_urlTEXTNOT NULL DEFAULT ''Computed access URL
statusTEXTNOT NULL DEFAULT 'inactive'active, inactive, or error
current_deploy_idINTEGERREFERENCES deploys(id)Currently live deploy
live_container_nameTEXTNOT NULL DEFAULT ''Name of the running container
github_installation_idINTEGERGitHub App installation ID
github_repo_idINTEGERGitHub repository ID
registry_urlTEXTNOT NULL DEFAULT ''Container registry URL (default: ghcr.io)
created_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPCreation time
updated_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPLast update time

Indexes:

  • idx_apps_domain -- UNIQUE on domain WHERE domain != ''
  • idx_apps_fallback_port -- UNIQUE on fallback_port WHERE fallback_port > 0

project_type behavior:

  • Empty string '' (default) means Talos auto-detects the project type from sentinel files when no Dockerfile is present.
  • A non-empty value (static, node, go, java) forces that provider, skipping auto-detection entirely.
  • Only applies to Talos Build mode (build_mode = 'talos_build'). In External CI mode, this column is ignored.
  • Existing rows default to '' (auto-detect) — no migration needed for the new column.

deploys ​

Records each deployment attempt.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique deploy ID
app_idINTEGERNOT NULL REFERENCES apps(id) ON DELETE CASCADETarget application
image_refTEXTNOT NULLContainer image deployed
commit_shaTEXTDEFAULT ''Git commit SHA
branchTEXTNOT NULLGit branch
statusTEXTNOT NULL DEFAULT 'pending'pending, running, success, failed, rollback, auto_rollback
container_idTEXTDEFAULT ''Docker container ID
health_statusTEXTDEFAULT ''healthy or unhealthy
logsTEXTDEFAULT ''Error message or deploy summary
env_snapshotTEXTNOT NULL DEFAULT ''JSON snapshot of env vars at deploy time
started_atDATETIMEWhen execution started
completed_atDATETIMEWhen deploy finished (success or failure)
triggered_byTEXTNOT NULL DEFAULT 'webhook'webhook, manual, or rollback
rollback_of_idINTEGERREFERENCES deploys(id)If this is a rollback, the deploy it rolled back from
created_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPCreation time

Indexes:

  • idx_deploys_app_id -- on app_id

deploy_events ​

Structured events emitted during deployment for diagnostics.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique event ID
deploy_idINTEGERNOT NULL REFERENCES deploys(id) ON DELETE CASCADEParent deploy
timestampDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPWhen the event occurred
levelTEXTNOT NULL DEFAULT 'info'info, warn, or error
stepTEXTNOT NULL DEFAULT ''Pipeline step: start, pull, health_check, route_update, stop_old, finalize, auto_rollback
messageTEXTNOT NULL DEFAULT ''Human-readable event description

Indexes:

  • idx_deploy_events_deploy_id -- on deploy_id

services ​

Managed backing services (databases, caches, storage).

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique service ID
nameTEXTNOT NULL UNIQUEService name
typeTEXTNOT NULLpostgres, mysql, redis, or garage
image_refTEXTNOT NULLDocker image (e.g., postgres:16)
statusTEXTNOT NULL DEFAULT 'pending'pending, provisioning, active, error, stopped
container_idTEXTDEFAULT ''Docker container ID
app_idINTEGERREFERENCES apps(id) ON DELETE SET NULLLegacy direct app link
volume_pathTEXTNOT NULL DEFAULT ''Host path for persistent data
credentialsTEXTNOT NULL DEFAULT ''AES-256-GCM encrypted JSON credentials
configTEXTNOT NULL DEFAULT '{}'Additional configuration JSON
internal_portINTEGERNOT NULL DEFAULT 0Service port (5432, 3306, 6379, 3900)
created_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPCreation time
updated_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPLast update time

app_services ​

Many-to-many link between apps and services, with an alias for env var injection.

ColumnTypeConstraintsDescription
app_idINTEGERNOT NULL REFERENCES apps(id) ON DELETE CASCADEApplication
service_idINTEGERNOT NULL REFERENCES services(id) ON DELETE CASCADEService
aliasTEXTNOT NULL DEFAULT ''Prefix for injected env vars

Primary Key: (app_id, service_id)

app_env_vars ​

Per-application environment variables.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique ID
app_idINTEGERNOT NULL REFERENCES apps(id) ON DELETE CASCADEApplication
keyTEXTNOT NULLVariable name
valueTEXTNOT NULL DEFAULT ''Variable value
is_secretINTEGERNOT NULL DEFAULT 01 if masked in UI
requiredINTEGERNOT NULL DEFAULT 01 if deploy fails when missing

Unique Constraint: (app_id, key)

app_env_var_history ​

Tracks previous values of environment variables for audit and diff.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique ID
app_idINTEGERNOT NULL REFERENCES apps(id) ON DELETE CASCADEApplication
keyTEXTNOT NULLVariable name
valueTEXTNOT NULL DEFAULT ''Previous value
is_secretINTEGERNOT NULL DEFAULT 0Was it a secret?
changed_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPWhen the change occurred
changed_byTEXTNOT NULL DEFAULT 'system'Who made the change

Indexes:

  • idx_env_var_history_app_key -- on (app_id, key)

backups ​

Backup records and metadata.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique backup ID
filenameTEXTNOT NULLBackup file name (e.g., talos-backup-20250101-120000.tar.gz)
size_bytesINTEGERNOT NULL DEFAULT 0File size in bytes
typeTEXTNOT NULL DEFAULT 'full'Backup type
statusTEXTNOT NULL DEFAULT 'completed'Backup status
created_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPCreation time

schema_migrations ​

Tracks applied database migrations.

ColumnTypeConstraintsDescription
versionINTEGERPRIMARY KEYMigration version number
applied_atDATETIMENOT NULL DEFAULT CURRENT_TIMESTAMPWhen the migration was applied

Credential Encryption ​

Service credentials are encrypted at rest using AES-256-GCM. The encryption key is derived from TALOS_ENCRYPTION_KEY in the .env file. Each service type has a structured credential format:

ServiceCredential Fields
PostgreSQLhost, port, database, user, password
MySQLhost, port, database, user, password
Redishost, port, password
Garageendpoint, region, access_key, secret_key, bucket

Credentials are stored as encrypted JSON in the services.credentials column and decrypted only when needed for injection into app containers.

Next Steps ​

Released under the Apache License 2.0.