Covers phases 1-2 of the build order in the architecture spec: the IMAP sync engine (IDLE + UIDVALIDITY tracking + jittered reconnect, headers first with lazy body fetch), the full data model, and a minimal REST API for auth, accounts, folders, messages and delta polling. Credentials are encrypted at rest with ChaCha20-Poly1305 rather than libsodium secretbox, to avoid a system dependency for the same construction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 lines
600 B
Bash
17 lines
600 B
Bash
# Copy to .env for local development (docker-compose reads this automatically
|
|
# for the `db` service password; the app reads it via dotenvy at startup).
|
|
|
|
DATABASE_URL=postgres://tern:tern@localhost:5432/tern
|
|
BIND_ADDR=127.0.0.1:8080
|
|
|
|
# 32 random bytes, base64-encoded. Generate with: openssl rand -base64 32
|
|
# Encrypts stored IMAP/SMTP credentials at rest (see src/crypto.rs). Losing
|
|
# this key makes every stored account credential unrecoverable — back it up
|
|
# outside the database.
|
|
CREDENTIAL_KEY=
|
|
|
|
BLOB_STORAGE_DIR=./data/blobs
|
|
SESSION_TTL_HOURS=720
|
|
|
|
RUST_LOG=tern_server=debug,tower_http=debug
|