1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Vendor-agnostic file storage for systemprompt.io.
//!
//! Every writer of user-visible files (uploads, generated images) goes
//! through the [`FileStorage`] trait so the backend can be swapped without
//! touching the domain crates. Today the only backend is
//! [`LocalFileStorage`], which writes under a single root directory; that
//! root may be a local disk or a shared mount visible to every replica.
//!
//! Storage ids are paths relative to the root (`files/uploads/…`). They are
//! validated on every call: absolute paths and `..` components are rejected
//! before any filesystem access.
//!
//! # Modules
//!
//! - [`local`] — [`LocalFileStorage`] and the id-to-path resolver.
//! - [`probe`] — [`probe_shared_mount`], the boot-time check that a
//! `storage.shared` root really is shared between replicas.
//!
//! Copyright (c) systemprompt.io — Business Source License 1.1.
//! See <https://systemprompt.io> for licensing details.
use Path;
use Arc;
use StorageBackend;
use FileStorage;
pub use LocalFileStorage;
pub use ;