infra/docker-compose-deployment #1

Merged
huantrinh1802 merged 2 commits from infra/docker-compose-deployment into main 2026-09-21 19:03:08 +10:00
No description provided.
Why:
- ntfy access tokens (Authorization: Bearer <token>) are needed to
  publish to a self-hosted/protected ntfy instance, per
  https://notify.bentribyte.app/docs/publish/#access-tokens

What:
- send_ntfy_message() now reads an optional notify.ntfy.server config
  key (defaults to https://ntfy.sh, unchanged from before) and an
  optional notify.ntfy.token key, sent as an Authorization: Bearer
  header when set.

Impact:
- No breaking change: without server/token set in
  ~/.config/khal/task_cal.toml, behavior is identical to before.
Why:
- Self-host the sync daemon, mail/calendar bridging, and Taskwarrior
  sync server as a Docker Compose stack instead of running the daemon
  only via macOS launchd/cron.

What:
- Move task/ and templates/ into src/ so the Dockerfile can COPY the
  whole repo into the image cleanly.
- Dockerfile: drop the SSH-agent/git-clone plumbing for pulling the
  app repo from GitHub at build time (COPY . . now bakes in the
  working tree directly - no runtime git access needed); drop the
  vestigial TODOIST_TOKEN build ARG (nothing reads it since Todoist
  was removed - ARGs land in image history even unused); drop the
  broken `ln -s .../.loca/bin/vdirsyncer` symlink (dead code, ENV
  PATH already covers /root/.local/bin).
- docker-compose.yaml / compose_restart.sh: drop the now-unused
  SSH_AUTH_SOCK plumbing and TODOIST_TOKEN arg/env; compose_restart.sh
  now rebuilds on every restart (`up -d --build`) since code is baked
  into the image rather than git-pulled at container start.
- startup.sh: fix `/etc/envinroment` typo (was silently never
  refreshing cron's environment with runtime secrets) and drop the
  git pull step that no longer applies.
- crontab.txt: fix the sync cron job to run `.venv/bin/python3` from
  `src/` (it was invoking the bare system python3, which has none of
  the project's dependencies installed, and was still pointing at the
  pre-reorg working directory).
- Add task/notify.py:check_davmail_auth(), a task/main.py
  `check_davmail` subcommand, and a crontab entry (every 15 min):
  probes davmail's local CalDAV proxy for the Fonto mailbox and
  notifies (via ntfy, throttled like the existing vdirsyncer-error
  path) when it starts rejecting requests - davmail's O365Manual mode
  needs interactive re-authentication once its cached OAuth session
  expires. Required extending task/utilities.py's counter.json state
  with a davmail_auth_count field, and fixing reset_state() to
  preserve vdirsyncer_count/davmail_auth_count instead of always
  zeroing them (it previously clobbered the vdirsyncer counter on
  every successful sync cycle, defeating its own throttle).
- .dockerignore: keep secrets/venv/caches out of the build context.
- .gitignore: cover the deploy-time secret/config files this compose
  setup needs (.taskrc, .mbsyncrc, PMSCred.json, task_config.toml,
  *.token, *.p12, davmail-config/, /data/) so creating them locally
  can't accidentally get them committed.
- README.md: document every file this deployment needs, which are
  already in the repo vs. must be provisioned locally, and how to
  deploy.

Impact:
- Breaking (deploy-only): the previous "git pull inside the running
  container" update path no longer works - `compose_restart.sh`
  rebuilds instead. First build still requires manually placing the
  files listed in README.md at the repo root (none of them exist in
  this checkout).
- No change to the existing macOS launchd/cron deployment path.
huantrinh1802 deleted branch infra/docker-compose-deployment 2026-09-21 19:03:08 +10:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
huantrinh1802/taskwarrior_sync_server!1
No description provided.