ia_dev/lib/README.md
2026-03-16 16:33:52 +01:00

16 lines
1000 B
Markdown

# ia_dev shared lib
## project_config.sh
Sourced by deploy scripts and gitea-issues to resolve the current project **id** and the path to its JSON config.
**Standalone usage:** scripts are run from ia_dev root. Source after setting `IA_DEV_ROOT` (path to ia_dev); `PROJECT_ROOT` is derived by scripts when needed from config (e.g. project_path in conf.json).
**After sourcing:** `PROJECT_SLUG` and `PROJECT_CONFIG_PATH` are set (and exported). Config path is `projects/<id>/conf.json`. For token-based resolution, `PROJECT_ENV` is also set.
**Project id resolution (no fallback):**
1. **MAIL_TO** (env): search all `projects/*/conf.json` for `tickets.authorized_emails.to` matching this address (string or list of env-keyed objects). The matching project directory name is the id.
2. **AI_AGENT_TOKEN** (env): search all `projects/<id>/.secrets/<env>/ia_token` for matching token; sets `PROJECT_SLUG` and `PROJECT_ENV` (project and environment).
See `projects/README.md` for the config schema.