skylite beta
Documentation menu

Describes what exists today. skylite is beta.

Configuration reference

Every key of the server's JSON configuration file, with its type, default and meaning, and the environment variables the server reads.

skylite serve -config <file> reads one JSON object from <file>. The server refuses unknown keys, trailing data after the object and any value that fails validation, and does not start with a configuration it refuses; the error says which key is wrong. The file never holds a secret: credentials come from files, environment variables or the cloud SDKs’ default credential chains.

The CLI reference lists the commands and exit statuses.

Example

A server with TLS, an OIDC issuer, Azure Blob Storage with Entra ID, two pods that forward to each other, and a readiness probe:

{
  "listen": ":8443",
  "tls": {"cert_file": "/etc/skylite/tls.crt", "key_file": "/etc/skylite/tls.key"},
  "auth": {
    "issuers": [
      {"issuer": "https://issuer.example.com", "audience": "skylite"}
    ],
    "rules": [
      {"issuer": "https://issuer.example.com", "claim": "groups", "value": "skylite-admins", "database": "*", "role": "admin"},
      {"issuer": "https://issuer.example.com", "subject": "orders-service", "database": "orders", "role": "write"}
    ]
  },
  "storage": {
    "prefix": "prod",
    "azure": {"account": "mystorageaccount", "container": "skylite", "entra": true}
  },
  "databases": ["orders"],
  "peer": {
    "listen": ":8444",
    "address_env": "SKYLITE_PEER_ADDRESS",
    "cert_file": "/etc/skylite/peer.crt",
    "key_file": "/etc/skylite/peer.key",
    "ca_file": "/etc/skylite/peer-ca.crt",
    "server_name": "skylite-peer"
  },
  "probe_listen": ":8081"
}

Top level

KeyTypeDefaultMeaning
listenstringrequiredTCP address of the client listener, such as :8443 or 127.0.0.1:8080.
tlsobjectnoneThe server’s certificate and key; see tls. Exactly one of tls and plaintext must be set.
plaintextbooleanfalsetrue serves HTTP/1.1 and HTTP/2 (prior-knowledge h2c) without TLS, for a server behind a mesh or proxy that terminates TLS, or for a local trial.
authobjectrequiredToken issuers and access rules; see auth.
storageobjectrequiredThe object store that holds the databases; see storage.
databasesarray of stringsemptyThe databases this server leads, or follows, and answers queries for. At most one fewer than the SQLite connections the memory budget holds (13 at 2 GiB), each listed once. A name is 1 to 63 characters from a-z, 0-9 and -, and starts with a letter or digit. A listed database need not exist yet: once it is created, the server takes office within a third of lease_ttl, about 20 seconds by default. With no databases the server only creates databases (PUT).
follower_readsbooleantrue when peer is set, otherwise falseLets a pod that does not lead a database answer stateless reads for it from a fresh local follower. Set it to false to serve reads only on the leader.
peerobjectnoneThe pod-to-pod listener; see peer. Without it, a pod answers not_serving for a database it does not serve, instead of forwarding the request.
probe_listenstringnoneTCP address of a plain HTTP listener that answers GET /readyz, without authentication: 200 while the server leads at least one configured database or has a fresh follower for one, 503 otherwise and from the start of shutdown. See Readiness.
memory_budgetintegerthree quarters of the memory limitThe memory budget in bytes, from 384 MiB (402653184) to 64 GiB. Without it the server takes three quarters of the container’s memory limit, or of GOMEMLIMIT if that is lower, and 2 GiB when neither is set. A budget below 1,026 MiB, plus 64 MiB per listed database, lowers the request body limit below 16 MiB; the server does not start if the budget cannot hold a SQLite connection for each listed database and one for clients, 384 MiB plus 128 MiB per database. When it is set, a cgroup limit the server cannot read does not stop it, and the server warns if the budget is above the container’s limit. Set it when the memory limit also holds other things, such as a memory-backed temporary directory. Give every pod that serves a database the same budget, because the request body limit follows from it. See Sizing.
lease_ttlinteger60The time to live of the server’s leases, in seconds, from 30 to 300. The leader renews each lease every third of it: a renewal reads the manifest and writes the lease, two storage requests under one timeout of that third. A standby reads the lease, and the manifest’s version, every 5 seconds whatever the value. A shorter value shortens the write outage after a leader crashes or is cut off, to between about two thirds of the value and the value plus 5 seconds, plus the takeover; in exchange the leader sends more requests, 0.2 a second per database at 30 seconds instead of 0.1 at 60, and is more sensitive to slow storage: a single slow request fails at most one renewal and the lease outlives that, but when requests keep taking more than a sixth of the value (5 seconds at 30, 10 at 60), no renewal completes and the lease expires. Give every pod that serves a database the same value. The lease does not record it, so a pod with a shorter value judges a healthy leader’s lease expired sooner than that leader expects and may take office from it: after one or more missed renewals, or without any when its value is below a third of the leader’s. Writes stay safe either way, because a deposed leader’s next conditional write fails, but each such takeover is a needless failover. See Failover.

