HTTP config sync via hello server #1

Open
opened 2026-08-07 14:23:08 +00:00 by hum3 · 0 comments
Owner

Summary

Add HTTP-based config sync so gomail instances can fetch and push rules via the hello server (e.g. http://hello:1961).

Motivation

Currently rules (gomail.yaml) and learned senders (gomail-learned.yaml) are local files. This means:

  • No backup if the device dies
  • Test/dev environments can't easily share the same rules
  • No central management of rules across instances

Proposed approach

Add endpoints to the hello server (or gomaild itself):

  • GET /config/gomail/rules — fetch current rules
  • GET /config/gomail/learned — fetch learned senders
  • PUT /config/gomail/learned — push updated learned senders

gomail would:

  1. On startup, fetch rules from the HTTP endpoint (with local file as fallback)
  2. After learning new senders, push the updated list to the server
  3. Server persists to a git-backed directory for version control

Alternatives considered

  • Git repo on device: Requires git + auth on gokrazy (not pure Go)
  • GOMAIL_CONFIG_DIR env var: Already implemented — solves path issues but not sync/backup
  • S3/object storage: Over-engineered for this use case

Fixed in the same release: learned senders save path now co-locates with gomail.yaml and supports GOMAIL_CONFIG_DIR override.


Migrated from Codeberg: originally #1, opened 2026-04-08.

## Summary Add HTTP-based config sync so gomail instances can fetch and push rules via the hello server (e.g. `http://hello:1961`). ## Motivation Currently rules (`gomail.yaml`) and learned senders (`gomail-learned.yaml`) are local files. This means: - No backup if the device dies - Test/dev environments can't easily share the same rules - No central management of rules across instances ## Proposed approach Add endpoints to the hello server (or gomaild itself): - `GET /config/gomail/rules` — fetch current rules - `GET /config/gomail/learned` — fetch learned senders - `PUT /config/gomail/learned` — push updated learned senders gomail would: 1. On startup, fetch rules from the HTTP endpoint (with local file as fallback) 2. After learning new senders, push the updated list to the server 3. Server persists to a git-backed directory for version control ## Alternatives considered - **Git repo on device**: Requires git + auth on gokrazy (not pure Go) - **GOMAIL_CONFIG_DIR env var**: Already implemented — solves path issues but not sync/backup - **S3/object storage**: Over-engineered for this use case ## Related Fixed in the same release: learned senders save path now co-locates with gomail.yaml and supports `GOMAIL_CONFIG_DIR` override. --- *Migrated from Codeberg: originally [#1](https://codeberg.org/hum3/gomail/issues/1), opened 2026-04-08.*
Sign in to join this conversation.
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
hum3/gomail#1
No description provided.