server sided external api calls (#697)

* server sided external api calls

* fix uploading gpx files

* rename api/v1/nominatim with api/v1/geocoding to prepare photon support

* remove NOMINATIM_MAX_RETRIES (side-kick from other PR)

* re-add nominatim url fallback

* docu, env var defaults and fallbacks, docker compose files

* refactor

* furhter refactorings and fixes

* PUBLIC_VALHALLA_ENABLED in docker compose files added

* fix env var names

---------

Co-authored-by: Flomp <Flomp@users.noreply.github.com>
This commit is contained in:
slothful-vassal
2026-04-28 18:19:06 +02:00
committed by GitHub
parent 7bdf0d3151
commit 85e5fb6df7
21 changed files with 391 additions and 100 deletions

View File

@@ -12,7 +12,7 @@ export ORIGIN=http://localhost:5173
export MEILI_URL=http://127.0.0.1:7700
export MEILI_MASTER_KEY=p2gYZAWODOrwTPr4AYoahCZ9CI8y9bUd0yQLGk-E3m8
export PUBLIC_POCKETBASE_URL=http://127.0.0.1:8090
export PUBLIC_VALHALLA_URL=https://valhalla1.openstreetmap.de
export VALHALLA_URL=https://valhalla1.openstreetmap.de
export POCKETBASE_ENCRYPTION_KEY=9ada3c93163812101e50e2bf49e880bc
cd search && ./meilisearch --master-key $MEILI_MASTER_KEY &

View File

@@ -42,10 +42,38 @@ Since we use an unmodified installation of meilisearch you can use all variables
| BODY_SIZE_LIMIT | Maximum allowed upload size | Infinity |
| PUBLIC_POCKETBASE_URL | IP or hostname (including the port) of your pocketbase instance | http://db:8090 |
| PUBLIC_DISABLE_SIGNUP | Disables signup option for new users | false |
| PUBLIC_VALHALLA_URL | Public IP or hostname (including the port) of a valhalla instance | https://valhalla1.openstreetmap.de |
| PUBLIC_NOMINATIM_URL | Public IP or hostname (including the port) of a nominatim instance | https://nominatim.openstreetmap.org |
| PUBLIC_PRIVATE_INSTANCE | Setting this to true will block visitors from viewing content without an account | false |
| UPLOAD_FOLDER | Folder from which <span class="-tracking-[0.075em]">wanderer</span> auto-uploads trails | /app/uploads |
| UPLOAD_USER | Username for the account with which <span class="-tracking-[0.075em]">wanderer</span> auto-uploads trails | |
| UPLOAD_PASSWORD | Password for the account with which <span class="-tracking-[0.075em]">wanderer</span> auto-uploads trails | |
| PUBLIC_OVERPASS_API_URL | Overpass API URL used for map points of interest | https://overpass-api.de |
## Geocoding & Routing
These variables configure server-side requests to Valhalla, Nominatim and Overpass.
| Environment Variable | Description | Default |
| ------------------------ | --------------------------------------------------------------------------- | ----------------------------------- |
| VALHALLA_URL | Valhalla API URL used for auto-routing and elevation data | https://valhalla1.openstreetmap.de |
| NOMINATIM_URL | Nominatim API URL used for (reverse) geocoding | https://nominatim.openstreetmap.org |
| OVERPASS_API_URL | Overpass API URL used for map points of interest | https://overpass-api.de |
When `*_URL` is unset, the backend falls back to legacy `PUBLIC_*_URL`.
## Custom CA certificates
If your API endpoints use certificates signed by a private CA, add the CA bundle and set `NODE_EXTRA_CA_CERTS` for the `web` service.
| Environment Variable | Description | Default |
| -------------------- | ------------------------------------------------------------------------ | ------- |
| NODE_EXTRA_CA_CERTS | Path to an additional CA bundle used by Node.js TLS connections | |
Example (`docker-compose.yml`):
```yaml
services:
web:
environment:
NODE_EXTRA_CA_CERTS: /etc/ssl/private-ca/ca.pem
volumes:
- ./certs/ca.pem:/etc/ssl/private-ca/ca.pem:ro
```

View File

@@ -111,11 +111,14 @@ services:
UPLOAD_FOLDER: /app/uploads
UPLOAD_USER:
UPLOAD_PASSWORD:
PUBLIC_OVERPASS_API_URL: https://overpass-api.de
PUBLIC_VALHALLA_URL: https://valhalla1.openstreetmap.de
PUBLIC_NOMINATIM_URL: https://nominatim.openstreetmap.org
OVERPASS_API_URL: https://overpass-api.de
VALHALLA_URL: https://valhalla1.openstreetmap.de
NOMINATIM_URL: https://nominatim.openstreetmap.org
# Optional: trust private CAs for server-side API calls
# NODE_EXTRA_CA_CERTS: /etc/ssl/private-ca/ca.pem
volumes:
- ./data/uploads:/app/uploads
# - ./certs/ca.pem:/etc/ssl/private-ca/ca.pem:ro
# - ./data/about.md:/app/build/client/md/about.md
ports:
- "3000:3000"

View File

@@ -66,7 +66,7 @@ export ORIGIN=http://localhost:3000
export MEILI_URL=http://127.0.0.1:7700
export MEILI_MASTER_KEY=YOU_SHOULD_DEFINITELY_CHANGE_ME
export PUBLIC_POCKETBASE_URL=http://127.0.0.1:8090
export PUBLIC_VALHALLA_URL=https://valhalla1.openstreetmap.de
export VALHALLA_URL=https://valhalla1.openstreetmap.de
export POCKETBASE_ENCRYPTION_KEY=YOUR_ENCRYPTION_KEY_HERE
# Optional configuration
@@ -76,6 +76,7 @@ export POCKETBASE_ENCRYPTION_KEY=YOUR_ENCRYPTION_KEY_HERE
# export UPLOAD_FOLDER=/app/uploads
# export UPLOAD_USER=
# export UPLOAD_PASSWORD=
# export NODE_EXTRA_CA_CERTS=/absolute/path/to/ca.pem
cd search && ./meilisearch --master-key $MEILI_MASTER_KEY &
cd db && ./pocketbase serve &