Helper scripts, Makefile targets, and one-liners for common Velaris development and operations tasks.
| Command | Description |
|---|---|
bash setup-velaris.sh | First-time setup: run the wizard, install dependencies, provision the database, generate secrets, render .env, apply migrations. Its last two steps are optional and asked, never assumed: configure ufw (SSH + Studio only), and install the systemd units so Velaris survives a reboot. |
bash start-velaris.sh | Start everything in order: Docker infra > migrations > release manifest > Engine (127.0.0.1:8100) > Case Service (127.0.0.1:8201) > Analytics (:8202) > HxGraph (:8203) > HxMigrate (:8204) > Studio (:5173). Self-heals dependencies on the way up. Only Studio binds a public interface; refuses to run if systemd already owns the services. From v3.2.0 it starts in production mode by default: no auto-reload, Studio built and served by vite preview (the Vite development server is no longer exposed), service logs in the install’s own logs/ folder (owner-only, rotated at each start, five kept) instead of /tmp. --dev (or VELARIS_RUN_MODE=development) keeps the old auto-reload behaviour for development. |
bash stop-velaris.sh | Gracefully stop all Velaris services. |
bash update-velaris.sh | Pull a new version, re-resolve dependencies, and apply any new migrations. Takes a database backup first and aborts if it fails. On an install run by systemd it then re-applies the release manifest, rebuilds Studio and restarts the services (v3.1.0); if it cannot restart them it reports restart_required rather than success. From v3.1.2 an image that cannot be pulled is a warning rather than the end of the run; an update that stops records the step in .update-status; and running the script again finishes an interrupted update instead of reporting it as current. Script error logs are written to ~/.local/state/velaris/ (private to the install’s user) rather than /tmp; the service logs keep their /tmp/velaris-<service>.log names. |
bash update-velaris.sh --install-timer | Install the hourly update agent (velaris-update.timer). From v3.2.0 it also installs velaris-update.path, so an update approved in Studio starts within seconds rather than at the next hourly check, and only one updater runs at a time. Without it, “Update this environment” in Studio only records the approval — nothing applies it until you run update-velaris.sh --auto by hand. With auto_update: false the agent acts only on updates approved in Studio. From v3.1.2 setup-velaris.sh offers to install it on a new install. The agent runs without a terminal, so the install’s git remote must be HTTPS (or an SSH key with no passphrase). |
.venv/bin/python scripts/storage-migrate.py | Copy every document from the S3/MinIO bucket to the local document folder, byte for byte (v3.1.2). Safe to re-run; --verify compares without copying; --dest chooses the folder. Never deletes from the bucket and never edits .env — it prints the switch-over steps for you to take. |
bash deploy/systemd/refresh-after-update.sh | The finishing step of an update on a systemd install, runnable by hand: release manifest, Studio rebuild, service restart. Run it once after updating to v3.1.0, because that update is carried out by the older script. |
bash backup-velaris.sh | Take a backup and record it in the HxDR posture, in one command. From v3.2.0 a backup is one encrypted set per run (velaris-<host>-<time>-v<version>.tar.age): the database (a consistent dump with exact row counts), the documents, the .env, the OpenBao vault snapshot and a checksum manifest, encrypted to the install’s age key (VELARIS_BACKUP_AGE_RECIPIENT). Copied to VELARIS_BACKUP_PATH (a mounted disk or NAS) and/or VELARIS_BACKUP_S3_*, kept 7 daily / 4 weekly / 6 monthly, and proven by a weekly restore into a throwaway database. Without a key it does what it always did: a database-only dump, and says so. Options: --dir, --quiet, --test-restore, --ensure-key (give an install a key pair), --forget-private-key (after copying the private key off the server). Exit codes: 0 complete, 1 failed, 3 partial (a part is named as missing), 4 no off-box copy made, 5 the restore test failed. |
bash restore-velaris.sh <set> --key <file> [--start] | Restore an install from a backup set, then prove it (from v3.2.0). Decrypts with your private key and checks every file’s checksum; refuses a set from a newer Velaris, a different database family, a running platform, or an install already present unless --replace-existing (which takes a safety backup first). Restores the vault, .env, the database, Temporal’s in-flight workflows and the documents, checks row counts before anything starts and, with --start, the audit hash chains, documents and sign-in. --verify runs the checks on an install already started. |
sudo bash deploy/systemd/install-backup-timer.sh | Install the daily backup timer (02:00). setup-velaris.sh offers it on a new install; an update never turns it on. --remove takes it away. |
bash scripts/check-image-versions.sh | Read-only: lists every pinned container image beside the newest available version. Run monthly as part of a release; nothing is raised automatically. |
bash uninstall-velaris.sh | Remove the installation. Shreds OpenBao secrets rather than leaving them on disk. |
pg_dump. A dump taken by hand leaves no record, so the recovery posture reports no backup while backups are in fact being taken — wrong in the direction that teaches people to ignore the screen. backup-velaris.sh makes the record part of taking the backup.
# nightly at 02:00, keeping 30 days
0 2 * * * /opt/velaris/backup-velaris.sh --quiet --keep 30
| Target | Description |
|---|---|
make help | List every available target with its description. |
make install | Install all dependencies according to velaris.yaml. |
make infra-up / make infra-down | Start or stop the infrastructure your velaris.yaml selects. |
make engine-dev | Run the Velaris Flow Engine. |
make engine-worker | Run the Temporal worker. |
make test / make test-engine | Run all tests, or just the engine suite. |
make lint / make format | Lint or format all code. |
make clean | Clean build artifacts. |
make wizard | Re-run the setup wizard. |
make migrate or make seed. Migrations are applied by start-velaris.sh from plain SQL files, and the seed data ships inside those migrations. See Migrations.| Script | Description |
|---|---|
scripts/secrets-init.sh | Initialise the OpenBao secret store. |
scripts/secrets-push.sh | Write new or changed secrets into the store. This is how a secret enters the system — not by editing .env. |
scripts/secrets-render.sh | Regenerate .env from the store. Overwrites hand edits. |
scripts/secrets-unseal.sh | Unseal OpenBao after a restart. |
scripts/bao.sh | Thin wrapper around the OpenBao CLI with the local endpoint pre-configured. |
scripts/secure-docker-ports.sh | Bind published container ports to loopback. Docker bypasses UFW — a firewall rule alone does not protect a published port. |
scripts/security-scan.sh | Run the dependency and configuration security scan. |
0.0.0.0 is reachable from the internet even with UFW denying that port. Run secure-docker-ports.sh on any host reachable from an untrusted network.setup-velaris.sh offers to configure ufw before it finishes. It allows SSH first — a default-deny applied before that rule locks you out of your own server over the very session you are running setup in — then Studio on 5173/tcp, then denies everything else inbound. An already-active firewall is left exactly as you configured it; declining prints the commands instead of proceeding quietly.
sudo ufw allow OpenSSH sudo ufw allow 5173/tcp # Studio - the only public ingress sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw enable
The gateway (8200), the four API services (8201–8204) and the engine (8100) bind 127.0.0.1 and need no rule at all.
# Velaris Engine — loopback only; no auth of its own uv run uvicorn helix_engine.main:app --reload \ --host 127.0.0.1 --port 8100 --proxy-headers # Case Service — loopback 8201, fronted by the gateway on 8200 uv run uvicorn case_service.main:app --reload --proxy-headers \ --host 127.0.0.1 --port 8201 --app-dir services/case-service # The three services split out of it — same pattern, one port each uv run uvicorn analytics_service.main:app --reload --proxy-headers \ --host 127.0.0.1 --port 8202 --app-dir services/analytics-service uv run uvicorn hxgraph_service.main:app --reload --proxy-headers \ --host 127.0.0.1 --port 8203 --app-dir services/hxgraph-service uv run uvicorn hxmigrate_service.main:app --reload --proxy-headers \ --host 127.0.0.1 --port 8204 --app-dir services/hxmigrate-service # Studio cd studio && npm run dev
# Tail all service logs tail -f /tmp/velaris-*.log # Check all services healthy for port in 8100 8200; do echo -n "localhost:$port/health > " curl -s http://localhost:$port/health | jq .status done # Count open cases (requires token) curl -s "http://localhost:8200/api/v1/cases?status=open&per_page=1" \ -H "Authorization: Bearer $TOKEN" | jq .total # Re-sync HxGraph after schema changes curl -s -X POST http://localhost:8200/api/v1/graph/sync | jq . # Check graph report curl -s http://localhost:8200/api/v1/graph/report | head -30
# Get an access token and export it. Auth lives inside case-service, # reached through the gateway on :8200 — there is no separate auth service. export TOKEN=$(curl -s -X POST http://localhost:8200/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"username": "admin", "password": "'"$VELARIS_ADMIN_PASSWORD"'"}' \ | jq -r .access_token) # Verify it works curl -s http://localhost:8200/api/v1/auth/me \ -H "Authorization: Bearer $TOKEN" | jq .username
HxGraph is live and answers questions about the running platform — useful when you need to understand how modules relate before changing one.
# Ask a question in natural language curl -s -X POST http://localhost:8200/api/v1/graph/query \ -H "Content-Type: application/json" \ -d '{"question":"which case types have an SLA?"}' | jq . # Find the path between two concepts curl -s "http://localhost:8200/api/v1/graph/path?from=intake&to=escalation" | jq . # Explain a concept / find similar ones curl -s "http://localhost:8200/api/v1/graph/explain?concept=loopback" | jq . curl -s "http://localhost:8200/api/v1/graph/similar?concept=escalation" | jq . # What depends on this node? curl -s http://localhost:8200/api/v1/graph/nodes/<id>/impact | jq . # Re-sync after schema changes, then export curl -s -X POST http://localhost:8200/api/v1/graph/sync | jq . curl -s http://localhost:8200/api/v1/graph/export > graph.json
# 1. Create a case CASE_ID=$(curl -s -X POST http://localhost:8200/api/v1/cases \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"case_type_id":"support-request","title":"Test case","data":{"priority":"high"}}' \ | jq -r .id) echo "Created: $CASE_ID" # 2. Check current stage curl -s http://localhost:8200/api/v1/cases/$CASE_ID \ -H "Authorization: Bearer $TOKEN" | jq .current_stage_id # 3. Advance stage curl -s -X POST http://localhost:8200/api/v1/cases/$CASE_ID/advance \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"transition_id": "intake-to-review"}' | jq .status # 4. Close the case curl -s -X POST http://localhost:8200/api/v1/cases/$CASE_ID/close \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"resolution_note": "Issue resolved in test"}' | jq .status
npx tsc --noEmit in studio/ and make lint at the repo root, then confirm the Studio still loads at http://localhost:5173/. A missing Python import takes down the whole service, not just the file you edited./api/v1/<prefix> to studio/vite.config.ts before the catch-all proxy entry. Without it the browser 404s while curl against :8200 works — a confusing failure that has bitten several modules.