]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/default.php
if zip is fine then application/x-bzip2 is too
[quix0rs-gnu-social.git] / lib / default.php
1 <?php
2 /**
3  * StatusNet, the distributed open-source microblogging tool
4  *
5  * Default settings for core configuration
6  *
7  * PHP version 5
8  *
9  * LICENCE: This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU Affero General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Affero General Public License for more details.
18  *
19  * You should have received a copy of the GNU Affero General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  * @category  Config
23  * @package   GNUsocial
24  * @author    Evan Prodromou <evan@status.net>
25  * @copyright 2008-9 StatusNet, Inc.
26  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
27  * @link      http://www.gnu.org/software/social/
28  */
29
30 $default =
31     array('site' =>
32         array('name' => 'Just another GNU social node',
33               'nickname' => 'gnusocial',
34               'wildcard' => null,
35               'server' => $_server,
36               'theme' => 'neo-gnu',
37               'path' => $_path,
38               'logfile' => null,
39               'logo' => null,
40               'ssllogo' => null,
41               'logperf' => false, // Enable to dump performance counters to syslog
42               'logperf_detail' => false, // Enable to dump every counter hit
43               'fancy' => false,
44               'locale_path' => INSTALLDIR.'/locale',
45               'language' => 'en',
46               'langdetect' => true,
47               'languages' => get_all_languages(),
48               'email' =>
49               array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : null,
50               'fakeaddressrecovery' => true,
51               'broughtby' => null,
52               'timezone' => 'UTC',
53               'broughtbyurl' => null,
54               'closed' => false,
55               'inviteonly' => true,
56               'private' => false,
57               'ssl' => 'never',
58               'sslproxy' => false,   // set to true to force GNU social to think it is HTTPS (i.e. using reverse proxy to enable it)
59               'sslserver' => null,
60               'dupelimit' => 60, // default for same person saying the same thing
61               'textlimit' => 1000, // in chars; 0 == no limit
62               'indent' => true,
63               'use_x_sendfile' => false,
64               'notice' => null, // site wide notice text
65               'build' => 1, // build number, for code-dependent cache
66               ),
67         'security' =>
68         array('hash_algos' => ['sha1', 'sha256', 'sha512'],   // set to null for anything that hash_hmac() can handle (and is in hash_algos())
69         ),
70         'db' =>
71           array('database' => null, // must be set
72               'schema_location' => INSTALLDIR . '/classes',
73               'class_location' => INSTALLDIR . '/classes',
74               'require_prefix' => 'classes/',
75               'class_prefix' => '',
76               'mirror' => null,
77               'utf8' => true,
78               'db_driver' => 'DB', # XXX: JanRain libs only work with DB
79               'quote_identifiers' => false,
80               'type' => 'mysql',
81               'schemacheck' => 'runtime', // 'runtime' or 'script'
82               'annotate_queries' => false, // true to add caller comments to queries, eg /* POST Notice::saveNew */
83               'log_queries' => false, // true to log all DB queries
84               'log_slow_queries' => 0, // if set, log queries taking over N seconds
85               'mysql_foreign_keys' => false), // if set, enables experimental foreign key support on MySQL
86         'fix' =>
87         array('fancyurls' => true,   // makes sure aliases in WebFinger etc. are not f'd by index.php/ URLs
88               'legacy_http' => false,   // set this to true if you have upgraded your site from http=>https
89               ),
90         'log' => [
91                 'debugtrace' => false,  // index.php handleError function, whether to include exception backtrace in log
92             ],
93         'syslog' =>
94         array('appname' => 'statusnet', # for syslog
95               'priority' => 'debug', # XXX: currently ignored
96               'facility' => LOG_USER),
97         'queue' =>
98         array('enabled' => true,
99               'daemon' => false, # Use queuedaemon. Default to false
100               'subsystem' => 'db', # default to database, or 'stomp'
101               'stomp_server' => null,
102               'queue_basename' => '/queue/statusnet/',
103               'control_channel' => '/topic/statusnet/control', // broadcasts to all queue daemons
104               'stomp_username' => null,
105               'stomp_password' => null,
106               'stomp_persistent' => true, // keep items across queue server restart, if persistence is enabled
107               'stomp_transactions' => true, // use STOMP transactions to aid in detecting failures (supported by ActiveMQ, but not by all)
108               'stomp_acks' => true, // send acknowledgements after successful processing (supported by ActiveMQ, but not by all)
109               'stomp_manual_failover' => true, // if multiple servers are listed, treat them as separate (enqueue on one randomly, listen on all)
110               'monitor' => null, // URL to monitor ping endpoint (work in progress)
111               'softlimit' => '90%', // total size or % of memory_limit at which to restart queue threads gracefully
112               'spawndelay' => 1, // Wait at least N seconds between (re)spawns of child processes to avoid slamming the queue server with subscription startup
113               'debug_memory' => false, // true to spit memory usage to log
114               'breakout' => array(), // List queue specifiers to break out when using Stomp queue.
115                                      // Default will share all queues for all sites within each group.
116                                      // Specify as <group>/<queue> or <group>/<queue>/<site>,
117                                      // using nickname identifier as site.
118                                      //
119                                      // 'main/distrib' separate "distrib" queue covering all sites
120                                      // 'xmpp/xmppout/mysite' separate "xmppout" queue covering just 'mysite'
121               'max_retries' => 10, // drop messages after N failed attempts to process (Stomp)
122               'dead_letter_dir' => false, // set to directory to save dropped messages into (Stomp)
123               ),
124         'license' =>
125         array('type' => 'cc', # can be 'cc', 'allrightsreserved', 'private'
126               'owner' => null, # can be name of content owner e.g. for enterprise
127               'url' => 'https://creativecommons.org/licenses/by/3.0/',
128               'title' => 'Creative Commons Attribution 3.0',
129               'image' => $_path . '/theme/licenses/cc_by_3.0_80x15.png'),
130         'mail' =>
131         array('backend' => 'mail',
132               'params' => null,
133               'domain_check' => true),
134         'nickname' =>
135         array('blacklist' => array(),
136               'featured' => array()),
137         'profile' =>
138         array('banned' => array(),
139               'biolimit' => null,
140               'changenick' => false,
141               'allowprivate' => false,  // whether to allow setting stream to private ("only followers can read")
142               'backup' => false,    // can cause DoS, so should be done via CLI
143               'restore' => false,
144               'delete' => false,
145               'move' => true),
146         'image' =>
147         array('jpegquality' => 85),
148         'avatar' =>
149         array('server' => null,
150               'dir' => INSTALLDIR . '/avatar/',
151               'path' => $_path . '/avatar/',
152               'ssl' => null,
153               'maxsize' => 300),
154         'foaf' =>
155         array(
156               'mbox_sha1sum' => false,
157             ),
158         'public' =>
159         array('localonly' => false,
160               'blacklist' => array(),
161               'autosource' => array()),
162         'theme' =>
163         array('server' => null,
164               'dir' => null,
165               'path'=> null,
166               'ssl' => null),
167         'usertheme' =>
168         array('linkcolor' => 'black',
169               'backgroundcolor' => 'black'),
170         'theme_upload' =>
171         array('enabled' => extension_loaded('zip')),
172         'javascript' =>
173         array('server' => null,
174               'path'=> null,
175               'ssl' => null,
176               'bustframes' => true),
177         'local' => // To override path/server for themes in 'local' dir (not currently applied to local plugins)
178         array('server' => null,
179               'dir' => null,
180               'path' => null,
181               'ssl' => null),
182         'throttle' =>
183         array('enabled' => false, // whether to throttle edits; false by default
184               'count' => 20, // number of allowed messages in timespan
185               'timespan' => 600), // timespan for throttling
186         'invite' =>
187         array('enabled' => true),
188         'tag' =>
189         array('dropoff' => 864000.0,   # controls weighting based on age
190               'cutoff' => 86400 * 90), # only look at notices posted in last 90 days
191         'popular' =>
192         array('dropoff' => 864000.0,   # controls weighting based on age
193               'cutoff' => 86400 * 90), # only look at notices favorited in last 90 days
194         'daemon' =>
195         array('piddir' => sys_get_temp_dir(),
196               'user' => false,
197               'group' => false),
198         'emailpost' =>
199         array('enabled' => false),
200         'sms' =>
201         array('enabled' => false),
202         'twitterimport' =>
203         array('enabled' => false),
204         'integration' =>
205         array('source' => 'StatusNet', # source attribute for Twitter
206               'taguri' => null), # base for tag URIs
207         'twitter' =>
208         array('signin' => true,
209               'consumer_key' => null,
210               'consumer_secret' => null),
211         'cache' =>
212         array('base' => null),
213         'ping' =>
214         array('notify' => array(),
215               'timeout' => 2),
216         'inboxes' =>
217         array('enabled' => true), # ignored after 0.9.x
218         'newuser' =>
219         array('default' => null,
220               'welcome' => null),
221         'linkify' => array(
222             // "bare" below means "without schema", like domain.com vs. https://domain.com
223             'bare_domains' => false,  // convert domain.com to <a href="http://domain.com/" ...>domain.com</a> ?
224             'bare_ipv4' => false,   // convert IPv4 addresses to hyperlinks?
225             'bare_ipv6' => false,   // convert IPv6 addresses to hyperlinks?
226         ),
227         'attachments' =>
228         array('server' => null,
229               'dir' => INSTALLDIR . '/file/',
230               'path' => $_path . '/file/',
231               'sslserver' => null,
232               'sslpath' => null,
233               'ssl' => null,
234               'supported' => array(
235                                 'application/vnd.oasis.opendocument.chart'                  => 'odc',
236                                 'application/vnd.oasis.opendocument.formula'                => 'odf',
237                                 'application/vnd.oasis.opendocument.graphics'               => 'odg',
238                                 'application/vnd.oasis.opendocument.graphics-template'      => 'otg',
239                                 'application/vnd.oasis.opendocument.image'                  => 'odi',
240                                 'application/vnd.oasis.opendocument.presentation'           => 'odp',
241                                 'application/vnd.oasis.opendocument.presentation-template'  => 'otp',
242                                 'application/vnd.oasis.opendocument.spreadsheet'            => 'ods',
243                                 'application/vnd.oasis.opendocument.spreadsheet-template'   => 'ots',
244                                 'application/vnd.oasis.opendocument.text'                   => 'odt',
245                                 'application/vnd.oasis.opendocument.text-master'            => 'odm',
246                                 'application/vnd.oasis.opendocument.text-template'          => 'ott',
247                                 'application/vnd.oasis.opendocument.text-web'               => 'oth',
248                                 'application/pdf'   => 'pdf',
249                                 'application/zip'   => 'zip',
250                                 'application/x-bzip2' => 'bz2',
251                                 'application/x-go-sgf' => 'sgf',
252                                 'application/xml'   => 'xml',
253                                 'application/gpx+xml' => 'gpx',
254                                 'image/png'         => 'png',
255                                 'image/jpeg'        => 'jpg',
256                                 'image/gif'         => 'gif',
257                                 'image/svg+xml'     => 'svg',
258                                 'image/vnd.microsoft.icon'  => 'ico',
259                                 'audio/ogg'         => 'ogg',
260                                 'audio/mpeg'        => 'mpg',
261                                 'audio/x-speex'     => 'spx',
262                                 'application/ogg'   => 'ogx',
263                                 'text/plain'        => 'txt',
264                                 'video/mpeg'        => 'mpeg',
265                                 'video/mp4'         => 'mp4',
266                                 'video/ogg'         => 'ogv',
267                                 'video/quicktime'   => 'mov',
268                                 'video/webm'        => 'webm',
269                                 ),
270               'file_quota' => 5000000,
271               'user_quota' => 50000000,
272               'monthly_quota' => 15000000,
273               'uploads' => true,
274               'show_html' => false,  // show (filtered) text/html attachments (and oEmbed HTML etc.). Doesn't affect AJAX calls.
275               'show_thumbs' => true, // show thumbnails in notice lists for uploaded images, and photos and videos linked remotely that provide oEmbed info
276               'process_links' => true, // check linked resources for embeddable photos and videos; this will hit referenced external web sites when processing new messages.
277               'extblacklist' => [
278                     'php' => 'phps',    // this turns .php into .phps
279                     'exe' => false,  // this would deny any uploads to keep the "exe" file extension
280                 ],
281               ),
282         'thumbnail' => [
283               'dir' => null,    // falls back to File::path('thumb') (equivalent to ['attachments']['dir'] .  '/thumb/')
284               'path' => null,   // falls back to generating a URL with File::url('thumb/$filename') (equivalent to ['attachments']['path'] . '/thumb/')
285               'server' => null, // Only used if ['thumbnail']['path'] is NOT empty, and then it falls back to ['site']['server'], schema is decided from GNUsocial::useHTTPS()
286
287               'crop' => false,      // overridden to true if thumb height === null
288               'maxsize' => 1000,     // thumbs with an edge larger than this will not be generated
289               'width' => 450,
290               'height' => 600,
291               'upscale' => false,
292               'animated' => false, // null="UseFileAsThumbnail", false="can use still frame". true requires ImageMagickPlugin
293             ],
294         'application' =>
295         array('desclimit' => null),
296         'group' =>
297         array('maxaliases' => 3,
298               'desclimit' => null,
299               'addtag' => false),
300         'peopletag' =>
301         array('maxtags' => 100, // maximum number of tags a user can create.
302               'maxpeople' => 500, // maximum no. of people with the same tag by the same user
303               'allow_tagging' => array('all' => true), // equivalent to array('local' => true, 'remote' => true)
304               'desclimit' => null),
305         'search' =>
306         array('type' => 'like'),
307         'sessions' =>
308         array('handle' => false,   // whether to handle sessions ourselves
309               'debug' => false,    // debugging output for sessions
310               'gc_limit' => 1000), // max sessions to expire at a time
311         'htmlfilter' => [  // remove tags from user/remotely generated HTML if they are === true
312             'img' => true,
313             'video' => true,
314             'audio' => true,
315         ],
316         'htmlpurifier' => [ // configurable options for HTMLPurifier
317             'Cache.DefinitionImpl'  => 'Serializer',
318             'Cache.SerializerPath'  => implode(DIRECTORY_SEPARATOR, [sys_get_temp_dir(), 'gnusocial']),
319         ],
320         'notice' =>
321         array('contentlimit' => null,
322               'allowprivate' => false,  // whether to allow users to "check the padlock" to publish notices available for their subscribers.
323               'defaultscope' => null, // null means 1 if site/private, 0 otherwise
324               'hidespam' => true), // Whether to hide silenced users from timelines
325         'message' =>
326         array('contentlimit' => null),
327         'location' =>
328         array('share' => 'user', // whether to share location; 'always', 'user', 'never'
329               'sharedefault' => false),
330         'logincommand' =>
331         array('disabled' => true),
332         'plugins' =>
333         array('core' => array(
334                             'ActivityVerb' => array(),
335                             'ActivityVerbPost' => array(),
336                             'ActivityModeration' => array(),
337                             'AuthCrypt' => array(),
338                             'Cronish' => array(),
339                             'Favorite' => array(),
340                             'HTMLPurifierSchemes' => array(),
341                             'Share' => array(),
342                             'LRDD' => array(),
343                         ),
344               'default' => array(
345                             'Activity' => array(),
346                             'AntiBrute' => array(),
347                             'Bookmark' => array(),
348                             'ClientSideShorten' => array(),
349                             'DefaultLayout' => array(),
350                             'Directory' => array(),
351                             'DirectMessage' => array(),
352                             'EmailAuthentication' => array(),
353                             'Event' => array(),
354                             'Oembed' => array(),
355                             'OpenID' => array(),
356                             'OpportunisticQM' => array(),
357                             'OStatus' => array(),
358                             'Poll' => array(),
359                             'SimpleCaptcha' => array(),
360                             'TagSub' => array(),
361                             'WebFinger' => array(),
362                         ),
363               'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories
364               'server' => null,
365               'sslserver' => null,
366               'path' => null,
367               'sslpath' => null,
368               ),
369         'admin' =>
370         array('panels' => array('site', 'user', 'paths', 'access', 'sessions', 'sitenotice', 'license', 'plugins')),
371         'singleuser' =>
372         array('enabled' => false,
373               'nickname' => null),
374         'robotstxt' =>
375         array('crawldelay' => 0,
376               'disallow' => array('main', 'settings', 'admin', 'search', 'message')
377               ),
378         'api' =>
379         array('realm' => null),
380         'nofollow' =>
381         array('subscribers' => true,
382               'members' => true,
383               'peopletag' => true,
384               'external' => 'sometimes'), // Options: 'sometimes', 'never', default = 'sometimes'
385         'url' =>
386         array('shortener' => 'internal',
387               'maxurllength' => 100,
388               'maxnoticelength' => -1),
389         'http' => // HTTP client settings when contacting other sites
390         array('ssl_cafile' => false, // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt') (this activates "ssl_verify_peer")
391               'ssl_verify_host' => true,    // HTTPRequest2 makes sure this is set to CURLOPT_SSL_VERIFYHOST==2 if using curl
392               'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.)
393               'connect_timeout' => 5,
394               'proxy_host' => null,
395               'proxy_port' => null,
396               'proxy_user' => null,
397               'proxy_password' => null,
398               'proxy_auth_scheme' => null,
399               ),
400         'router' =>
401         array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel
402         'discovery' =>
403           array('cors' => false), // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
404         'performance' => array('high' => false) // disable some features for higher performance; default false
405     );