-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.example.toml
74 lines (53 loc) · 2.03 KB
/
config.example.toml
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
# This is an example configuration file which showcases many, but not all,
# of the available configuration options. For a full list of options, including
# more information on each of them, please see:
# https://github.com/pls-shareit/api/blob/master/docs/configuration.md
# Enable the given frontend.
frontend_path = "/srv/shareit/frontend"
# Store uploaded files here.
upload_dir = "/srv/shareit/shares"
# Only check for expiry once a day.
expiry_check_interval = "1 day"
[passwords]
# Don't allow people without a password to do anything except look at shares.
default = []
# Allow Alice to do absolutely *everything* - create, update or delete any share.
supersecretpassword = ["create_any", "update_any", "custom_name"]
# Allow Bob to do anything except update or delete other people's shares.
"pa$$word-of-B0B" = ["create_any", "update_own", "custom_name"]
# Only allow Charlie to create links with random names.
chaaaaarl13 = ["create_link"]
[database]
# Connect to an external database.
host = "postgres.example.com"
port = 5000
# Set the database username and password.
user = "shareit-server"
pass = "verysecret"
# And database name.
name = "shareit-server"
[network]
# Bind on all available interfaces.
address = "0.0.0.0"
# Listen on the conventional HTTP port.
port = 80
# This is a domain name pointing to this server.
host = "https://shareit.example.com"
[restrictions]
# This is a password exclusive server, so we're happy with big files.
max_file_size = "1 GB"
# And we have some *very* long URLs to be shortened.
max_link_length = 2047
# Because of the big files though, we want them to expire quickly.
max_expiry_time = "1 week"
# Override default of disallowing HTML files since we trust the users.
disallowed_mime_types = []
# Also, we want to allow shortlinks for mail addresses.
allowed_link_schemes = ["http", "https", "mailto"]
[names]
# Allow long share names, because why not.
max_length = 255
# Try to make random share names absolutely as short as possible.
random_length = 1
# And try very hard.
random_attempt_limit = 25