drupflare/worker - v1.0.4
    Preparing search index...

    Interface SiteEnv

    The worker's environment: @drupflare/durabledb's generic shape plus the vars only this application reads (heap restore, the R2 mirror drain and prefill).

    interface SiteEnv {
        AGED_SERVE_MAX_MS?: string;
        AI?: {
            run(model: string, input: Record<string, unknown>): Promise<unknown>;
        };
        AI_MODELS?: string;
        ARGON2?: string;
        ASSET_AGGREGATES?: string;
        ASSETS: {};
        BOOT_IMAGE?: string;
        BOOT_IMAGE_BAKE?: string;
        CACHE_API?: string;
        CACHE_DATA_MAX_ROWS?: string
        | number;
        CF_EMAIL_ACCOUNT_ID?: string;
        CF_EMAIL_TOKEN?: string;
        CF_VERSION_METADATA?: { id: string; tag?: string; timestamp?: string };
        CFW_EMAIL_BINDING?: string;
        CRON_MAX_MS?: string | number;
        CRON_MAX_ROWS?: string | number;
        CRON_MAX_UNITS?: string | number;
        CRON_QUEUE_BATCH_SIZE?: string | number;
        DRUPAL_CRON?: string;
        EAGER_DERIVATIVES?: string;
        EDGE_PLAN?: string;
        FILES_PUBLIC_URL?: string;
        FILL_BATCH_SIZE?: string | number;
        FILL_BATCH_WALL_MS?: string | number;
        FILL_SETTLE_MS?: string | number;
        GC_INTERVAL_MS?: string | number;
        GEN_BUCKET_MS?: string | number;
        HEAP_IMAGE?: string;
        HEAP_RESTORE_CHUNKS?: string | number;
        HEAP_SNAPSHOT?: string;
        HTTP_DRAIN_LIMIT?: string | number;
        HTTP_DRAIN_ON_ALARM?: string;
        IMAGE_ENGINE?: string;
        ISOLATE_ABOVE_BYTES?: string | number;
        KEEP_WARM_MS?: string | number;
        LAZY_FS_BUDGET_BYTES?: string | number;
        LAZY_MOUNT?: string;
        MAIL_DRAIN_LIMIT?: string | number;
        MAIL_DRAIN_ON_ALARM?: string;
        MAIL_FROM?: string;
        MAIL_TRANSPORT?: string;
        MAX_BODY_BYTES?: string | number;
        MAX_UPLOAD_BYTES?: string | number;
        MEMORY_TRACE?: string;
        MIGRATE_CHUNKS_PER_INVOCATION?: string | number;
        MIGRATE_ENGINE?: string;
        MIGRATE_SELF_DRIVE?: string;
        MIRROR_LIMIT?: string | number;
        MODULE_PACK?: R2Bucket;
        NEVER_STALE?: string;
        OIDC_CLIENT_SECRET?: string;
        OPCACHE_MODE?: string;
        OUTBOUND_GUARD?: string;
        PARK?: string;
        PHP_LOG_LEVEL?: string;
        PLAN?: string;
        PREFILL?: string;
        PREFILL_ON_SAVE?: string;
        PREFILL_ON_SAVE_LIMIT?: string | number;
        PW_DIAGNOSTICS?: string;
        PW_SQL_TRACE?: string;
        PW_SQL_TRACE_FROM?: string | number;
        RECONCILE?: string;
        RECYCLE_ABOVE_BYTES?: string | number;
        REDIRECTS?: string | unknown[];
        REDIS_URL?: string;
        RENDER_BUDGET_MS?: string | number;
        RENDER_LANES?: DurableObjectNamespace<undefined>;
        REPLICA_COUNT?: string;
        REPLICA_LAG_MS?: string;
        REPLICA_READ_ONLY?: string;
        RESPONSE_HEADERS?: string | unknown[];
        SEND_EMAIL?: SendEmailLike;
        SHELL_ASSEMBLY?: string;
        SITE?: DurableObjectNamespace<undefined>;
        SITE_DB_PREFIX?: string;
        SITE_LOCATION_HINT?: string;
        SITE_ORIGIN?: string;
        SLEEP_BUDGET_MS?: string;
        SMTP_AUTH?: string;
        SMTP_HOST?: string;
        SMTP_PASS?: string;
        SMTP_PORT?: string | number;
        SMTP_TLS?: string;
        SMTP_USER?: string;
        SQL_CHUNK_PREFIX?: string;
        SYSLOG_APP_NAME?: string;
        SYSLOG_URL?: string;
        UPDATE_FETCH_URL?: string;
        UPDB_ALLOW_UNBOUNDED?: string;
        UPDB_CHECK_REQUIREMENTS?: string;
        UPDB_FLUSH_SPLIT?: string;
        UPDB_MAX_ATTEMPTS?: string | number;
        UPDB_MAX_BEATS?: string | number;
        UPDB_MAX_COLD_WAITS?: string | number;
        UPDB_MAX_PASSES?: string | number;
        UPDB_ON_ABORT?: string;
        UPDB_RETRY_POLICY?: string;
        UPDB_SNAPSHOT_MAX_ROWS?: string | number;
        WATCHDOG_ROW_LIMIT?: string | number;
        WINDOW_MAX_FILLS?: string | number;
        WINDOW_SITES?: string;
        WINDOW_WALL_MS?: string | number;
        WRITE_FORWARD?: string;
    }

    Hierarchy (View Summary)

    Index
    AGED_SERVE_MAX_MS? AI? AI_MODELS? ARGON2? ASSET_AGGREGATES? ASSETS BOOT_IMAGE? BOOT_IMAGE_BAKE? CACHE_API? CACHE_DATA_MAX_ROWS? CF_EMAIL_ACCOUNT_ID? CF_EMAIL_TOKEN? CF_VERSION_METADATA? CFW_EMAIL_BINDING? CRON_MAX_MS? CRON_MAX_ROWS? CRON_MAX_UNITS? CRON_QUEUE_BATCH_SIZE? DRUPAL_CRON? EAGER_DERIVATIVES? EDGE_PLAN? FILES_PUBLIC_URL? FILL_BATCH_SIZE? FILL_BATCH_WALL_MS? FILL_SETTLE_MS? GC_INTERVAL_MS? GEN_BUCKET_MS? HEAP_IMAGE? HEAP_RESTORE_CHUNKS? HEAP_SNAPSHOT? HTTP_DRAIN_LIMIT? HTTP_DRAIN_ON_ALARM? IMAGE_ENGINE? ISOLATE_ABOVE_BYTES? KEEP_WARM_MS? LAZY_FS_BUDGET_BYTES? LAZY_MOUNT? MAIL_DRAIN_LIMIT? MAIL_DRAIN_ON_ALARM? MAIL_FROM? MAIL_TRANSPORT? MAX_BODY_BYTES? MAX_UPLOAD_BYTES? MEMORY_TRACE? MIGRATE_CHUNKS_PER_INVOCATION? MIGRATE_ENGINE? MIGRATE_SELF_DRIVE? MIRROR_LIMIT? MODULE_PACK? NEVER_STALE? OIDC_CLIENT_SECRET? OPCACHE_MODE? OUTBOUND_GUARD? PARK? PHP_LOG_LEVEL? PLAN? PREFILL? PREFILL_ON_SAVE? PREFILL_ON_SAVE_LIMIT? PW_DIAGNOSTICS? PW_SQL_TRACE? PW_SQL_TRACE_FROM? RECONCILE? RECYCLE_ABOVE_BYTES? REDIRECTS? REDIS_URL? RENDER_BUDGET_MS? RENDER_LANES? REPLICA_COUNT? REPLICA_LAG_MS? REPLICA_READ_ONLY? RESPONSE_HEADERS? SEND_EMAIL? SHELL_ASSEMBLY? SITE? SITE_DB_PREFIX? SITE_LOCATION_HINT? SITE_ORIGIN? SLEEP_BUDGET_MS? SMTP_AUTH? SMTP_HOST? SMTP_PASS? SMTP_PORT? SMTP_TLS? SMTP_USER? SQL_CHUNK_PREFIX? SYSLOG_APP_NAME? SYSLOG_URL? UPDATE_FETCH_URL? UPDB_ALLOW_UNBOUNDED? UPDB_CHECK_REQUIREMENTS? UPDB_FLUSH_SPLIT? UPDB_MAX_ATTEMPTS? UPDB_MAX_BEATS? UPDB_MAX_COLD_WAITS? UPDB_MAX_PASSES? UPDB_ON_ABORT? UPDB_RETRY_POLICY? UPDB_SNAPSHOT_MAX_ROWS? WATCHDOG_ROW_LIMIT? WINDOW_MAX_FILLS? WINDOW_SITES? WINDOW_WALL_MS? WRITE_FORWARD?
    AGED_SERVE_MAX_MS?: string

    how long a superseded page may still be answered, in ms; see agedServeMaxMs()

    AI?: { run(model: string, input: Record<string, unknown>): Promise<unknown> }

    The Workers AI binding; absent on accounts without it, so readers treat it as optional. A binding, not the HTTP API, which would need the account token readable from a queue row.

    AI_MODELS?: string

    comma-separated model ids; unset means the short default list

    ARGON2?: string

    argon2id password hashing; off unless 1, because it rehashes every login

    ASSET_AGGREGATES?: string

    Replaces a stored page's asset tags with the build's aggregates; off unless 1. Needs bun run assets:agg (writes assets/agg/, 6.57 MB for 808 libraries).

    ASSETS: {}

    not optional: every mount reads its pack through this, so an object without it cannot boot

    BOOT_IMAGE?: string

    Boots from the published image under assets/bootimage/ when this site equals the bake's (pack, modules, driver, config rows, settings); any difference boots plain. Off unless 1.

    BOOT_IMAGE_BAKE?: string

    lets this object capture its own boot image; only the local bake rig sets it

    CACHE_API?: string

    off where the platform forbids caches.default (a WfP user Worker); on otherwise

    CACHE_DATA_MAX_ROWS?: string | number
    CF_EMAIL_ACCOUNT_ID?: string

    the account the Cloudflare Email Sending HTTP API posts under

    CF_EMAIL_TOKEN?: string

    an API token with Email Sending: Edit; a secret, never a vars entry

    CF_VERSION_METADATA?: { id: string; tag?: string; timestamp?: string }

    the serving Worker version, reported on /health; absent under wrangler dev --local

    CFW_EMAIL_BINDING?: string
    CRON_MAX_MS?: string | number
    CRON_MAX_ROWS?: string | number
    CRON_MAX_UNITS?: string | number
    CRON_QUEUE_BATCH_SIZE?: string | number
    DRUPAL_CRON?: string
    EAGER_DERIVATIVES?: string

    0 stops rendering styles on upload while the binding stays

    EDGE_PLAN?: string

    the front worker's compiled-plan tier; on unless 0

    FILES_PUBLIC_URL?: string

    The origin public files are served from, when FILES has a custom domain. Empty serves through the Worker; a file not yet mirrored keeps the Worker URL.

    FILL_BATCH_SIZE?: string | number
    FILL_BATCH_WALL_MS?: string | number
    FILL_SETTLE_MS?: string | number

    ms a fresh interpreter runs no background PHP (fill, cron); default 60,000, 0 is off

    GC_INTERVAL_MS?: string | number
    GEN_BUCKET_MS?: string | number
    HEAP_IMAGE?: string

    Takes a heap image per pack generation so a cold boot can restore; off unless 1. A restore cost ~648 ms more cpuTime than a boot (1,912 vs 1,264 ms median, deployed free).

    HEAP_RESTORE_CHUNKS?: string | number
    HEAP_SNAPSHOT?: string
    HTTP_DRAIN_LIMIT?: string | number
    HTTP_DRAIN_ON_ALARM?: string
    IMAGE_ENGINE?: string

    Image derivative engine: tinyimg (default) or images. images needs a zone with transformations and caps at 5,000 a month; only it encodes avif.

    ISOLATE_ABOVE_BYTES?: string | number

    Whole-isolate drop threshold: linear memory plus the JS-side mount bytes. RECYCLE_ABOVE_BYTES reads linear memory alone, but the 128 MiB ceiling covers both.

    KEEP_WARM_MS?: string | number
    LAZY_FS_BUDGET_BYTES?: string | number
    LAZY_MOUNT?: string
    MAIL_DRAIN_LIMIT?: string | number

    messages one firing may send; capped at 25, because each is one of 50 subrequests

    MAIL_DRAIN_ON_ALARM?: string

    whether alarm() sends what cfwMail queued

    MAIL_FROM?: string

    the From address for a message that carries none; Drupal's site mail wins when set

    MAIL_TRANSPORT?: string

    auto | binding | api | smtp | off; auto takes the first configured transport

    MAX_BODY_BYTES?: string | number

    largest non-file request body the edge forwards, in bytes; default 2 MiB, 0 disables

    MAX_UPLOAD_BYTES?: string | number

    largest multipart/form-data body the edge forwards, in bytes; default 100 MiB, 0 disables

    MEMORY_TRACE?: string

    1 logs memory readings at each boot and invocation end; for diagnosing a reset

    MIGRATE_CHUNKS_PER_INVOCATION?: string | number
    MIGRATE_ENGINE?: string
    MIGRATE_SELF_DRIVE?: string
    MIRROR_LIMIT?: string | number
    MODULE_PACK?: R2Bucket
    NEVER_STALE?: string

    Comma-separated path prefixes never answered from a previous generation. Added to the built-in deny-list, not replacing it; see staleAllowed().

    OIDC_CLIENT_SECRET?: string

    The OIDC client secret. Never add it or the issuer (in cfw_meta) to KV_OVERRIDABLE: a KV writer could point logins at their own provider.

    OPCACHE_MODE?: string

    the opcache arm: file (shipping), shm or off; see src/runtime/opcache.ts

    OUTBOUND_GUARD?: string

    Refuses an outbound fetch to a private, loopback or metadata address; on unless 0. PHP names the URL, so any module chooses the destination; 0 is for the e2e rig.

    PARK?: string

    Whether the Zend park may arm; on unless set to something other than 1. Arming routes every render through cfw_park_run, even when nothing yields.

    PHP_LOG_LEVEL?: string

    PHP log level mirrored to console.log: off | error | warn | log | info | debug. Defaults to info; on 8.5 debug is mostly deprecation notices with stack traces.

    PLAN?: string
    PREFILL?: string
    PREFILL_ON_SAVE?: string
    PREFILL_ON_SAVE_LIMIT?: string | number
    PW_DIAGNOSTICS?: string
    PW_SQL_TRACE?: string

    logs every Drupal statement through console.log, which survives an object reset

    PW_SQL_TRACE_FROM?: string | number

    first statement number to log, so a 256 KB tail budget covers the end of a long run

    RECONCILE?: string

    Brings an already-provisioned site up to the pack that ships today; on unless 0. The pack delivers only at provisioning, so off means pack fixes never arrive.

    RECYCLE_ABOVE_BYTES?: string | number

    Linear memory above which the interpreter is dropped at the end of an invocation. Defaults to 112 MiB; past ~120 MiB it trades the boot it avoids for the reset it prevents.

    REDIRECTS?: string | unknown[]

    redirect rules for the front worker, in the same two forms

    REDIS_URL?: string

    The Redis endpoint as one URL, redis://user:pass@host:6379/0 (rediss:// for TLS). The endpoint is the operator's; PHP names an operation and never a host.

    RENDER_BUDGET_MS?: string | number
    RENDER_LANES?: DurableObjectNamespace<undefined>

    the lanes an upload's image styles are rendered on; see src/ops/render-lane.ts

    REPLICA_COUNT?: string

    Replica lanes a site has beyond the primary; 0 or unset means one object per site. Only the router reads it; an object's own role comes from its name.

    REPLICA_LAG_MS?: string

    How long a serving lane may go without pulling the primary's log; the staleness bound. A stalled lane looks healthy: the fence refuses only callers that state a freshness need.

    REPLICA_READ_ONLY?: string

    Makes this object a read-only replica: every mutating host capability is refused. Off unless 1; a primary that silently refuses writes is a broken site.

    RESPONSE_HEADERS?: string | unknown[]

    response header rules for the front worker, as a JSON string or array; see edge-rules

    SEND_EMAIL?: SendEmailLike

    A send_email binding, the only Cloudflare send that needs no credential. It reaches verified destination addresses only (200 per account), so it cannot mail visitors.

    SHELL_ASSEMBLY?: string

    fragment assembly for authenticated GETs; on unless 0

    SITE?: DurableObjectNamespace<undefined>

    the object's own namespace, so a replica lane can reach its primary to pull the log

    SITE_DB_PREFIX?: string
    SITE_LOCATION_HINT?: string

    Where a site's Durable Object is created: one of wnam enam sam weur eeur apac oc afr me. KV-overridable through settings; applies at creation only.

    SITE_ORIGIN?: string

    The scheme://host[:port] Drupal renders absolute URLs against. Unset, the object pins the first non-local origin; set it behind a proxy rewriting Host.

    SLEEP_BUDGET_MS?: string

    see sleepBudgetMs()

    SMTP_AUTH?: string

    PLAIN | LOGIN

    SMTP_HOST?: string

    submission host for the third-party lane; a Cloudflare relay is refused

    SMTP_PASS?: string
    SMTP_PORT?: string | number

    587 for starttls, 465 for implicit TLS; 25 is blocked on Workers and is refused

    SMTP_TLS?: string

    starttls | implicit | off

    SMTP_USER?: string
    SQL_CHUNK_PREFIX?: string
    SYSLOG_APP_NAME?: string

    the app name on every record this site ships; defaults to drupal

    SYSLOG_URL?: string

    syslog://collector:514 or syslogs://collector:6514 for RFC 5425 TLS

    UPDATE_FETCH_URL?: string

    Where release history is fetched from when a site does not use drupal.org. Only the prefetch reads it; set it together with update.settings:fetch.url.

    UPDB_ALLOW_UNBOUNDED?: string
    UPDB_CHECK_REQUIREMENTS?: string
    UPDB_FLUSH_SPLIT?: string
    UPDB_MAX_ATTEMPTS?: string | number
    UPDB_MAX_BEATS?: string | number
    UPDB_MAX_COLD_WAITS?: string | number
    UPDB_MAX_PASSES?: string | number
    UPDB_ON_ABORT?: string
    UPDB_RETRY_POLICY?: string
    UPDB_SNAPSHOT_MAX_ROWS?: string | number
    WATCHDOG_ROW_LIMIT?: string | number
    WINDOW_MAX_FILLS?: string | number
    WINDOW_SITES?: string
    WINDOW_WALL_MS?: string | number
    WRITE_FORWARD?: string

    Lets a pool lane execute writes and forward them to the primary instead of refusing them. Off unless 1; the read path's safety argument does not cover forwarding.