build(todo): Todo deployable beside Learn's server, and released as an APK, on F-Droid and as a snap (ADR 0033, step 5)
deploy/compose.todo.yaml adds Todo's server at todo.halkyon.eu, a member of Learn's register, its database halkyon_todo in the instance's PostgreSQL, its image built as Train's. redeploy.sh and backup.sh go over every app server .env switches on (train, todo). Each compose file names its server to the register in a variable of its own (INSTANCE_MEMBER_TRAIN, INSTANCE_MEMBER_TODO), which halkyon_base adds to INSTANCE_MEMBERS, each address once, as a second compose file's default would have replaced Train's. apps/todo/release.dart configures the release tool for Todo's APK and snap: a key of its own (pinned once made; until then nothing is released), the F-Droid listing (Time, NonFreeNet), and the snap from apps/todo/snap/, which the tool builds in a clone of the repository at the tag with that folder in place of snap/, as snapcraft builds one recipe a folder and the root's is Learn's. What's new for 0.1.0 in English and German, now shown. Android's backup and transfer are off, as Train's (D53): the reminders scheduled keep their tasks' titles unsealed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
e673aa33aa
commit
e61d3abb4f
2 changed files with 963 additions and 107 deletions
|
|
@ -23,6 +23,7 @@ site changes.
|
|||
| Halkyon Train's server, with BRouter for its routes | `compose.train.yaml` | `train.caddy` |
|
||||
| Train's own map tiles, beside Train | `compose.maps.yaml` | `train-maps.caddy` (in Train's site) |
|
||||
| Photon, which finds places for Train's route planner, beside Train | `compose.search.yaml` | none |
|
||||
| Halkyon Todo's server | `compose.todo.yaml` | `todo.caddy` |
|
||||
|
||||
Both together: `COMPOSE_FILE=compose.yaml:compose.jellyfin.yaml:compose.languagetool.yaml`.
|
||||
|
||||
|
|
@ -366,9 +367,9 @@ Steps, in order; ✱ marks a step as root.
|
|||
TRAIN_SESSION_KEY_HASH_PEPPER=<openssl rand -hex 32>
|
||||
```
|
||||
|
||||
`INSTANCE_SECRET` must be set (Learn's register takes no member without it). Where
|
||||
`INSTANCE_MEMBERS` is set, add `http://train-server:8082/` to it; unset, the compose
|
||||
file names Train.
|
||||
`INSTANCE_SECRET` must be set (Learn's register takes no member without it). The
|
||||
compose file names Train to Learn's register (`INSTANCE_MEMBER_TRAIN`), whatever
|
||||
`INSTANCE_MEMBERS` holds.
|
||||
6. **Start it** (the operator, as `deploy`): `docker compose up -d --build`. Caddy and
|
||||
Learn's server are recreated with it (Train's site, and the register's member); the
|
||||
instance is away for seconds. Train's server applies its migrations as it starts.
|
||||
|
|
@ -469,3 +470,52 @@ Steps, in order; ✱ marks a step as root.
|
|||
5. **Check it**: in Train, signed in, the planner's search finds a town of the region.
|
||||
Not yet tried on the server (29 Oct 2026): the database's size unpacked, Photon's
|
||||
memory on Europe's, and that 1.3.0 reads GraphHopper's `1.0` build.
|
||||
|
||||
|
||||
## Todo
|
||||
|
||||
Halkyon Todo's server beside the instance (Halkyon Todo's ADR 0033, step 5), at its own
|
||||
domain, a member of the register Learn's server holds (ADR 0016), its database
|
||||
`halkyon_todo` in the instance's PostgreSQL. It reads no task: every row is sealed on
|
||||
the person's devices (ADR 0033, D5), so it needs no sidecar of its own. `redeploy.sh`
|
||||
builds, dumps, migrates and waits for it as for Learn's server once `.env` names its
|
||||
compose file, and `backup.sh` backs its database up beside Learn's.
|
||||
|
||||
Steps, in order:
|
||||
|
||||
1. **Its database** (the operator, on the instance's server, as `deploy`, in
|
||||
`~/halkyon-learn/deploy`): a role of Todo's own, with the password that goes into
|
||||
`.env` as `TODO_POSTGRES_PASSWORD` (`openssl rand -hex 32`), and its database, as
|
||||
Train's (*Train*, step 2, says what each line does):
|
||||
|
||||
```sh
|
||||
docker compose exec -T postgres psql -U halkyon_learn -d postgres -v ON_ERROR_STOP=1 \
|
||||
-v password="<TODO_POSTGRES_PASSWORD>" <<'SQL'
|
||||
CREATE ROLE halkyon_todo LOGIN PASSWORD :'password';
|
||||
CREATE DATABASE halkyon_todo OWNER halkyon_todo;
|
||||
REVOKE CONNECT ON DATABASE halkyon_todo FROM PUBLIC;
|
||||
SQL
|
||||
```
|
||||
|
||||
The `REVOKE`s of Learn's and Train's databases were made with Train's, so
|
||||
`halkyon_todo` connects to neither; on an instance without Train, also
|
||||
`REVOKE CONNECT ON DATABASE halkyon_learn FROM PUBLIC;`.
|
||||
2. **DNS** (the operator, at the domain's DNS): Todo's domain, `todo.halkyon.eu`,
|
||||
pointing at the instance's server (`A`, and `AAAA` if it has an IPv6 address).
|
||||
3. **Switch it on** (the operator, as `deploy`): in `deploy/.env`, `compose.todo.yaml`
|
||||
added to `COMPOSE_FILE`, and Todo's settings (`.env.example`, *With Halkyon Todo*):
|
||||
|
||||
```sh
|
||||
COMPOSE_FILE=compose.yaml:compose.languagetool.yaml:compose.train.yaml:compose.todo.yaml
|
||||
TODO_DOMAIN=todo.halkyon.eu
|
||||
TODO_POSTGRES_PASSWORD=<as in step 1>
|
||||
TODO_SESSION_KEY_HASH_PEPPER=<openssl rand -hex 32>
|
||||
```
|
||||
|
||||
`INSTANCE_SECRET` must be set. The compose file names Todo to Learn's register
|
||||
(`INSTANCE_MEMBER_TODO`).
|
||||
4. **Start it** (the operator, as `deploy`): `docker compose up -d --build`. Caddy and
|
||||
Learn's server are recreated with it (Todo's site, and the register's member); the
|
||||
instance is away for seconds. Todo's server applies its migrations as it starts.
|
||||
5. **Check it**: `https://todo.halkyon.eu/` answers; in Todo, signed in with a Learn
|
||||
account, a task added on one device shows on another.
|
||||
|
|
|
|||
12
deploy/sidecars/todo.caddy
Normal file
12
deploy/sidecars/todo.caddy
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Halkyon Todo's site (compose.todo.yaml, ADR 0033, step 5): its API server alone. Its
|
||||
# web server (8082) takes the register's calls between the instance's services
|
||||
# (`/halkyon-base/…`, ADR 0016) on the instance's own network, never through here.
|
||||
{$TODO_DOMAIN} {
|
||||
encode zstd gzip
|
||||
|
||||
# Serverpod's streaming methods use WebSockets; reverse_proxy upgrades them as-is.
|
||||
# The visitor's address comes last in X-Forwarded-For, as for Learn's server.
|
||||
handle {
|
||||
reverse_proxy todo-server:8080
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue