Attempts to read each original from a source storage provider before the
import gives up: one initial try plus one retry. The object store performs
its own internal retries under each attempt, so a transient provider blip
rarely reaches this outer limit.
Whether a Conduit media entry was blocked by a moderator. Conduit keeps the
file and refuses it only at read time (blocked_servername_mediaid);
tuwunel has no per-media blocklist, so importing a blocked original would
serve it again. The blocklist key is server_name 0xff media_id, the same
bytes as the servernamemediaid_metadata key, so the entryβs raw key probes
it directly. Only a clean miss imports; a hard read error aborts the import
(like an unreachable source) rather than silently re-serving blocked media.
The object-store key of a Conduit content-addressed media object, the same
shard segments as conduit_media_path joined by /. The source providerβs
base_path supplies any bucket prefix (Conduitβs media.path).
Reconstructs the on-disk path of a Conduit content-addressed media file from
the lowercase SHA-256 hex digest naming it, matching Conduitβs
split_media_path: media_dir joined with the digestβs shard segments.
Splits a lowercase SHA-256 hex digest into Conduitβs shard segments: depth
segments of length characters then the remainder, or the whole digest when
depth is zero (a flat layout). config::check bounds depth * length
below the digest length so the segments never overrun it.
Whether a provider read failed because the object is absent (a 404 or a
dangling metadata row), which is skipped rather than retried. tuwunelβs
Error::is_not_found does not cover the object-store variant, so match it
directly.
Resolves the configured Conduit media source. A named provider must already
be defined under [storage_provider]; its absence is an operator error that
aborts the import rather than silently dropping every file.
Imports Conduitβs pending knocks. Conduit names the columns
roomuserid_knockcount / userroomid_knockstate; tuwunel renamed them to
*knocked* but kept the byte layout (room_id 0xff user_id -> u64 count;
user_id 0xff room_id -> JSON stripped state), so each row copies verbatim.
Imported once: tuwunel clears a knock on the userβs join or leave, so a
re-import would resurrect a knock the user has already resolved.
Splits a servernamemediaid_metadata value into its digest, filename, and
content type. The value is sha256(32) | filename | 0xff | content_type
with an optional trailing 0xff that Conduitβs media-auth migration appends
to flag unauthenticated access; that flag is ignored.
Reads one Conduit original, named by its content digest, from the configured
media source. A filesystem file that cannot be read is reported as None
(skipped, like a dangling metadata row). A source storage provider is
retried on a transient fault; a persistent one returns Err so the import
aborts instead of dropping reachable media.
Reads one original from the source storage provider. An absent object is
skipped (Ok(None)) like a dangling filesystem row; a transient fault is
retried up to PROVIDER_READ_ATTEMPTS times, and a persistent one aborts
the import with an Err.