default.php 21 KB

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