]> git.p6c8.net - jirafeau.git/blob - lib/config.original.php
Merge branch 'master' into next-release
[jirafeau.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 $cfg['dark_style'] = 'dark-courgette';
47
48 /* Name the organisation running this installation, eg. 'ACME'
49 */
50 $cfg['organisation'] = 'ACME';
51
52 /* Provide a contact person for this installation, eg. 'John Doe <doe@example.com>'
53 */
54 $cfg['contactperson'] = '';
55
56 /* Give the installation a title, eg. 'Datahub' or 'John Doe Filehost'
57 */
58 $cfg['title'] = '';
59
60 /* Propose a preview link if file type is previewable
61 */
62 $cfg['preview'] = true;
63
64 /* Enable the encryption feature
65 * By enabling it, file-level deduplication won't work anymore. See FAQ.
66 */
67 $cfg['enable_crypt'] = false;
68
69 /* Length of link reference
70 */
71 $cfg['link_name_length'] = 8;
72
73 /* Upload password(s).
74 * An empty array will disable password authentication.
75 * $cfg['upload_password'] = array(); // No password
76 * $cfg['upload_password'] = array('psw1'); // One password
77 * $cfg['upload_password'] = array('psw1', 'psw2'); // Two passwords
78 */
79 $cfg['upload_password'] = array();
80
81 /* List of IP allowed to upload a file.
82 * If the list is empty, then there is no upload restriction based on IP.
83 * Elements of the list can be a single IP (e.g. "123.45.67.89") or
84 * an IP range (e.g. "123.45.0.0/16").
85 * Note that CIDR notation is available for IPv4 only for the moment.
86 */
87 $cfg['upload_ip'] = array();
88
89 /* List of IP allowed to upload a file without password.
90 * Elements of the list can be a single IP (e.g. "123.45.67.89") or
91 * an IP range (e.g. "123.45.0.0/16").
92 * Note that CIDR notation is available for IPv4 only for the moment.
93 */
94 $cfg['upload_ip_nopassword'] = array();
95
96 /* Password for the admin interface.
97 * An empty password will disable password authentication.
98 * The password is a sha256 hash of the original version.
99 * Example: echo -n "myVerySecretAdminPassword" | sha256sum
100 */
101 $cfg['admin_password'] = '';
102
103 /* If set, let the users be authenticated as administrator.
104 * The users provided here are authenticated by HTTP authentication.
105 * Note that Jirafeau does not manage the HTTP login part, it just checks
106 * that one of the provided users is logged in.
107 * May be an array for multiple users or a string for a single user.
108 * The option to provide a string is for backward compatibility.
109 * If »admin_password« parameter is set, then the »admin_password« is ignored.
110 */
111 $cfg['admin_http_auth_user'] = array();
112
113 /* List of IP allowed to access the admin interface.
114 * If the list is empty, then there is no admin interface restriction based on IP.
115 * Elements of the list can be a single IP (e.g. "123.45.67.89") or
116 * an IP range (e.g. "123.45.0.0/16").
117 * Note that CIDR notation is available for IPv4 only for the moment.
118 */
119 $cfg['admin_ip'] = array();
120
121 /* Allow user to select different options for file expiration time.
122 * Possible values in array:
123 * 'minute': file is available for one minute
124 * 'hour': file available for one hour
125 * 'day': file available for one day
126 * 'week': file available for one week
127 * 'fortnight': file is available for two weeks
128 * 'month': file is available for one month
129 * 'quarter': file is available for three months
130 * 'year': file available for one year
131 * 'none': unlimited availability
132 */
133 $cfg['availabilities'] = array(
134 'minute' => true,
135 'hour' => true,
136 'day' => true,
137 'week' => true,
138 'fortnight' => true,
139 'month' => true,
140 'quarter' => false,
141 'year' => false,
142 'none' => false
143 );
144
145 /* Set a default value for the expiration time.
146 * The value has to equal one of the enabled options in »availabilities«, e.g. »month«.
147 */
148 $cfg['availability_default'] = 'month';
149
150 /* Give the uploading user the option to have the file
151 * deleted after the first download.
152 */
153 $cfg['one_time_download'] = true;
154
155 /* When set to "true", the checkbox for deleting the file after the first download
156 * is preselected.
157 */
158 $cfg['one_time_download_preselected'] = false;
159
160 /* Set maximal upload size expressed in MB.
161 * »0« means unlimited upload size.
162 */
163 $cfg['maximal_upload_size'] = 0;
164
165 /* Proxy IP
166 * If the installation is behind some reverse proxies, it is possible to set
167 * the allowed proxy IP.
168 * $cfg['proxy_ip'] = array('12.34.56.78');
169 * Jirafeau will then get a visitor's IP from HTTP_X_FORWARDED_FOR
170 * instead of REMOTE_ADDR.
171 */
172 $cfg['proxy_ip'] = array();
173
174 /* File hash
175 * In order to make file deduplication work, files can be hashed through different methods.
176 * To enable file deduplication feature, set this option to `md5`.
177 *
178 * Possible values are 'md5', 'md5_outside' and 'random'.
179 *
180 * With 'md5' option, the whole file is hashed through md5. This is the default.
181 * With 'md5_outside', hash is computed using:
182 * - md5 of the first part of the file,
183 * - md5 of the last part of the file and
184 * - file's size.
185 * This method offer file deduplication at minimal cost but can be dangerous as files with the same partial hash can be mistaken.
186 * With 'random' option, file hash is set to a random value and file deduplication cannot work but it is fast and safe.
187 */
188 $cfg['file_hash'] = 'random';
189
190 /* Work around that LiteSpeed truncates large files when downloading.
191 * Only for use with the LiteSpeed web server!
192 * An internal redirect is made using X-LiteSpeed-Location instead
193 * of streaming the file from PHP.
194 * Limitations:
195 * - The Jirafeau files folder has to be placed under the document root and should be
196 * protected from unauthorized access using rewrite rules.
197 * See https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:config:internal-redirect#protection_from_direct_access
198 * - Incompatible with server side encryption.
199 * - Incompatible with one time download.
200 */
201 $cfg['litespeed_workaround'] = false;
202
203 /* Use the X-Sendfile header which should cause your webserver to handle
204 * the sending of the file. The webserver must be configured to do this
205 * using the mod_xsendfile module in Apache or the appropriate config in
206 * lighttpd. The offload will not happen in the case of server-side encrypted
207 * files, but all other cases should work. Benefits include being able
208 * to resume downloads and seek instantly in media players like VLC or
209 * the Firefox/Discord/Chrome embedded player.
210 */
211 $cfg['use_xsendfile'] = false;
212
213 /* Store uploader's IP along with 'link' file.
214 * Depending of your legislation, you may have to adjust this parameter.
215 */
216 $cfg['store_uploader_ip'] = true;
217
218 /* Required flag to test if the installation is already installed
219 * or needs to start the installation script
220 */
221 $cfg['installation_done'] = false;
222
223 /* Enable this debug flag to allow eventual PHP error reporting.
224 * This is disabled by default permission misconfiguration might generate warnings or errors.
225 * Those warnings can break Jirafeau and also show path to var- folder in debug messages.
226 * var- folder should kept secret and accessing it may lead to data leak if unprotected.
227 */
228 $cfg['debug'] = false;
229
230 /** Set Jirafeau's maximal upload chunk
231 * When Jirafeau upload a large file, Jirafeau sends several data chunks to fit server's capabilities.
232 * Jirafeau tries to upload each data chunk with the maximal size allowed by PHP (post_max_size and upload_max_filesize).
233 * However, too large PHP configuration values are not needed and could induce unwanted side effects (see #303).
234 * This parameter set Jirafeau's own maximal chunk size with a reasonable value.
235 * Option is only used for async uploads and won't be used for browsers without html5 support.
236 * You should not touch this parameter unless you have good reason to do so. Feel free to open an issue to ask questions.
237 * Set to 0 to remove limitation.
238 */
239 $cfg['max_upload_chunk_size_bytes'] = 100000000; // 100MB
240
241 /* Set password requirement policy for downloading files
242 * Possible values:
243 * optional (default): Password may be set by the uploader, but is not mandatory
244 * required: Setting a password is mandatory to upload a file.
245 * generated: Passwords are automatically generated and shown to the uploader, when uploading a file
246 */
247 $cfg['download_password_requirement'] = 'optional';
248
249 /* Set length of generated passwords
250 */
251 $cfg['download_password_gen_len'] = 10;
252
253 /* Set allowed chars for password generation
254 */
255 $cfg['download_password_gen_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*()_-=+;:,.?';
256 /* Set password complexity policy for downloading files
257 * possible values:
258 * none (default): Passwords for downloading files can be of arbitrary complexity
259 * regex: Passwords are checked with a regex for complexity constraints
260 */
261 $cfg['download_password_policy'] = 'none';
262 /* Set the regex for regex download password policy
263 * Delimiters are need, but modifiers should not be used
264 */
265 $cfg['download_password_policy_regex'] = '/.*/';

patrick-canterino.de