Capture td tasks from iPhone (Drafts) and ingest them into local project-specific td databases on Mac.
This project provides a lightweight bridge:
- iPhone Drafts sends task text to a hosted HTTPS endpoint.
- DigitalOcean endpoint queues items (
btcorphotos). - Mac
launchdpuller polls queue, runstd createin correct project dir, and ACKs processed items.
This avoids exposing your Mac directly to the internet and works well with intermittent Mac availability.
Draft content format:
project@priority@title@notes
Examples:
btc@P2@Fix reconnect jitter@check startup burst behavior
photos@P1@Update itinerary map line@line still missing in some cases
giftlist@P3@Add birthday idea for dad@hiking boots size 11
gmailwiz@P2@Tune label rules@inbox-zero pass missing newsletters
Rules:
project:btc,photos,giftlist, orgmailwizpriority:P0,P1,P2,P3title:tdrequires minimum 15 characters (puller pads short titles)
td_do_puller.py: Mac queue consumer +td createexecutor.drafts_send_to_td.js: Drafts action script (POST to endpoint).td_do_puller.env: local runtime config (endpoint/token/pull limit). Secret.DO_DRAFTS_SETUP.md: operator notes for iPhone action setup.do-server/: canonical copy of the DigitalOcean queue server code (see below).
The hosted endpoint at https://gaylon.photos/td-capture runs on a DigitalOcean droplet. The code in do-server/ is the authoritative local copy — the droplet is not under git, so this repo is the source of truth.
- Droplet:
root@134.199.211.199(SSH aliassshDOin~/.zshrc).gaylon.photosresolves to Cloudflare, not the droplet — always SSH by IP. - Path on droplet:
/opt/td-capture/(server.py,.env,queue.db). - Service:
systemctl {status,restart} td-capture.service. Unit file at/etc/systemd/system/td-capture.service(mirrored here asdo-server/td-capture.service). - Project whitelist:
server.pyvalidates theprojectfield server-side. Allowed values must be kept in sync withPROJECT_MAPintd_do_puller.py. Currently:btc,photos,giftlist,gmailwiz.
scp do-server/server.py root@134.199.211.199:/opt/td-capture/server.py
ssh root@134.199.211.199 'systemctl restart td-capture.service && systemctl is-active td-capture.service'
curl -fsS https://gaylon.photos/td-capture/health- Ensure
tdCLI is installed and project DBs exist. - Configure
td_do_puller.env:
TD_DO_CAPTURE_BASE=https://your-domain/td-capture
TD_DO_CAPTURE_TOKEN=<SECRET_TOKEN>
TD_DO_PULL_LIMIT=25- Load launch agent:
launchctl bootstrap gui/$(id -u) /Users/<you>/Library/LaunchAgents/com.td.do-puller.plist
launchctl kickstart -k gui/$(id -u)/com.td.do-puller- Verify:
launchctl print gui/$(id -u)/com.td.do-puller | head -n 40
tail -n 80 /Users/<you>/logs/td-importer/td-do-puller.out.log
tail -n 80 /Users/<you>/logs/td-importer/td-do-puller.err.logCreate action Send to td with one Run JavaScript step.
drafts_send_to_td.js expects a tokenized endpoint:
let endpoint = "https://your-domain/td-capture?token=<SECRET_TOKEN>";Then run action on a draft using the project@priority@title@notes format.
Expected endpoints:
POST /td-captureor/td-capture/enqueueGET /td-capture/pull?limit=NPOST /td-capture/ackPOST /td-capture/requeueGET /td-capture/health
- Do not commit live tokens in:
td_do_puller.envdrafts_send_to_td.js- setup docs with tokenized URLs
- Rotate token if previously exposed in screenshots/chats.
- Prefer placeholder values in docs and local-only secret files.
- Puller uses file lock to avoid concurrent runs.
- On transient failures, items are requeued.
- Successfully processed IDs are recorded in
td_do_processed_ids.txt.
HTTP 401 unauthorized: token mismatch between Drafts/Mac and hosted endpoint.pulled=0repeatedly: queue empty or wrong token.- No task created: check
td-do-puller.err.logand title length/priority/project values.