lufi.conf.template 7.21 KB
Newer Older
Luc Didry's avatar
Luc Didry committed
1
2
3
4
5
6
7
8
# vim:set sw=4 ts=4 sts=4 ft=perl expandtab:
{
    ####################
    # Hypnotoad settings
    ####################
    # see http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad for a full list of settings
    hypnotoad => {
        # array of IP addresses and ports you want to listen to
Luc Didry's avatar
Luc Didry committed
9
        listen => ['http://127.0.0.1:8081'],
10
        # if you use Lufi behind a reverse proxy like Nginx, you want to set proxy to 1
11
12
        # if you use Lufi directly, let it commented
        #proxy  => 1,
Luc Didry's avatar
Luc Didry committed
13

14
15
16
17
        # Please read http://mojolicious.org/perldoc/Mojo/Server/Hypnotoad#workers
        # to adjust this to your server
        workers => 30,
        clients => 1,
Luc Didry's avatar
Luc Didry committed
18
19
20
21
22
23
24
25
26
27
    },

    # put a way to contact you here and uncomment it
    # MANDATORY
    #contact       => 'admin[at]example.com',

    # array of random strings used to encrypt cookies
    # optional, default is ['fdjsofjoihrei'], PLEASE, CHANGE IT
    #secrets        => ['fdjsofjoihrei'],

Luc Didry's avatar
Luc Didry committed
28
29
30
31
    # choose a theme. See the available themes in `themes` directory
    # optional, default is 'default'
    #theme         => 'default',

Luc Didry's avatar
Luc Didry committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    # length of the random URL
    # optional, default is 8
    #length            => 8,

    # how many URLs will be provisioned in a batch ?
    # optional, default is 5
    #provis_step       => 5,

    # max number of URLs to be provisioned
    # optional, default is 100
    #provisioning      => 100,

    # length of the modify/delete token
    # optional, default is 32
    #token_length      => 32,

Luc Didry's avatar
Luc Didry committed
48
49
50
51
52
    # max file size, in octets
    # you can write it 100*1024*1024
    # optional, no default
    #max_file_size     => 104857600,

Luc Didry's avatar
Luc Didry committed
53
54
55
56
57
    # if you want to have piwik statistics, provide a piwik image tracker
    # only the image tracker is allowed, no javascript
    # optional, no default
    #piwik_img         => 'https://piwik.example.org/piwik.php?idsite=1&rec=1',

58
    # broadcast_message which will displayed on the index page
Luc Didry's avatar
Luc Didry committed
59
60
61
    # optional, no default
    #broadcast_message => 'Maintenance',

Luc Didry's avatar
Luc Didry committed
62
63
64
65
66
67
68
69
70
71
    # default time limit for files
    # valid values are 0, 1, 7, 30 and 365
    # optional, default is 0 (no limit)
    #default_delay     => 0,

    # number of days after which the images will be deleted, even if they were uploaded with "no delay" (or value superior to max_delay)
    # a warning message will be displayed on homepage
    # optional, default is 0 (no limit)
    #max_delay         => 0,

Luc Didry's avatar
Luc Didry committed
72
73
    # size thresholds: if you want to define max delays for different sizes of file
    # the keys are size in Bytes, you can't have 10*1000*10000 as key
Luc Didry's avatar
Luc Didry committed
74
    # if a file is smaller than the smallest configured size, it will have a expiration delay of max_delay (see above)
Luc Didry's avatar
Luc Didry committed
75
76
77
78
79
    # optional, default is using max_delay (see above) for all sizes
    #delay_for_size  => {
    #    10000000   => 90, # between 10MB and 50MB => max is 90 days, less than 10MB => max is max_delay (see above)
    #    50000000   => 60, # between 50MB ans 1GB  => max is 60 days
    #    1000000000 => 2,  # more than 1GB         => max is 2 days
80
    #},
Luc Didry's avatar
Luc Didry committed
81

Luc Didry's avatar
Luc Didry committed
82
83
    # URL sub-directory in which you want Lufi to be accessible
    # example: you want to have Lufi under https://example.org/lufi/
Luc Didry's avatar
Luc Didry committed
84
85
86
87
88
89
90
91
92
93
94
95
    # => set prefix to '/lufi' or to '/lufi/', it doesn't matter
    # optional, defaut is /
    #prefix        => '/',

    # array of authorized domains for API calls.
    # if you want to authorize everyone to use the API: ['*']
    # optional, no domains allowed by default
    #allowed_domains   => ['http://1.example.com', 'http://2.example.com'],

    # if set, the shortened URLs will use this domain
    # optional
    #fixed_domain => 'example.org',
Luc Didry's avatar
Luc Didry committed
96
97
98
99
100
101
102
103
104
105
106
107

    # Mail configuration
    # See https://metacpan.org/pod/Mojolicious::Plugin::Mail#EXAMPLES
    # Optional, default to sendmail method with no arguments
    #mail => {
    #    # Valid values are 'sendmail' and 'smtp'
    #    how => 'smtp',
    #    howargs => ['smtp.example.org']
    #},

    # Email sender address
    # Optional, default to no-reply@lufi.io
108
    #mail_sender => 'no-reply@lufi.io',
109

Luc Didry's avatar
Luc Didry committed
110
111
112
113
114
115
    # choose what database you want to use
    # valid choices are sqlite and postgresql (all lowercase)
    # optional, default is sqlite
    #dbtype => 'sqlite',

    # SQLite ONLY - only used if dbtype is set to sqlite
116
117
    # define a path to the SQLite database
    # you can define it relative to lufi directory or set an absolute path
Luc Didry's avatar
Luc Didry committed
118
    # remember that it has to be in a directory writable by Lufi user
119
120
    # optional, default is lufi.db
    #db_path           => 'lufi.db',
121

Luc Didry's avatar
Luc Didry committed
122
123
124
125
126
127
128
129
130
131
    # PostgreSQL ONLY - only used if dbtype is set to postgresql
    # these are the credentials to access the PostgreSQL database
    # mandatory if you choosed postgresql as dbtype
    #pgdb => {
    #    database => 'lufi',
    #    host     => 'localhost',
    #    #user     => 'DBUSER',
    #    #pwd      => 'DBPASSWORD'
    #},

Luc Didry's avatar
Fix #13    
Luc Didry committed
132
133
134
135
136
137
138
    # define a path to the upload directory, where the uploaded files will be stored
    # you can define it relative to lufi directory or set an absolute path
    # remember that it has to be in a directory writable by Lufi user
    # DO NOT CHANGE THIS IF FILES HAVE BEEN ALREADY UPLOADED: THEY WILL NOT BE DOWNLOADABLE ANYMORE
    # optional, default is 'files'
    #upload_dir           => 'files',

139
140
141
142
143
144
145
146
147
148
149
150
    # set `ldap` if you want that only authenticated users can upload files
    # please note that everybody can still download files
    # optional, no default
    #ldap => {
    #    uri         => 'ldaps://ldap.example.org',
    #    user_tree   => 'ou=users,dc=example,dc=org',
    #    bind_dn     => ',ou=users,dc=example,dc=org',
    #    bind_user   => 'uid=ldap_user',
    #    bind_pwd    => 'secr3t',
    #    user_filter => '!(uid=ldap_user)'
    #},

151
152
153
154
    # set `htpasswd` if you want to use an htpasswd file instead of ldap
    # see 'man htpasswd' to know how to create such file
    #htpasswd => 'lufi.passwd',

Armando Lüscher's avatar
Armando Lüscher committed
155
    # if you've set ldap above, the session will last `session_duration` seconds before
156
157
158
159
    # the user needs to reauthenticate
    # optional, default is 3600
    #session_duration => 3600,

160
161
162
163
    # allow to add a password on files, asked before allowing to download files
    # optional, default to 0
    #allow_pwd_on_files => 0,

Luc Didry's avatar
Luc Didry committed
164
165
166
167
    # if set, the files' URLs will always use this domain
    # optional
    #fixed_domain => 'example.org',

168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
    #########################
    # Lufi cron jobs settings
    #########################

    # number of days senders' IP addresses are kept in database
    # after that delay, they will be deleted from database (used with script/lufi cron cleanbdd)
    # optional, default is 365
    #keep_ip_during    => 365,

    # max size of the files directory, in octets
    # used by script/lufi cron watch to trigger an action
    # optional, no default
    #max_total_size    => 10*1024*1024*1024,

    # default action when files directory is over max_total_size (used with script/lufi cron watch)
    # valid values are 'warn', 'stop-upload' and 'delete'
    # please, see readme
    # optional, default is 'warn'
    #policy_when_full  => 'warn',

    # images which are not viewed since delete_no_longer_viewed_files days will be deleted by the cron cleanfiles task
    # if delete_no_longer_viewed_files is not set, the no longer viewed files will NOT be deleted
    # optional, no default
191
    #delete_no_longer_viewed_files => 90,
Luc Didry's avatar
Luc Didry committed
192
};