provisioning/schemas/platform/common/external-services.ncl

60 lines
2.3 KiB
Text

# External Services Configuration Schema
# Unified declaration of external services required by the platform
# (Database, OCI Registry, Git Sources, Cache)
let database_schema = import "./database.ncl" in
{
# OCI registry that extension-registry connects to for pulling/pushing extensions
OciRegistryConfig = {
id | String,
registry | String, # host:port (e.g., zot.internal:5000)
namespace | String, # OCI namespace (e.g., provisioning/extensions)
auth_token_path | String | optional, # path to auth token file
verify_ssl | Bool | default = true,
},
# Git source (Forgejo/Gitea/GitHub) for extension discovery and release management
GitSourceConfig = {
id | String,
provider | String, # "forgejo" | "gitea" | "github"
url | String | optional, # not needed for github.com
organization | String,
token_path | String, # path to auth token file
verify_ssl | Bool | default = true,
},
# Local filesystem path used as extension store or cache directory
PathConfig = {
path | String,
writable | Bool | default = true,
},
# Cache configuration: either local filesystem or remote service
CacheConfig = {
mode | String, # "local" | "remote"
path | String | optional, # for local mode
url | String | optional, # for remote mode (redis://host:port)
},
# The full external services block for a deployment mode
# Declares all external dependencies that must be operational before internal services start
ExternalServicesConfig = {
# Database: reuses DatabaseConfig from database.ncl
# Can be embedded (filesystem), local server (surrealdb_server), or remote
database | database_schema.DatabaseConfig,
# OCI registries (zero or more) - for extension distribution
oci_registries | Array OciRegistryConfig | default = [],
# Git sources (zero or more) - for extension discovery
git_sources | Array GitSourceConfig | default = [],
# Local extension path fallback (used when no OCI is configured)
# Primarily for solo mode: extensions stored as files instead of in OCI registry
extension_path | PathConfig | optional,
# Cache configuration: critical for extension-registry and orchestrator
cache | CacheConfig,
},
}