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

patrick-canterino.de