feat(api): absorb the Hub control plane into the local instance model
Add central notification channels, rules, queue and delivery logs, fleet organization groups and tags, device discovery, the device action catalog, instance module reads, the log centre, connection settings and system maintenance as native /api/v1 routes backed by the existing secret store, audit trail and pinned upstream transport.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { isAbsolute } from 'node:path';
|
||||
import { dirname, isAbsolute, join } from 'node:path';
|
||||
import {
|
||||
buildControlPlaneApp,
|
||||
type ControlPlaneApp,
|
||||
@@ -18,8 +18,11 @@ export interface ProductionControlPlaneOptions {
|
||||
readonly gatewayToken?: string;
|
||||
readonly keychainMetadataCheck?: () => boolean | Promise<boolean>;
|
||||
readonly assetsCheck?: () => boolean | Promise<boolean>;
|
||||
readonly runtimeVersion?: string;
|
||||
readonly recoveryMarkersCheck?: () => number | Promise<number>;
|
||||
readonly upstreamGatewayCheck?: () => boolean | Promise<boolean>;
|
||||
/** Production keeps device online state fresh on its own; tests and canaries can opt out. */
|
||||
readonly heartbeatEnabled?: boolean;
|
||||
}
|
||||
|
||||
export function buildProductionControlPlane(
|
||||
@@ -40,6 +43,9 @@ export function buildProductionControlPlane(
|
||||
db,
|
||||
store,
|
||||
upstream: options.upstream ?? createProductionUpstream(),
|
||||
runtimeVersion: options.runtimeVersion ?? '0.1.0',
|
||||
backupDirectory: join(dirname(options.databasePath), 'backups'),
|
||||
heartbeatEnabled: options.heartbeatEnabled ?? true,
|
||||
// This route-local decision is safe only in this composition: when a token is
|
||||
// configured, buildApp's global onRequest hook rejects the request first.
|
||||
// Keep all other control-plane compositions fail-closed by default.
|
||||
|
||||
Reference in New Issue
Block a user