Skip to main content

Environment Variables

This page documents the remaining FLUXAOS_* environment variables. Runtime deploy paths and cleanup policy are no longer env-backed: FLX-221..224 moved them into project / config_entry database rows.

Set env vars in .env (committed, non-secret defaults) or .env.local (gitignored secrets and local overrides). Core services read FLUXAOS_INIT_RESULT_DOC_SCRIPT and FLUXAOS_INGEST_RESULT_DOC_SCRIPT through FluxaosConfig (src/config/env.ts); the daemon, CLI, auth bypass, GitHub adapter, and tests read their own process env directly.

Daemon — required

VariableTypeDefaultPurpose
FLUXAOS_DAEMON_SHUTDOWN_GRACE_SECONDSpositive integernone (required)Seconds to wait for in-flight stage runs to drain after SIGTERM. The daemon refuses to start without it.

Pipeline result documents

VariableTypeDefaultPurpose
FLUXAOS_INIT_RESULT_DOC_SCRIPTpathnone (required)Path to the init-result-doc script invoked via node. Canonical production value: .next/daemon/init-result-doc.mjs. Boot fails fast if unset (FLX-212).
FLUXAOS_INGEST_RESULT_DOC_SCRIPTpathnone (required)Path to the ingest-result-doc script invoked via node. Canonical production value: .next/daemon/ingest-result-doc.mjs. Boot fails fast if unset (FLX-212).

Deploy credentials

VariableTypeDefaultPurpose
FLUXAOS_GITHUB_TOKENtokennoneGitHub PAT with repo scope. The deploy bridge fails fast when it needs to open a PR and this is unset.

Daemon recovery

VariableTypeDefaultPurpose
FLUXAOS_DAEMON_RECOVERY_SWEEP_INTERVAL_MINpositive integernone (optional)If set, the daemon runs crash recovery every N minutes. If unset, only the startup sweep runs.

CLI

VariableTypeDefaultPurpose
FLUXAOS_API_URLURLnoneFull tRPC endpoint used by npm run cli -- <command>, e.g. http://localhost:3004/api/trpc.
FLUXAOS_CLI_PROJECT_IDUUIDnoneProject UUID targeted by the CLI (tenancy slugs were dropped in FLX-239 Stage 8 — UUIDs are the only addressing scheme). The seeded project is 00000000-0000-4000-8000-000000000001.

Development / testing

VariableTypeDefaultPurpose
FLUXAOS_TEST_TARGET_REPOstringnoneowner/repo that deploy-touching e2e journey tests open PRs against. Specs skip cleanly when unset.
FLUXAOS_TARGET_REPO_PATHpathnoneLegacy/test-only local checkout path still consumed by older deploy-touching e2e specs. Not a runtime fallback; real stage acquisition reads project.target_repo_path from the database.
FLUXAOS_LAN_AUTH_BYPASS1noneHomelab-only auth bypass for local/LAN Playwright and CLI usage. Never set on an internet-reachable host.

DB-backed runtime config, not env

These names are the runtime source of truth after FLX-221..224:

DB key / columnWhere it livesPurpose
project.target_repo_pathproject tablePer-project absolute path to a local target-repo clone on main; NULL makes stage acquisition fail fast with MissingProjectTargetRepoPathError.
runtime.workspace_rootglobal config_entry rowOptional worktree root override. Seeded value null means use <repo>/.fluxaos-worktrees/.
runtime.artifacts_rootglobal config_entry rowOptional artifact root override. Seeded value null means use <repo>/.fluxaos-artifacts/.
cleanup.sweep_interval_minglobal config_entry rowCleanup scheduler cadence.
cleanup.stale_daysglobal config_entry rowWorktree stale threshold.
cleanup.session_retention_daysglobal config_entry rowTerminal session retention.
cleanup.artifacts_retention_daysglobal config_entry rowArtifact directory retention.
cleanup.scheduler_enabledglobal config_entry rowBoolean boot gate; restart the daemon after changing it.

The old env names FLUXAOS_WORKSPACE_ROOT, FLUXAOS_ARTIFACTS_ROOT, and FLUXAOS_CLEANUP_* are retired. If they appear in local templates or tests, they are compatibility scaffolding only; do not document or use them as operator configuration.