Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

7.1 KB
Raw Blame
{
  "$schema": "../../node_modules/wrangler/config-schema.json",
  "name": "openmausbot-control-plane",
  "main": "src/index.ts",
  "account_id": "0c92969a82eb9e173b013a7e7a02333d",
  "compatibility_date": "2026-08-25",
  "compatibility_flags": ["nodejs_compat"],
  "workers_dev": false,
  "routes": [
    {
      "pattern": "accounts.openmausbot.com",
      "custom_domain": true
    }
  ],
  "vars": {
    "BETTER_AUTH_URL": "https://accounts.openmausbot.com",
    "EMAIL_FROM": "[email protected]",
    "ALLOWED_ORIGINS": "",
    "CLOUDFLARE_ACCOUNT_ID": "0c92969a82eb9e173b013a7e7a02333d",
    "CLOUDFLARE_ZONE_ID": "bae08399bb6f96eb7266c65ac0057eee",
    "COMPANION_HOST_SUFFIX": "openmausbot.com",
    // More Cloudflare accounts for managed endpoints (README "Several
    // Cloudflare accounts"). Unset: the account above is the only one. A new
    // endpoint goes to the account with the most room; an endpoint never
    // leaves the account it was created in, so never edit an entry's
    // accountId, zoneId or companionHostSuffix once it holds endpoints (add a
    // new entry instead). The same JSON may be a secret to keep the IDs out of
    // this file. Each entry's token is the secret named by apiTokenSecret
    // (wrangler secret put CLOUDFLARE_API_TOKEN_MAUSBOT_SI), never a var, and
    // is listed in secrets.required below (as is this JSON when it is a
    // secret) so every deploy keeps it. To stop new endpoints going to an
    // account and keep its own, set its "newEndpoints": false.
    // Supamaus account, zone mausbot.si. dnsRecordLimit 3500 is the Pro (upgraded Oct 21; was 200 on Free)
    // plan's record quota for a zone added after Sep 2024; on Pro it is 3,500
    // (set it here once the zone is on Pro), and the tunnel quota (1,000)
    // binds first. Desktop apps accept mausbot.si hostnames from 0.1.104 (#2582).
    "CLOUDFLARE_ENDPOINT_ACCOUNTS": [
      {
        "accountId": "bbb5305f06e28a6f2abaac299f3b09dc",
        "zoneId": "4ded3da43e7b2c3a5f27b0fb33e5bd7a",
        "companionHostSuffix": "mausbot.si",
        "apiTokenSecret": "CLOUDFLARE_API_TOKEN_MAUSBOT_SI",
        "tunnelLimit": 1000,
        "dnsRecordLimit": 3500,
        "minAppVersion": "0.1.104"
      }
    ],
    // Managed endpoint capacity of the account above (see README "Tunnel
    // capacity and idle reclaim"): its tunnel quota and its zone's DNS record
    // quota. They drive the 90% usage alert and /healthz, rank accounts for
    // new endpoints, and tell a tunnel-quota 429 from a rate limit, so keep
    // them equal to Cloudflare's real quotas. They never refuse an
    // allocation on their own. The openmausbot.com zone is on Pro: 3,500
    // DNS records.
    "OMB_TUNNEL_LIMIT": "1000",
    "OMB_DNS_RECORD_LIMIT": "3500",
    // "on" marks idle tunnels for cleanup; "observe" only logs candidates.
    "OMB_TUNNEL_RECLAIM": "on",
    // Days a tunnel must have been offline (and its installation quiet)
    // before reclaim (minimum 1). Never-connected tunnels use a fixed two days.
    // A reclaimed installation gets its same hostname back when it returns.
    "OMB_TUNNEL_OFFLINE_RECLAIM_DAYS": "3",
    // Dry run: a second offline period (days, 1-365) that the scan only
    // counts. /healthz reports capacity.reclaim.preview.eligible once a full
    // pass (about 50 minutes per 1,000 tunnels) has run at it. Empty: off.
    "OMB_TUNNEL_RECLAIM_PREVIEW_DAYS": "",
    // Cleanup rows per five-minute cron run. 20 needs Workers Paid; use 4 on
    // Workers Free (50 subrequests per invocation).
    "OMB_CLEANUP_SWEEP_LIMIT": "20",
    // MausBot Relay (README "MausBot Relay"). Host tokens are signed with RELAY_TOKEN_SIGNING_KEY (b64u of a 32-byte
    // Ed25519 seed, `wrangler secret put`). It is in secrets.required so a deploy can't drop it: set it before the
    // first deploy that lists it. The relay holds only the matching public key. RELAY_NODES lists only nodes that
    // exist; add relay2 when its box and DNS are up.
    // RELAY_ROLLOUT_PERCENT (0-100) admits computers by a stable hash of their host id; RELAY_ALLOW_INSTALLATIONS
    // (comma-separated installation ids) admits a few by name; RELAY_DISABLED "1" turns every token off.
    "RELAY_NODES": "relay1.openmausbot.com,relay2.openmausbot.com",
    "RELAY_NODES_AMERICAS": "",
    "RELAY_TOKEN_KID": "k1",
    "RELAY_ROLLOUT_PERCENT": "100",
    "RELAY_ALLOW_INSTALLATIONS": "",
    "RELAY_DISABLED": "0",
    // The first desktop release that reaches phones through the relay. From it, a desktop with no old phones paired
    // gets 409 relay_capable instead of a new tunnel. Empty: never refused.
    "RELAY_CAPABLE_MIN_VERSION": "0.1.145",
    // Giving tunnels back (README "Releasing tunnels"). Each is off as written here; /healthz `tunnelRelease`
    // shows what each would clear before it is turned on. All of them need migration 0015.
    // RELAY_TUNNEL_RELEASE_PERCENT (0-100): the share of computers, by the same stable hash as the relay rollout,
    // whose tunnel is released once every paired phone has used the encrypted connection and no old phone has been
    // reported for RELAY_TUNNEL_RELEASE_DAYS. Raise it 10, 50, 100.
    "RELAY_TUNNEL_RELEASE_PERCENT": "100",
    "RELAY_TUNNEL_RELEASE_DAYS": "1",
    // The cutoffs, the last step. TUNNEL_LEGACY_PHONE_CUTOFF_PERCENT (0-100, the same stable hash): on that share
    // of the computers the relay serves, the tunnel is given up whatever phones are paired. An old phone app no
    // longer connects from outside the home network: the phone is updated and paired again, and the desktop says so
    // (from the release that reads `tunnel` on 409 relay_capable). Ramp 10, then 100. If the relay itself fails,
    // RELAY_DISABLED "1" (or a lower RELAY_ROLLOUT_PERCENT) stops the cutoff and desktops get their address back.
    // TUNNEL_MIN_APP_VERSION (x.y.z): a desktop below it neither gets nor keeps a tunnel and is answered
    // 426 update_required. The cron removes a tunnel only from a computer seen in the last two days, whose stored
    // release is therefore current. Empty: no minimum.
    "TUNNEL_LEGACY_PHONE_CUTOFF_PERCENT": "100",
    "TUNNEL_MIN_APP_VERSION": "0.1.145",
    // The first desktop release that reads `tunnel` on 409 relay_capable and keeps asking afterwards (x.y.z). From
    // it, a relay-served desktop with an old phone is answered relay_capable ("full") at the tunnel limit instead of
    // 503 endpoint_capacity; earlier releases keep the 503 they show and retry on. Empty: always the 503.
    "TUNNEL_REASON_MIN_VERSION": "0.1.152"
  },
  "secrets": {
    "required": ["BETTER_AUTH_SECRET", "CLOUDFLARE_API_TOKEN", "CLOUDFLARE_API_TOKEN_MAUSBOT_SI", "RELAY_TOKEN_SIGNING_KEY"]
  },
  "d1_databases": [
    {
      "binding": "DB",
      "database_name": "openmausbot-control-plane",
      "database_id": "8a7c34ed-5428-4ae2-8722-fef2fe9bf160",
      "migrations_dir": "migrations"
    }
  ],
  "send_email": [
    {
      "name": "EMAIL",
      "allowed_sender_addresses": ["[email protected]"]
    }
  ],
  "triggers": {
    "crons": ["*/5 * * * *"]
  },
  "observability": {
    "enabled": true,
    "logs": { "enabled": true, "head_sampling_rate": 1 },
    "traces": { "enabled": true, "head_sampling_rate": 0.05 }
  }
}