tls

KeyTypeDefaultMeaning
tls.cert_filestringrequired with tlsPEM certificate chain. Read once, at start; a rotated certificate needs a restart.
tls.key_filestringrequired with tlsPEM private key. Read once, at start.

The server accepts TLS 1.2 or later and serves HTTP/1.1 and HTTP/2.

auth

Every request carries an OIDC JWT as a bearer token. The server verifies it against the configured issuers, then grants a role from the rules. Tokens must be signed with RS256 (RSA keys of at least 2,048 bits), ES256 or EdDSA. A principal no rule matches is denied everything.

KeyTypeDefaultMeaning
auth.issuersarrayrequired, at least oneThe token issuers the server trusts. Each issuer appears once.
auth.issuers[].issuerstringrequiredThe exact value tokens carry in iss. Without jwks_file it must be an https URL with no query, fragment, user information or white space, and the server fetches the issuer’s signing keys through OIDC discovery (<issuer>/.well-known/openid-configuration).
auth.issuers[].audiencestringrequiredA value the token’s aud claim must contain.
auth.issuers[].jwks_filestringnoneA JSON Web Key Set file holding the issuer’s public keys, used instead of OIDC discovery; no network request is made for this issuer. The server does not start if the file is missing, unreadable or holds no usable key (each key needs a kid). It reads the file again periodically, so a rotated file is picked up without a restart.
auth.rulesarrayemptyAccess rules. With none, every request is refused with 403.
auth.rules[].issuerstringrequiredOne of the configured issuers.
auth.rules[].subjectstringMatches the token’s sub exactly. Exactly one of subject and claim is set.
auth.rules[].claimstringA top-level claim name, such as groups or roles. The rule matches when the claim equals value, or, for an array claim, contains it.
auth.rules[].valuestringrequired with claimThe value the claim must equal or contain.
auth.rules[].databasestringrequiredA database name, or a pattern in which * matches any run of characters and ? one character, such as * or orders-*.
auth.rules[].rolestringrequiredread, write or admin. Each role includes the ones before it.

What each role allows:

RoleAllows
readQueries and describe; closing and cancelling one’s own channels.
writeEverything read allows, plus opening write channels: writes and transactions.
adminEverything write allows, plus creating databases (PUT).

storage

storage holds prefix and exactly one of localfs, s3, gcs and azure.

KeyTypeDefaultMeaning
storage.prefixstringemptyA key prefix: segments separated by /, each made of letters, digits, ., _ and -, not . or .., not ending in ., with no empty segment (so no leading or trailing /). At most 28 segments and 873 bytes. A database’s objects live under <prefix>/<database>/, or <database>/ without a prefix.

storage.localfs

KeyTypeDefaultMeaning
storage.localfs.pathstringrequiredA local directory. For trials and tests: the durability of the databases is that of this directory.

storage.azure

See Azure Blob Storage for setup, permissions and credentials.

