Skip to main content

Configuration

Complete reference for AsterConfig, which controls trust, networking, storage, and connectivity for both AsterServer and AsterClient. The field names, semantics, and environment variables are the same across Python and TypeScript -- only the constructor idioms differ. Examples on this page use Python; the TypeScript AsterConfig type mirrors the same shape.

Resolution order

Configuration values are resolved from three layers. Each layer overrides the previous:

  1. Built-in defaults -- ephemeral key, in-memory storage, all admission gates open.
  2. TOML config file -- loaded via AsterConfig.from_file("aster.toml").
  3. Environment variables -- ASTER_* prefixed. Always win when set.
from aster import AsterConfig

# Auto-load from env vars only (default when no config is passed)
config = AsterConfig.from_env()

# Load from TOML file, with env var overrides
config = AsterConfig.from_file("aster.toml")

# Inline (testing, scripts)
config = AsterConfig(root_pubkey=pub_bytes, allow_all_consumers=True)

Field reference

Trust fields

FieldTypeDefaultEnv varDescription
root_pubkeybytes or NoneNoneASTER_ROOT_PUBKEY (hex)32-byte ed25519 root public key. The deployment trust anchor. Highest priority.
root_pubkey_filestr or NoneNoneASTER_ROOT_PUBKEY_FILEPath to a file containing the root public key (hex string or JSON with "public_key" field).
enrollment_credential_filestr or NoneNoneASTER_ENROLLMENT_CREDENTIALPath to a JSON enrollment credential signed by the root key. Required for consumers in production.
enrollment_credential_iidstr or NoneNoneASTER_ENROLLMENT_CREDENTIAL_IIDCloud Instance Identity Document token. Required when the credential's policy includes aster.iid_* attributes.
allow_all_consumersboolFalseASTER_ALLOW_ALL_CONSUMERSSkip consumer admission gate. Set true for development.
allow_all_producersboolTrueASTER_ALLOW_ALL_PRODUCERSSkip producer admission gate. Default allows all producers.

Connect fields (consumer-side)

FieldTypeDefaultEnv varDescription
endpoint_addrstr or NoneNoneASTER_ENDPOINT_ADDRProducer's endpoint address. Base64-encoded NodeAddr or hex EndpointId. Required for AsterClient.

Storage fields

FieldTypeDefaultEnv varDescription
storage_pathstr or NoneNoneASTER_STORAGE_PATHPath for persistent storage (FsStore). Enables docs and blobs to survive restarts. If unset, uses in-memory storage.

Health fields

FieldTypeDefaultEnv varDescription
health_portint0ASTER_HEALTH_PORTPort for health HTTP server. 0 disables the server (default).
health_hoststr127.0.0.1ASTER_HEALTH_HOSTBind address for the health server. Use 0.0.0.0 inside containers.

Network fields

FieldTypeDefaultEnv varDescription
secret_keybytes or NoneNoneASTER_SECRET_KEY (base64)32-byte node identity key. Determines the stable EndpointId. If unset, a fresh key is generated each run.
relay_modestr or NoneNoneASTER_RELAY_MODERelay server mode: "default", "disabled", or a custom relay URL.
bind_addrstr or NoneNoneASTER_BIND_ADDRLocal bind address (e.g. "0.0.0.0:9000").
enable_monitoringboolFalseASTER_ENABLE_MONITORINGEnable endpoint monitoring/metrics.
enable_hooksboolFalseASTER_ENABLE_HOOKSEnable connection hooks (Gate 0). Auto-set when admission is active.
hook_timeout_msint5000ASTER_HOOK_TIMEOUT_MSTimeout for hook decisions in milliseconds.
clear_ip_transportsboolFalseASTER_CLEAR_IP_TRANSPORTSDisable direct IP transports.
clear_relay_transportsboolFalseASTER_CLEAR_RELAY_TRANSPORTSDisable relay transports.
portmapper_configstr or NoneNoneASTER_PORTMAPPER_CONFIGPort mapper configuration: "disabled" or other.
proxy_urlstr or NoneNoneASTER_PROXY_URLHTTP proxy URL for relay connections.
proxy_from_envboolFalseASTER_PROXY_FROM_ENVRead proxy settings from HTTP_PROXY/HTTPS_PROXY env vars.

Identity fields

FieldTypeDefaultEnv varDescription
identity_filestr or NoneNoneASTER_IDENTITY_FILEPath to .aster-identity TOML file. Defaults to .aster-identity in the current working directory if it exists.

TOML file format

The TOML config file uses four sections: [trust], [connect], [storage], and [network].

[trust]
root_pubkey_file = "~/.aster/root_pub.key"
allow_all_consumers = false
allow_all_producers = true

