# DBAOps Sovereign™ — Customer deployment (production)

**RHOYLLE INNOVATION EMPIRE LLC** — checklist for paid / production installs.

**Deliverable definition:** **`PRODUCT.md`** (what the customer receives). **Release sign-off:** **`docs/RELEASE-GOLD.md`**.

**Automated pre-flight (replace “guarantee” with verified steps):**

- **`npm run verify:deploy`** — fast chain: Node syntax checks + API Jest tests (run from repository root before promote).
- **Optional:** `VERIFY_DEPLOY_MIGRATE_CHECK=true npm run verify:deploy` when `SOVEREIGN_DB_CONNECTION` is available — SQL reachability + `ctl.Servers` probe only (`migrate --check-only`, no schema changes).
- **Optional:** `VERIFY_DEPLOY_LIVE_API=https://your-api.example` (scheme + host + optional port **only** — script calls `/api/health`, `/api/openapi.json`, `/api/license`) — requires a running API.
- **After deploy:** `npm run verify:smoke` (or the live step above) against the reachable base URL.

## 1. Architecture (minimum)

| Tier | Role |
|------|------|
| SQL Server | Hosts **SovereignRepository** (schema via migrate) |
| API | Node.js **Express** (port **3041** default) |
| Dashboard | Static React build behind your web server or CDN |
| Collectors | PowerShell on managed SQL hosts → HTTPS to API |

Place a **reverse proxy / TLS terminator** (IIS, nginx, Azure App Gateway, etc.) in front of the API for HTTPS. Do not expose the Node process directly to the public internet.

## 2. Environment (required for production)

| Variable | Purpose |
|----------|---------|
| `NODE_ENV` | `production` — enables strict startup checks and safe error messages |
| `JWT_SECRET` | Long random secret — **required** in production (API will not start with the dev placeholder) |
| `SOVEREIGN_REQUIRE_AUTH` | **`true` or omit** (defaults **on** when `NODE_ENV=production`). **`false` / `0` is refused** — the API exits at startup (fail-closed). For a deliberately open API, use **`NODE_ENV=development`** only in a **closed** lab, never on the customer edge. |
| `SOVEREIGN_INGEST_KEY` | Shared secret for collectors (`X-Sovereign-Ingest-Key`) — **strongly recommended** |
| `SOVEREIGN_DB_CONNECTION` | Connection string to **SovereignRepository** |
| `SOVEREIGN_DB_ENCRYPT` | `true` when SQL requires encryption (e.g. Azure SQL) |
| `SOVEREIGN_REQUIRE_DATABASE` | `true` for orchestrators using `/api/health/ready` |
| `CORS_ORIGIN` | Your dashboard origin(s), e.g. `https://fleet.customer.com` |

**SQL connection (Windows Integrated Authentication):** On **Windows**, `Trusted_Connection=Yes` uses the **`msnodesqlv8`** driver (installed with `src/api` dependencies). The default **tedious** driver cannot perform Windows SSO from Node.js. On **Linux/macOS**, use **SQL authentication** (`User Id` / `Password`) or run the API on Windows. After changing `.env`, run **`npm run migrate`** from the repo root.

Optional:

| Variable | Default | Notes |
|----------|---------|--------|
| `SOVEREIGN_ENFORCE_LICENSE` | on | Set `false` only for internal QA. When on, **mutations** are blocked if license is expired/inactive/over limit (GET remains for dashboards). |

## 3. License (`ctl.License`)

- Seed or insert an active row: edition, **InstancesAllowed**, **ExpiresAt**, **IsActive**.
- Use **`GET /api/license`** for posture: `OK` | `EXPIRED` | `LIMIT_REACHED` | `INACTIVE`.
- **Fleet register** and **license gate** enforce limits for paying deployments.

## 4. Migrate & run

1. Run **`npm run migrate`** (or `scripts/migrate.ps1`) against SQL with `SOVEREIGN_DB_CONNECTION` set.
2. Start API: `node server.js` from `src/api` or use **Docker** (see `docker-compose.yml` — API-only; **all-in-one** pilot defaults to `NODE_ENV=development`; set `NODE_ENV=production` and secrets for production parity).
3. Serve dashboard `build/` with static hosting; set **`REACT_APP_API_BASE`** (or your build’s env) to the public API URL.

## 5. Commercial support

- **Product**: DBAOps Sovereign™ · **DBAOps™** Serial No. 99717776  
- **Vendor**: RHOYLLE INNOVATION EMPIRE LLC  
- Contract-specific support channels and SLAs are defined in your **order form / MSA** — not in this repository.

## 6. Contract surface

- **API contract**: `GET /api/openapi.json` (OpenAPI 3.0.3).
- **Health**: `GET /api/health` (liveness), `GET /api/health/ready` (readiness + SQL probe).

---

© 2026 RHOYLLE INNOVATION EMPIRE LLC.
