]> jfr.im git - uguu.git/blob - static/php/includes/settings.inc.php
minor fixes
[uguu.git] / static / php / includes / settings.inc.php
1 <?php
2
3 /**
4 * User configurable settings for Uguu.
5 */
6
7 /*
8 * PDO connection socket
9 *
10 * Database connection to use for communication. Currently, MySQL is the only
11 * DSN prefix supported.
12 *
13 * @see http://php.net/manual/en/ref.pdo-mysql.connection.php PHP manual for
14 * PDO_MYSQL DSN.
15 * @param string UGUU_DB_CONN DSN:host|unix_socket=hostname|path;dbname=database
16 */
17 define('UGUU_DB_CONN', 'sqlite:/path/to/db/uguu.sq3');
18
19 /*
20 * PDO database login credentials
21 */
22
23 /* @param string UGUU_DB_NAME Database username */
24 define('UGUU_DB_USER', 'NULL');
25 /* @param string UGUU_DB_PASS Database password */
26 define('UGUU_DB_PASS', 'NULL');
27
28 /** Log IP of uploads */
29 define('LOG_IP', 'no');
30
31 /*
32 * File system location where to store uploaded files
33 *
34 * @param string Path to directory with trailing delimiter
35 */
36 define('UGUU_FILES_ROOT', '/path/to/file/');
37
38 /*
39 * Maximum number of iterations while generating a new filename
40 *
41 * Uguu uses an algorithm to generate random filenames. Sometimes a file may
42 * exist under a randomly generated filename, so we count tries and keep trying.
43 * If this value is exceeded, we give up trying to generate a new filename.
44 *
45 * @param int UGUU_FILES_RETRIES Number of attempts to retry
46 */
47 define('UGUU_FILES_RETRIES', 15);
48
49 /*
50 * The length of generated filename (without file extension)
51 *
52 * @param int UGUU_FILES_LENGTH Number of random alphabetical ASCII characters
53 * to use
54 */
55 define('UGUU_FILES_LENGTH', 8);
56
57 /*
58 * URI to prepend to links for uploaded files
59 *
60 * @param string UGUU_URL URI with trailing delimiter
61 */
62 define('UGUU_URL', 'https://url.to.subdomain.where.files.will.be.served.com');
63
64 /*
65 * URI for filename generation
66 *
67 * @param string characters to be used in generateName()
68 */
69 define('ID_CHARSET', 'abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ');
70
71 /*
72 * Filtered mime types
73 * @param string[] $FILTER_MIME allowed/blocked mime types
74 */
75 //$FILTER_MIME = array("application/octet-stream", "application/msword", "text/html", "application/x-dosexec", "application/zip", "application/java", "application/java-archive", "application/pdf", "application/x-executable");
76 //$FILTER_EXT = array("exe", "scr", "com", "vbs", "bat", "cmd", "htm", "html", "zip", "jar", "msi", "apk", "pdf");
77
78 define('CONFIG_BLOCKED_EXTENSIONS', serialize(['exe', 'scr', 'com', 'vbs', 'bat', 'cmd', 'htm', 'html', 'jar', 'msi', 'apk', 'phtml', 'svg']));
79 define('CONFIG_BLOCKED_MIME', serialize(['application/msword', 'text/html', 'application/x-dosexec', 'application/java', 'application/java-archive', 'application/x-executable', 'application/x-mach-binary', 'image/svg+xml']));
80
81 /**
82 * Filter mode: whitelist (true) or blacklist (false).
83 *
84 * @param bool $FILTER_MODE mime type filter mode
85 */
86 $FILTER_MODE = false;
87 /**
88 * Double dot file extensions.
89 *
90 * Uguu keeps the last file extension for the uploaded file. In other words, an
91 * uploaded file with `.tar.gz` extension will be given a random filename which
92 * ends in `.gz` unless configured here to ignore discards for `.tar.gz`.
93 *
94 * @param string[] $doubledots Array of double dot file extensions strings
95 * without the first prefixing dot
96 */
97 $doubledots = array_map('strrev', [
98 'tar.gz',
99 'tar.bz',
100 'tar.bz2',
101 'tar.xz',
102 'user.js',
103 ]);