From 6bc1b6fb19de9615fe643728d7cb0b276d09dd29 Mon Sep 17 00:00:00 2001 From: Andrii Arsenin Date: Wed, 30 Sep 2026 21:23:18 +0300 Subject: [PATCH] chore: make .env optional and comment out all example settings - load .env in compose only when it exists; every setting has a default - comment out every setting in .env.example, with ## for descriptions and # VAR=default for settings to uncomment - update README, development docs and CLAUDE.md accordingly --- .env.example | 55 ++++++++++++++++++++++++--------------------- CLAUDE.md | 2 +- README.md | 3 ++- compose.yaml | 4 +++- docs/development.md | 2 +- 5 files changed, 37 insertions(+), 29 deletions(-) diff --git a/.env.example b/.env.example index ad8dff1..c278fd2 100644 --- a/.env.example +++ b/.env.example @@ -1,30 +1,35 @@ -NODE_ENV=development -PORT=3000 +## Optional overrides: copy to .env and uncomment the settings you need. +## Every setting has a default (shown below), so liqa runs without a .env file. +## +## Lines starting with "##" are descriptions. +## Lines starting with "# " are settings: remove the "# " to enable one. -# SQLite database path -DB_PATH=data/liqa.db +# NODE_ENV=development +# PORT=3000 -# Stored scenario files and run artifacts (downloads, failure dumps, traces) -FILES_DIR=data/files -# Days to keep run artifacts before they are deleted -FILE_RUN_EXPIRATION_DAYS=7 -# When expired files are deleted (cron expression) -FILE_CLEANUP_CRON=0 3 * * * +## SQLite database path +# DB_PATH=data/liqa.db -# Chromium binary to use instead of Playwright's own (not needed in Docker, -# which ships Playwright's chromium-headless-shell) +## Stored scenario files and run artifacts (downloads, failure dumps, traces) +# FILES_DIR=data/files +## Days to keep run artifacts before they are deleted +# FILE_RUN_EXPIRATION_DAYS=7 +## When expired files are deleted (cron expression) +# FILE_CLEANUP_CRON=0 3 * * * + +## Close open sessions that have been idle for longer than this many minutes +# SESSION_IDLE_TIMEOUT_MINUTES=30 +## Delete closed sessions whose updatedAt is older than this many days +# SESSION_DELETE_CLOSED_DAYS=7 + +## Playwright trace recording for scenario runs: on | retain-on-failure | off +## (traces often reach ~10 MB per run; can be overridden per run in the run modal) +# PLAYWRIGHT_TRACE_MODE=off + +## Chromium binary to use instead of Playwright's own (not needed in Docker, +## which ships Playwright's chromium-headless-shell) # PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium -# Session lifecycle -# Close open sessions that have been idle for longer than this many minutes -SESSION_IDLE_TIMEOUT_MINUTES=30 -# Delete closed sessions whose updatedAt is older than this many days -SESSION_DELETE_CLOSED_DAYS=7 - -# Playwright trace recording for scenario runs: on | retain-on-failure | off -# (traces often reach ~10 MB per run; can be overridden per run in the run modal) -PLAYWRIGHT_TRACE_MODE=off - -# Directory with the built client to serve at / (set to "client" in the Docker image; -# leave empty to not serve the UI, e.g. when using the Vite dev server) -# CLIENT_DIR= +## Directory with the built client to serve at / (the Docker image sets it to +## "client"; leave unset to not serve the UI, e.g. when using the Vite dev server) +# CLIENT_DIR=client diff --git a/CLAUDE.md b/CLAUDE.md index e6964d0..5730abe 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -20,7 +20,7 @@ It is an npm workspace with two packages: ## Default deployment (docker compose) -`compose.yaml` at the repo root runs a single `liqa` container, built from the root `Dockerfile`, at http://localhost:13000. The server serves everything: the UI at `/` (the built client, via `CLIENT_DIR`), the REST API at `/api/v1`, MCP at `/mcp`, Swagger at `/docs`. It reads `.env` and mounts `./data` (SQLite DB `data/liqa.db` + stored files). +`compose.yaml` at the repo root runs a single `liqa` container, built from the root `Dockerfile`, at http://localhost:13000. The server serves everything: the UI at `/` (the built client, via `CLIENT_DIR`), the REST API at `/api/v1`, MCP at `/mcp`, Swagger at `/docs`. It reads `.env` if present (optional - every setting has a default) and mounts `./data` (SQLite DB `data/liqa.db` + stored files). Rebuild and restart: `docker compose up -d --build`. Check with `docker compose ps`, `curl localhost:13000/health` and `docker compose logs liqa`. diff --git a/README.md b/README.md index 4d09adc..e7d7fbe 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,11 @@ A browser automation and QA service for web applications. It stores multi-step b ## Quick start ```bash -cp .env.example .env docker compose up -d --build ``` +No configuration is needed: every setting has a default. To override one, copy `.env.example` to `.env` and uncomment it. + Everything is served from one container at **http://localhost:13000**: the UI at `/`, the REST API at `/api/v1`, MCP at `/mcp`, Swagger at `/docs`. Data is kept in `./data/`. --- diff --git a/compose.yaml b/compose.yaml index b9a084f..a62a881 100644 --- a/compose.yaml +++ b/compose.yaml @@ -5,8 +5,10 @@ services: ports: # UI, REST API (/api/v1), MCP (/mcp) and Swagger (/docs) - "13000:3000" + # Optional overrides (see .env.example); every setting has a default env_file: - - .env + - path: .env + required: false volumes: # persist SQLite database across restarts - ./data:/app/data diff --git a/docs/development.md b/docs/development.md index 48293eb..19646be 100644 --- a/docs/development.md +++ b/docs/development.md @@ -19,7 +19,7 @@ npm install npx playwright install --only-shell chromium # first time only: headless Chromium for the server ``` -Copy `.env.example` to `.env` and fill in the required values before running. +No `.env` is needed: every setting below has a default. To override settings, copy `.env.example` to `.env` and uncomment the ones you need. Docker Compose loads `.env` when it exists. ### Environment variables (server)