111 lines
3.8 KiB
Markdown
111 lines
3.8 KiB
Markdown
|
|
# Ouroboros nginx + UI fix — 2026-06-03
|
||
|
|
|
||
|
|
**Agent:** Loke (subagent)
|
||
|
|
**Tid:** 2026-06-03
|
||
|
|
**Status:** ✅ Alla filer förberedda — kräver root-körning av apply.sh för aktivering
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## DEL 1: nginx-config
|
||
|
|
|
||
|
|
### Ändringar
|
||
|
|
| Route | Gammal port | Ny port | Kommentar |
|
||
|
|
|-------|-------------|---------|-----------|
|
||
|
|
| `/api/v1/` | 3900 | **3253** | ouroboros-orchestration som faktiskt kör |
|
||
|
|
| `/api/analytics/` | — | **3210** | Ny location tillagd |
|
||
|
|
|
||
|
|
Alla andra portar bibehålls (3105, 4011, 4002, 4003, 4004, 4005).
|
||
|
|
|
||
|
|
### Pending location
|
||
|
|
```
|
||
|
|
/home/bernt/.openclaw/workspace/nginx-pending/ouroboros.wavult.com
|
||
|
|
```
|
||
|
|
|
||
|
|
### Apply-instruktioner för root
|
||
|
|
```bash
|
||
|
|
sudo bash /home/bernt/.openclaw/workspace/nginx-pending/apply.sh
|
||
|
|
```
|
||
|
|
|
||
|
|
Scriptet gör:
|
||
|
|
1. Kopierar nginx-config till `/etc/nginx/sites-enabled/ouroboros.wavult.com`
|
||
|
|
2. Kör `nginx -t`
|
||
|
|
3. Kör `systemctl reload nginx`
|
||
|
|
4. Kopierar HTML-patches till `/opt/amos/public/ouroboros/`
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## DEL 2: company-onboarding.html
|
||
|
|
|
||
|
|
### Patches: `/home/bernt/.openclaw/workspace/html-patches/company-onboarding.html`
|
||
|
|
|
||
|
|
**Ändringar:**
|
||
|
|
- ✅ **Password-fält** tillagt i Step 2 (id=`adminPassword`, type=password, min 8 tecken)
|
||
|
|
- ✅ **Validering** i `goStep3()` — kontrollerar lösenord ≥ 8 tecken
|
||
|
|
- ✅ **`admin_password`** skickas med i POST `/api/company/provision`
|
||
|
|
- ✅ **State-objekt** utökat med `adminPassword: null`
|
||
|
|
- ✅ **Completion-skärm** (Step 4):
|
||
|
|
- Visar `credentialBox` med org_id, e-post och lösenord (maskerat)
|
||
|
|
- Login-knapp ändrad till `"Klart! Logga in här →"` med href `/ouroboros/app/login.html`
|
||
|
|
- Fallback till `data.dashboard_url` om satt av API
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## DEL 3: app/index.html
|
||
|
|
|
||
|
|
### Patches: `/home/bernt/.openclaw/workspace/html-patches/app-index.html`
|
||
|
|
|
||
|
|
**Ändringar:**
|
||
|
|
- ✅ **`getCookie(name)`** helper-funktion tillagd
|
||
|
|
- ✅ **`init()`** utökad med wavult_token-stöd:
|
||
|
|
- Kontrollerar `wavult_token` cookie OCH `localStorage['amos_token']`
|
||
|
|
- Om cookie finns men ingen session: gör `GET /api/auth/me` för att bygga session
|
||
|
|
- Felhantering: redirect till `/ouroboros/app/login.html` (var: `/ouroboros/setup.html`)
|
||
|
|
- ✅ **logout()** rensar `wavult_token` cookie + redirect till `/ouroboros/app/login.html`
|
||
|
|
- ✅ Alla redirects ändrade från `/ouroboros/setup.html` → `/ouroboros/app/login.html`
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## DEL 4: app/login.html
|
||
|
|
|
||
|
|
### Patches: `/home/bernt/.openclaw/workspace/html-patches/app-login.html`
|
||
|
|
|
||
|
|
**Ändringar:**
|
||
|
|
- ✅ **`getCookie` + `setTokenCookie`** helpers tillagda
|
||
|
|
- ✅ **Auto-redirect** om `wavult_token` cookie eller `amos_token` localStorage finns
|
||
|
|
- ✅ **Efter lyckad login:**
|
||
|
|
- Sätter `wavult_token` cookie (30 dagar, SameSite=Lax)
|
||
|
|
- Bygger och sparar `ouroboros_session` i localStorage (för dashboard)
|
||
|
|
- ✅ **Dashboard-redirect** baserat på `data.dashboard`:
|
||
|
|
- `/ceo` → `/ouroboros/app/`
|
||
|
|
- `/ouroboros` → `/ouroboros/app/`
|
||
|
|
- Annat `/path` → `data.dashboard`
|
||
|
|
- Fallback → `/ouroboros/app/`
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Filöversikt
|
||
|
|
|
||
|
|
| Fil | Patch-location | Produktion |
|
||
|
|
|-----|---------------|-----------|
|
||
|
|
| nginx config | `.../nginx-pending/ouroboros.wavult.com` | `/etc/nginx/sites-enabled/ouroboros.wavult.com` |
|
||
|
|
| apply script | `.../nginx-pending/apply.sh` | Körs av root |
|
||
|
|
| company-onboarding.html | `.../html-patches/company-onboarding.html` | `/opt/amos/public/ouroboros/company-onboarding.html` |
|
||
|
|
| app/index.html | `.../html-patches/app-index.html` | `/opt/amos/public/ouroboros/app/index.html` |
|
||
|
|
| app/login.html | `.../html-patches/app-login.html` | `/opt/amos/public/ouroboros/app/login.html` |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Root-kommando (allt-i-ett)
|
||
|
|
|
||
|
|
```bash
|
||
|
|
sudo bash /home/bernt/.openclaw/workspace/nginx-pending/apply.sh
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Obs: varför inte direkt?
|
||
|
|
|
||
|
|
Filerna i `/opt/amos/public/ouroboros/` ägs av `root`. Användaren `bernt` har inte write-access.
|
||
|
|
AAMOS API (port 3100) körs men JWT-token var trunkerad i agent-task (eyJhbG…CHJA).
|
||
|
|
Lösning: prepare-and-apply-pattern med root-script.
|