1 parent
ecc201ef50
commit
698e3c4a1b
124 files changed
+4593
-2721
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# RustBox 0.1.0
|
||||
# RustBox 0.1.1
|
||||
|
||||
RustBox is a webmail derived from `c0h1b4/oxi`. The consumed Oxi revision is recorded in `UPSTREAM_BASE`.
|
||||
|
||||
@@ -70,27 +70,33 @@ If the mail host settings are omitted, RustBox uses `localhost` with IMAP `993`
|
||||
|
||||
Mail-size limits are intentionally separate. `max_attachment_size_mb` applies to each raw uploaded file, while `max_message_size_mb` is checked against the final RFC822/MIME byte stream immediately before SMTP submission. The latter therefore includes message bodies, headers, MIME boundaries, base64 expansion, inline CID parts and OpenPGP transformations. The composer displays only an estimate; the server-side final-MIME check is authoritative.
|
||||
|
||||
## Persistent sessions and cluster traffic
|
||||
## Database, sessions and cluster traffic
|
||||
|
||||
RustBox 0.1.0 persists login sessions by default in SQLite at `data_dir/rustbox.sqlite`. The session contains encrypted IMAP/SMTP credentials so it can survive a process restart; the encryption key is stored as `data_dir/session.key` with restrictive permissions for the default single-node SQLite setup.
|
||||
RustBox 0.1.1 uses one SQL backend for the whole application. `database_backend = "sqlite" | "mysql" | "pgsql"` selects where account data is stored and, by default, where persistent login sessions are stored. SQLite defaults to `data_dir/rustbox.sqlite`; MySQL and PostgreSQL require `database_url`.
|
||||
|
||||
RustBox uses `rusqlite` for SQLite and `sqlx` only for MySQL/PostgreSQL, avoiding duplicate native SQLite linkage in the Cargo dependency graph.
|
||||
Account data remains isolated per account inside the selected database. Existing 0.1.0 per-user SQLite databases at `data_dir/<user_hash>/db.sqlite` are imported on first access when they are at schema version 46; the source file is retained as `db.sqlite.pre-0.1.1.bak` after a successful import.
|
||||
|
||||
The session database backend can be `sqlite`, `mysql` or `pgsql`. For multi-node deployments use MySQL/PostgreSQL or Redis, set `cluster_mode = true`, and provide the same base64-encoded 32-byte `session_encryption_key` on every node. Redis is configured independently from the database and can use either a direct URL or Redis Sentinel discovery.
|
||||
`session_backend = "database"` stores sessions in the selected application database. `session_backend = "redis"` uses Redis instead; Redis Sentinel is supported through the Sentinel settings. For a multi-node deployment the application database itself must be shared MySQL/PostgreSQL, even when Redis stores sessions. Provide the same base64-encoded 32-byte `session_encryption_key` on every node that shares sessions.
|
||||
|
||||
```toml
|
||||
# Default: SQLite under data_dir.
|
||||
# Default: the whole application uses SQLite under data_dir.
|
||||
database_backend = "sqlite"
|
||||
# database_url = "sqlite:///var/lib/rustbox/rustbox.sqlite?mode=rwc"
|
||||
session_backend = "database"
|
||||
|
||||
# Shared SQL example:
|
||||
# Full PostgreSQL backend:
|
||||
# database_backend = "pgsql"
|
||||
# database_url = "postgres://rustbox:secret@db/rustbox"
|
||||
# cluster_mode = true
|
||||
# session_backend = "database"
|
||||
# session_encryption_key = "<base64-32-byte-key>"
|
||||
|
||||
# Redis example; the application database remains configured separately above.
|
||||
# Full MySQL backend (MySQL 8.0.13+):
|
||||
# database_backend = "mysql"
|
||||
# database_url = "mysql://rustbox:secret@db/rustbox"
|
||||
# session_backend = "database"
|
||||
# session_encryption_key = "<base64-32-byte-key>"
|
||||
|
||||
# Optional Redis session persistence; application data still uses database_backend.
|
||||
# session_backend = "redis"
|
||||
# redis_url = "redis://redis:6379/"
|
||||
|
||||
@@ -101,7 +107,7 @@ session_backend = "database"
|
||||
# redis_password = "secret"
|
||||
```
|
||||
|
||||
All executable application SQL is centralized by dialect under `src/queries/{sqlite,mysql,pgsql}/queries.rs`. The migration tree is flat per dialect: `migrations/sqlite/`, `migrations/mysql/`, and `migrations/pgsql/`. SQLite user-schema migrations are `V001`-`V046`, and the session schema is `V047__sessions.sql` for each SQL dialect.
|
||||
All executable application SQL is centralized by dialect under `src/queries/{sqlite,mysql,pgsql}/queries.rs`. Each engine has one complete baseline in `migrations/{sqlite,mysql,pgsql}/schema.sql`, including the session table. The squashed baseline is schema version 46 and the next schema migration number is V047 for all engines. Redis requires no SQL migration. See `migrations/README.md`.
|
||||
|
||||
|
||||
## Development
|
||||
@@ -170,7 +176,7 @@ Initialize Git after extracting the release archive:
|
||||
```bash
|
||||
git init
|
||||
git add .
|
||||
git commit -m "RustBox 0.1.0 release"
|
||||
git commit -m "RustBox 0.1.1 release"
|
||||
./scripts/setup-upstream.sh
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user