aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-06 05:09:56 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-06 05:51:49 +0100
commitff8da797a143cb1dfbeb4ce2d2c3e4a1d0c2e56a (patch)
treec51bbbd084f531d11ba765186cc5d39709e40ba3 /README.md
parent804b8841f3fe59f7058c91fa25c1694f4433642a (diff)
downloadslcl-ff8da797a143cb1dfbeb4ce2d2c3e4a1d0c2e56a.tar.gz
Implement user quota
This feature allows admins to set a specific quota for each user, in MiB. This feature is particularly useful for shared instances, where unlimited user storage might be unfeasible or even dangerous for the server. Also, a nice HTML5 <progress> element has been added to the site that shows how much of the quota has been consumed. If no quota is set, slcl falls back to the default behaviour i.e., assume unlimited storage. Limitations: - While HTTP does specify a Content-Length, which determines the length of the whole request, it does not specify how many files are involved or their individual sizes. - Because of this, if multiple files are uploaded simultaneously, the whole request would be dropped if user quota is exceeded, even if not all files exceeded it. - Also, Content-Length adds the length of some HTTP boilerplate (e.g.: boundaries), but slcl must rely on this before accepting the whole request. In other words, this means some requests might be rejected by slcl because of the extra bytes caused by such boilerplate. - When the quota is exceeded, slcl must close the connection so that the rest of the transfer is cancelled. Unfortunately, this means no HTML can be sent back to the customer to inform about the situation.
Diffstat (limited to 'README.md')
-rw-r--r--README.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/README.md b/README.md
index 03309de..241dd8b 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ simplicity and efficiency.
## Features
-- Private access directory with file uploading.
+- Private access directory with file uploading, with configurable quota.
- Read-only public file sharing.
- Its own, tiny HTTP/1.0 and 1.1-compatible server.
- A simple JSON file as the credentials database.
@@ -128,15 +128,17 @@ schema:
"name": "...",
"password": "...",
"salt": "...",
- "key": "..."
+ "key": "...",
+ "quota": "..."
}]
}
```
-[`usergen`](usergen) is an interactive script that consumes a username and
-password, and writes a JSON object that can be appended to the `users` JSON
-array in `db.json`. A salt is randomly generated using `openssl` and passwords
-are hashed multiple times beforehand - see [`usergen`](usergen) and
+[`usergen`](usergen) is an interactive script that consumes a username, a
+password and, optionally, a user quota in MiB. Then, [`usergen`](usergen)
+writes a JSON object that can be appended to the `users` JSON array in
+`db.json`. A salt is randomly generated using `openssl` and passwords are
+hashed multiple times beforehand - see [`usergen`](usergen) and
[`auth.c`](/auth.c) for further reference. Also, a random key is generated
that is later used to sign HTTP cookies.