feat(config): add per-provider storage_group with backbone autofill - #789
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #787: expose nntppool's
StorageGroupas a per-providerstorage_groupsetting, 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.
StorageGrouplets an operator declare same-backbone providers so one 430 skips the whole group.Changes
Provider.StorageGroup(v4.13.0 lacked it).internal/config/manager.go):StorageGroup stringonProviderConfig; mapped inToNNTPProvider; added toprovidersFieldsEqual(triggers pool rebuild) and legacyProvidersEqual. Empty = no-op (falls back to host identity, matching today's behaviour).config_handlers.go,types.go):storage_groupacross provider create/update request & response structs.provider_backbone_handlers.go):GET /api/providers/backbonesproxies 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.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/...(addedprovidersFieldsEqual/ToNNTPProviderandparseBackboneEntriestests)bun run check+bun run buildmake(full backend + frontend) exits 0news.newshosting.com→storage_groupprefills toOmicron; confirm editable and persists on saveCloses #787