Skip to content

Configuration & Environment Variables ​

The @nogoo9/no-crd server and CLI utility are configurable using standard command-line flags or environment variables. This guide covers the boot verification process and details all configurable parameters.


🚦 Service Startup Sequence ​

When you boot the nogoo9-no-crd server, the service executes a startup verification flow to validate configuration parameters and block bad traffic before reporting health status:

Detailed Startup Steps: ​

  1. Polyfill & Validation: Global polyfills (such as Buffer) are loaded first for Deno/Node compatibility. If authentication is enabled (AUTH_ENABLED=true), the OIDC URL configurations are validated.
  2. Logging Initialization: Configures LogTape logger sinks. If utilizing the stdio transport, the console logging outputs are suppressed (console.log = () => {}) to preserve stdin/stdout protocol integrity.
  3. Eager Kubernetes Connectivity Check: Probes the Kubernetes API server using a listNamespacedPod request (with limit: 1). If the connection is refused or the API is unreachable, the server exits immediately with actionable hints.
  4. Eager MCP Tool Registration Validation: Constructs a throwaway MCP server instance to verify that the pod's RBAC service account holds the required permissions to list resources and register tools.
  5. Fastify Server Binding: Binds the HTTP/HTTPS listeners to the designated host and port.
  6. Eager Session Key Resolution: Initiates the session key negotiation/resolution cascade (resolveSessionSecret()):
    • Reads environment variables (PROXY_SESSION_SECRET / JWT_SECRET).
    • Attempts to read or create a Kubernetes Secret (nogoo9-session-key).
    • Queries sibling pods via /internal/session-key if RBAC writes are disabled.
    • Generates a random key in-memory as a fallback.
  7. Liveness & Readiness Block: Until the session key is resolved, /healthz and /mcp/healthz endpoints will respond with 503 Service Unavailable. This blocks Kubernetes ingress traffic from routing to the booting pod until it has successfully aligned on the session key.

βš™οΈ Configuration Variables ​

πŸ”Œ Server Configuration ​

CLI OptionEnvironment VariableDefaultAllowed ValuesDescription
-t, --transportTRANSPORThttphttp, stdio, bothServer transport mode. both fires up both transports simultaneously.
-p, --portPORT3000NumberHTTP server port for SSE transport.
-H, --hostHOST0.0.0.0StringHost interface to bind the HTTP/SSE server to.
--base-urlBASE_URL""Path stringBase URL path prefix for hosting behind a reverse proxy (e.g. /gateway/no-crd).
-STATELESSfalsetrue, falseEnable stateless request handling (no session affinity).
-l, --log-levelLOG_LEVELinfodebug, info, warning, error, fatalLogging verbosity filter.
-LOG_FILEnogoo9-mcp.logStringOutput file path for file logging.
-RATE_LIMIT_MAX100NumberMaximum requests allowed per window for rate limited routes.
-RATE_LIMIT_WINDOW60000NumberTime window in milliseconds for rate limited routes.
--proxy-timeoutPROXY_TIMEOUT120000NumberTimeout in milliseconds for the routing proxy upstream requests.
--proxy-keep-alivePROXY_KEEP_ALIVEtruetrue, falseEnable TCP keep-alive for the routing proxy upstream requests.

πŸ”’ TLS Configuration ​

CLI OptionEnvironment VariableDefaultAllowed ValuesDescription
--tls-certTLS_CERT-Path stringPath to TLS certificate file to enable HTTPS.
--tls-keyTLS_KEY-Path stringPath to TLS private key file to enable HTTPS.
--tls-caTLS_CA-Path stringPath to TLS CA certificate file for HTTPS client/verification.
-NODE_TLS_REJECT_UNAUTHORIZEDtrue0 (false), 1 (true)Set to 0 to bypass TLS verification (for development/testing only).

🌐 CORS Configuration ​

CLI OptionEnvironment VariableDefaultAllowed ValuesDescription
--cors-originCORS_ALLOWED_ORIGIN, CORS_ORIGIN*StringCORS Allowed Origin header.
--cors-methodsCORS_ALLOWED_METHODS, CORS_METHODSGET, POST, OPTIONSStringCORS Allowed Methods header.
--cors-headersCORS_ALLOWED_HEADERS, CORS_HEADERSContent-Type, Authorization, mcp-protocol-version, mcp-session-idStringCORS Allowed Headers header.
--cors-allow-credentialsCORS_ALLOW_CREDENTIALS, CORS_CREDENTIALSfalsetrue, falseEnable CORS Access-Control-Allow-Credentials header.
--cors-expose-headersCORS_EXPOSED_HEADERS, CORS_EXPOSEDmcp-session-id, x-refreshed-tokenStringCustom CORS Access-Control-Expose-Headers header.
--cors-max-ageCORS_MAX_AGE-NumberCustom CORS Access-Control-Max-Age header in seconds.

☸️ Kubernetes Configuration ​

