diff --git a/.env.example b/.env.example index 4aaff53..5b16271 100644 --- a/.env.example +++ b/.env.example @@ -32,6 +32,14 @@ GOFTP_RUN_AS= # Largest accepted upload per file, e.g. 10GiB; 0 = unlimited. GOFTP_UPLOAD_MAX_SIZE=0 +# Free disk space that uploads leave for the database and everything else +# on the disk, e.g. 5GiB; 0 = no check. +GOFTP_UPLOAD_MIN_FREE=1GiB + +# How much each user's home may hold, along with what they deleted from it +# that is in the trash, e.g. 10GiB; 0 = no limit. `goftp user quota NAME +# SIZE` sets it for one user. +GOFTP_HOMES_QUOTA=0 # Connections one client may hold at once when clients connect directly, # e.g. 100; 0 = no limit. Behind a reverse proxy, limit them there. diff --git a/README.md b/README.md index 7a8d051..5b06144 100644 --- a/README.md +++ b/README.md @@ -216,8 +216,8 @@ token. `POST /.auth/logout` ends the session. Sessions last needs a Content-Length. The target directory must exist, and `upload.max_size` caps each file. -Uploads stop short of the disk's last `upload.min_free` bytes (1 GiB by -default; `0` turns the check off), which stay for the database and +Uploads stop short of the disk's last `upload.min_free` bytes +(`GOFTP_UPLOAD_MIN_FREE`; 1 GiB by default, `0` turns the check off), which stay for the database and everything else on that disk: the upload gets `507 Insufficient Storage`. Users who may upload new files into a folder (`write`) can also create folders in it, with the "New folder" button or diff --git a/docker-compose.yml b/docker-compose.yml index 0fa8d72..c83f00f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,8 @@ services: GOFTP_DATABASE_URL: postgres://goftp@postgres:5432/goftp?sslmode=disable PGPASSWORD: ${POSTGRES_PASSWORD} GOFTP_UPLOAD_MAX_SIZE: ${GOFTP_UPLOAD_MAX_SIZE:-0} + GOFTP_UPLOAD_MIN_FREE: ${GOFTP_UPLOAD_MIN_FREE:-1GiB} + GOFTP_HOMES_QUOTA: ${GOFTP_HOMES_QUOTA:-0} GOFTP_SERVER_MAX_CONNS_PER_IP: ${GOFTP_MAX_CONNS_PER_IP:-0} GOFTP_SERVER_PROXY_HEADER: ${GOFTP_PROXY_HEADER:-} GOFTP_SERVER_TRUSTED_PROXIES: ${GOFTP_TRUSTED_PROXIES:-}