export type DwnServerConfig = typeof config; /** * Parses a byte-size string with optional b/kb/mb/gb suffix into bytes. */ export declare function parseByteSize(value: string): number; export declare const config: { /** * Used to populate the `server` property returned by the `/info` endpoint. */ serverName: string; /** * The base external URL of this DWN. * This is used to construct URL paths such as the `Request URI` in the Web5 Connect flow. * Should NOT be pointing to `localhost` for production use. */ baseUrl: string; /** * Port that server listens on. */ port: number; /** * Hostname or interface that the HTTP server binds to. When the local-node * profile is enabled, this defaults to loopback and non-loopback values are rejected. */ hostname: string; /** * Enables the local DWN node trust profile. This profile is opt-in so cloud * deployments keep their existing behavior unless explicitly configured. */ localNodeProfileEnabled: boolean; /** * Origins supplied by local-node wrappers for development/CI policy. * Protected local-node routes are authorized by per-origin pairing tokens. */ localNodeAllowedOrigins: string[]; /** * The URL of the TTL cache used by the DWN. * NOTE: Used for session/state keeping, thus requires the cache to be commonly addressable by nodes in a cloud cluster environment. * * Currently only supports SQL databases, e.g. * Postgres: 'postgres://root:dwn@localhost:5432/dwn' * MySQL: 'mysql://root:dwn@localhost:3306/dwn' */ ttlCacheUrl: string; /** * Optional path to a `package.json` used to populate the `version` property returned by `/info`. * When unset, `@enbox/dwn-server/package.json` is resolved from installed packages. */ packageJsonPath: string; /** * Maximum size of data that can be provided with a RecordsWrite. * Request bodies up to this size are buffered fully into memory, so the * default should be conservative enough to prevent memory exhaustion from * concurrent large uploads. Operators can raise the limit via the * `MAX_RECORD_DATA_SIZE` env var (e.g. `'1gb'`). */ maxRecordDataSize: number; /** * Maximum number of unacknowledged subscription events the server will send * per subscription before pausing delivery. Clients must send `rpc.ack` to * advance the window. Configurable via `DWN_MAX_IN_FLIGHT` env var. */ maxInFlight: number; webSocketSupport: boolean; /** * Path to DWN EventBus plugin to use for cross-process durable-log wakes. * Default in-memory implementation will be used if left empty. */ eventBusPluginPath: string; messageStore: string; dataStore: string; resumableTaskStore: string; /** * PostgreSQL connection pool tuning. When multiple DWN stores share the same * Postgres connection URL, a single shared pool is used instead of one pool * per store (which would be 4 pools x 10 default connections = 40 connections). */ pgPoolMin: number; pgPoolMax: number; pgPoolIdleTimeout: number; registrationStoreUrl: string; registrationProofOfWorkSeed: string; registrationProofOfWorkEnabled: boolean; registrationProofOfWorkInitialMaxHash: string; termsOfServiceFilePath: string; providerAuthEnabled: boolean; providerAuthAuthorizeUrl: string; providerAuthTokenUrl: string; providerAuthRefreshUrl: string; providerAuthManagementUrl: string; providerAuthPluginPath: string; providerAuthJwtSecret: string; providerAuthJwtJwksUrl: string; logLevel: string; /** * Bearer token for the admin API. If unset (or empty), the admin API is disabled entirely. * Can also be read from a file path via `DWN_ADMIN_TOKEN_FILE` (useful for Docker secrets). */ adminToken: string; /** * Maximum number of recent DWN activity events retained in the in-memory * ring buffer for the admin `/events` endpoint. Defaults to 10,000. */ adminActivityLogCapacity: number; /** * Interval (in seconds) at which Prometheus gauge metrics are updated from * the admin store. Defaults to 30 seconds. */ adminMetricsUpdateIntervalSeconds: number; /** * WebAuthn Relying Party ID for admin passkey authentication. Typically * the hostname of the DWN server (e.g. `dev.aws.dwn.enbox.id`). When not * set, the hostname is extracted from `DWN_BASE_URL` at runtime. * * @see https://github.com/enboxorg/enbox/issues/546 */ adminWebAuthnRpId: string; /** * Human-readable Relying Party name shown during passkey registration. * Defaults to `"DWN Admin"`. */ adminWebAuthnRpName: string; /** * Session time-to-live (in seconds) for passkey-authenticated sessions. * Defaults to 86400 (24 hours). */ adminSessionTtlSeconds: number; /** * Default maximum number of messages a tenant may store. 0 = unlimited (default). * Per-tenant overrides are managed via the admin API. */ quotaMaxMessages: number; /** * Default maximum data storage in bytes a tenant may use. 0 = unlimited (default). * Per-tenant overrides are managed via the admin API. */ quotaMaxStorageBytes: number; /** * Maximum age of audit log entries in days. Entries older than this are purged. * 0 = no age limit (default: 90 days). * * @see https://github.com/enboxorg/enbox/issues/394 */ auditLogMaxAgeDays: number; /** * Maximum number of audit log rows to retain. Oldest entries are purged when exceeded. * 0 = no row limit (default: 100000). * * @see https://github.com/enboxorg/enbox/issues/394 */ auditLogMaxRows: number; /** * Maximum HTTP requests per second per IP address. Set to 0 to disable. * Defaults to 30 req/s which is generous for normal usage while limiting abuse. * Can be reconfigured at runtime via the admin `PATCH /config` endpoint. */ rateLimitRequestsPerSecond: number; /** * Maximum burst size for per-IP rate limiting. Allows short spikes above the * sustained rate without triggering 429s. Defaults to 50. */ rateLimitBurst: number; /** * Maximum DWN requests per second per tenant DID. Set to 0 to disable. * Defaults to 20 req/s. Applies to both HTTP and WebSocket transports. * Can be reconfigured at runtime via the admin `PATCH /config` endpoint. */ rateLimitTenantRequestsPerSecond: number; /** * Maximum burst size for per-tenant rate limiting. Defaults to 50. */ rateLimitTenantBurst: number; /** * Enable endpoint forwarding: when a RecordsWrite/RecordsDelete is processed, * forward the original signed message to the tenant's other DWN service * endpoints (discovered via DID resolution). Disabled by default. */ forwardingEnabled: boolean; /** * Enable module-aware record delivery: when a RecordsWrite/RecordsDelete is * processed at a module path with `$delivery`, proactively deliver to * participants' DWN endpoints. Disabled by default. */ deliveryEnabled: boolean; /** * Maximum number of concurrent outbound delivery/forwarding requests. * Prevents unbounded parallelism when delivering to many providers. * Defaults to 10. */ deliveryMaxConcurrency: number; /** * TTL in seconds for caching DID document service endpoint resolution results. * Avoids resolving the same DID document on every delivery. Defaults to 300 (5 min). */ deliveryEndpointCacheTtlSeconds: number; /** * TTL in seconds for the recently-forwarded messageCid deduplication cache. * Messages with CIDs in this cache are not forwarded again, reducing redundant * outbound requests between peer endpoints. Defaults to 60. */ forwardingDeduplicationTtlSeconds: number; }; //# sourceMappingURL=config.d.ts.map