docs: update all documentation and AGENTS.md

This commit is contained in:
2026-06-16 03:35:22 +00:00
parent bc72db903c
commit b8c2fa2f24
7 changed files with 73 additions and 17 deletions
+55 -3
View File
@@ -965,7 +965,29 @@ Set or update the ACME account contact email.
**Response (`data`):** Returns the set `email` field.
---
#### Generate Self-Signed Certificate
```
POST /api/certs/self-signed
```
Generate a self-signed certificate for a domain. Idempotent — skips if `fullchain.cer` and `<domain>.key` already exist at `data/acme/<domain>/`.
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `domain` | `string` | Yes | Domain name for the certificate CN |
| `days` | `number` | No | Validity in days; defaults to `365` |
**Response (`data`):**
| Field | Type | Description |
|-------|------|-------------|
| `domain` | `string` | Domain name |
| `cert` | `string` | Path to `fullchain.cer` |
| `key` | `string` | Path to `<domain>.key` |
| `generated` | `boolean` | `true` if a new cert was created, `false` if existing cert was reused |
## WireGuard API
@@ -1229,7 +1251,7 @@ Return config and runtime state for a specific interface.
| `config` | `object` | Full networkd config entry for this interface |
| `runtime` | `object` | Runtime state from `networkctl` (addresses, gateway, DNS, state) |
Returns HTTP `404` if the interface is not found in config.
Returns HTTP `400` if the interface name is invalid (contains path components, spaces, or characters outside `^[a-zA-Z0-9][a-zA-Z0-9._-]*$`). Returns HTTP `404` if the interface is not found in config.
---
@@ -1250,6 +1272,8 @@ Save network config for an interface, render the `.network` file, copy it to `/e
| `name` | `string` | Interface name |
| `applied` | `boolean` | Always `true` on success |
Returns HTTP `400` if the interface name is invalid.
---
#### Reload Interface
@@ -1267,6 +1291,8 @@ Reload networkd for a single interface (runs `networkctl reload <name>`).
| `name` | `string` | Interface name |
| `reloaded` | `boolean` | Always `true` on success |
Returns HTTP `400` if the interface name is invalid.
### Full Sync
#### Apply All Interfaces
@@ -1321,11 +1347,37 @@ Suggest firewalld zone assignments for configured interfaces based on heuristics
|-------|------|-------------|
| `data.zones` | `object` | Map of interface name to suggested zone (`"lan"`, `"wan"`, `"management"`) |
### Sysctl
#### Set Kernel Parameter
```
POST /api/sysctl/set
```
Set a sysctl kernel parameter value via `sysctl -w`, then verify by reading it back.
**Request Body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | `string` | Yes | Kernel parameter name (e.g., `"net.ipv4.ip_forward"`) |
| `value` | `string` | Yes | Value to set |
**Response (`data`):**
| Field | Type | Description |
|-------|------|-------------|
| `name` | `string` | Parameter name |
| `value` | `string` | Value set |
Returns HTTP `500` if the value cannot be verified after write.
---
## Logs API
Endpoints prefixed with `/api/logs/...`. Serve rendered HTML log line fragments for HTMX consumption. These endpoints **do not** follow the standard JSON `{"ok": true, "data": ...}` response contract — they return HTML `<div>` elements directly. Errors are rendered inline as `(error reading ...)` text rather than returning JSON error responses.
Endpoints prefixed with `/api/logs/...`. These endpoints **do not** follow the standard JSON `{"ok": true, "data": ...}` response contract — they return HTML `<div>` elements directly. Errors are rendered inline as `(error reading ...)` text rather than returning JSON error responses.
### System Journal