Cursor Cloud Environment
Single Go product (server on port :6060) plus CLI helpers under cmd/. Requires PostgreSQL + Redis. The update script only runs go mod download; everything below must be done per session because it is not part of the update script.
Start services each session (systemd is unavailable)
sudo pg_ctlcluster 16 main start # PostgreSQL 16 (data + role/db persist in snapshot)
sudo redis-server --daemonize yes --save "" --requirepass flowbot # password MUST match flowbot.yaml
DB role/database are flowbot/flowbot (password flowbot, superuser). Recreate only if missing:
sudo -u postgres psql -c "CREATE ROLE flowbot LOGIN PASSWORD 'flowbot' SUPERUSER;" -c "CREATE DATABASE flowbot OWNER flowbot;"
Ent auto-migrates on server startup, so no manual migration step is needed.
Config (flowbot.yaml, gitignored, already present at repo root)
Non-obvious validation gotchas (see pkg/config/config.go tags / validate.go) when deriving config from docs/reference/config.yaml:
redis.urlmust include a non-empty password (e.g.redis://:flowbot@127.0.0.1:6379/0), so Redis is run with--requirepass flowbot.- Platform
required_if=Enabled trueis not uniform: Discord requires app/client/bot credentials; Tailchat requiresapi_url. Slack and Telegram do not fail validation with empty tokens — still set unused platforms toenabled: falsein Cloud. GET /metricsrequiresmetrics.bearer_tokenor an access token withadmin:metrics/admin:*scope./service/{capability}/*(after Authorize) requires a minimum scope (service:{capability}:read|write, orpipeline:*for/service/web/pipelines, orhub:capabilities:readfor/service/hub). Tokens with empty scopes are rejected. Web login still issuesadmin:*.platform.tailchat.webhook_tokenis required when Tailchat is enabled (headerX-Tailchat-Token).vendors.memos.webhook_tokenis required for Memos webhooks (?token=query); empty config rejects deliveries like other providers.- Prefer
metrics.enabled: falsewhen VictoriaMetrics is not running; leaving it on is harmless except push errors. http.cors.allow_originsdefaults empty (no CORS reflection);["*"]never enables credentials. HSTS is sent whenhttp.tls_behind_proxyormodules.web.auth.cookie_secureis true.- Local DSN:
postgres.dsn→postgres://flowbot:flowbot@localhost/flowbot?sslmode=disable. - Redis:
redis.url→redis://:flowbot@127.0.0.1:6379/0(password required in URL). - Legacy keys
store_configandredis.host/port/password/dbare rejected at load with a migration hint.
Run / build / lint / test
- Run dev server:
go tool task run(usesgo run -tags swagger ./cmd). Health:/livez,/readyz. Web UI:/service/web/login(credentials live in theweb_accountsdatabase after first setup or YAML migration; use/service/web/setupwhen no account exists). - Lint (
go tool task lint) includes a JS step (oxlint ./public);oxlintis installed globally via npm. If missing, runnpm install -g oxlint(npm prefix must point inside the nvm node dir, e.g.npm config set prefix "$HOME/.nvm/versions/node/v22.22.2", and that bin dir must be on PATH). - Unit tests (
go tool task test) pass without Docker and use the running Redis. go tool task test:specs(BDD) needs Docker/testcontainers, which is NOT installed here; install Docker first if you must run them. Without Docker, run unit tests and explicitly state that specs were not run.