# Ali — two-repo Gitea workflow

Canonical layout per [FORGE_CANONICAL_REGISTRY.md](./FORGE_CANONICAL_REGISTRY.md).

## 1. Cursor Remote-SSH

Connect to **`dev-bis-ali`** → open **`/srv/projects/proxmox`** for ops docs and orchestration scripts.

## 2. Edit banking app code

Primary workspace: **`~/smom-dbis-138`**

```bash
cd ~/smom-dbis-138
git pull origin main
# edit frontend-dapp/, services/, config/, etc.
```

## 3. Build and run on dev VM (`.59`)

```bash
cd ~/smom-dbis-138
git pull origin main
bash scripts/deployment/deploy-omnl-bank-production.sh
bash scripts/deployment/deploy-omnl-domains.sh   # dev nginx only
```

Health checks:

```bash
curl -sf http://127.0.0.1:3011/api/v1/settlement/health | head -c 120
curl -sf http://127.0.0.1:3012/api/v1/exchange/health | head -c 120
curl -s -o /dev/null -w 'frontend=%{http_code}\n' http://127.0.0.1:3002/central-bank
```

## 4. Push to Gitea

```bash
cd ~/smom-dbis-138
git add -A
git commit -m "feat: your change"
git push origin main
```

Remote: `https://gitea.d-bis.org/d-bis/smom-dbis-138.git`  
Branch: **`main`**

## 5. Production banking LXCs (5820–5828)

First-time / after SSH config changes on dev-bis-ali:

```bash
bash scripts/deployment/setup-dev1-pve-ssh-access.sh
```

Operator sync from LAN (dev-bis-ali or Proxmox host with `pct`):

```bash
cd ~/smom-dbis-138
git pull origin main

# dry-run (default)
bash scripts/deployment/sync-ali-omnl-banking-portal-lxcs.sh

# deploy all nine LXCs
bash scripts/deployment/sync-ali-omnl-banking-portal-lxcs.sh --apply
```

Single LXC:

```bash
export OMNL_PCT_CTID=5825
bash scripts/deployment/deploy-omnl-banking-portal-pct.sh
```

## Env / secrets

| File | Contents |
|------|----------|
| `/srv/projects/proxmox/.env` | Proxmox, NPM, Cloudflare, Gitea tokens |
| `~/smom-dbis-138/.env` | `PRIVATE_KEY`, `RPC_URL_138`, `OMNL_API_KEY`, deploy keys |

Both: `chmod 600`

## Verify public endpoints

From operator machine:

```bash
pnpm ali:hospitallers:verify-external
```

Expected: **14/14** public endpoints passing (9 portal FQDNs + API health routes).

## Summary

| Layer | Repo | Deploy target |
|-------|------|---------------|
| Banking app | `smom-dbis-138` | `~/smom-dbis-138` (dev) → `/srv/ali-portal` (each LXC) |
| Ops / edge | `proxmox` | NPMplus, DNS, LXC map |

One monorepo, nine public URLs, same stack on every banking LXC.
