Let the owner change regions by place name, without a restart

The p2p node can now add and drop regions while running (SetRegions):
topics, validators, subscriptions and per-region peer discovery start and
stop with them, and a newly followed region catches up by sync.

PUT /api/v1/regions (owner token) applies a change and the node saves it in
regions.json, which wins over --region from then on. The owner's browser
gets a "Regions" page: search a place by name (GeoNames cities, offline,
CC BY 4.0), follow its cell plus any cell within about 40 km.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 10:28:16 +01:00
co-authored by Claude Sonnet 5.5
parent e7bec4fb63
commit fd439710df
24 changed files with 70080 additions and 42 deletions
+54
View File
@@ -115,6 +115,33 @@ const de = {
"own.login": "Anmelden",
"own.loginBad": "Der Knoten hat den Token abgelehnt.",
"own.logout": "Abmelden",
"reg.title": "Regionen",
"reg.intro":
"Dein Knoten hält die Anzeigen dieser Regionen bereit und gibt sie an andere weiter. Suche einen Ort, zum Beispiel Bonn oder Hamburg. Die Änderung gilt sofort und bleibt nach einem Neustart erhalten.",
"reg.search": "Ort suchen",
"reg.placeholder": "z. B. Bonn, Köln, Hamburg",
"reg.results": "Gefundene Orte",
"reg.none": "Dazu habe ich keinen Ort gefunden. Prüfe die Schreibweise, oder gib unten ein Regionskürzel ein.",
"reg.noPlaces": "Die Ortsliste konnte nicht geladen werden. Du kannst unten Regionskürzel eingeben.",
"reg.cellsTitle": "Regionen rund um {place}",
"reg.cellsHelp":
"Eine Region ist ein Gebiet von etwa 100 bis 150 km Breite. Liegt der Ort nahe am Rand, kommt die Nachbarregion dazu, damit dir Anzeigen gleich hinter der Grenze nicht fehlen. Nimm den Haken heraus, was du nicht brauchst.",
"reg.here": "hier",
"reg.add": "Hinzufügen",
"reg.chosen": "Ausgewählte Regionen",
"reg.nothing": "Noch keine Region ausgewählt.",
"reg.remove": "{region} entfernen",
"reg.codes": "Oder Regionskürzel eingeben",
"reg.codesHelp": "Für alle, die sie kennen: drei Zeichen wie u1j, mehrere mit Komma getrennt.",
"reg.badCode": "„{code}“ ist keine Region: es müssen genau 3 Zeichen sein (Ziffern und Buchstaben außer a, i, l, o).",
"reg.needOne": "Wähle mindestens eine Region.",
"reg.tooMany": "Das sind zu viele Regionen (höchstens {max}).",
"reg.save": "Speichern",
"reg.saving": "Speichert …",
"reg.saved": "Gespeichert. Der Knoten folgt jetzt diesen Regionen.",
"reg.failed": "Das hat nicht geklappt.",
"reg.signedOut": "Du bist abgemeldet. Melde dich unter „Meine Anzeigen“ neu an.",
"reg.credit": "Ortsnamen: GeoNames (geonames.org), Lizenz CC BY 4.0.",
"own.listings": "Deine Anzeigen",
"own.none": "Dein Knoten hat keine aktiven Anzeigen.",
"own.perMonth": "/ Monat",
@@ -362,6 +389,33 @@ const en: Record<keyof typeof de, string> = {
"own.login": "Sign in",
"own.loginBad": "The node rejected the token.",
"own.logout": "Sign out",
"reg.title": "Regions",
"reg.intro":
"Your node keeps the listings of these regions and passes them on to others. Search for a place, for example Bonn or Hamburg. A change applies at once and survives a restart.",
"reg.search": "Search for a place",
"reg.placeholder": "e.g. Bonn, Cologne, Hamburg",
"reg.results": "Places found",
"reg.none": "I found no place for that. Check the spelling, or enter a region code below.",
"reg.noPlaces": "The list of places could not be loaded. You can enter region codes below.",
"reg.cellsTitle": "Regions around {place}",
"reg.cellsHelp":
"A region is an area roughly 100 to 150 km across. If the place is near an edge, the neighbouring region is included so you do not miss listings just across the border. Untick what you do not need.",
"reg.here": "here",
"reg.add": "Add",
"reg.chosen": "Chosen regions",
"reg.nothing": "No region chosen yet.",
"reg.remove": "Remove {region}",
"reg.codes": "Or enter region codes",
"reg.codesHelp": "For those who know them: three characters like u1j, several separated by commas.",
"reg.badCode": "“{code}” is not a region: it must be exactly 3 characters (digits and letters except a, i, l, o).",
"reg.needOne": "Choose at least one region.",
"reg.tooMany": "That is too many regions (at most {max}).",
"reg.save": "Save",
"reg.saving": "Saving …",
"reg.saved": "Saved. The node now follows these regions.",
"reg.failed": "That did not work.",
"reg.signedOut": "You are signed out. Sign in again under “My listings”.",
"reg.credit": "Place names: GeoNames (geonames.org), licence CC BY 4.0.",
"own.listings": "Your listings",
"own.none": "Your node has no active listings.",
"own.perMonth": "/ month",