refactor: 30-day defaults for all expiry settings
- QUEUE_MAX_AGE: 48h -> 30 days (per-client queue entry expiry) - MESSAGE_MAX_AGE: replaces count-based MAX_HISTORY with time-based 30-day message expiry - SESSION_IDLE_TIMEOUT: 24h -> 30 days All expiry is now time-based (30 days) as requested. Closes #40
This commit is contained in:
22
README.md
22
README.md
@@ -249,8 +249,8 @@ Key properties:
|
||||
- **Ordered**: Queue entries have monotonically increasing IDs. Messages are
|
||||
always delivered in order within a client's queue.
|
||||
- **No delivery/read receipts** for channel messages. DM receipts are planned.
|
||||
- **Queue depth**: Server-configurable via `QUEUE_MAX_AGE`. Default is 48
|
||||
hours. Entries older than this are pruned.
|
||||
- **Queue depth**: Server-configurable via `QUEUE_MAX_AGE`. Default is 30
|
||||
days. Entries older than this are pruned.
|
||||
|
||||
### Long-Polling
|
||||
|
||||
@@ -1788,14 +1788,14 @@ skew issues) and simpler than UUIDs (integer comparison vs. string comparison).
|
||||
|
||||
### Data Lifecycle
|
||||
|
||||
- **Messages**: Rotated per `MAX_HISTORY` — oldest messages beyond the limit
|
||||
are pruned periodically per target (channel or DM).
|
||||
- **Messages**: Pruned automatically when older than `MESSAGE_MAX_AGE`
|
||||
(default 30 days).
|
||||
- **Queue entries**: Pruned automatically when older than `QUEUE_MAX_AGE`
|
||||
(default 48h).
|
||||
(default 30 days).
|
||||
- **Channels**: Deleted when the last member leaves (ephemeral).
|
||||
- **Users/sessions**: Deleted on `QUIT` or `POST /api/v1/logout`. Idle
|
||||
sessions are automatically expired after `SESSION_IDLE_TIMEOUT` (default
|
||||
24h) — the server runs a background cleanup loop that parts idle users
|
||||
30 days) — the server runs a background cleanup loop that parts idle users
|
||||
from all channels, broadcasts QUIT, and releases their nicks.
|
||||
|
||||
---
|
||||
@@ -1812,9 +1812,9 @@ directory is also loaded automatically via
|
||||
| `PORT` | int | `8080` | HTTP listen port |
|
||||
| `DBURL` | string | `file:///var/lib/neoirc/state.db?_journal_mode=WAL` | SQLite connection string. For file-based: `file:///path/to/db.db?_journal_mode=WAL`. For in-memory (testing): `file::memory:?cache=shared`. |
|
||||
| `DEBUG` | bool | `false` | Enable debug logging (verbose request/response logging) |
|
||||
| `MAX_HISTORY` | int | `10000` | Maximum messages retained per target (channel or DM) before rotation |
|
||||
| `SESSION_IDLE_TIMEOUT` | string | `24h` | Session idle timeout as a Go duration string (e.g. `24h`, `30m`). Sessions with no activity for this long are expired and the nick is released. |
|
||||
| `QUEUE_MAX_AGE` | int | `172800` | Maximum age of client queue entries in seconds (48h). Entries older than this are pruned. |
|
||||
| `MESSAGE_MAX_AGE` | int | `2592000` | Maximum age of messages in seconds (30 days). Messages older than this are pruned. |
|
||||
| `SESSION_IDLE_TIMEOUT` | string | `720h` | Session idle timeout as a Go duration string (e.g. `720h`, `24h`). Sessions with no activity for this long are expired and the nick is released. Default is 30 days. |
|
||||
| `QUEUE_MAX_AGE` | int | `2592000` | Maximum age of client queue entries in seconds (30 days). Entries older than this are pruned. |
|
||||
| `MAX_MESSAGE_SIZE` | int | `4096` | Maximum message body size in bytes (planned enforcement) |
|
||||
| `LONG_POLL_TIMEOUT`| int | `15` | Default long-poll timeout in seconds (client can override via query param, server caps at 30) |
|
||||
| `MOTD` | string | `""` | Message of the day, shown to clients via `GET /api/v1/server` |
|
||||
@@ -1833,7 +1833,7 @@ SERVER_NAME=My NeoIRC Server
|
||||
MOTD=Welcome! Be excellent to each other.
|
||||
DEBUG=false
|
||||
DBURL=file:///var/lib/neoirc/state.db?_journal_mode=WAL
|
||||
SESSION_IDLE_TIMEOUT=24h
|
||||
SESSION_IDLE_TIMEOUT=720h
|
||||
```
|
||||
|
||||
---
|
||||
@@ -2229,7 +2229,7 @@ GET /api/v1/challenge
|
||||
|
||||
- [ ] **Hashcash proof-of-work** for session creation (abuse prevention)
|
||||
- [x] **Queue pruning** — delete old queue entries per `QUEUE_MAX_AGE`
|
||||
- [x] **Message rotation** — enforce `MAX_HISTORY` per target
|
||||
- [x] **Message rotation** — prune messages older than `MESSAGE_MAX_AGE`
|
||||
- [ ] **Channel modes** — enforce `+i`, `+m`, `+s`, `+t`, `+n`
|
||||
- [ ] **User channel modes** — `+o` (operator), `+v` (voice)
|
||||
- [x] **MODE command** — query channel and user modes (set not yet implemented)
|
||||
|
||||
Reference in New Issue
Block a user