mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-23 14:17:06 +00:00
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* fix(redis): a command that gets no answer rejects after the configured timeout redis.commandTimeoutMs (default 2000) arms a per-command timer on the cluster client, so a command sent to a node that never replies, or queued while the cluster is not ready, rejects and the caller takes its error path. Blocking commands and duplicate() clients are left without it. * fix(broadcast): a failed pubsub publish or subscribe is logged, not left unhandled With command timeouts, a stalled publish now rejects; the fan-out is fire-and-forget, so the rejection is caught and logged. The sign-in relay test pins that /login/set still reaches a subscribed /login/wait when Redis never answers. * fix(permissions): a scan cache read that Redis fails to serve counts as a miss The scan then computes from the store, as the generation and per-check cache reads already do, instead of failing the permission check. * refactor(redis): isCommandTimeout names the rejection of a timed-out command Callers that issue a write can recognise the timeout and queue its undo on the same key. Also notes that a timed-out command is not withdrawn, restores the console spies in the timeout tests, and drops formatting churn in types.ts. * fix(metering): an increment whose buffering timed out is counted once On a timeout the write-through runs and the buffered copy is negated on the same keys, so if the timed-out increment lands later the next flush nets it out. incr and incrAux both do this. * fix(rate-limit): a concurrency slot whose acquire timed out is removed The ZREM goes to the same key behind the timed-out MULTI, so a slot that lands late does not stay held until the orphan window. * fix(uploads): leases whose take timed out are released The release goes to the same keys behind the timed-out take, so leases that land late do not count against the owner until their deadline. * fix(redis-lock): a claim that timed out is released if it lands The token-checked delete goes to the same key behind the timed-out SET NX, so a late claim does not hold the lock for its full TTL. * fix(broadcast): a rejected pubsub subscribe is retried with backoff Retries start at 1s and cap at 30s, and stop once the service shuts down. * refactor(redis): isCommandTimeout lives in its own module Stores, the rate limiter and the lock helper recognise a timed-out command without importing the client. * fix(credit-holds): a hold whose take or reserve timed out is released The release goes to the same key behind the timed-out script, so a hold that lands late does not shrink the spendable budget for its TTL. * fix(metering): a write-through answers without waiting on its undo The undo's place in the queue is fixed when it is sent, so the request no longer waits on it. When the undo itself times out, the warning says the increment may be counted once more or not at all. * fix(broadcast): a pubsub subscribe retry checks the client is still current A retry that fires after shutdown no longer subscribes the closed client. * feat(redis): after a timeout, commands fail fast until a probe gets a reply For redis.failFastMs (default 5000) after a command times out, other commands reject unsent with 'Redis unavailable', so a stall costs a request one timeout instead of one per call. After each interval one probe is sent; a reply, or the cluster becoming ready, ends it. Commands sent through sendAsUndo, blocking commands, CLUSTER commands and duplicate() clients are not held back. A pipeline is admitted or rejected as a whole. * fix(redis): undos of a timed-out command are sent while failing fast The metering negation, slot ZREM, upload and credit-hold releases and the lock's token-checked delete go through sendAsUndo, so they still queue behind the original that may land. A command rejected unsent is not a timeout, so it triggers no undo. * test(auth): the sign-in relay completes within one command timeout under a stall /login/set and /login/wait against a cluster whose node never answers now finish in about one timeout, since calls after the first fail fast. * style(redis): one-line comments, and types.ts keeps its existing formatting * fix(redis): releases are sent while failing fast and not waited on The lock release, concurrency-slot release, credit-hold release and upload-lease release and settle go through sendAsUndo, so resources taken before the breaker opened are freed rather than held for their TTL. They are sent without awaiting; later commands on the same key queue behind them. The KV and memory slot backends are still awaited. * fix(redis): a retried pipeline is timed again, and only replies end failing fast Pipeline commands whose error reply cleared their timer are re-armed when the pipeline resends them after MOVED, ASK or a closed connection, and the ASKING command it adds is always admitted. Only a reply, including an error reply, counts as an answer: a closed connection or an ended cluster no longer ends failing fast. * fix(rate-limit): window take-backs are sent while failing fast, and a release never rejects The ZREM or DECRBY that takes back a denied window charge goes through sendAsUndo without being awaited, and the request is still denied. A slot release that throws synchronously is logged, not rejected, and the release() doc says when it settles. * fix(broadcast): a publish failing fast warns once per stretch, not once per event Warnings for publishes rejected with 'Redis unavailable' are skipped until a publish succeeds again; other failures still warn every time. * test(redis): timing bounds name their command timeout and leave CI headroom The relay test sets a 1000 ms timeout and checks it finishes within one timeout rather than two; the release timing bound is 250 ms. * style(broadcast): shorter comment on the publish warning * fix(metering): the cached base is dropped while failing fast, without waiting forgetBase sends its DEL through sendAsUndo, so after a write-through it still queues behind the timed-out increment and its undo instead of being rejected unsent. incr no longer awaits it on the request path; the MeteringService callers still do. * fix(redis): a command rejected while failing fast is handled, so one nobody awaits can't end the process * style(types): unrelated interfaces keep the formatting lint expects * fix(cache): invalidations are sent while failing fast, so a write during a stall doesn't leave the old entry cached --------- Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
616 lines
29 KiB
JSON
616 lines
29 KiB
JSON
{
|
|
// Comprehensive template — every key the OSS backend or shipped (non-prod)
|
|
// extensions read. Copy to `config.json` and trim what you don't need;
|
|
// unset keys fall back to documented defaults. See
|
|
// `src/backend/types.ts` for the per-field source of truth.
|
|
//
|
|
// Each setting lives at exactly one canonical key — there are no fallback
|
|
// aliases. Values shown are illustrative, not production secrets.
|
|
//
|
|
// Keys consumed only by closed-source / hosted-prod extensions are
|
|
// intentionally omitted.
|
|
|
|
// ── Environment / identity ──────────────────────────────────────────
|
|
"config_name": "template",
|
|
// `dev` opens a browser on boot, skips blocked-email checks, and runs the
|
|
// dev-time webpack watcher; `prod` serves pre-built bundles.
|
|
"env": "dev",
|
|
// Console output format. `json` replaces the global console so every call
|
|
// emits one structured JSON line (level, timestamp, msg, and the active
|
|
// request's trace id) — one event per call, so a line-oriented log
|
|
// collector can't split stack traces across events and level filtering
|
|
// works. Unset (the default) leaves console output human-readable.
|
|
"log_format": "text",
|
|
"version": "0.0.0",
|
|
// Stable identity for this server node — used by pager alerts and
|
|
// graceful-shutdown coordination.
|
|
"serverId": "node-1",
|
|
|
|
// ── Networking / URLs ───────────────────────────────────────────────
|
|
// Port Puter listens on internally.
|
|
"port": 4100,
|
|
// Externally-visible port (set this when behind a reverse proxy on 80/443).
|
|
"pub_port": 4100,
|
|
// Idle keep-alive timeout in ms. Must stay above the idle timeout of any
|
|
// proxy in front, or the proxy reuses connections this server has closed
|
|
// and its clients see 502s.
|
|
"keep_alive_timeout": 920000,
|
|
"protocol": "http",
|
|
"domain": "puter.localhost",
|
|
// Fully-qualified externally-visible URL. Computed from protocol/domain/
|
|
// pub_port if unset.
|
|
"origin": "http://puter.localhost:4100",
|
|
// Public base URL for the API subdomain (used to build signed URLs and
|
|
// surfaced to the client by the `installedApps` and `whoami` extensions).
|
|
"api_base_url": "http://api.puter.localhost:4100",
|
|
// Subdomains Puter routes on. Wildcard DNS (`*.<domain>`) must point at
|
|
// this server for site/app hosting to work.
|
|
"static_hosting_domain": "site.puter.localhost",
|
|
"static_hosting_domain_alt": "host.puter.localhost",
|
|
"private_app_hosting_domain": "app.puter.localhost",
|
|
"private_app_hosting_domain_alt": "dev.puter.localhost",
|
|
// Host-header / domain handling. Defaults below are the dev-friendly
|
|
// settings; tighten for any public install.
|
|
"allow_all_host_values": true,
|
|
"allow_no_host_header": true,
|
|
"allow_nipio_domains": false,
|
|
"custom_domains_enabled": false,
|
|
"enable_ip_validation": false,
|
|
// Express `trust proxy` setting — set to the number of reverse-proxy
|
|
// hops in front of the server (1 = nginx/Cloudflare, 2 = CF→ALB→app),
|
|
// or to a CIDR / IP / list. `false` (safe default) makes `req.ip` the
|
|
// direct socket peer. NEVER set to `true` in prod — it trusts every hop
|
|
// and makes X-Forwarded-For forgeable.
|
|
"trust_proxy": false,
|
|
// Request header a TLS-terminating proxy in front of the server sets to
|
|
// the client's TLS fingerprint (JA3/JA4). Only set it when that proxy
|
|
// overwrites any value the client sends. Unset disables it.
|
|
// "tlsFingerprintHeader": "x-tls-fingerprint",
|
|
"no_browser_launch": false,
|
|
|
|
// ── Dev watcher (devWatcher extension) ──────────────────────────────
|
|
// Rebuilds GUI + puter.js on file changes when running from source.
|
|
// Ignored when `env: "prod"` unless `devwatch.enabled: true`.
|
|
"no_devwatch": false,
|
|
"devwatch": {
|
|
// Delay after watcher startup before boot continues. Lets webpack
|
|
// emit its first build so the homepage doesn't 404 on bundle.min.js.
|
|
"ready_delay_ms": 5000
|
|
},
|
|
|
|
// ── Auth / session ──────────────────────────────────────────────────
|
|
// ALWAYS replace these for any public install — `openssl rand -hex 64`.
|
|
"jwt_secret_v2": "change-me",
|
|
"url_signature_secret": "change-me",
|
|
"cookie_name": "puter_auth_token",
|
|
"min_pass_length": 6,
|
|
// When true, anonymous users must log in instead of creating temp or
|
|
// permanent accounts.
|
|
"disable_user_signup": false,
|
|
"allow_system_login": false,
|
|
"strict_email_verification_required": false,
|
|
"captcha": {
|
|
"enabled": false,
|
|
"difficulty": "medium"
|
|
},
|
|
"oidc": {
|
|
"providers": {
|
|
// Google uses OIDC discovery — only ids are required.
|
|
"google": {
|
|
"client_id": "",
|
|
"client_secret": "",
|
|
"scopes": "openid email profile"
|
|
},
|
|
// Custom OIDC providers must also supply the three endpoints.
|
|
"custom-oidc": {
|
|
"client_id": "",
|
|
"client_secret": "",
|
|
"authorization_endpoint": "",
|
|
"token_endpoint": "",
|
|
"userinfo_endpoint": "",
|
|
"scopes": "openid email profile"
|
|
}
|
|
}
|
|
},
|
|
|
|
// ── Groups / provisioning ───────────────────────────────────────────
|
|
// UIDs of the persistent groups new users are auto-enrolled in.
|
|
"default_user_group": "78b1b1dd-c959-44d2-b02c-8735671f9997",
|
|
"default_temp_group": "b7220104-7905-4985-b996-649fdcdb3c8f",
|
|
// When true, ACL grants read/list on `/<user>/Public` to any actor.
|
|
"enable_public_folders": true,
|
|
|
|
// ── Storage / S3 ────────────────────────────────────────────────────
|
|
"s3": {
|
|
// Local fauxqs (in-process S3-compatible) — used in dev and the
|
|
// bundled-defaults Docker mode. Files land under `dataDir`.
|
|
"localConfig": {
|
|
"inMemory": false,
|
|
"host": "127.0.0.1",
|
|
"port": 4566,
|
|
"dataDir": "volatile/runtime/fauxqs-data",
|
|
"s3StorageDir": "volatile/runtime/fauxqs-s3-data"
|
|
},
|
|
// For real / external S3, replace `localConfig` above with `s3Config`.
|
|
"_remote_example": {
|
|
"s3Config": {
|
|
"useCredentialChain": false,
|
|
"endpoint": "https://s3.example.com",
|
|
// Endpoint used in presigned URLs handed to the browser. Set
|
|
// this when the server-side endpoint isn't reachable from the
|
|
// browser (e.g. docker-internal `http://s3:9000`).
|
|
"publicEndpoint": "",
|
|
"accessKeyId": "",
|
|
"secretAccessKey": "",
|
|
"region": "us-west-2",
|
|
// Set true for RustFS / MinIO / fauxqs (path-style URLs).
|
|
// Real AWS S3 wants virtual-hosted — leave unset / false.
|
|
"forcePathStyle": false
|
|
}
|
|
}
|
|
},
|
|
"s3_bucket": "puter-local",
|
|
"s3_region": "us-west-2",
|
|
"region": "us-west-2",
|
|
// Default per-user storage cap (bytes). 100 MB.
|
|
"storage_capacity": 104857600,
|
|
"is_storage_limited": false,
|
|
"available_device_storage": 0,
|
|
// ── Thumbnails (thumbnails extension) ───────────────────────────────
|
|
// Optional dedicated S3-compatible bucket for generated thumbnails.
|
|
// When unset (or `endpoint` empty), the extension falls back to the
|
|
// main S3 client / bucket above.
|
|
"thumbnailStore": {
|
|
"name": "puter-local",
|
|
"endpoint": "",
|
|
"credentials": {
|
|
"accessKeyId": "",
|
|
"secretAccessKey": ""
|
|
}
|
|
},
|
|
|
|
// ── Database ────────────────────────────────────────────────────────
|
|
"database": {
|
|
// `sqlite` for single-node/dev, `mysql` for MariaDB/MySQL,
|
|
// or `postgres` for PostgreSQL.
|
|
//
|
|
// NOTE: `postgres` support is a community contribution and is not
|
|
// exercised by Puter.com production. It boots, passes its own
|
|
// integration tests against pgmock, and runs the common user/app/
|
|
// fsentry/session/permission/OIDC flows — but less-traveled code
|
|
// paths may surface MySQL/SQLite-isms that haven't been ported yet.
|
|
// Expect rough edges and please file issues if you hit one. For
|
|
// production self-hosting today, `mysql` (MariaDB) and `sqlite` are
|
|
// the supported defaults.
|
|
"engine": "sqlite",
|
|
// sqlite — file path on disk
|
|
"path": "volatile/runtime/puter-database.sqlite",
|
|
"targetVersion": 0,
|
|
// mysql/postgres — connection details. PostgreSQL defaults to port
|
|
// 5432 when `engine` is `postgres`; MySQL/MariaDB normally use 3306.
|
|
"host": "",
|
|
"port": 3306,
|
|
"user": "",
|
|
"password": "",
|
|
"database": "",
|
|
// postgres may also use a URL instead of host/user/password fields:
|
|
// "connectionString": "postgres://puter:secret@localhost:5432/puter",
|
|
// Optional read-replica pool. Reads route here when populated.
|
|
"replica": {
|
|
"host": "",
|
|
"port": 3306,
|
|
"user": "",
|
|
"password": "",
|
|
"database": ""
|
|
}
|
|
// mysql/postgres self-host bootstrap: set `migrationPaths` to apply the
|
|
// bundled schema on first boot. Idempotent — safe to leave on.
|
|
// "migrationPaths": ["./src/backend/clients/database/migrations/mysql"]
|
|
// "migrationPaths": ["./src/backend/clients/database/migrations/postgres"]
|
|
},
|
|
|
|
// ── DynamoDB (KV store) ─────────────────────────────────────────────
|
|
"dynamo": {
|
|
// Local emulator (dynamodb-local) endpoint. Drop this field for real
|
|
// AWS DynamoDB.
|
|
"endpoint": "http://localhost:8000",
|
|
// Set true when pointing at a local emulator so Puter creates the KV
|
|
// table on boot. NEVER set against real AWS — provision via IaC.
|
|
// "bootstrapTables": true,
|
|
"path": "",
|
|
// Credentials. NOTE: snake_case here, unlike `s3.s3Config` below.
|
|
// For dynamodb-local, any non-empty values work. On AWS,
|
|
// `"useCredentialChain": true` uses the default credential chain
|
|
// instead of keys.
|
|
"aws": {
|
|
"access_key": "",
|
|
"secret_key": "",
|
|
"region": "us-west-2"
|
|
}
|
|
},
|
|
|
|
// ── Redis / Valkey (cache + cross-node rate limit) ──────────────────
|
|
"redis": {
|
|
// True → in-process redis-mock (dev / single-node).
|
|
"useMock": true,
|
|
// Cluster nodes for ioredis. For a single Valkey/Redis container,
|
|
// run it in cluster mode (one node, all slots).
|
|
"startupNodes": [
|
|
{
|
|
"host": "127.0.0.1",
|
|
"port": 7000
|
|
}
|
|
]
|
|
// Defaults to true (matches prod ElastiCache). Set false for plain-TCP
|
|
// self-host Valkey/Redis.
|
|
// "tls": false,
|
|
// A command with no reply after this many ms rejects; 0 waits forever.
|
|
// "commandTimeoutMs": 2000,
|
|
// After a timeout, ms that commands reject unsent bar one probe; 0 off.
|
|
// "failFastMs": 5000
|
|
},
|
|
|
|
// ── Email (transactional) ───────────────────────────────────────────
|
|
// Nodemailer transport — used for password resets, email confirmation, etc.
|
|
"email": {
|
|
"from": "\"Puter\" <no-reply@puter.com>",
|
|
"host": "smtp.example.com",
|
|
"port": 587,
|
|
"secure": false,
|
|
"service": "",
|
|
"auth": {
|
|
"user": "",
|
|
"pass": ""
|
|
}
|
|
// Each send names a stream: "auth", "signup" or "notify". A stream
|
|
// listed here adds its headers to every message on it, and its "from"
|
|
// when the sender gives none. Tags are written to "tagsHeader".
|
|
// "streams": {
|
|
// "notify": {
|
|
// "from": "\"Puter\" <notify@puter.example.com>",
|
|
// "headers": { "X-Example-Stream": "notify" },
|
|
// "tagsHeader": "X-Example-Tags"
|
|
// }
|
|
// }
|
|
},
|
|
|
|
// ── Inbound mail (separate process) ─────────────────────────────────
|
|
// Mailboxes addressed at one of your own domains. `secret` gates the
|
|
// ingress endpoint that files a message into the recipient's ~/.mail.
|
|
//
|
|
// `localServer` additionally runs an SMTP listener that accepts mail from
|
|
// other mail servers and hands each message to that endpoint. It runs as
|
|
// its own process - `npm run start:smtp`, or the `smtp` compose profile -
|
|
// and stores nothing itself. Without it, nothing delivers to the endpoint
|
|
// unless you point something else at it.
|
|
//
|
|
// The listener is unauthenticated by nature: anything on the internet may
|
|
// hand it a message for an address in `localDomains`. It performs no spam,
|
|
// SPF, DKIM or DMARC checks. Read the self-hosting guide before exposing
|
|
// it.
|
|
// "userEmail": {
|
|
// "secret": "a long random string",
|
|
// "localServer": true,
|
|
// "localDomains": ["example.com"],
|
|
// // Container-internal by default; publish 25 onto it from outside.
|
|
// "localPort": 2525,
|
|
// // Defaults to <api_base_url>/email/ingress. The endpoint is served
|
|
// // on the `api` subdomain, so when this points somewhere internal,
|
|
// // `localIngressHost` has to name that virtual host.
|
|
// "localIngressUrl": "http://puter:4100/email/ingress",
|
|
// "localIngressHost": "api.example.com",
|
|
// "localHostname": "mx.example.com",
|
|
// "localMaxRecipients": 50,
|
|
// // Concurrent connections. Each message is held in memory while it
|
|
// // is delivered, so this also bounds memory use.
|
|
// "localMaxClients": 20
|
|
// },
|
|
|
|
// ── Sharing ─────────────────────────────────────────────────────────
|
|
// Email a recipient who already has an account about a new share. On
|
|
// unless set to false; they opt out via the unsubscribe link, or by
|
|
// blocking a sender. An invite to an address with no account always goes.
|
|
// "share_email_notifications": false,
|
|
//
|
|
// New shares one account may create per UTC day. Default 200.
|
|
// "share_daily_limit": 200,
|
|
//
|
|
// How often a share may interrupt its recipient — the notification pushed
|
|
// to their screen and the email with it. Over budget the share still
|
|
// succeeds and their notification is still brought up to date; only the
|
|
// interruption is dropped. The recipient bounds are what stop many senders
|
|
// burying one person between them. A non-positive value removes a bound.
|
|
// "share_notify_limits": {
|
|
// "pairWindowSeconds": 900,
|
|
// "pairDaily": 20,
|
|
// "recipientHourly": 10,
|
|
// "recipientDaily": 50,
|
|
// "emailBatchSeconds": 90
|
|
// },
|
|
|
|
// ── Teams / teams ──────────────────────────────────────────────
|
|
// Off by default, and off is the state every existing install stays in.
|
|
// The tables ship either way and sit inert; this gates whether `/teams`
|
|
// is registered at all, so with it off the paths do not exist rather than
|
|
// existing and refusing. It is also the backout: turning it off removes
|
|
// the feature without touching data. Teams ships as an extension; on,
|
|
// the server refuses to boot unless one registers it.
|
|
"teams_enabled": false,
|
|
//
|
|
// Live teams one user may own. Soft-deleted ones do not count, so
|
|
// deleting yours frees the slot. Default 1.
|
|
"max_teams_per_user": 1,
|
|
//
|
|
// Seats one team may provision. Each seat is a real Puter account taking a
|
|
// name from the global username pool, so this is what bounds a team's blast
|
|
// radius. The owner's plan decides which of the two applies; defaults are 3
|
|
// and 40. A plan registered with `teamSeatCap` uses that instead. Lowering
|
|
// a cap below a team's current seat count blocks new provisioning and
|
|
// disables nobody. Deployments upgrading from the old flat default of 50:
|
|
// without a billing extension every owner reads as free, so set
|
|
// `max_seats_per_team` to keep the old behavior.
|
|
"max_seats_per_team_free": 3,
|
|
"max_seats_per_team_paid": 40,
|
|
//
|
|
// One flat cap for every team, whatever the owner pays. Setting it
|
|
// overrides both of the above, so a deployment that does not sell seats can
|
|
// ignore plans entirely. Unset by default — leave it that way to keep the
|
|
// free cap meaningful.
|
|
// "max_seats_per_team": 50,
|
|
//
|
|
// Staged rollout: only these email domains may create a team, and the tab
|
|
// renders for them even with `gui_params.teams_ui` off. Members of an
|
|
// existing team always pass. Unset means everyone, gated by `teams_ui`.
|
|
// "teams_allowed_email_domains": ["puter.com"],
|
|
|
|
// ── Notifications ───────────────────────────────────────────────────
|
|
// How long a notification is kept, in days from creation. Acknowledged or
|
|
// not, a row past this is swept. Off by default; any value above 0 arms
|
|
// the sweep.
|
|
// "notificationRetentionDays": 14,
|
|
//
|
|
// Ms a live notification waits for open tabs to acknowledge it.
|
|
// "notificationAckTimeoutMs": 5000,
|
|
|
|
// ── Alarms / alerting ───────────────────────────────────────────────
|
|
// Where system alarms go. Severity is the routing decision — each
|
|
// transport takes everything at or above its own `minSeverity`:
|
|
//
|
|
// critical — an unhandled server error; pages on-call.
|
|
// error — pages as well; prefer critical or warning.
|
|
// warning — look at it today; no page.
|
|
// info — a record in the chat channel only.
|
|
//
|
|
// Both transports are off unless enabled, so a self-hosted node just
|
|
// logs its alarms to the console.
|
|
"pager": {
|
|
// Severity for call sites that don't pick one. Default "critical".
|
|
"defaultSeverity": "critical",
|
|
|
|
// Retier or silence an alarm without a deploy. Keys are alarm ids,
|
|
// or a prefix ending in `*`; the exact id wins over a pattern, and
|
|
// the longest matching pattern wins among patterns. Values are a
|
|
// severity or "mute". This is applied last, so it overrides both the
|
|
// call site and any known-error rule.
|
|
"severityOverrides": {
|
|
// "cronMonitor:*": "info",
|
|
// "http_500:GET:/some/flapping/route:*": "mute"
|
|
},
|
|
|
|
"pagerduty": {
|
|
"enabled": false,
|
|
"routingKey": "",
|
|
// Lowest severity that reaches PagerDuty. Default "warning",
|
|
// which keeps `info` out of the paging system entirely.
|
|
"minSeverity": "warning"
|
|
},
|
|
|
|
// Slack incoming webhook — the low-noise destination for everything
|
|
// that shouldn't page.
|
|
"slack": {
|
|
"enabled": false,
|
|
"webhookUrl": "",
|
|
// Optional; defaults to the channel the webhook was created for.
|
|
"channel": "#alerts",
|
|
"username": "puter-alarms",
|
|
// Severity window posted to Slack. The ceiling defaults to
|
|
// "info" when PagerDuty is configured — what pages belongs in
|
|
// the pager, not in chat — and to "critical" when Slack is the
|
|
// only transport.
|
|
"minSeverity": "info",
|
|
"maxSeverity": "info",
|
|
// Don't repost the same alarm id within this window. The first
|
|
// occurrence always posts; the next post that gets through
|
|
// reports how many occurrences piled up. 0 disables throttling.
|
|
"repeatThrottleMs": 900000
|
|
}
|
|
},
|
|
|
|
// ── Rate limiting ───────────────────────────────────────────────────
|
|
// `memory` for single-node, `redis` for multi-node (default), `kv` for
|
|
// dynamo-backed counters.
|
|
"rate_limit": {
|
|
"backend": "redis"
|
|
},
|
|
|
|
// ── AI / integration providers ──────────────────────────────────────
|
|
// All AI drivers (chat, image, video, TTS, OCR, STT) read from here.
|
|
// Provider id == driver-side identifier. Leave empty / omit to disable.
|
|
"providers": {
|
|
// ─ Chat / completion ─
|
|
"claude": { "apiKey": "" },
|
|
"openai-completion": { "apiKey": "" },
|
|
"azure-openai": {
|
|
"apiKey": "",
|
|
"apiURL": ""
|
|
},
|
|
"gemini": { "apiKey": "" },
|
|
// Meta Model API (Muse Spark). `muse-spark-1.2-contributor`
|
|
// trades a ~12x discount for Meta training on its prompts and
|
|
// completions, so it is only served to callers that name it.
|
|
"meta": { "apiKey": "" },
|
|
"groq": { "apiKey": "" },
|
|
"deepseek": { "apiKey": "" },
|
|
"mistral": { "apiKey": "" },
|
|
"xai": { "apiKey": "" },
|
|
"moonshot": { "apiKey": "" },
|
|
// MiniMax. One key powers chat and video generation (H3, Hailuo);
|
|
// video calls go to the same host, beside the chat API's `/v1`.
|
|
"minimax": {
|
|
"apiKey": "",
|
|
"apiBaseUrl": "https://api.minimax.io/v1"
|
|
},
|
|
"openrouter": {
|
|
"apiKey": "",
|
|
"apiBaseUrl": "https://openrouter.ai/api/v1"
|
|
},
|
|
"infron": {
|
|
"apiKey": "",
|
|
"apiBaseUrl": "https://llm.onerouter.pro/v1"
|
|
},
|
|
// BytePlus ModelArk. One key powers chat (Seed/GLM/DeepSeek), image
|
|
// generation (Seedream) and video generation (Seedance); `apiBaseUrl`
|
|
// selects the region; see
|
|
// https://docs.byteplus.com/en/docs/ModelArk/1330310 for options.
|
|
"byteplus": {
|
|
"apiKey": "",
|
|
"apiBaseUrl": "https://ark.ap-southeast.bytepluses.com/api/v3"
|
|
},
|
|
// Kling AI. One API key (not the legacy AccessKey/SecretKey pair)
|
|
// powers video generation, image generation and TTS; `apiBaseUrl`
|
|
// defaults to https://api-singapore.klingai.com.
|
|
"kling": { "apiKey": "" },
|
|
"zai": { "apiKey": "" },
|
|
"alibaba": { "apiKey": "" },
|
|
"hoonify": {
|
|
"apiKey": "",
|
|
"apiBaseUrl": "https://api.hoonify.ai/v1"
|
|
},
|
|
"together-ai": { "apiKey": "" },
|
|
// Local Ollama. `enabled: false` skips the auto-probe at startup
|
|
// (otherwise Puter logs ECONNREFUSED on every boot when no Ollama
|
|
// is running).
|
|
"ollama": {
|
|
"enabled": false,
|
|
"apiBaseUrl": "http://localhost:11434"
|
|
},
|
|
|
|
// ─ Image generation ─
|
|
"openai-image-generation": { "apiKey": "" },
|
|
"gemini-image-generation": { "apiKey": "" },
|
|
"together-image-generation": { "apiKey": "" },
|
|
"cloudflare-image-generation": {
|
|
"apiToken": "",
|
|
"accountId": "",
|
|
"apiBaseUrl": "https://api.cloudflare.com/client/v4"
|
|
},
|
|
"xai-image-generation": { "apiKey": "" },
|
|
|
|
// ─ Video generation ─
|
|
"together-video-generation": { "apiKey": "" },
|
|
"gemini-video-generation": { "apiKey": "" },
|
|
|
|
// ─ Speech / OCR ─
|
|
"openai": { "apiKey": "" },
|
|
"elevenlabs": {
|
|
"apiKey": "",
|
|
"apiBaseUrl": "https://api.elevenlabs.io",
|
|
"defaultVoiceId": "",
|
|
"speechToSpeechModelId": ""
|
|
},
|
|
// Both AWS providers also take `"useCredentialChain": true` in place
|
|
// of keys, like `dynamo.aws`.
|
|
"aws-polly": {
|
|
"access_key": "",
|
|
"secret_key": "",
|
|
"region": "us-west-2"
|
|
},
|
|
"speechify": { "apiKey": "" },
|
|
"aws-textract": {
|
|
"access_key": "",
|
|
"secret_key": "",
|
|
"region": "us-west-2"
|
|
},
|
|
"mistral-ocr": { "apiKey": "" }
|
|
},
|
|
|
|
// ── GUI / static mounts ─────────────────────────────────────────────
|
|
"gui_assets_root": "./src/gui",
|
|
"gui_profile": "development",
|
|
"builtin_apps": {
|
|
"dev-center": "./src/dev-center"
|
|
},
|
|
// Force the bundled GUI even in dev — set true when running from a
|
|
// pre-built tree without webpack-dev-server.
|
|
"use_bundled_gui": false,
|
|
"gui_bundle": "/dist/bundle.min.js",
|
|
"gui_css": "/dist/bundle.min.css",
|
|
"gui_puterjs_bundle": "https://js.puter.com/v2/",
|
|
"gui_params": {
|
|
"title": "Puter",
|
|
"short_description": "Your personal cloud computer",
|
|
"social_media_image": ""
|
|
},
|
|
// Optional roots for native app bundles and custom puter.js builds.
|
|
"native_apps_root": "",
|
|
"client_libs_root": "",
|
|
"puterjs_root": "./src/puter-js/dist",
|
|
|
|
// ── Feature flags (whoami extension) ────────────────────────────────
|
|
// Flat `{ flag_name: boolean }` bag. Server-only by default — flags are
|
|
// only surfaced to the client if their key is on the allowlist in
|
|
// `extensions/whoami.ts` (CLIENT_VISIBLE_FEATURE_FLAGS).
|
|
"feature_flags": {
|
|
"example_flag": false
|
|
},
|
|
|
|
// ── Misc / safety ───────────────────────────────────────────────────
|
|
// TLDs / domains rejected at signup (prod only).
|
|
"blockedEmailDomains": [],
|
|
"support_email": "support@puter.com",
|
|
// Worker / subdomain names users can't claim.
|
|
"reserved_words": [],
|
|
"max_subdomains_per_user": 10,
|
|
"server_health": {
|
|
"db_liveness_latency_fail_ms": 1500,
|
|
"stale_health_loop_fail_ms": 0
|
|
},
|
|
|
|
// ── Extensions ──────────────────────────────────────────────────────
|
|
// Directories scanned for extension entrypoints (`*.ts` / subdirs).
|
|
"extensions": [
|
|
"./extensions"
|
|
],
|
|
|
|
// ── Metering ────────────────────────────────────────────────────────
|
|
// When true, every account resolves to an unlimited policy: usage is still
|
|
// recorded, but nothing is ever refused for lack of budget. This is the
|
|
// setting for a deployment with no way to buy more — without it, accounts
|
|
// are held to the free monthly allowance and start getting 402s from the AI
|
|
// surfaces, file transfers and KV once they pass it.
|
|
"unlimitedMetering": false,
|
|
|
|
// Whether an account that has spent its whole allowance is refused the
|
|
// operations that spend it — file transfers, KV calls. Recording is
|
|
// unaffected either way. `workers` extends the same refusal to
|
|
// worker-driven calls, which are exempt by default because a deployed
|
|
// worker has nowhere to surface a payment prompt. `subscriptions` covers
|
|
// the separate question of surfaces reserved for paid plans (the
|
|
// vendor-compatible AI endpoints): turn it off on a deployment with no
|
|
// paid plans, or every account is refused them.
|
|
// "meteringEnforcement": { "enabled": true, "workers": false, "subscriptions": true },
|
|
|
|
// Fleet-wide spend rate, in micro-cents per minute, past which metering
|
|
// raises the `metering:excessiveGlobalUsageRate` alarm. Omit it (the
|
|
// default) to leave the check off: the only useful value is a multiple of
|
|
// what this deployment's normal traffic costs, so it has to be measured
|
|
// rather than guessed, and a stale number here alarms on healthy growth.
|
|
// "maxGlobalUsagePerMinute": 200000000
|
|
|
|
// How many full months past its own a monthly usage record is kept before
|
|
// it expires. Defaults to 3; set to 0 to keep every month's records
|
|
// forever. Changing it, including to 0, applies to records first written
|
|
// after the change; records already stamped keep their expiry.
|
|
// "meteringRetentionMonths": 3
|
|
}
|