Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Copy to .env and fill in your values, or run `bash install/docker-install.sh`
# which writes this file interactively.
# Copy to .env and fill in your values, or run `bash install/docker-install.sh`,
# which writes this file for you.

# Paste the key from your ollebo.com mapserver entry.
# Reserved for future ollebo.com registration handshake — safe to leave empty
# today, but set it now so the install is ready.
# The map key from the mapserver you created on ollebo.com. It decides which
# Space your maps appear in. You can also paste it on the Settings page later;
# a key saved there takes priority.
OLLEBO_KEY=

# Tenant scope. First key in the terracotta [space, map, variant] schema.
# Local folder name for your maps inside the tile store. It does not need to
# match anything on ollebo.com.
OLLEBO_SPACE_ID=local

# Browser-facing tile URL. Must be reachable from any viewer (including
# ollebo.com). For local installs behind a tunnel, paste the ngrok/cloudflared
# https URL here.
# The address browsers use to fetch tiles. It must be reachable by everyone who
# views your maps on ollebo.com, e.g. https://tiles.example.com.
TERRACOTTA_PUBLIC_URL=http://localhost:5001

# ollebo.com API base. Used by the dormant updateMap() registration call.
API=https://www.ollebo.com/api/v1
# ollebo.com API. Where this server checks its key and registers maps.
API=https://www.ollebo.com/api

# Terracotta storage. Defaults match what's baked into the container.
# Tile store. The defaults match the container.
TERRACOTTA_DB_PATH=/data/db/terracotta.sqlite
TERRACOTTA_PROVIDER=sqlite
238 changes: 132 additions & 106 deletions README.md

Large diffs are not rendered by default.

Binary file removed code/__pycache__/listMaps.cpython-312.pyc
Binary file not shown.
Binary file removed code/__pycache__/listTiles.cpython-312.pyc
Binary file not shown.
Binary file removed code/__pycache__/start.cpython-312.pyc
Binary file not shown.
31 changes: 0 additions & 31 deletions code/listTiles.py

This file was deleted.

Binary file not shown.
1 change: 1 addition & 0 deletions code/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ flask
flask_cors
names
requests
gunicorn
4 changes: 3 additions & 1 deletion code/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ python3 -c 'from config import ensure_settings_table; ensure_settings_table()' |
echo "Scanning /data/maps for new files..."
python3 -c 'from mapmaker.makingGeotiff import scan_and_ingest; scan_and_ingest()' || echo "scan failed, continuing to flask"

FLASK_APP=start.py flask run --host=0.0.0.0 --port=8080
# Building a map runs inside the request and can take many minutes, so there is
# no request timeout. Threads keep the UI responsive while a map builds.
exec gunicorn --bind 0.0.0.0:8080 --workers 1 --threads 8 --timeout 0 start:app
30 changes: 0 additions & 30 deletions code/templates/tiles.html

This file was deleted.

3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ services:
environment:
- TERRACOTTA_DB_PATH=${TERRACOTTA_DB_PATH:-/data/db/terracotta.sqlite}
- TERRACOTTA_PROVIDER=${TERRACOTTA_PROVIDER:-sqlite}
- TC_DRIVER_PATH=${TERRACOTTA_DB_PATH:-/data/db/terracotta.sqlite}
- TC_ALLOWED_ORIGINS_TILES=["https://dash.ollebo.com","https://dash.northamlin.com"]
working_dir: /code
command: ["sh", "-c", "mkdir -p /data/db && python3 -c 'from mapmaker.maps import terracotta_client; terracotta_client.ensure_schema()' && terracotta serve -d /data/db/terracotta.sqlite --allow-all-ips --port 5000"]
command: ["sh", "-c", "mkdir -p /data/db && python3 -c 'from mapmaker.maps import terracotta_client; terracotta_client.ensure_schema()' && exec gunicorn --bind 0.0.0.0:5000 --workers 4 terracotta.server.app:app"]
4 changes: 2 additions & 2 deletions install/helm/mapserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Deploys the OlleBo mapserver (Flask uploader + terracotta tile server) onto a Kubernetes cluster as a single Pod with two containers, backed by three PVCs.

For onboarding, env vars, and architecture, see the [top-level README](../../../README.md). This file is a chart-scoped reference.
For what the mapserver does, how it connects to ollebo.com and the authentication you must add yourself, see the [top-level README](../../../README.md). This file is a chart reference.

## Quick install

Expand All @@ -17,7 +17,7 @@ helm install mapserver oci://ghcr.io/ollebo/charts/mapserver \

## Topology

- **One Pod, two containers**: `map-server` (Flask, port 8080) + `terracotta` (port 5000).
- **One Pod, two containers**: `map-server` (Flask under gunicorn, port 8080) + `terracotta` (gunicorn, port 5000, `terracotta.workers` processes).
- **One initContainer**: `terracotta-init` runs `ensure_schema()` against the SQLite DB so terracotta starts with a populated schema.
- **Three PVCs**: `-maps`, `-cogs`, `-db`. Independently sized and class-able via `persistence.{name}.size` / `persistence.{name}.storageClassName`.
- **One Service** with two named ports (`flask`, `terracotta`).
Expand Down
5 changes: 4 additions & 1 deletion install/helm/mapserver/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,14 @@ spec:
command:
- sh
- -c
- terracotta serve -d {{ .Values.terracotta.dbPath }} --allow-all-ips --port 5000
- exec gunicorn --bind 0.0.0.0:5000 --workers {{ .Values.terracotta.workers }} terracotta.server.app:app
ports:
- name: terracotta
containerPort: 5000
protocol: TCP
env:
- name: TC_DRIVER_PATH
value: {{ .Values.terracotta.dbPath | quote }}
envFrom:
- configMapRef:
name: {{ include "mapserver.fullname" . }}
Expand Down
2 changes: 2 additions & 0 deletions install/helm/mapserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ terracotta:
# with no path.
publicUrl: http://localhost:5001
dbPath: /data/db/terracotta.sqlite
# Tile server processes. Each one renders tiles in parallel with the others.
workers: 4
provider: sqlite
# Web pages allowed to load tiles. Terracotta's default is localhost only,
# which makes the ollebo.com dashboards fail with a CORS error.
Expand Down
4 changes: 3 additions & 1 deletion maps/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# This is the locations of where you will put map images to be proccess
# Source maps

In the Docker install, put GeoTIFF (`.tif`) files here. They are mounted at `/data/maps`, and the mapserver turns each one into a map when it starts or when you click Rescan.
1 change: 0 additions & 1 deletion web/README.md

This file was deleted.

Loading