]> git.p6c8.net - jirafeau_project.git/blob - lib/config.original.php
Add support for the X-Sendfile header/module to offload downloads.
[jirafeau_project.git] / lib / config.original.php
1 <?php
2 /*
3 * Jirafeau, your web file repository
4 * Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org>
5 * Copyright (C) 2015 Jerome Jutteau <jerome@jutteau.fr>
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21 /**
22 * Default configuration
23 *
24 * To overwrite these settings copy the file,
25 * rename it to »config.local.php« and adapt the parameters.
26 **/
27
28 /* URL of installation, with trailing slash (eg. »https://example.com/jirafeau/«)
29 */
30 $cfg['web_root'] = '';
31
32 /* Path to data directory, with trailing slash (eg. »/var/www/data/var_314159265358979323846264«
33 */
34 $cfg['var_root'] = '';
35
36 /* Language - choose between 'auto' or any language located in the /lib/locales/ folder.
37 * The mode »auto« will cause the script to detect the user's browser information
38 * and offer a matching language, or use »en« if it is not available.
39 * Forcing a specific lang will slightly reduce computation time.
40 */
41 $cfg['lang'] = 'auto';
42
43 /* Select a theme - see media folder for available themes
44 */
45 $cfg['style'] = 'courgette';
46
47 /* Name the organisation running this installation, eg. 'ACME'
48 */
49 $cfg['organisation'] = 'ACME';
50
51 /* Provide a contact person for this installation, eg. 'John Doe <doe@example.com>'
52 */
53 $cfg['contactperson'] = '';
54
55 /* Give the installation a title, eg. 'Datahub' or 'John Doe Filehost'
56 */
57 $cfg['title'] = '';
58
59 /* Propose a preview link if file type is previewable
60 */
61 $cfg['preview'] = true;
62
63 /* Enable the encryption feature
64 * By enabling it, file-level deduplication won't work anymore. See FAQ.
65 */
66 $cfg['enable_crypt'] = false;
67
68 /* Length of link reference
69 */
70 $cfg['link_name_length'] = 8;
71
72 /* Upload password(s).
73 * An empty array will disable password authentication.
74 * $cfg['upload_password'] = array(); // No password
75 * $cfg['upload_password'] = array('psw1'); // One password
76 * $cfg['upload_password'] = array('psw1', 'psw2'); // Two passwords
77 */
78 $cfg['upload_password'] = array();
79
80 /* List of IP allowed to upload a file.
81 * If the list is empty, then there is no upload restriction based on IP.
82 * Elements of the list can be a single IP (e.g. "123.45.67.89") or
83 * an IP range (e.g. "123.45.0.0/16").
84 * Note that CIDR notation is available for IPv4 only for the moment.
85 */
86 $cfg['upload_ip'] = array();
87
88 /* List of IP allowed to upload a file without password.
89 * Elements of the list can be a single IP (e.g. "123.45.67.89") or
90 * an IP range (e.g. "123.45.0.0/16").
91 * Note that CIDR notation is available for IPv4 only for the moment.
92 */
93 $cfg['upload_ip_nopassword'] = array();
94
95 /* Password for the admin interface.
96 * An empty password will disable password authentication.
97 * The password is a sha256 hash of the original version.
98 */
99 $cfg['admin_password'] = '';
100
101 /* If set, let the user be authenticated as administrator.
102 * The user provided here is the user authenticated by HTTP authentication.
103 * Note that Jirafeau does not manage the HTTP login part, it just checks
104 * that the provided user is logged in.
105 * If »admin_password« parameter is set, then the »admin_password« is ignored.
106 */
107 $cfg['admin_http_auth_user'] = '';
108
109 /* Allow user to select different options for file expiration time.
110 * Possible values in array:
111 * 'minute': file is available for one minute
112 * 'hour': file available for one hour
113 * 'day': file available for one day
114 * 'week': file available for one week
115 * 'fortnight': file is available for two weeks
116 * 'month': file is available for one month
117 * 'quarter': file is available for three months
118 * 'year': file available for one year
119 * 'none': unlimited availability
120 */
121 $cfg['availabilities'] = array(
122 'minute' => true,
123 'hour' => true,
124 'day' => true,
125 'week' => true,
126 'fortnight' => true,
127 'month' => true,
128 'quarter' => false,
129 'year' => false,
130 'none' => false
131 );
132
133 /* Set a default value for the expiration time.
134 * The value has to equal one of the enabled options in »availabilities«, e.g. »month«.
135 */
136 $cfg['availability_default'] = 'month';
137
138 /* Give the uploading user the option to have the file
139 * deleted after the first download.
140 */
141 $cfg['one_time_download'] = true;
142
143 /* Set maximal upload size expressed in MB.
144 * »0« means unlimited upload size.
145 */
146 $cfg['maximal_upload_size'] = 0;
147
148 /* Proxy IP
149 * If the installation is behind some reverse proxies, it is possible to set
150 * the allowed proxy IP.
151 * $cfg['proxy_ip'] = array('12.34.56.78');
152 * Jirafeau will then get a visitor's IP from HTTP_X_FORWARDED_FOR
153 * instead of REMOTE_ADDR.
154 */
155 $cfg['proxy_ip'] = array();
156
157 /* File hash
158 * In order to make file deduplication work, files can be hashed through different methods.
159 * By default, files are hashed through md5 but other methods are available.
160 *
161 * Possible values are 'md5', 'md5_outside' and 'random'.
162 *
163 * With 'md5' option, the whole file is hashed through md5. This is the default.
164 * With 'md5_outside', hash is computed using:
165 * - md5 of the first part of the file,
166 * - md5 of the last part of the file and
167 * - file's size.
168 * This method offer file deduplication at minimal cost but can be dangerous as files with the same partial hash can be mistaken.
169 * With 'random' option, file hash is set to a random value and file deduplication cannot work anymore but it is fast and safe.
170 */
171 $cfg['file_hash'] = 'md5';
172
173 /* Work around that LiteSpeed truncates large files when downloading.
174 * Only for use with the LiteSpeed web server!
175 * An internal redirect is made using X-LiteSpeed-Location instead
176 * of streaming the file from PHP.
177 * Limitations:
178 * - The Jirafeau files folder has to be placed under the document root and should be
179 * protected from unauthorized access using rewrite rules.
180 * See https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:config:internal-redirect#protection_from_direct_access
181 * - Incompatible with server side encryption.
182 * - Incompatible with one time download.
183 */
184 $cfg['litespeed_workaround'] = false;
185
186 /* Use the X-Sendfile header which should cause your webserver to handle
187 * the sending of the file. The webserver must be configured to do this
188 * using the mod_xsendfile module in Apache or the appropriate config in
189 * lighttpd. The offload will not happen in the case of server-side encrypted
190 * files, but all other cases should work. Benefits include being able
191 * to resume downloads and seek instantly in media players like VLC or
192 * the Firefox/Discord/Chrome embedded player.
193 */
194 $cfg['use_xsendfile'] = false;
195
196 /* Store uploader's IP along with 'link' file.
197 * Depending of your legislation, you may have to adjust this parameter.
198 */
199 $cfg['store_uploader_ip'] = true;
200
201 /* Required flag to test if the installation is already installed
202 * or needs to start the installation script
203 */
204 $cfg['installation_done'] = false;
205
206 /* Enable this debug flag to allow eventual PHP error reporting.
207 * This is disabled by default permission misconfiguration might generate warnings or errors.
208 * Those warnings can break Jirafeau and also show path to var- folder in debug messages.
209 * var- folder should kept secret and accessing it may lead to data leak if unprotected.
210 */
211 $cfg['debug'] = false;

patrick-canterino.de