2023-02-23 01:16:48 +01:00
|
|
|
.TH SLCL 1 slcl
|
|
|
|
|
|
|
|
.SH NAME
|
|
|
|
slcl \- a suckless cloud
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B slcl
|
|
|
|
.RB [-t
|
|
|
|
.IR tmpdir ]
|
|
|
|
.RB [-p
|
|
|
|
.IR port ]
|
|
|
|
.RB dir
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.B slcl
|
|
|
|
is a simple and fast implementation of a web file server, commonly
|
|
|
|
known as "cloud storage" or simply "cloud", that takes a directory
|
|
|
|
.IR dir
|
|
|
|
where the credentials database and user files are stored (see
|
|
|
|
.B FILES
|
|
|
|
below).
|
|
|
|
|
|
|
|
.SH OPTIONS
|
|
|
|
.BI \-t " tmpdir"
|
|
|
|
Defines the directory where temporary files created by
|
|
|
|
.B slcl
|
|
|
|
are stored. If not specified, the environment variable
|
|
|
|
.I TMPDIR
|
|
|
|
is selected. However, if no value is available for
|
|
|
|
.IR TMPDIR ,
|
|
|
|
.I /tmp
|
|
|
|
is selected.
|
|
|
|
|
|
|
|
.BI \-p " port"
|
|
|
|
Defines the TCP
|
|
|
|
.I port
|
|
|
|
.B slcl
|
|
|
|
will listen to. If not specified, a random port is used.
|
|
|
|
|
|
|
|
.SH FILES
|
|
|
|
|
|
|
|
.B slcl
|
|
|
|
consumes a path to a directory with the following tree structure:
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.EX
|
|
|
|
\ .
|
|
|
|
├── db.json
|
|
|
|
├── public/
|
|
|
|
└── user/
|
|
|
|
.EE
|
|
|
|
|
|
|
|
Where:
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.B db.json
|
|
|
|
This file is the credentials database, in JSON.
|
|
|
|
.B Note:
|
|
|
|
if not found,
|
|
|
|
.B slcl
|
|
|
|
creates a database with no users, with file mode bits set to
|
|
|
|
.IR 0600 .
|
|
|
|
The following schema is expected:
|
|
|
|
.PP
|
|
|
|
.EX
|
|
|
|
{
|
|
|
|
"users": [{
|
|
|
|
"name": "...",
|
|
|
|
"password": "...",
|
|
|
|
"salt": "...",
|
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.
2023-03-06 05:09:56 +01:00
|
|
|
"key": "...",
|
|
|
|
"quota": "..."
|
2023-02-23 01:16:48 +01:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
.EE
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.B public/
|
|
|
|
This directory contains read-only files that can be accessed without
|
|
|
|
authentication, implemented as symlinks to other files in
|
|
|
|
.BR user/ .
|
|
|
|
.B Note:
|
|
|
|
this directory must be created before running
|
|
|
|
.BR slcl .
|
|
|
|
|
|
|
|
.TP
|
|
|
|
.B user/
|
|
|
|
This directory contains user directories, which in turn contain anything users
|
|
|
|
put into them.
|
|
|
|
.B Note:
|
|
|
|
this directory, as well as any user directories inside it, must be created
|
|
|
|
before running
|
|
|
|
.BR slcl .
|
|
|
|
|
|
|
|
.SH EXAMPLES
|
|
|
|
|
|
|
|
Below, there is an example of a directory with two users, namely
|
|
|
|
.I alice
|
|
|
|
and
|
|
|
|
.IR john ,
|
|
|
|
storing one file each, as well as a publicly-shared file by
|
|
|
|
.IR alice :
|
|
|
|
|
|
|
|
.PP
|
|
|
|
.EX
|
|
|
|
\ .
|
|
|
|
├── db.json
|
|
|
|
├── public
|
|
|
|
│ └── 416d604c03a1cbb2 -> user/alice/file.txt
|
|
|
|
└── user
|
|
|
|
├── alice
|
|
|
|
│ └── file.txt
|
|
|
|
└── john
|
|
|
|
└── file2.txt
|
|
|
|
.EE
|
|
|
|
|
|
|
|
.SH LICENSE
|
|
|
|
See the LICENSE file for further reference.
|
|
|
|
|
|
|
|
.SH AUTHORS
|
|
|
|
Written by Xavier Del Campo Romero.
|
|
|
|
|
|
|
|
.SH TODO
|
|
|
|
Implement user quota and public file sharing.
|