Admin UI: instance management (add, enable, disable) #36

Open
opened 2026-04-29 23:57:03 +02:00 by myrmidex · 0 comments
Owner

Context

Currently instances are managed via raw DB inserts/updates. There is no UI to add a new Mastodon or Lemmy instance, enable/disable polling, or change the interval. This is an operational blocker for self-hosters.

Acceptance criteria

  • GET /admin/instances (already exists) — extend with Add button
  • POST /admin/instances — create new instance (url, type, interval_seconds, enabled). Validates via InstanceConfig::fromArray() — reuse existing validation logic
  • PATCH /admin/instances/{id}/toggle — flip enabled/disabled
  • DELETE /admin/instances/{id} — remove instance (pages remain, FK is onDelete('set null'))
  • Livewire component or plain controller — decide at implementation time. Given low traffic (admin only), plain controller + redirects is fine
  • Tests: create valid instance → appears in list; create with invalid URL → validation error; toggle → enabled state flips; delete → instance gone, pages unaffected

Notes

  • No auth in v0.2 (deferred post-MVP). Admin routes stay unprotected behind the assumption that /admin is not publicly reachable in prod (Pangolin can enforce this at the proxy layer). Document this assumption.
  • interval_seconds in the UI can be a simple integer field for now — a "every N minutes" helper label is a nice-to-have.
## Context Currently instances are managed via raw DB inserts/updates. There is no UI to add a new Mastodon or Lemmy instance, enable/disable polling, or change the interval. This is an operational blocker for self-hosters. ## Acceptance criteria - [ ] `GET /admin/instances` (already exists) — extend with Add button - [ ] `POST /admin/instances` — create new instance (url, type, interval_seconds, enabled). Validates via `InstanceConfig::fromArray()` — reuse existing validation logic - [ ] `PATCH /admin/instances/{id}/toggle` — flip enabled/disabled - [ ] `DELETE /admin/instances/{id}` — remove instance (pages remain, FK is `onDelete('set null')`) - [ ] Livewire component or plain controller — decide at implementation time. Given low traffic (admin only), plain controller + redirects is fine - [ ] Tests: create valid instance → appears in list; create with invalid URL → validation error; toggle → enabled state flips; delete → instance gone, pages unaffected ## Notes - No auth in v0.2 (deferred post-MVP). Admin routes stay unprotected behind the assumption that `/admin` is not publicly reachable in prod (Pangolin can enforce this at the proxy layer). Document this assumption. - `interval_seconds` in the UI can be a simple integer field for now — a "every N minutes" helper label is a nice-to-have.
myrmidex added this to the v0.2 milestone 2026-04-29 23:57:03 +02:00
myrmidex self-assigned this 2026-04-29 23:57:03 +02:00
myrmidex added the
enhancement
label 2026-05-01 01:02:00 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lvl0/trove#36
No description provided.