Commit Graph
19 Commits
Author SHA1 Message Date
tanshu c926f45faa Repair mozimo_net before Caddy restarts onto it
The deploy failed in the network role: the Caddy restart exited 125 with
"unable to find network with name or ID mozimo_net", and with Restart=always
and a 100ms delay the start limit was spent in under a second — taking every
other site this host serves down with it.

The network was gone, but mozimo-network.service was not: it is a oneshot with
RemainAfterExit=yes, so systemd kept reporting it active after the network had
been removed out of band. The generated Requires=mozimo-network.service looked
satisfied, so the flushed "Restart Caddy" handler started Caddy against a
network that no longer existed, and nothing recreated it.

- ansible/roles/network/tasks/main.yaml: daemon-reload after templating the
  unit so it can be started on a first deploy; ask podman (`podman network
  exists`) rather than systemd whether the network is really there; restart
  mozimo-network.service when it is not; confirm it exists before the handler
  flush, so a network that cannot be repaired fails the play rather than the
  host's reverse proxy.
- The Caddy restart condition includes the recreated case: a network that
  comes back keeps its name but not its identity, so Caddy's network namespace
  is stale even when neither template changed.
- ansible/README.md: the oneshot/stale-state trap and the manual recovery.

Verified on emily after recovering Caddy by hand: the play completes with
22 ok / 6 changed / 0 failed, and mozimo and vince run behind Caddy (TLS for
mozimo.in still waits on the DNS cutover).
2026-10-16 10:32:24 +05:30
tanshu d04314ab1c Deploy with rootless podman + Quadlet on emily
Retargets the build and the playbook off rootful Docker on monoco, following the
conventions already in place on emily's other services: Quadlet units in
~/.config/containers/systemd, per-service data in ~/podman-data, and a shared
Caddy that every service registers itself with — a network drop-in plus a
marked block in its Caddyfile. Nothing is published on the host; Caddy reaches
the containers by name over mozimo_net.

- Makefile: podman build + push instead of docker buildx, PLATFORMS=linux/arm64
  (both hosts are aarch64). podman has no built-in QEMU the way buildx's builder
  image does, so a foreign-platform failure now points at qemu-user-static.
- deploy.sh: pass COMMIT= to make, which the Makefile actually reads; it was
  passing TAG=, so the tag silently came from `git rev-parse` instead.
- ansible: hosts emily, become false, XDG_RUNTIME_DIR for rootless podman and
  systemctl --user. Docker modules become Quadlet templates with user-service
  handlers, and the network role now ships mozimo.network plus the Caddy drop-in
  rather than calling docker_network.
- UserNS=keep-id maps the container's uid 1000 (node) and root (vince) onto the
  host user, so PocketBase and Vince write host-owned files instead of
  subuid-owned ones; the play asserts the pinned uid still matches the host.
- ansible/README.md: the unit layout, the service-registration convention, and
  the monoco -> emily migration (PocketBase 23 MB + Vince 119 MB, DNS cutover,
  rollback).

Verified by a check-mode rehearsal against emily (13 ok / 8 changed / 0 failed)
and a disposable Quadlet unit on that host proving the uid mapping, the
EnvironmentFile and the isolated network. The real build and cutover have not
been run.
2026-10-16 10:11:39 +05:30
tanshu 4a3863a809 301 from www to apex 2026-10-13 12:18:44 +00:00
tanshu 84dffa8451 Promoted to main website. 2026-09-06 16:58:31 +00:00
tanshu 3929d3f0b2 Vince fixed 2026-09-06 16:34:23 +00:00
tanshu 605b4b16cc Wrong image 2026-09-06 16:09:46 +00:00
tanshu e0eb577e3e Google analytics integration.
Sentry.io integration.
Vince integration.
Region-scoped consent (denied-by-default in EU/EEA/UK/CH, granted elsewhere, DPDP-friendly notice)
2026-09-06 16:03:13 +00:00
tanshu 2524f0c46f Caddy role: single files/Caddyfile.j2 template (overlord pattern)
- template moved to ansible/files/Caddyfile.j2, tasks folded into main.yaml
2026-09-06 09:01:46 +00:00
tanshu c4a6425926 Caddy: adopt dual-role snippet (PB api+admin on main host), relative PB file urls
- www host: /_* and /api/* proxy to pocketbase :8090, everything else to
  the TanStack app; redir /_ /_/ for the admin path
- cms host unchanged: redir / -> /_/
- migration: legacy per-host marker blocks are removed before the new
  combined block is installed
- cms.ts: PB file urls are now same-origin relative (/api/files/...) —
  browsers could never load the old 127.0.0.1:8090 urls; validated the
  rendered Caddyfile with caddy:2
2026-09-06 14:22:09 +05:30
tanshu f5d5dcac94 vars: pb_root flag on the cms caddy host (dashboard at /) 2026-09-06 14:16:57 +05:30
tanshu c5e89f0f90 Caddy: PocketBase dashboard reachable at cms host root (redir / -> /_/)
- snippet generation moved to a j2 template; per-host pb_root flag
- cms.mozimo.in emits 'redir / /_/' before reverse_proxy (pattern from
  overlord's Caddyfile); other hosts unchanged
- snippets now update in place (blockinfile idempotency) instead of
  skipping when the desired block changed
2026-09-06 14:15:52 +05:30
tanshu 7d29886975 cleanup 2026-09-06 08:02:01 +00:00
tanshu 134f0b0a7a Deploy workflow: commit-id image tags, guarded deploy.sh, opt-in prune
- Makefile builds from 'git archive HEAD' (stale-remote-HEAD impossible):
  tags registry.tanshu.com/mozimo:<short-commit> + :main; build-check target
  verifies both architectures without pushing
- deploy.sh: refuses dirty tracked tree / HEAD != origin/main (--force to
  bypass), ff-only pull, passes the commit as image_tag to ansible,
  --prune flag for opt-in image cleanup
- ansible: docker_image uses image_tag extra-var (falls back to tag),
  prune task keeps the 3 newest mozimo images, mozimo-repo only
2026-09-06 13:21:16 +05:30
tanshu c80c2b0b12 cms typo 2026-09-06 06:52:23 +00:00
tanshu 328a1a23e0 Agent skills
Prettier
eslint
shopify
2026-09-06 06:38:04 +00:00
tanshu 7961a3d2a6 deepseek harness 2026-09-03 10:11:31 +00:00
tanshu ed959df5e9 Updated hosts for non www usage 2026-04-19 10:11:30 +00:00
tanshu e94dec0036 Performance improvements and Dockerfile update 2026-04-19 09:54:47 +00:00
tanshu 7b1ee49d11 Added google tag
Added ansible
Added deploy.sh
2025-10-04 14:53:45 +00:00