Skip to content

feat(config): add per-provider storage_group with backbone autofill - #789

Merged
javi11 merged 1 commit into
mainfrom
session/nntppool-upgrade-storage-autofill-980831
Jul 21, 2026
Merged

feat(config): add per-provider storage_group with backbone autofill#789
javi11 merged 1 commit into
mainfrom
session/nntppool-upgrade-storage-autofill-980831

Conversation

@javi11

@javi11 javi11 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Implements #787: expose nntppool's StorageGroup as a per-provider storage_group setting, plus optional autofill of the group from the provider's backbone.

Why: A common layout is two accounts on one backbone plus a genuine third-party backup (e.g. Newshosting + Easynews, both Omicron, with Eweka as backup). nntppool already skips further providers on the same host after a 430, but same-backbone providers have different hostnames, so the second is always queried and always returns 430 — wasting a round trip and delaying the backup that's the only provider that could hold a different answer. StorageGroup lets an operator declare same-backbone providers so one 430 skips the whole group.

Changes

  • nntppool → v4.14.0 — adds Provider.StorageGroup (v4.13.0 lacked it).
  • Config (internal/config/manager.go): StorageGroup string on ProviderConfig; mapped in ToNNTPProvider; added to providersFieldsEqual (triggers pool rebuild) and legacy ProvidersEqual. Empty = no-op (falls back to host identity, matching today's behaviour).
  • API (config_handlers.go, types.go): storage_group across provider create/update request & response structs.
  • Backbone autofill (provider_backbone_handlers.go): GET /api/providers/backbones proxies and caches (24h, stale-on-error) usenet.rexum.space/api/providers, returning a slim deduped {host, backbone, provider} list. The browser can't fetch rexum directly (no CORS), hence the backend proxy.
  • Frontend (ProviderModal.tsx, useProviders.ts, client.ts, types/config.ts): optional "Storage Group" field; on host blur, prefills the group from the matched backbone (exact host match, then unambiguous same-registrable-domain fallback) — never overwrites a value the user typed.

Test plan

  • go build ./..., go vet ./internal/...
  • go test -race ./internal/config/... ./internal/api/... (added providersFieldsEqual/ToNNTPProvider and parseBackboneEntries tests)
  • bun run check + bun run build
  • make (full backend + frontend) exits 0
  • Manual: open a provider modal, type news.newshosting.comstorage_group prefills to Omicron; confirm editable and persists on save

Closes #787

Upgrade nntppool to v4.14.0, which adds Provider.StorageGroup: when set, a
430 (missing article) from one provider skips all providers sharing that
group for the request. This lets two accounts on the same backbone (e.g.
Newshosting + Easynews on Omicron) be declared as one storage group so a
third-party backup is reached without a wasted round trip.

- config: StorageGroup field on ProviderConfig, plumbed through
  ToNNTPProvider, providersFieldsEqual (pool rebuild) and ProvidersEqual
- api: expose storage_group across provider create/update/response
- api: GET /providers/backbones proxies+caches usenet.rexum.space provider
  tree (no CORS for the browser) as a slim host->backbone list
- frontend: optional Storage Group field that autofills from the entered
  host's backbone (exact match, then unambiguous same-domain fallback)
- tests: providersFieldsEqual/ToNNTPProvider storage-group cases and
  parseBackboneEntries transform

Closes #787
@javi11
javi11 merged commit 4b5ee33 into main Jul 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose nntppool StorageGroup as a per-provider storage_group setting

1 participant