Skip to content

Server Configuration (Hub & Runtime Broker)

This document describes the configuration for the Scion Hub (State Server) and the Scion Runtime Broker.

Server configuration is defined in the server section of your settings.yaml file.

  • Primary: ~/.scion/settings.yaml (Global settings)
  • Legacy: ~/.scion/server.yaml (Deprecated, but supported as fallback)
schema_version: "1"
server:
env: prod
log_level: info
hub:
port: 9810
host: "0.0.0.0"
public_url: "https://hub.scion.dev"
broker:
enabled: true
port: 9800
broker_id: "generated-uuid"
database:
driver: sqlite
url: "hub.db"
auth:
dev_mode: false

Controls the central Hub API server.

FieldTypeDefaultDescription
portint9810HTTP port to listen on (standalone mode). In combined mode (--enable-web), the Hub API is served on the web port instead and this setting is ignored.
hoststring"0.0.0.0"Network interface to bind to.
public_urlstringThe externally accessible URL of the Hub (used for callbacks).
read_timeoutduration"30s"HTTP read timeout.
write_timeoutduration"60s"HTTP write timeout.
admin_emailslist[]List of emails granted super-admin access.
soft_delete_retentiondurationDuration to retain soft-deleted agents (e.g., "72h").
soft_delete_retain_filesboolfalsePreserve workspace files during the soft-delete period.
corsobjectCORS configuration (see below).
FieldTypeDefaultDescription
enabledbooltrueEnable CORS.
allowed_originslist["*"]Allowed origins.

Controls the Runtime Broker service.

FieldTypeDefaultDescription
enabledboolfalseWhether to start the broker service.
portint9800HTTP port to listen on.
broker_idstringUnique UUID for this broker.
broker_namestringHuman-readable name.
broker_nicknamestringShort display name.
hub_endpointstringThe Hub URL this broker connects to.
container_hub_endpointstringOverrides hub_endpoint when injecting the Hub URL into agent containers. Use when containers cannot reach the Hub at the broker’s address (e.g. http://host.containers.internal:8080 for local development).
broker_tokenstringAuthentication token for the Hub.
auto_provideboolfalseAutomatically add as provider for new groves.

Persistence settings for the Hub.

FieldTypeDefaultDescription
driverstring"sqlite"Database driver: sqlite or postgres.
urlstring"hub.db"Connection string or file path.
FieldTypeDefaultDescription
dev_modeboolfalseEnable insecure development authentication.
dev_tokenstringStatic token for dev mode.
authorized_domainslist[]Limit access to specific email domains.

OAuth provider credentials.

server:
oauth:
web:
google: { client_id: "...", client_secret: "..." }
github: { client_id: "...", client_secret: "..." }
cli:
google: { client_id: "...", client_secret: "..." }

Backend for storing templates and artifacts.

FieldTypeDefaultDescription
providerstring"local"Storage provider: local or gcs.
bucketstringGCS bucket name.
local_pathstringLocal path for storage.

Backend for managing encrypted secrets. The local backend is read-only and rejects secret write operations. Configure gcpsm to enable full secret management.

FieldTypeDefaultDescription
backendstring"local"Secrets backend: local or gcpsm. The local backend rejects writes; use gcpsm for production.
gcp_project_idstringGCP Project ID for Secret Manager. Required when backend is gcpsm.
gcp_credentialsstringPath to GCP service account JSON or the JSON content itself. Optional if using Application Default Credentials.

All server settings can be overridden via environment variables using the SCION_SERVER_ prefix and snake_case naming.

Examples:

  • server.hub.port -> SCION_SERVER_HUB_PORT
  • server.broker.enabled -> SCION_SERVER_BROKER_ENABLED
  • server.broker.container_hub_endpoint -> SCION_SERVER_BROKER_CONTAINERHUBENDPOINT
  • server.database.url -> SCION_SERVER_DATABASE_URL
  • server.auth.dev_mode -> SCION_SERVER_AUTH_DEVMODE
  • server.secrets.backend -> SCION_SERVER_SECRETS_BACKEND
  • server.secrets.gcp_project_id -> SCION_SERVER_SECRETS_GCP_PROJECT_ID
  • server.secrets.gcp_credentials -> SCION_SERVER_SECRETS_GCP_CREDENTIALS

These environment variables control server-side logging behavior. They are not part of the settings.yaml structure.

VariableDescriptionDefault
SCION_LOG_GCPEnable GCP Cloud Logging JSON format on stdoutfalse
SCION_LOG_LEVELLog level: debug, info, warn, errorinfo
SCION_CLOUD_LOGGINGSend logs directly to Cloud Logging via client libraryfalse
SCION_CLOUD_LOGGING_LOG_IDLog name in Cloud Logging for application logsscion
SCION_GCP_PROJECT_IDGCP project ID for Cloud Logging (priority 1)auto-detect
GOOGLE_CLOUD_PROJECTGCP project ID for Cloud Logging (priority 2)-
SCION_SERVER_REQUEST_LOG_PATHWrite HTTP request logs to a file at this path. Each line is a JSON object in HttpRequest format. When not set, request logs follow the default routing (stdout in background mode, suppressed in foreground mode, Cloud Logging when enabled).(disabled)

See the Local Development Logging guide for details on log formats, request log fields, and Cloud Logging integration.

When server.hub.public_url is not explicitly set, the Hub endpoint injected into agents is resolved in this order:

  1. SCION_SERVER_HUB_PUBLIC_URL or server.hub.public_url — explicit Hub public URL.
  2. Grove-level hub.endpoint setting.
  3. SCION_SERVER_BASE_URL — the server’s public base URL (also used for OAuth redirects).
  4. Auto-computed http://localhost:{port} (last resort).

For local development where the Hub runs on localhost but agents are in containers, set server.broker.container_hub_endpoint to a container-accessible address like http://host.containers.internal:8080.