feat: serve the public web from the daemon and document the archive

- Add web.listen config (default 127.0.0.1:8081, empty disables)
- Start the public web in app, close it with the rest
- Add end-to-end test: archive stays private, becomes public, hides addresses, one-click unsubscribe works
- Cover mutation survivors: attachments, first text part, multibyte cap, member id 0, page clamp, API limit cap, closing connections
- Update OpenAPI, README and example config
This commit is contained in:
tgiachi 2026-11-09 15:22:50 +01:00
commit 8f64ac671d

View file

@ -22,6 +22,19 @@ components:
address: {type: string}
post_policy: {type: string, enum: [members, moderated]}
join_policy: {type: string, enum: [open, closed]}
archive_policy: {type: string, enum: [public, private, off], description: "public: browsable on the web; private: API only (default); off: not stored"}
Message:
type: object
properties:
id: {type: integer}
thread_id: {type: integer}
message_id: {type: string}
in_reply_to: {type: string}
subject: {type: string}
sender: {type: string, description: Display name of the author}
date: {type: string, format: date-time}
size: {type: integer}
body: {type: string, description: Only when reading a single message}
Member:
type: object
properties:
@ -108,6 +121,7 @@ paths:
title: {type: string}
post_policy: {type: string, enum: [members, moderated]}
join_policy: {type: string, enum: [open, closed]}
archive_policy: {type: string, enum: [public, private, off]}
responses:
'200':
description: OK
@ -191,3 +205,41 @@ paths:
responses:
'204': {description: Discarded}
'404': {$ref: '#/components/responses/Error'}
/lists/{id}/archive:
parameters:
- {name: id, in: path, required: true, schema: {type: integer}}
get:
summary: List or search archived messages, newest first
parameters:
- {name: q, in: query, schema: {type: string}, description: Full-text search over subject, body and sender; words are ANDed}
- {name: limit, in: query, schema: {type: integer, default: 50, maximum: 200}}
- {name: offset, in: query, schema: {type: integer, default: 0}}
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
total: {type: integer}
messages: {type: array, items: {$ref: '#/components/schemas/Message'}}
'400': {$ref: '#/components/responses/Error'}
'404': {$ref: '#/components/responses/Error'}
/archive/{id}:
parameters:
- {name: id, in: path, required: true, schema: {type: integer}}
get:
summary: Read an archived message with its body
responses:
'200':
description: OK
content:
application/json:
schema: {$ref: '#/components/schemas/Message'}
'404': {$ref: '#/components/responses/Error'}
delete:
summary: Delete an archived message and its search entry
responses:
'204': {description: Deleted}
'404': {$ref: '#/components/responses/Error'}