Files
Mateusz PstruchaandClaude Opus 5.5 90fc65dbf5 Add live change notifications and notify/don't-notify rules
Every change is appended to an events table and broadcast to open
WebSockets (GET /api/ws); GET /api/events?since= reads the same log as
the polling fallback and delta endpoint, so clients can switch
transports without losing their place. Inserts are serialised so ids
are ordered by commit, cursors older than the 7-day retention reset,
and the socket authenticates in-band since browsers can't set headers.

New mail notifies when it's unread and still in the inbox after rules;
rule actions notify / dont_notify override that, last one applied
wins. An account's first sync and UIDVALIDITY re-syncs are backlog and
never notify. Thread actions, outbox status, and tag/folder/rule/
account edits emit events too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 18:55:34 +02:00

32 lines
1.0 KiB
Nginx Configuration File

# Minimal reverse proxy per server-architecture-spec.md §7: nginx terminates
# TLS (add a cert + `listen 443 ssl;` for real deployment — this is the
# plain-HTTP local-dev shape) and forwards to the API, which never needs to
# be reachable directly.
# Only ask for an upgrade when the client did; plain requests keep
# ordinary keep-alive semantics.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name _;
location / {
proxy_pass http://server:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket upgrade for /api/ws (live notifications). The server
# pings every 25 s, so the default 60 s proxy_read_timeout never
# cuts an idle socket.
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}