Operator configuration
Look up each field in bricole.jsonc, when it is required, and how it changes a host.
An operator file describes one installation. The operator CLI reads it from the path passed to --config and generates Wrangler configurations for the Workers. Keep the file with the installation’s deployment records. The version in your Bricole checkout determines the schema and the runtime settings inherited from the release.
For a new email installation, copy packages/operator/bricole.example.jsonc. For OIDC, copy packages/operator/bricole.oidc.example.jsonc. This third example uses Cloudflare Access without an identity Worker or mail sender. All identifiers and domains here are fictional.
{
"config": 1,
"account": "0123456789abcdef0123456789abcdef",
"worker": "field-station",
"domains": { "apps": "example.org", "host": "station.example.org" },
"identity": {
"provider": "access",
"access": {
"teamDomain": "https://field-station.cloudflareaccess.com",
"audience": "example-application-audience",
},
},
} Run bun run operator check --config <file> from the checkout. An editor can validate the field names and types. The command also enforces relationships between fields. Unknown fields are rejected. See the installation guide for the steps outside the file.
Installation and routing
| Field | Requirement and effect |
|---|---|
$schema | Optional string pointing your editor at packages/operator/schema/config-1.json. Resolve the path relative to your own file. The CLI uses its bundled validator. |
config | Required integer version, currently 1. An unreadable version stops the command. |
account | Required Cloudflare account ID, 32 hexadecimal characters. Uppercase is accepted and normalized to lowercase. Pins the account for generated configurations and Wrangler calls. |
worker | Required host Worker name. Use 1–54 lowercase letters, digits and interior hyphens. Its Durable Objects and secrets belong to this Worker. Keep the name stable across upgrades. |
domains | Required object describing the host and the domain used for artifact origins. Hostnames throughout the file use lowercase DNS labels and have a maximum length of 253 characters. |
domains.apps | Required domain for artifact, public website and shared-view origins. The operator generates a wildcard zone route here. Leave room within 253 characters for the generated hostname, including prefix, 26-character ID, optional suffix and dot. |
domains.host | Required first-level subdomain of domains.apps, for example station.example.org. Its label must be distinct from the reserved art-, site- and view- prefixes. People sign in at this hostname. |
domains.hostRoute | Defaults to custom-domain, which generates an exact Worker Custom Domain. Use zone-route for a host reached through a zone route such as station.example.org/*. |
domains.labelSuffix | Defaults to the empty string. Otherwise use a hyphen followed by 1–31 lowercase letters or digits. For -lab, the wildcard route becomes *-lab.example.org/*. This changes the derived artifact origins. |
websites | Optional mapping, empty by default, from an exact hostname to the artifact whose released website should answer there. Values use art_ followed by 26 lowercase base32 characters (a–z, 2–7). For example, "www.example.org": "art_aaaaaaaaaaaaaaaaaaaaaaaaaa". Each key generates a Custom Domain. The host’s own name and reserved first-level artifact labels on the apps domain are refused. Publish a website revision on the artifact separately. |
resources | Optional on first install. On upgrade, supply the resources belonging to this installation. The analytics block also requires this object. |
resources.oauthKv | Required inside resources. ID of the host’s OAuth KV namespace, 32 lowercase hexadecimal characters. A fresh install can create a namespace named after the Worker with -oauth appended. Save the returned ID for upgrades. |
Identity
Choose one provider. Email codes require both the identity service and a sender. OIDC requires the service and an OIDC client. Access requires the Access application settings and can operate without the identity service. OIDC and Access can also send invitation mail when you configure both the service and a sender. See authentication for the sign-in workflows.
| Field | Requirement and effect |
|---|---|
identity | Required object defining how people sign in. |
identity.provider | Required. One of email, access or oidc. Sets the host’s SIGN_IN_PROVIDER. |
identity.service | Required for email, OIDC or any configured sender. Declares a private identity Worker bound to the host as IDENTITY. Optional for Access without mail. |
identity.service.worker | Required within the service. A distinct Worker name, 1–63 lowercase letters, digits and interior hyphens. Also names the identity D1 database created on first install. |
identity.service.database | Optional on first install, required on upgrade with the service. Lowercase hexadecimal D1 database UUID in 8-4-4-4-12 format. Record the ID returned on creation. |
identity.service.secret | Required within the service. A reference object for the secret used by the identity Worker. |
identity.service.secret.secret | Required literal AUTH_SECRET. The installer generates its value on first deployment of the identity Worker. |
identity.email | Required for email-code sign-in. Optional on Access or OIDC with a service for invitation mail. Enables an Email Sending binding on the identity Worker. |
identity.email.from | Required inside email. A valid sender email address on a domain with Email Sending enabled, for example station@notify.example.org. Sets EMAIL_FROM. |
identity.access | Required and accepted only for the Access provider. Configure the Access application on the host’s /auth/access route. |
identity.access.teamDomain | Required Access team origin of the form https://team-name.cloudflareaccess.com, with no trailing slash. Uploaded to the host as ACCESS_TEAM_DOMAIN. |
identity.access.audience | Required nonempty Access application AUD tag. Uploaded to the host as ACCESS_AUD and checked against the assertion. |
identity.access.emailVerified | Boolean, defaults to false. Set to true only when the configured Access identity methods verify email addresses. This lets Bricole trust an asserted email for operations such as matching the creator list. |
identity.oidc | Required and accepted only for OIDC. The client requests openid email. |
identity.oidc.issuer | Required HTTPS issuer exactly as in discovery, including any path. Credentials, whitespace, backslashes, query and fragment are rejected. A changed issuer changes the identity namespace. |
identity.oidc.clientId | Required nonempty ID of the client registered with that issuer. Register https://station.example.org/auth/oidc/callback/oidc, substituting your host. |
identity.oidc.clientSecret | Required reference object naming the identity Worker’s OIDC client secret. |
identity.oidc.clientSecret.secret | Required literal OIDC_CLIENT_SECRET. Supply the provider-issued value from the deploy environment when the Worker first needs it. |
Usage analytics
Enable analytics after the first deployment, when both Durable Object namespace IDs are available. Add the block below alongside the existing resources.oauthKv pin. Find the namespaces by host Worker and class in the Cloudflare dashboard. The IDs in the example are fictional.
"analytics": {
"token": { "secret": "CLOUDFLARE_ANALYTICS_TOKEN" },
"namespaces": {
"artifacts": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"directory": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
}
} | Field | Requirement and effect |
|---|---|
analytics | Optional object enabling live Cloudflare analytics on the admin Usage page. Requires resources.oauthKv. Omitting the block leaves usage unconfigured. |
analytics.token | Required within analytics. Reference to a host secret with Account Analytics: Read on this installation’s account. |
analytics.token.secret | Required literal CLOUDFLARE_ANALYTICS_TOKEN. Provide the value in the deploy environment the first time it is needed. |
analytics.namespaces | Required within analytics. Identifies two distinct Durable Object namespaces, each a 32-character lowercase hexadecimal ID. |
analytics.namespaces.artifacts | Required ID of the host Worker’s Artifact class. Used for artifact usage and storage. |
analytics.namespaces.directory | Required ID of its Directory class. Used for directory usage and storage. |
Removing the analytics block and deploying disables usage reporting. The host secret persists until you delete it, and the Cloudflare credential persists until you revoke it.
Existing Durable Object migrations
New installations inherit the release’s Durable Object exports. An existing Worker still using Wrangler migration tags can carry its original history in the operator file. Copy the deployed history in its original order. Each class or script name below is a nonempty string.
| Field | Requirement and effect |
|---|---|
legacyMigrations | Optional nonempty array, upgrade only. Replaces the release’s exports with the historical Wrangler migrations. Each tag must be unique and the active migration tag must be the final entry. |
legacyMigrations[].tag | Required nonempty name of the historical migration. |
legacyMigrations[].new_classes | Optional array of class names introduced with classic Durable Object storage. |
legacyMigrations[].new_sqlite_classes | Optional array of class names introduced with SQLite storage. |
legacyMigrations[].renamed_classes | Optional array recording class renames in this Worker. |
legacyMigrations[].renamed_classes[].from | Required previous class name in each rename. |
legacyMigrations[].renamed_classes[].to | Required replacement class name in each rename. |
legacyMigrations[].transferred_classes | Optional array recording classes transferred from another Worker. |
legacyMigrations[].transferred_classes[].from | Required source class name in each transfer. |
legacyMigrations[].transferred_classes[].from_script | Required source Worker name in each transfer. |
legacyMigrations[].transferred_classes[].to | Required class name in the receiving Worker. |
legacyMigrations[].deleted_classes | Optional array of class names deleted in the historical migration. |
The deploy command refuses pending history, deletions in generated exports and changes to the deployed class set. Review the operator CLI before modifying a live installation.