halkyon/deploy/compose.todo.yaml
Tizian 「ティツィアーン」 a91aa98817
feat(todo): Todo's server answers a place's forecast (ADR 0033, D40)
The weather of D40 comes through the instance, as Train's workouts'
(ADR 0036, D1): Todo's server gets a `weather` endpoint, `offered` and
`forecast`, answering a place's hours for the next 16 days from
Open-Meteo for people signed in alone, the place rounded to about a
kilometre, nothing kept or logged, 30 requests a person a minute.
Refusals are `WeatherRefused` (off, invalid, tooOften, unreachable).
`WEATHER=off` and `OPEN_METEO_API_KEY` switch it as they switch Train's,
and production's compose file passes them to Todo's server too.

D40 records the developer's decisions of 10 Nov 2026 on the weather and
the agent's details (what dry, sunny, a temperature range and calm mean
over a task's hours).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-10 15:27:58 +01:00

63 lines
2.8 KiB
YAML

# Halkyon Todo's server beside the instance (ADR 0033, step 5). Switched on in .env,
# with Todo's domain and secrets:
#
# COMPOSE_FILE=compose.learn.yaml:compose.todo.yaml
# TODO_DOMAIN=todo.halkyon.eu
#
# Todo is a member of the instance's register, which Learn's server holds (ADR 0016),
# as Train is: one account a person, signing in through the register, the shared
# INSTANCE_SECRET on every call between them, which reach each other on the instance's
# own networks alone. Its database is `halkyon_todo` in the instance's PostgreSQL, under
# a role of its own that can't connect to Learn's or Train's. Its server reads no task:
# every row is sealed on the person's devices (ADR 0033, D5). Setting it up:
# sidecars/README.md, Todo.
services:
todo-server:
build:
context: ..
dockerfile: apps/todo/halkyon_todo_server/Dockerfile
image: halkyon-todo-server
restart: unless-stopped
# As Learn's: migrations at every start (redeploy.sh has applied them before).
command: ["--apply-migrations"]
environment:
SERVERPOD_DATABASE_PASSWORD: ${TODO_POSTGRES_PASSWORD:?set TODO_POSTGRES_PASSWORD in deploy/.env}
SERVERPOD_PASSWORD_serverSideSessionKeyHashPepper: ${TODO_SESSION_KEY_HASH_PEPPER:?set TODO_SESSION_KEY_HASH_PEPPER in deploy/.env}
# Its public address, which config/production.yaml names otherwise: the
# instance's own domain.
SERVERPOD_API_SERVER_PUBLIC_HOST: ${TODO_DOMAIN:?set TODO_DOMAIN in deploy/.env}
SERVERPOD_WEB_SERVER_PUBLIC_HOST: ${TODO_DOMAIN:?set TODO_DOMAIN in deploy/.env}
# The register (ADR 0016): Learn's web server, on the instance's own network,
# and the secret every call between them carries.
ACCOUNT_REGISTER_URL: http://server:8082/
SERVERPOD_PASSWORD_instanceSecret: ${INSTANCE_SECRET:?set INSTANCE_SECRET in deploy/.env}
# Caddy, as for Learn's server (compose.learn.yaml).
TRUSTED_PROXIES: 172.30.80.2 fd4a:6c6b:7e80::2
SOURCE_URL: ${SOURCE_URL:-}
DATA_LOCATION: ${DATA_LOCATION:-}
BACKUP_LOCATION: ${BACKUP_LOCATION:-}
# Forecasts from Open-Meteo (ADR 0033, D40), as Train's workouts' weather:
# on unless `off`; a key for its paid host where used commercially.
WEATHER: ${WEATHER:-}
OPEN_METEO_API_KEY: ${OPEN_METEO_API_KEY:-}
networks:
- default
- edge
depends_on:
postgres:
condition: service_healthy
logging:
driver: journald
caddy:
environment:
TODO_DOMAIN: ${TODO_DOMAIN:?set TODO_DOMAIN in deploy/.env}
volumes:
- ./sidecars/todo.caddy:/etc/caddy/sidecars/todo.caddy:ro
server:
environment:
# Todo's web server, told when an account goes (ADR 0016), beside the members
# the other compose files and INSTANCE_MEMBERS name.
INSTANCE_MEMBER_TODO: http://todo-server:8082/