CLI OptionEnvironment VariableDefaultAllowed ValuesDescription
-m, --modeMODEclustercluster, namespacedKubernetes access scope. namespaced locks operations to a single namespace.
-n, --namespaceNAMESPACE, DEFAULT_NAMESPACEnogoo9StringDefault Kubernetes namespace for operations.
--disable-permission-checksDISABLE_PERMISSION_CHECKSfalsetrue, falseDisable Kubernetes RBAC permission checks and assume all tools are enabled.
--managed-onlyMANAGED_ONLYtruetrue, falseWhen true, pod tools only operate on pods managed by this server (nogoo9/managed-by label). No one bypasses this, not even admins. See ADR-008.
--default-workspace-portDEFAULT_WORKSPACE_PORT-NumberDefault target port inside the workspace pods to proxy traffic to.
-REGISTRY_URL-URL stringTarget container registry URL to query for images (e.g. http://localhost:5001).
-TEMPLATES_DIR-Path stringPath to local directory containing pod template files (YAML/JSON). See ADR-001.
-BUILTIN_TEMPLATEStruetrue, falseSet to false to disable built-in templates shipped with the package.

πŸ”‘ Authentication Configuration ​

CLI OptionEnvironment VariableDefaultAllowed ValuesDescription
--auth-enabledAUTH_ENABLEDfalsetrue, falseEnables JWT token authentication on MCP tools and route proxy.
-JWT_VERIFICATION_REQUIREDtruetrue, falseEnable/disable JWT signature verification (signature checks).
-JWT_SECRET-StringSymmetric HMAC-SHA256 secret for token verification.
-JWT_PUBLIC_KEY-StringPEM encoded RSA/ECDSA public key for asymmetric token verification.
-JWKS_URI-URL stringRemote JWKS endpoint URL to dynamically retrieve verification keys.
-INTROSPECTION_ENDPOINT, JWT_INTROSPECTION_ENDPOINT-URL stringEndpoint for token introspection/validation.
-OAUTH_CLIENT_ID-StringOAuth client ID for auth configuration.
-OAUTH_CLIENT_SECRET-StringOAuth client secret for auth configuration.
-JWT_AUDIENCE-StringExpected token audience. Falls back to OAUTH_CLIENT_ID if set.
-AUTH_ISSUER, JWT_ISSUER""URL stringIdentifier URL for the Authorization Server advertised in metadata discovery.
-AUTH_SUB_JSONPATH$.subJSONPathPayload path to extract unique user identity from JWT payload.
--auth-scope-jsonpathAUTH_SCOPE_JSONPATH$.scopeJSONPathPayload path to extract scopes claim from JWT payload.
--auth-roles-jsonpathAUTH_ROLES_JSONPATH, AUTH_ADMIN_JSONPATH$.realm_access.rolesJSONPathPayload path to extract user roles from JWT payload.
-AUTH_ADMIN_ROLEadminStringRole name signifying administrator access.
--auth-required-read-scopeAUTH_REQUIRED_READ_SCOPEnogoo9:readStringOAuth scope required for read operations. If not set, read scope check is bypassed.
--auth-required-write-scopeAUTH_REQUIRED_WRITE_SCOPEnogoo9:writeStringOAuth scope required for write/mutation operations. If not set, write scope check is bypassed.
--auth-required-admin-scopeAUTH_REQUIRED_ADMIN_SCOPEnogoo9:adminStringOAuth scope required for administrator operations. If not set, admin scope check is bypassed.
--auth-required-read-roleAUTH_REQUIRED_READ_ROLEviewerStringUser role required for read operations. If not set, read role check is bypassed.
--auth-required-write-roleAUTH_REQUIRED_WRITE_ROLEuserStringUser role required for write/mutation operations. If not set, write role check is bypassed.
-PROXY_SESSION_TTL1800NumberSession cookie expiration lifetime in seconds (sliding window duration).
-PROXY_REFRESH_COOKIE_TTL604800NumberDefault Max-Age for the encrypted refresh token cookie (nocr_refresh). Overridden by the IdP's refresh_expires_in when available.
-PROXY_TOKEN_COOKIE_TTL86400NumberDefault Max-Age for the access token cookie (nocr_token). Overridden by the JWT exp claim when available.
-PROXY_SESSION_SECRET""StringHMAC secret key used to sign stateless session cookies. Falls back to JWT_SECRET if not configured.
-OAUTH_SCOPESopenid profile email offline_accessSpace-separated scope stringOAuth scopes to request during authorization. Include 'offline_access' for refresh tokens.
-OAUTH_AUTHORIZATION_URL-URL stringDirect OAuth authorization URL.
-OAUTH_SERVER_DISCOVERY_URL, OAUTH_DISCOVERY_URL-URL stringDiscovery URL for the OAuth server used by the backend gateway. Falls back to OAUTH_DISCOVERY_URL.
-OAUTH_SERVER_TOKEN_URL, OAUTH_TOKEN_URL-URL stringDirect OAuth token exchange endpoint for the backend server.
-OAUTH_END_SESSION_URL-URL stringDirect OAuth logout endpoint.
--auth-inject-workspace-jwtAUTH_INJECT_WORKSPACE_JWTtruetrue, falseDetermines if the custom 'x-workspace-jwt' header containing the raw token is injected into proxy requests.
-AUTH_DEFAULT_ROLEviewerStringFallback role if the token does not provide scopes/roles.

πŸ–₯️ UI & Themes Configuration ​

CLI OptionEnvironment VariableDefaultAllowed ValuesDescription
-UI_ENABLEDtruetrue, falseEnables the embedded HTML Pod Manager UI resource.
-THEMES_DIRthemesPath stringLocal directory path containing custom CSS UI themes.
-THEMES_CONFIGMAP-StringName of Kubernetes ConfigMap containing custom UI theme configurations.
-DOCS_DIR/app/docs (Docker) or docs/.vitepress/dist (Local)Path stringBase directory from which static documentation files are served.
-OAUTH_DISCOVERY_URL""URL stringDiscovery URL for the OAuth authorization server used by the UI client.
-OAUTH_CLIENT_ID""StringOAuth client ID for UI authorization.
-OAUTH_LOGIN_METHODredirectredirect, popupLogin interaction mode for UI OAuth client.
-UI_TITLEnogoo9 Pod ManagerStringCustom title shown in the dashboard header.
-UI_SUBTITLEOn-demand Kubernetes pod orchestration and agent-sandbox management without CRDs.StringCustom subtitle shown below the dashboard title.