KeyTypeDefaultMeaning
storage.azure.accountstringrequiredThe storage account name.
storage.azure.containerstringrequiredThe container. It must exist; the server never creates it.
storage.azure.endpointstringhttps://<account>.blob.core.windows.netAnother blob endpoint, such as Azurite’s. With entra, it must be https.
storage.azure.shared_key_filestringPath of a file holding the account’s base64 shared key.
storage.azure.shared_key_envstringName of an environment variable holding the account’s base64 shared key.
storage.azure.entrabooleanfalsetrue authenticates with Entra ID through the Azure SDK’s DefaultAzureCredential.

Exactly one of shared_key_file, shared_key_env and entra is set.

storage.s3

Amazon S3 and S3-compatible stores. Tested against the RustFS emulator only, not against Amazon S3. Credentials come from the AWS SDK’s default chain: environment variables, shared configuration files, web identity, then the instance or task role.

KeyTypeDefaultMeaning
storage.s3.bucketstringrequiredThe bucket. It must exist.
storage.s3.regionstringrequiredThe bucket’s region, used to sign requests.
storage.s3.endpointstringAmazon S3Base URL of an S3-compatible service.
storage.s3.path_stylebooleanfalsePut the bucket in the URL path rather than the host name, as most S3-compatible services need.

storage.gcs

Google Cloud Storage. Tested against the fake-gcs-server emulator only, not against Google Cloud Storage. Credentials come from Application Default Credentials.

KeyTypeDefaultMeaning
storage.gcs.bucketstringrequiredThe bucket. It must exist.
storage.gcs.endpointstringGoogle Cloud StorageAn emulator’s URL. With an endpoint set, requests carry no credentials.

Every endpoint must be an http or https URL with a host and no user information, query string or fragment, so that it cannot carry a credential. The server does not start with one that breaks this rule, and its error does not repeat the value.

peer

The peer listener lets any pod accept any request and forward what it cannot serve, one hop, to the pod that can. Pods authenticate each other with mutual TLS. See Running several pods.

KeyTypeDefaultMeaning
peer.listenstringrequired with peerTCP address of the peer listener, such as :8444.
peer.address_envstringrequired with peerName of an environment variable holding the host:port other pods dial to reach this pod’s peer listener, for example $(POD_IP):8444 set from the Kubernetes downward API. The server does not start if the variable is unset or holds no host.
peer.cert_filestringrequired with peerPEM certificate this pod presents as both peer server and peer client. It needs the serverAuth and clientAuth extended key usages and the DNS name in server_name. Read once, at start.
peer.key_filestringrequired with peerPEM key of that certificate. Read once, at start.
peer.ca_filestringrequired with peerPEM certificates of the CA that issues peer certificates. Use a CA that issues nothing else: any holder of a certificate it issued is treated as a pod.
peer.server_namestringrequired with peerThe DNS name every peer certificate carries.

The peer listener accepts TLS 1.3 only.

Environment variables

skylite defines no environment variables of its own. The server reads:

VariableRead when
The one named by peer.address_envpeer is set.
The one named by storage.azure.shared_key_envThat key is set.
AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_FEDERATED_TOKEN_FILE, AZURE_TOKEN_CREDENTIALS and the other variables of the Azure SDK’s DefaultAzureCredentialstorage.azure.entra is true. See Azure Blob Storage.
The AWS SDK’s variables, such as AWS_ACCESS_KEY_ID or AWS_ROLE_ARN with AWS_WEB_IDENTITY_TOKEN_FILEstorage.s3 is set.
GOOGLE_APPLICATION_CREDENTIALSstorage.gcs is set without endpoint.
TMPDIRAlways. The leaders’ local files (write-ahead log and SQLite temporary files) and upload spool files go under it; see Sizing.

Logs

The server writes JSON log lines to standard error. Logs never hold a bearer token or any part of one, a channel token, SQL text, parameters or SQLite’s messages. Logs and shutdown lists what is logged.