ferry Documentation

ARCHITECTURE.md

๐Ÿงญ Design Principles

๐Ÿ—„๏ธ Database & Concurrency (SQLite)

ferry uses SQLite in WAL mode with the following mandatory settings:

๐Ÿ’พ Storage Requirements

๐Ÿ›ก๏ธ Backup & Maintenance

SQLite WAL creates additional *.wal and *.shm files. A simple file-level copy while ferry is running is NOT sufficient for a consistent backup. Recommended backup methods:

  1. Stop ferry before copying files.
  2. Use VACUUM INTO 'backup.db'.
  3. Use the CLI: sqlite3 ferry.db ".backup 'backup.db'"

๐Ÿ—„๏ธ Data Model

Blobs (Storage)

Files (Logical)

Shares

Users

๐Ÿงน Internal Cleanup Worker (Mark-and-Sweep)

The cleanup worker is fully implemented and manages the lifecycle of physical data:

  1. Automated: Runs every 15m by default.
  2. Triggerable: Functional via Admin UI or ferry cleanup CLI command.
  3. Internal API: CLI trigger uses a protected HTTP API (/api/admin/cleanup) with the static password as Bearer token.
  4. Mark: Reachable blobs are defined as hashes linked by active, non-expired shares. Unreferenced blobs older than 30m (grace period) are marked with unreachable_since.
  5. Sweep: Blobs marked as unreachable for more than 24h are physically deleted from disk and DB.

โš ๏ธ Transactional Safety & Race Conditions

๐Ÿ” Security Model

Authority & Authentication

Role Model

Identity Model

LDAP/AD Planning

Transport Security For LDAP

Session Management

Multi-User Permissions

Bootstrap & Administration

Admin id:<uuid> Preparation Path

Share Direction Semantics

The current semantic contract for share direction terminology is documented in SHARE_SEMANTICS.md.

System Monitoring & Status (/status)

Storage Integrity & Cleanup Behavior

Login Rules

Break-Glass Recovery Mode

๐Ÿ“Ÿ CLI

๐Ÿ” Encryption Model

ferry does not implement application-level encryption-at-rest.

Rationale

Security Model

Non-Goals

Implications