1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
.TH SLCL 1 slcl
.SH NAME
slcl \- a simple and lightweight 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": "...",
"key": "...",
"quota": "..."
}]
}
.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 COPYRIGHT
Copyright (C) 2023 Xavier Del Campo Romero.
.P
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.SH SEE ALSO
.B usergen(1)
|