From e6f0f737d048ca9c5b88e6877a43d8e3f23d3d13 Mon Sep 17 00:00:00 2001
From: Ian Renton
Date: Sun, 27 Sep 2026 14:36:40 +0100
Subject: [PATCH] Multi select upstream providers to send spots to #95
---
static/apidocs/openapi.yml | 44 ++++----
static/js/add-spot.js | 92 ++++++++--------
templates/add-spot.html | 34 ++----
templates/alerts.html | 2 +-
templates/bands.html | 4 +-
templates/base.html | 10 +-
templates/conditions.html | 2 +-
templates/help/thanks.html | 11 +-
templates/map.html | 4 +-
templates/spots.html | 4 +-
templates/status.html | 2 +-
webserver/handlers/api/addspot.py | 100 ++++++++++--------
.../api/compatibility/v2_compatibility.py | 17 +++
13 files changed, 178 insertions(+), 148 deletions(-)
diff --git a/static/apidocs/openapi.yml b/static/apidocs/openapi.yml
index 2b0226f..6aef7bc 100644
--- a/static/apidocs/openapi.yml
+++ b/static/apidocs/openapi.yml
@@ -23,6 +23,7 @@ info:
* **Breaking change:** POST `/spot` now expects `activities` (a list) and `activity_refs` in the `spot` object, rather than `sig` and `sig_refs`.
* **Breaking change:** In the `/options` response, `sigs` has been renamed to `activities`, and within each activity, `sig_type` has been renamed to `activity_type`.
* **Breaking change:** In the `/status` response, `sig_ref_data_providers` has been renamed to `activity_ref_data_providers`, and within each provider, `sig_name` has been renamed to `activity_name`.
+ * **Breaking change:** In the POST `/spot` `handling` object, `submit_upstream` and `upstream_provider` have been replaced by `upstream_providers`, a list of provider names, so a spot can be sent to multiple upstream providers at once. `upstream_credentials` is now a map of provider name to that provider's credentials.
#### Upgrading a client from v2 to v3 API endpoints
@@ -940,6 +941,7 @@ components:
- BIWOTA
- COTA
- PGA
+ - Railways
- Toilets
example: POTA
@@ -1381,30 +1383,30 @@ components:
description: >
Optional server-side instructions for how to process this spot submission.
properties:
- submit_upstream:
- type: boolean
+ upstream_providers:
+ type: array
+ items:
+ type: string
description: >
- If true, forward the spot to an external upstream provider (e.g. POTA, SOTA) rather than only adding it
- to this Spothole server. Requires `upstream_provider` to be set. Check `spot_submit_providers` in the
- `/options` response to see which activities and providers support this.
- default: false
- upstream_provider:
- type: string
- description: >
- Name of the upstream provider to submit the spot to, e.g. "POTA" or "SOTA". Must
- match one of the provider names returned in `spot_submit_providers` for the chosen activity.
- example: POTA
+ Names of upstream providers to forward the spot to (e.g. "POTA", "SOTA"), in addition to or instead
+ of only adding it to this Spothole server. Each name must match one of the provider names returned in
+ `spot_submit_providers` in the `/options` response for the chosen activity. Omit or leave empty to
+ add the spot to this Spothole server only.
+ example: [ POTA, ParksNPeaks ]
upstream_credentials:
type: object
description: >
- Provider-specific credentials required to authenticate the upstream submission.
- The required keys depend on the provider. Credentials are used only for the upstream
- call and are never stored by Spothole.
+ A map of provider name to the provider-specific credentials required to authenticate the upstream
+ submission to that provider. The required keys depend on the provider. Credentials are used only for
+ the upstream call and are never stored by Spothole.
additionalProperties:
- type: string
+ type: object
+ additionalProperties:
+ type: string
example:
- user_id: "12345"
- api_key: "abc123"
+ ParksNPeaks:
+ user_id: "12345"
+ api_key: "abc123"
captcha_token:
type: string
description: >
@@ -2294,9 +2296,9 @@ components:
type: object
description: >
A map of activity name to a list of provider names that support upstream spot submission for that
- activity. If an activity appears as a key here, the POST /spot endpoint accepts `submit_upstream: true`
- for spots with that activity, and will forward the spot to one of the listed providers. Omitted if no
- providers support upstream submission.
+ activity. If an activity appears as a key here, the POST /spot endpoint accepts these provider names in
+ `upstream_providers` for spots with that activity, and will forward the spot to any of the listed
+ providers. Omitted if no providers support upstream submission.
additionalProperties:
type: array
items:
diff --git a/static/js/add-spot.js b/static/js/add-spot.js
index 9c187f4..f553b44 100644
--- a/static/js/add-spot.js
+++ b/static/js/add-spot.js
@@ -63,46 +63,46 @@ function updateUpstreamArea() {
$("#upstream-area").show();
- // Update the provider selector
- $("#upstream-provider-select").empty();
+ // Rebuild the provider checkboxes, keeping any that were already checked for the previous activity
+ const previouslyChecked = getSelectedUpstreamProviders();
+ const container = $("#upstream-providers").empty();
$.each(providers, function (i, name) {
- $("#upstream-provider-select").append($('
-
The following people have specifically helped develop Spothole either by contributing code, requesting features,
- or helping squash bugs: Steven M1SDH, Dan S50U, Matt W1CDN, Norby LX1NO, Andrew VK3ARR, Mario DL4MFM, Mark M5TEA,
- Michael G7VJR, Rob G7LAS, Ed DD5LP, Raph F4LUB, Luc ON7KEC, Richard GD4OFB, Daniel PY2TDB, Alan VK1AO,
- Andrew WK1AD, Ullrich DF5WC, Wayne N3CDF, Jonathan G4IVV, Erik N2EPE, Sorin YO9TSN, Matt HB9HWI, Priit ES1TEB,
- Leigh KG7WED, Jouni OH3CUF, Onno VK6FLAB, and Bruce WA7BNM. (If I've forgotten you, let me know!)
+
The following people have specifically helped develop Spothole either by contributing code, allowing access to
+ their data, providing guidance, requesting features, or helping squash bugs: Steven M1SDH, Dan S50U, Matt W1CDN,
+ Norby LX1NO, Andrew VK3ARR, Mario DL4MFM, Mark M5TEA, Michael G7VJR, Rob G7LAS, Ed DD5LP, Raph F4LUB,
+ Luc ON7KEC, Richard GD4OFB, Daniel PY2TDB, Alan VK1AO, Andrew WK1AD, Ullrich DF5WC, Wayne N3CDF, Jonathan G4IVV,
+ Erik N2EPE, Sorin YO9TSN, Matt HB9HWI, Priit ES1TEB, Leigh KG7WED, Jouni OH3CUF, Onno VK6FLAB, Bruce WA7BNM, and
+ Larry F5PYI. (If I've forgotten you, let me know!)
Spothole is also dependent on a number of Python libraries, such as pyhamtools, and many JavaScript
libraries, as well as the Font Awesome icon set and flag icons from the Noto Color Emoji set, and MIT-licenced
GeoJSON files for CQ and ITU zones from HA8TKS.