/** * Admin API Handler * Provides configuration management, restart functionality, and log streaming */ import type { ApiServer } from '../ApiServer'; import type { AuthenticatedRequest } from '../middleware/AuthMiddleware'; import type { DdnsManager } from '../../edge/DdnsManager'; interface EnvConfig { [key: string]: string; } export interface SanitizedEnvRead { env: EnvConfig; secrets: Record; } export declare const ALLOWED_ADMIN_CONFIG_KEYS: readonly ["XPOD_DEPLOY_MODE", "CSS_ROOT_FILE_PATH", "CSS_BASE_URL", "XPOD_TUNNEL_PROVIDER", "XPOD_TUNNEL_ACTIVE_PROFILE_ID", "XPOD_TUNNEL_PROFILES", "XPOD_TUNNEL_PUBLIC_URL", "XPOD_DNS_DOMAIN", "XPOD_DDNS_ENABLED", "XPOD_DNS_PROVIDER", "XPOD_DNS_RECORD_TTL", "XPOD_DNS_PROVIDER_TOKEN", "CLOUDFLARE_API_TOKEN", "CLOUDFLARE_TUNNEL_URL", "SAKURA_TUNNEL_URL", "CLOUDFLARE_TUNNEL_TOKEN", "SAKURA_TUNNEL_TOKEN", "NGROK_AUTHTOKEN", "NGROK_URL", "FRP_TUNNEL_TOKEN", "FRP_TUNNEL_URL", "XPOD_HTTPS_MODE", "XPOD_HTTPS_CERT_PATH", "XPOD_HTTPS_KEY_PATH", "XPOD_ACME_EMAIL", "XPOD_ACME_DOMAINS", "XPOD_ACME_RENEW_BEFORE_DAYS", "XPOD_P2P_ENABLED", "XPOD_P2P_SIGNAL_SERVICE", "XPOD_P2P_FALLBACK_POLICY", "XPOD_PUBLIC_API_URL", "XPOD_PUBLIC_REGISTRY_URL", "CSS_ALLOWED_HOSTS", "CSS_BASE_STORAGE_DOMAIN", "CSS_CLUSTER_INGRESS_DOMAIN", "XPOD_NODE_ID", "XPOD_SP_DOMAIN", "XPOD_NODE_TOKEN", "XPOD_SERVICE_TOKEN", "CSS_PORT", "CSS_SPARQL_ENDPOINT", "CSS_IDENTITY_DB_URL", "CSS_LOGGING_LEVEL", "CSS_SHOW_STACK_TRACE"]; export declare function isAdminSecretEnvKey(key: string): boolean; export declare function sanitizeEnvForRead(env: EnvConfig): SanitizedEnvRead; export declare function createAllowedAdminConfigPatch(input: EnvConfig): EnvConfig; export declare function sanitizeLogMessage(message: string, env: EnvConfig): string; export interface AdminAuthorizerOptions { internalAdminAuthSecret?: string; } export declare function isAdminMutationAllowed(req: AuthenticatedRequest, options?: AdminAuthorizerOptions): boolean; export declare function createAdminServicesCapabilities(req: AuthenticatedRequest, options?: AdminAuthorizerOptions): { services: { lifecycle: { restart: { supported: boolean; reason?: string; }; }; configuration: { write: { supported: boolean; reason?: string; }; }; }; }; export declare function readDurableAdminEnvironment(): Record; /** * Tunnel profiles exactly as the runtime resolved them. * * `credentialEnvKey` is the profile-scoped key when one is configured, so a caller can * write a secret where the runtime will actually read it. */ export declare function projectTunnelProfiles(): Array<{ id: string; provider: string; label?: string; publicUrl?: string; credentialEnvKey?: string; credentialConfigured: boolean; active: boolean; parameters?: Record; }>; export declare function writeDurableAdminEnvironmentPatch(input: Record, removals?: string[]): void; /** * Why a coordinated public domain cannot be served, or `null` when nothing * rules it out. * * A domain issued in tunnel mode is published by the configured tunnel, so a * node that reports tunnel mode with no provider has a route that nothing * serves. This is the one reachability fact the runtime can establish locally; * everything else about a domain can only be confirmed from outside. */ export declare function describeUnservedPublicRoute(ddnsManager?: Pick): string | null; export interface AdminRoutesOptions extends AdminAuthorizerOptions { /** Reads the coordinated-public-route state without which reachability is unknowable. */ ddnsManager?: Pick; } export declare function registerAdminRoutes(server: ApiServer, options?: AdminRoutesOptions): void; export {};