[connect]
endpoint_addr = "aGVsbG8gd29ybGQ..."

[storage]
path = "/var/lib/aster"

[network]
relay_mode = "default"
bind_addr = "0.0.0.0:9000"
# secret_key = "<base64-encoded 32 bytes>"
enable_monitoring = false
enable_hooks = false
hook_timeout_ms = 5000

Environment variables

All environment variables use the ASTER_ prefix. Boolean values accept true/false, 1/0, yes/no, or on/off (case-insensitive).

# Trust
ASTER_ROOT_PUBKEY=<64-char hex string>
ASTER_ROOT_PUBKEY_FILE=~/.aster/root_pub.key
ASTER_ENROLLMENT_CREDENTIAL=consumer.token
ASTER_ENROLLMENT_CREDENTIAL_IID=<cloud IID token>
ASTER_ALLOW_ALL_CONSUMERS=false
ASTER_ALLOW_ALL_PRODUCERS=true

# Connect
ASTER_ENDPOINT_ADDR=<base64 NodeAddr>

# Storage
ASTER_STORAGE_PATH=/var/lib/aster

# Health
ASTER_HEALTH_PORT=0 # Port for health HTTP server (0=disabled, default)
ASTER_HEALTH_HOST=127.0.0.1 # Bind address for health server

# Network
ASTER_SECRET_KEY=<base64-encoded 32 bytes>
ASTER_RELAY_MODE=default
ASTER_BIND_ADDR=0.0.0.0:9000
ASTER_ENABLE_MONITORING=false
ASTER_ENABLE_HOOKS=false
ASTER_HOOK_TIMEOUT_MS=5000

# Identity
ASTER_IDENTITY_FILE=.aster-identity

.aster-identity file format

The .aster-identity file is a TOML file generated by aster enroll node. It contains the node's secret key and one or more peer enrollment entries:

[node]
secret_key = "<base64-encoded 32-byte secret key>"

[[peers]]
name = "billing-producer"
role = "producer"
root_pubkey = "<64-char hex>"
type = "policy"
expires_at = 1735689599
endpoint_id = "<64-char hex>"
attributes = {}
signature = "<hex-encoded signature>"

[[peers]]
name = "analytics-consumer"
role = "consumer"
root_pubkey = "<64-char hex>"
type = "policy"
expires_at = 1735689599
attributes = {}
signature = "<hex-encoded signature>"

AsterServer and AsterClient auto-detect this file in the current working directory. Use identity= to point to a specific file, and peer= to select a peer entry by name:

server = AsterServer(services=[...], identity=".aster-identity", peer="billing-producer")
client = AsterClient(identity=".aster-identity", peer="analytics-consumer")

Debugging configuration

Use print_config() to display the resolved configuration with provenance (which source each value came from):

config = AsterConfig.from_env()
config.print_config()

Output:

  [trust]
root_pubkey : <not set> (default)
root_pubkey_file : ~/.aster/root_pub.key (ASTER_ROOT_PUBKEY_FILE)
enrollment_credential_file : <not set> (default)
allow_all_consumers : True (ASTER_ALLOW_ALL_CONSUMERS)
allow_all_producers : True (default)
[connect]
endpoint_addr : aGVsbG8gd29ybGQ... (ASTER_ENDPOINT_ADDR)
[network]
secret_key : ****...a1b2c3d4 (ASTER_SECRET_KEY)
relay_mode : <default> (default)
bind_addr : <any> (default)
enable_monitoring : False (default)
enable_hooks : False (default)
[storage]
path : <in-memory> (default)

Sensitive fields (secret_key, enrollment_credential_file) are masked in the output. The root_pubkey is public and shown in full.

For JSON output, pass json=True:

config.print_config(json=True)

Logging and observability

FieldEnv varTOMLDefaultDescription
log_formatASTER_LOG_FORMAT[logging] format"text""json" for structured (k8s/ELK) or "text" for dev
log_levelASTER_LOG_LEVEL[logging] level"info""debug", "info", "warning", "error"
log_maskASTER_LOG_MASK[logging] masktrueMask sensitive fields (keys, credentials) in logs
# aster.toml
[logging]
format = "json"
level = "info"
mask = true

See the Observability guide for full details on structured logging, OTel metrics, and distributed tracing.

Dev mode auto-detection

When no explicit root_pubkey_file is configured and admission is needed, AsterConfig generates an ephemeral root keypair automatically. In this mode:

  • AsterServer sets allow_all_consumers=True so consumers can connect without credentials.
  • A warning is logged: "Dev mode: allow_all_consumers=True (ephemeral root key)."

To switch to production mode, set ASTER_ROOT_PUBKEY_FILE to a file containing the root public key. This disables ephemeral key generation and requires consumers to present valid enrollment credentials.