# Project-specific configuration This repo (`ia_dev`) is intended to be used as a **git submodule** inside each project. Project-specific parameters are stored in `projects//conf.json` (e.g. `projects/lecoffreio/conf.json`). The `` is the project identifier and the name of the directory under `projects/`. ## Current project selection There is no longer a "slug" in the URL or path; the project **id** (directory name under `projects/`) is resolved by: **1. Mail ticketing** From the **To** address of an email: search all `projects/*/conf.json` for `tickets.authorized_emails.to` equal to that address (case-insensitive). The matching project directory name is the id. **2. API ai_working_help** The token is found by scanning as described above: traverse all projects and all envs, reading each `projects//.secrets//ia_token` and comparing its content (or content + env) to the Bearer token. The first match yields the project id and the env (e.g. `test`, `pprod`, `prod`). **3. Scripts / fallback** (when no request context) - **`MAIL_TO`** (env): same as (1), resolve id by email "to". - **`AI_AGENT_TOKEN`** (env): same as (2), resolve id (and env) by token; sets `PROJECT_SLUG` and `PROJECT_ENV`. - **`IA_PROJECT`** (env) - **`.ia_project`** at repository root (one line) - **`ai_project_id`** at repository root (one line). When `ia_dev` is a submodule, this file lives at the host repo root (parent of `ia_dev`). When running from a repo that has `ia_dev` as a submodule, the root is the parent repo; the script resolves `ia_dev` either as `./ia_dev` or `./deploy` (symlink to `ia_dev/deploy`). ## Schema One JSON file per project: `projects//conf.json` (e.g. `projects/lecoffreio/conf.json`). The `` is the directory name; the config file is always named `conf.json`. | Field | Required | Description | |-------|----------|-------------| | `name` | yes | Human-readable project name | | `project_path` | no | Relative path to project from ia_dev (e.g. `../lecoffre_ng_test`); used when running from ia_dev standalone | | `build_dirs` | no | List of directories (relative to repo root) where `npm run build` is run before push. If missing or empty, build check is skipped | | `version` | no | Version/bump configuration | | `version.package_json_paths` | no | List of paths (relative to repo root) to `package.json` files to update on bump | | `version.splash_app_name` | no | App name used in splash message template | | `mail` | no | Mail/imap bridge config | | `git` | no | Git hosting: `wiki_url`, `token_file` (path relative to repo root for token file). Ticketing URL is under `tickets`, not `git`. | | `tickets` | no | Ticketing: `ticketing_url` (Gitea issues URL), `authorized_emails` (`to`: alias or list of env-keyed objects, `from`: list of allowed sender addresses). **to** resolves the project id when processing mails. It may be a single string or a list of one object with env keys: `[{ "test": "AI..TEST@4nkweb.com", "pprod": "...", "prod": "..." }]`. Pattern: `AI..@4nkweb.com` (`project_id` and `env` may be uppercase). See projects/ia_dev/docs/TICKETS_SPOOL_FORMAT.md. | The API token for ai_working_help is **not** in conf.json. It is found by scanning all projects and all envs (as described above): each file `projects//.secrets//ia_token` is read and the Bearer is compared to the file content or to (file content + env). Token value is **base** + **env**; **env** is the environment name (test, pprod, prod), to be adapted per environment. The first match gives project id and env. ## Example (minimal) ```json { "name": "My App", "build_dirs": ["backend", "frontend"] } ``` ## Example (full) See `projects/lecoffreio/conf.json`.