Files
dockhand-upstream/drizzle-pg/meta/0012_snapshot.json
T
Bartosz S. 28bb291c32 feat: add branch selection to Git Stack modal with branches API endpoint (#1343)
* feat: add branch selection to Git Stack modal with branches API endpoint

- Add branch dropdown in create mode (fetches branches from new API endpoint)
- Add branch field in edit mode for existing Git stacks
- Remove redundant branch badge next to repository URL in edit mode
- Add POST /api/git/branches endpoint to list available branches
- Export buildGitEnv, buildRepoUrl, execGit from git.ts for reuse

* cla: recheck with correct author email

* fix: harden git branches endpoint and fix credential resolution

* feat(git-stacks): per-stack branch override

Add a per-stack 'branch' column to git_stacks so each stack can deploy
from a branch different from its repository's default.

- Migration 0012 (drizzle + drizzle-pg): add nullable 'branch' column
- resolveStackBranch() in git.ts: effective branch = per-stack override,
  else repository default; wired into sync/deploy/test paths
- db.ts: persist/read branch; GitStackData.branch is string | null
- API routes (preview-env, stacks create/update): honor explicit branch
  override with partial-update semantics (null/empty clears the override)
- UI: GitStackModal shows a 'Repository default' sentinel + per-stack
  selector; GitSourceBadge displays effective branch with a '(per-stack)'
  marker; stacks page passes through the per-stack branch
- tests/git-stack-branch.test.ts: unit coverage for resolveStackBranch
  and effective-branch display semantics

* feat(git-branches): security hardening per PR #1343 maintainer review

Adopts the three security recommendations from the maintainer review on
the git-branch-stack feature:

1. SSRF guard (assertSafeBranchTarget)
   New src/lib/server/git-branch-lookup.ts rejects repository URLs that
   point at private/loopback/link-local addresses before any git
   subprocess is spawned. Covers IPv4 (127/8, 169.254/16, 10/8,
   172.16/12, 192.168/16, 100.64/10, 0/8), IPv6 (::1, fe80::/10,
   fc00::/7, ::), IPv4-mapped IPv6 (::ffff:a.b.c.d), and a 25-entry
   hostname denylist (localhost, metadata.google.internal,
   host.docker.internal, etc.). Raw-URL parse only — no DNS resolution,
   avoiding TOCTOU/rebinding. Runs on BOTH the url and repositoryId
   paths (a stored repo's URL could also point internal).

2. Credential-exfiltration guard (assertCredentialUrlPair)
   A raw url paired with a stored credentialId is only allowed when the
   credential is plausibly for that host. SSH and none credentials are
   always allowed (no secret to leak). Password credentials: allowed
   when the username equals the URL host, or when the credential name
   (or its hyphen/underscore-separated segments) equals the host or its
   first label (e.g. "github-pat" → github.com). Inference-based — no
   new DB column. The repositoryId path is not subject to this guard
   (the pairing is the user's own stored config).

3. Timeout on git subprocesses
   execGit now accepts a timeoutMs parameter (default GIT_TIMEOUT_MS =
   20s, env-overridable). On timeout the process is killed with SIGKILL
   and the caller receives { timedOut: true, code: 124 }. Applied to all
   execGit call sites (clone, pull, fetch, ls-remote, etc.) so a dead
   or black-holed remote cannot stall a request indefinitely.

OpenAPI: @openapi JSDoc block added to the branches endpoint; spec
regenerated via the upstream generator (359/359 coverage, all 6 gates
pass). /api/git/branches POST entry added to openapi.generated.json.

Svelte5: fix-svelte-optional-params.sh applied to 7 .svelte files
(x?: T → x: T = undefined) to work around esbuild's rejection of
TS-only optional-parameter syntax in lang="ts" script tags.

Tests: 59 tests in tests/git-branches.test.ts covering SSRF (blocked
IPs, boundary cases), credential affinity (allowed/rejected cases),
endpoint pipeline ordering, and parseRepoHost edge cases.

Rebased onto upstream/main (a485c85) — zero conflicts; GitStackModal.svelte
had not drifted since the branch was created.

* fix(git): close SSRF/RCE/exfil gaps across all git URL+credential endpoints (PR #1343 re-review)

1. SSRF: replace hand-rolled assertSafeBranchTarget with shared URL()-based
   isSafeNotificationUrl — blocks decimal/octal/hex/short-form IPv4 and
   v4-mapped IPv6 encodings (all six maintainer bypass payloads now blocked).
   ALL schemes (http/https/ssh/git/scp-like) now judge the CANONICALIZED
   host through that single check: non-http(s) schemes can't be passed to
   URL() as-is, so the parsed host (port-stripped, IPv6 bracketed only
   when it contains a colon) is run through isSafeNotificationUrl under
   an https:// scheme. Closes the ssh/git encoded-IP bypass (decimal
   2130706433, hex 0x7f000001, short-form 127.1 over ssh://, git:// and
   scp-like all resolve to 127.0.0.1 and are now blocked).
2. Credential affinity: drop the dead second rule — with rule (i) being
   username === host, the single-label variant was identical and unreachable.
3. listRemoteBranches + testRepositoryConfig call assertSafeRepoUrl explicitly
   so the ext::/file:: transport denylist holds on every path into a git
   subprocess, not only via buildRepoUrl.
4. preview-env: assertSafeRepoTarget (SSRF+RCE) + repoFilePath containment for
   composePath/envFilePath (path traversal) + assertCredentialHostMatch
   (exfil).
5. repositories/test: assertSafeRepoTarget + assertCredentialHostMatch.

Tests: 134 across 3 files (git-branches, preview-env-security,
repositories-test-security) — lock the six http(s) encoding bypasses, the
four ssh/git encoded-IP payloads at unit and endpoint level, the subdomain
attack, single-label username, path traversal, and the endpoint pipelines.

Verified safe (no change): backup/destinations/test, registries/test,
environments/test, git/repositories CRUD, git/stacks, git/repositories/[id]/test.

* fix(git): address branch stack review feedback

- scope remote branch lookup timeout to ls-remote only
- require git:edit permission for preview-env
- clarify SSRF policy while preserving private LAN Git hosts
- support free-text branch selection for new repositories
- share production branch resolution logic with tests and UI
- add testable preview-env request pipeline
2026-08-22 10:20:43 +02:00

3489 lines
89 KiB
JSON

{
"id": "0012_add_git_stack_branch",
"prevId": "5f9fe4e6-7799-406c-a232-c72726c6db27",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.api_tokens": {
"name": "api_tokens",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"token_hash": {
"name": "token_hash",
"type": "text",
"primaryKey": false,
"notNull": true
},
"token_prefix": {
"name": "token_prefix",
"type": "text",
"primaryKey": false,
"notNull": true
},
"last_used": {
"name": "last_used",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {
"api_tokens_user_id_idx": {
"name": "api_tokens_user_id_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"api_tokens_token_prefix_idx": {
"name": "api_tokens_token_prefix_idx",
"columns": [
{
"expression": "token_prefix",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"api_tokens_user_id_users_id_fk": {
"name": "api_tokens_user_id_users_id_fk",
"tableFrom": "api_tokens",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"api_tokens_token_hash_unique": {
"name": "api_tokens_token_hash_unique",
"nullsNotDistinct": false,
"columns": [
"token_hash"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.audit_logs": {
"name": "audit_logs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": true
},
"action": {
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": true
},
"entity_type": {
"name": "entity_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"entity_id": {
"name": "entity_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"entity_name": {
"name": "entity_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"details": {
"name": "details",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ip_address": {
"name": "ip_address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"user_agent": {
"name": "user_agent",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {
"audit_logs_user_id_idx": {
"name": "audit_logs_user_id_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"audit_logs_created_at_idx": {
"name": "audit_logs_created_at_idx",
"columns": [
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"audit_logs_user_id_users_id_fk": {
"name": "audit_logs_user_id_users_id_fk",
"tableFrom": "audit_logs",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"audit_logs_environment_id_environments_id_fk": {
"name": "audit_logs_environment_id_environments_id_fk",
"tableFrom": "audit_logs",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auth_settings": {
"name": "auth_settings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"auth_enabled": {
"name": "auth_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"default_provider": {
"name": "default_provider",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'local'"
},
"session_timeout": {
"name": "session_timeout",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 86400
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auto_update_settings": {
"name": "auto_update_settings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"container_name": {
"name": "container_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"schedule_type": {
"name": "schedule_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'daily'"
},
"cron_expression": {
"name": "cron_expression",
"type": "text",
"primaryKey": false,
"notNull": false
},
"vulnerability_criteria": {
"name": "vulnerability_criteria",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'never'"
},
"last_checked": {
"name": "last_checked",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"last_updated": {
"name": "last_updated",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"auto_update_settings_environment_id_environments_id_fk": {
"name": "auto_update_settings_environment_id_environments_id_fk",
"tableFrom": "auto_update_settings",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"auto_update_settings_environment_id_container_name_unique": {
"name": "auto_update_settings_environment_id_container_name_unique",
"nullsNotDistinct": false,
"columns": [
"environment_id",
"container_name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.backup_configs": {
"name": "backup_configs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'container'"
},
"target_name": {
"name": "target_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"destination_id": {
"name": "destination_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"all_volumes": {
"name": "all_volumes",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"selected_volumes": {
"name": "selected_volumes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"stop_before_backup": {
"name": "stop_before_backup",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"schedule": {
"name": "schedule",
"type": "text",
"primaryKey": false,
"notNull": false
},
"retention": {
"name": "retention",
"type": "text",
"primaryKey": false,
"notNull": false
},
"options": {
"name": "options",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tags": {
"name": "tags",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_backup_at": {
"name": "last_backup_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"last_backup_status": {
"name": "last_backup_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"backup_configs_environment_id_environments_id_fk": {
"name": "backup_configs_environment_id_environments_id_fk",
"tableFrom": "backup_configs",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"backup_configs_destination_id_backup_destinations_id_fk": {
"name": "backup_configs_destination_id_backup_destinations_id_fk",
"tableFrom": "backup_configs",
"tableTo": "backup_destinations",
"columnsFrom": [
"destination_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.backup_destinations": {
"name": "backup_destinations",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"repository": {
"name": "repository",
"type": "text",
"primaryKey": false,
"notNull": true
},
"password": {
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": true
},
"env_vars": {
"name": "env_vars",
"type": "text",
"primaryKey": false,
"notNull": false
},
"flags": {
"name": "flags",
"type": "text",
"primaryKey": false,
"notNull": false
},
"host_path": {
"name": "host_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"policies": {
"name": "policies",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_test_at": {
"name": "last_test_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"last_test_status": {
"name": "last_test_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_test_error": {
"name": "last_test_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"backup_destinations_name_unique": {
"name": "backup_destinations_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.config_sets": {
"name": "config_sets",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"env_vars": {
"name": "env_vars",
"type": "text",
"primaryKey": false,
"notNull": false
},
"labels": {
"name": "labels",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ports": {
"name": "ports",
"type": "text",
"primaryKey": false,
"notNull": false
},
"volumes": {
"name": "volumes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"network_mode": {
"name": "network_mode",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'bridge'"
},
"restart_policy": {
"name": "restart_policy",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'no'"
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"config_sets_name_unique": {
"name": "config_sets_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.container_events": {
"name": "container_events",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"container_id": {
"name": "container_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"container_name": {
"name": "container_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"image": {
"name": "image",
"type": "text",
"primaryKey": false,
"notNull": false
},
"action": {
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": true
},
"actor_attributes": {
"name": "actor_attributes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"timestamp": {
"name": "timestamp",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {
"container_events_env_timestamp_idx": {
"name": "container_events_env_timestamp_idx",
"columns": [
{
"expression": "environment_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "timestamp",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"container_events_environment_id_environments_id_fk": {
"name": "container_events_environment_id_environments_id_fk",
"tableFrom": "container_events",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.environment_notifications": {
"name": "environment_notifications",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"notification_id": {
"name": "notification_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"event_types": {
"name": "event_types",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"environment_notifications_environment_id_environments_id_fk": {
"name": "environment_notifications_environment_id_environments_id_fk",
"tableFrom": "environment_notifications",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"environment_notifications_notification_id_notification_settings_id_fk": {
"name": "environment_notifications_notification_id_notification_settings_id_fk",
"tableFrom": "environment_notifications",
"tableTo": "notification_settings",
"columnsFrom": [
"notification_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"environment_notifications_environment_id_notification_id_unique": {
"name": "environment_notifications_environment_id_notification_id_unique",
"nullsNotDistinct": false,
"columns": [
"environment_id",
"notification_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.environments": {
"name": "environments",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"host": {
"name": "host",
"type": "text",
"primaryKey": false,
"notNull": false
},
"port": {
"name": "port",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 2375
},
"protocol": {
"name": "protocol",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'http'"
},
"tls_ca": {
"name": "tls_ca",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tls_cert": {
"name": "tls_cert",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tls_key": {
"name": "tls_key",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tls_skip_verify": {
"name": "tls_skip_verify",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'globe'"
},
"collect_activity": {
"name": "collect_activity",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"collect_metrics": {
"name": "collect_metrics",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"highlight_changes": {
"name": "highlight_changes",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"labels": {
"name": "labels",
"type": "text",
"primaryKey": false,
"notNull": false
},
"connection_type": {
"name": "connection_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'socket'"
},
"socket_path": {
"name": "socket_path",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'/var/run/docker.sock'"
},
"hawser_token": {
"name": "hawser_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"hawser_last_seen": {
"name": "hawser_last_seen",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"hawser_agent_id": {
"name": "hawser_agent_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"hawser_agent_name": {
"name": "hawser_agent_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"hawser_version": {
"name": "hawser_version",
"type": "text",
"primaryKey": false,
"notNull": false
},
"hawser_capabilities": {
"name": "hawser_capabilities",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"environments_name_unique": {
"name": "environments_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.git_credentials": {
"name": "git_credentials",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"auth_type": {
"name": "auth_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'none'"
},
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": false
},
"password": {
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ssh_private_key": {
"name": "ssh_private_key",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ssh_passphrase": {
"name": "ssh_passphrase",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"git_credentials_name_unique": {
"name": "git_credentials_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.git_repositories": {
"name": "git_repositories",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"branch": {
"name": "branch",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'main'"
},
"credential_id": {
"name": "credential_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"compose_path": {
"name": "compose_path",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'docker-compose.yml'"
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"auto_update": {
"name": "auto_update",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"auto_update_schedule": {
"name": "auto_update_schedule",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'daily'"
},
"auto_update_cron": {
"name": "auto_update_cron",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'0 3 * * *'"
},
"webhook_enabled": {
"name": "webhook_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"webhook_secret": {
"name": "webhook_secret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_sync": {
"name": "last_sync",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"last_commit": {
"name": "last_commit",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sync_status": {
"name": "sync_status",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'pending'"
},
"sync_error": {
"name": "sync_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"git_repositories_credential_id_git_credentials_id_fk": {
"name": "git_repositories_credential_id_git_credentials_id_fk",
"tableFrom": "git_repositories",
"tableTo": "git_credentials",
"columnsFrom": [
"credential_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"git_repositories_name_unique": {
"name": "git_repositories_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.git_stacks": {
"name": "git_stacks",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"stack_name": {
"name": "stack_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"branch": {
"name": "branch",
"type": "text",
"primaryKey": false,
"notNull": false
},
"repository_id": {
"name": "repository_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"compose_path": {
"name": "compose_path",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'docker-compose.yml'"
},
"env_file_path": {
"name": "env_file_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"auto_update": {
"name": "auto_update",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"auto_update_schedule": {
"name": "auto_update_schedule",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'daily'"
},
"auto_update_cron": {
"name": "auto_update_cron",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'0 3 * * *'"
},
"webhook_enabled": {
"name": "webhook_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"webhook_secret": {
"name": "webhook_secret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"context_dir": {
"name": "context_dir",
"type": "text",
"primaryKey": false,
"notNull": false
},
"build_on_deploy": {
"name": "build_on_deploy",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"no_build_cache": {
"name": "no_build_cache",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"repull_images": {
"name": "repull_images",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"force_redeploy": {
"name": "force_redeploy",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"last_sync": {
"name": "last_sync",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"last_commit": {
"name": "last_commit",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sync_status": {
"name": "sync_status",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'pending'"
},
"sync_error": {
"name": "sync_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"synced_files": {
"name": "synced_files",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"git_stacks_environment_id_environments_id_fk": {
"name": "git_stacks_environment_id_environments_id_fk",
"tableFrom": "git_stacks",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"git_stacks_repository_id_git_repositories_id_fk": {
"name": "git_stacks_repository_id_git_repositories_id_fk",
"tableFrom": "git_stacks",
"tableTo": "git_repositories",
"columnsFrom": [
"repository_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"git_stacks_stack_name_environment_id_unique": {
"name": "git_stacks_stack_name_environment_id_unique",
"nullsNotDistinct": false,
"columns": [
"stack_name",
"environment_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.hawser_tokens": {
"name": "hawser_tokens",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"token": {
"name": "token",
"type": "text",
"primaryKey": false,
"notNull": true
},
"token_prefix": {
"name": "token_prefix",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"is_active": {
"name": "is_active",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"last_used": {
"name": "last_used",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"hawser_tokens_environment_id_environments_id_fk": {
"name": "hawser_tokens_environment_id_environments_id_fk",
"tableFrom": "hawser_tokens",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"hawser_tokens_token_unique": {
"name": "hawser_tokens_token_unique",
"nullsNotDistinct": false,
"columns": [
"token"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.host_metrics": {
"name": "host_metrics",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"cpu_percent": {
"name": "cpu_percent",
"type": "double precision",
"primaryKey": false,
"notNull": true
},
"memory_percent": {
"name": "memory_percent",
"type": "double precision",
"primaryKey": false,
"notNull": true
},
"memory_used": {
"name": "memory_used",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"memory_total": {
"name": "memory_total",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"timestamp": {
"name": "timestamp",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {
"host_metrics_env_timestamp_idx": {
"name": "host_metrics_env_timestamp_idx",
"columns": [
{
"expression": "environment_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "timestamp",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"host_metrics_environment_id_environments_id_fk": {
"name": "host_metrics_environment_id_environments_id_fk",
"tableFrom": "host_metrics",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.ldap_config": {
"name": "ldap_config",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"server_url": {
"name": "server_url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"bind_dn": {
"name": "bind_dn",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bind_password": {
"name": "bind_password",
"type": "text",
"primaryKey": false,
"notNull": false
},
"base_dn": {
"name": "base_dn",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_filter": {
"name": "user_filter",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'(uid={{username}})'"
},
"username_attribute": {
"name": "username_attribute",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'uid'"
},
"email_attribute": {
"name": "email_attribute",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'mail'"
},
"display_name_attribute": {
"name": "display_name_attribute",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'cn'"
},
"group_base_dn": {
"name": "group_base_dn",
"type": "text",
"primaryKey": false,
"notNull": false
},
"group_filter": {
"name": "group_filter",
"type": "text",
"primaryKey": false,
"notNull": false
},
"admin_group": {
"name": "admin_group",
"type": "text",
"primaryKey": false,
"notNull": false
},
"role_mappings": {
"name": "role_mappings",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tls_enabled": {
"name": "tls_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"tls_ca": {
"name": "tls_ca",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.notification_settings": {
"name": "notification_settings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"config": {
"name": "config",
"type": "text",
"primaryKey": false,
"notNull": true
},
"event_types": {
"name": "event_types",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.oidc_config": {
"name": "oidc_config",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"issuer_url": {
"name": "issuer_url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"client_id": {
"name": "client_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"client_secret": {
"name": "client_secret",
"type": "text",
"primaryKey": false,
"notNull": true
},
"redirect_uri": {
"name": "redirect_uri",
"type": "text",
"primaryKey": false,
"notNull": true
},
"scopes": {
"name": "scopes",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'openid profile email'"
},
"username_claim": {
"name": "username_claim",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'preferred_username'"
},
"email_claim": {
"name": "email_claim",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'email'"
},
"display_name_claim": {
"name": "display_name_claim",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'name'"
},
"admin_claim": {
"name": "admin_claim",
"type": "text",
"primaryKey": false,
"notNull": false
},
"admin_value": {
"name": "admin_value",
"type": "text",
"primaryKey": false,
"notNull": false
},
"role_mappings_claim": {
"name": "role_mappings_claim",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'groups'"
},
"role_mappings": {
"name": "role_mappings",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.pending_container_updates": {
"name": "pending_container_updates",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"container_id": {
"name": "container_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"container_name": {
"name": "container_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"current_image": {
"name": "current_image",
"type": "text",
"primaryKey": false,
"notNull": true
},
"has_image_update": {
"name": "has_image_update",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"newer_version": {
"name": "newer_version",
"type": "text",
"primaryKey": false,
"notNull": false
},
"checked_at": {
"name": "checked_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"pending_container_updates_environment_id_environments_id_fk": {
"name": "pending_container_updates_environment_id_environments_id_fk",
"tableFrom": "pending_container_updates",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"pending_container_updates_environment_id_container_id_unique": {
"name": "pending_container_updates_environment_id_container_id_unique",
"nullsNotDistinct": false,
"columns": [
"environment_id",
"container_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.registries": {
"name": "registries",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": false
},
"password": {
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": false
},
"is_default": {
"name": "is_default",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"registries_name_unique": {
"name": "registries_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.roles": {
"name": "roles",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"is_system": {
"name": "is_system",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"permissions": {
"name": "permissions",
"type": "text",
"primaryKey": false,
"notNull": true
},
"environment_ids": {
"name": "environment_ids",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"roles_name_unique": {
"name": "roles_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.schedule_executions": {
"name": "schedule_executions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"schedule_type": {
"name": "schedule_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"schedule_id": {
"name": "schedule_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"entity_name": {
"name": "entity_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"triggered_by": {
"name": "triggered_by",
"type": "text",
"primaryKey": false,
"notNull": true
},
"triggered_at": {
"name": "triggered_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"started_at": {
"name": "started_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"completed_at": {
"name": "completed_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"duration": {
"name": "duration",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true
},
"error_message": {
"name": "error_message",
"type": "text",
"primaryKey": false,
"notNull": false
},
"details": {
"name": "details",
"type": "text",
"primaryKey": false,
"notNull": false
},
"logs": {
"name": "logs",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {
"schedule_executions_type_id_idx": {
"name": "schedule_executions_type_id_idx",
"columns": [
{
"expression": "schedule_type",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "schedule_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"schedule_executions_environment_id_environments_id_fk": {
"name": "schedule_executions_environment_id_environments_id_fk",
"tableFrom": "schedule_executions",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.secret_providers": {
"name": "secret_providers",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"config": {
"name": "config",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"secret_providers_name_unique": {
"name": "secret_providers_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.sessions": {
"name": "sessions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {
"sessions_user_id_idx": {
"name": "sessions_user_id_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"sessions_expires_at_idx": {
"name": "sessions_expires_at_idx",
"columns": [
{
"expression": "expires_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"sessions_user_id_users_id_fk": {
"name": "sessions_user_id_users_id_fk",
"tableFrom": "sessions",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.settings": {
"name": "settings",
"schema": "",
"columns": {
"key": {
"name": "key",
"type": "text",
"primaryKey": true,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.stack_environment_variables": {
"name": "stack_environment_variables",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"stack_name": {
"name": "stack_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"is_secret": {
"name": "is_secret",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"stack_environment_variables_environment_id_environments_id_fk": {
"name": "stack_environment_variables_environment_id_environments_id_fk",
"tableFrom": "stack_environment_variables",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"stack_environment_variables_stack_name_environment_id_key_unique": {
"name": "stack_environment_variables_stack_name_environment_id_key_unique",
"nullsNotDistinct": false,
"columns": [
"stack_name",
"environment_id",
"key"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.stack_events": {
"name": "stack_events",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"stack_name": {
"name": "stack_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"event_type": {
"name": "event_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"timestamp": {
"name": "timestamp",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"metadata": {
"name": "metadata",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"stack_events_environment_id_environments_id_fk": {
"name": "stack_events_environment_id_environments_id_fk",
"tableFrom": "stack_events",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.stack_sources": {
"name": "stack_sources",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"stack_name": {
"name": "stack_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"source_type": {
"name": "source_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'internal'"
},
"git_repository_id": {
"name": "git_repository_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"git_stack_id": {
"name": "git_stack_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"compose_path": {
"name": "compose_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"env_path": {
"name": "env_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"secret_provider_id": {
"name": "secret_provider_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"injected_secret_keys": {
"name": "injected_secret_keys",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"stack_sources_environment_id_environments_id_fk": {
"name": "stack_sources_environment_id_environments_id_fk",
"tableFrom": "stack_sources",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"stack_sources_git_repository_id_git_repositories_id_fk": {
"name": "stack_sources_git_repository_id_git_repositories_id_fk",
"tableFrom": "stack_sources",
"tableTo": "git_repositories",
"columnsFrom": [
"git_repository_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"stack_sources_git_stack_id_git_stacks_id_fk": {
"name": "stack_sources_git_stack_id_git_stacks_id_fk",
"tableFrom": "stack_sources",
"tableTo": "git_stacks",
"columnsFrom": [
"git_stack_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"stack_sources_secret_provider_id_secret_providers_id_fk": {
"name": "stack_sources_secret_provider_id_secret_providers_id_fk",
"tableFrom": "stack_sources",
"tableTo": "secret_providers",
"columnsFrom": [
"secret_provider_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"stack_sources_stack_name_environment_id_unique": {
"name": "stack_sources_stack_name_environment_id_unique",
"nullsNotDistinct": false,
"columns": [
"stack_name",
"environment_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.template_sources": {
"name": "template_sources",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"source_id": {
"name": "source_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"builtin": {
"name": "builtin",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"template_sources_source_id_unique": {
"name": "template_sources_source_id_unique",
"nullsNotDistinct": false,
"columns": [
"source_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.user_preferences": {
"name": "user_preferences",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"user_preferences_user_id_users_id_fk": {
"name": "user_preferences_user_id_users_id_fk",
"tableFrom": "user_preferences",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"user_preferences_environment_id_environments_id_fk": {
"name": "user_preferences_environment_id_environments_id_fk",
"tableFrom": "user_preferences",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"user_preferences_user_id_environment_id_key_unique": {
"name": "user_preferences_user_id_environment_id_key_unique",
"nullsNotDistinct": false,
"columns": [
"user_id",
"environment_id",
"key"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.user_roles": {
"name": "user_roles",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"role_id": {
"name": "role_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"user_roles_user_id_users_id_fk": {
"name": "user_roles_user_id_users_id_fk",
"tableFrom": "user_roles",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"user_roles_role_id_roles_id_fk": {
"name": "user_roles_role_id_roles_id_fk",
"tableFrom": "user_roles",
"tableTo": "roles",
"columnsFrom": [
"role_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"user_roles_environment_id_environments_id_fk": {
"name": "user_roles_environment_id_environments_id_fk",
"tableFrom": "user_roles",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"user_roles_user_id_role_id_environment_id_unique": {
"name": "user_roles_user_id_role_id_environment_id_unique",
"nullsNotDistinct": false,
"columns": [
"user_id",
"role_id",
"environment_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.users": {
"name": "users",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"password_hash": {
"name": "password_hash",
"type": "text",
"primaryKey": false,
"notNull": true
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"avatar": {
"name": "avatar",
"type": "text",
"primaryKey": false,
"notNull": false
},
"auth_provider": {
"name": "auth_provider",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'local'"
},
"mfa_enabled": {
"name": "mfa_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"mfa_secret": {
"name": "mfa_secret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"is_active": {
"name": "is_active",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"last_login": {
"name": "last_login",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"users_username_unique": {
"name": "users_username_unique",
"nullsNotDistinct": false,
"columns": [
"username"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.vulnerability_scans": {
"name": "vulnerability_scans",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"environment_id": {
"name": "environment_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"image_id": {
"name": "image_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"image_name": {
"name": "image_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"scanner": {
"name": "scanner",
"type": "text",
"primaryKey": false,
"notNull": true
},
"scanned_at": {
"name": "scanned_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"scan_duration": {
"name": "scan_duration",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"critical_count": {
"name": "critical_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 0
},
"high_count": {
"name": "high_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 0
},
"medium_count": {
"name": "medium_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 0
},
"low_count": {
"name": "low_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 0
},
"negligible_count": {
"name": "negligible_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 0
},
"unknown_count": {
"name": "unknown_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 0
},
"vulnerabilities": {
"name": "vulnerabilities",
"type": "text",
"primaryKey": false,
"notNull": false
},
"error": {
"name": "error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {
"vulnerability_scans_env_image_idx": {
"name": "vulnerability_scans_env_image_idx",
"columns": [
{
"expression": "environment_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "image_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"vulnerability_scans_environment_id_environments_id_fk": {
"name": "vulnerability_scans_environment_id_environments_id_fk",
"tableFrom": "vulnerability_scans",
"tableTo": "environments",
"columnsFrom": [
"environment_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}