Skip to main content

Module quotas

Module quotas 

Source
Expand description

Storage quotas: an optional limit per user (users.storage_quota_bytes) and one for the whole vault (vault_quota.total_bytes). Both count the sizes of the stored file versions – identical content stored twice counts twice, as it does for the user who uploads it; purged versions free their share. Without a limit (the default) nothing is checked.

Every path that stores versions goes through files::store_uploads, which calls ensure_room in its transaction; chunked uploads check their announced size up front, before any bytes are sent.

Structs§

Usage
Limit and usage of one user or of the vault, in bytes.

Functions§

parse_limit_mb
Parses the --mb argument of the CLI: a number of MiB or none.
set_user_quota
Sets (or with None removes) the storage quota of a user. Admins only; stored versions are never removed – a user over the new limit just cannot store more.
set_vault_quota
Sets (or with None removes) the storage quota of the whole vault. Admins only.
user_usage
Limit and usage of a user.
vault_usage
Limit and usage of the whole vault.