Skip to content

Latest commit

 

History

History
153 lines (98 loc) · 2.12 KB

File metadata and controls

153 lines (98 loc) · 2.12 KB

API

Le API restituiscono JSON salvo gli endpoint che servono file statici o configurazioni testuali.

Pubbliche

Health

GET /api/health

Restituisce stato applicativo e percorso di export.

Bootstrap

GET /api/bootstrap

Restituisce nome app, tema e flag setupRequired.

Setup Admin

POST /api/setup/admin

Crea il primo amministratore. Disponibile solo se il setup non e' gia' completato.

Login

POST /api/auth/login

Richiede username, password e, se abilitato per l'utente, codice TOTP.

Autenticate

Logout

POST /api/auth/logout

Invalida la sessione corrente.

Utente Corrente

GET /api/auth/me

Restituisce l'utente autenticato.

Stato Applicazione

GET /api/state

Restituisce host, certificati, utenti sanitizzati, attivita' ed environment applicativo.

Dashboard

GET /api/dashboard

Restituisce metriche sistema e stato TCP dei backend configurati.

Logs

GET /api/logs
GET /api/logs?kind=access&hostId=...
GET /api/logs?kind=error&hostId=...

Restituisce registro attivita' o tail dei log host configurati.

Host

Crea Host

POST /api/hosts

Aggiorna Host

PUT /api/hosts/:id

Elimina Host

DELETE /api/hosts/:id

Duplica Host

POST /api/hosts/:id/duplicate

Configurazione Host

GET /api/hosts/:id/config

Restituisce la configurazione Apache renderizzata come testo.

Deploy Host

POST /api/hosts/:id/deploy

Scrive la configurazione in GENERATED_DIR e, se configurato, nei percorsi Apache reali.

Preview

POST /api/preview

Valida un payload host e restituisce la configurazione Apache renderizzata.

Certificati

POST /api/certificates/ovh

Genera o esegue il comando certbot con challenge DNS OVH.

Utenti Admin

Richiedono ruolo admin.

GET /api/users
POST /api/users
PUT /api/users/:id
DELETE /api/users/:id
POST /api/users/:id/totp/prepare

Gli endpoint utente restituiscono sempre utenti sanitizzati, senza password hash e senza chiave TOTP.