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. 'utf8' => true,
  73. 'db_driver' => 'DB', # XXX: JanRain libs only work with DB
  74. 'disable_null_strings' => true, // 'NULL' can be harmful
  75. 'quote_identifiers' => true,
  76. 'type' => 'mysql',
  77. 'schemacheck' => 'runtime', // 'runtime' or 'script'
  78. 'annotate_queries' => false, // true to add caller comments to queries, eg /* POST Notice::saveNew */
  79. 'log_queries' => false, // true to log all DB queries
  80. 'log_slow_queries' => 0, // if set, log queries taking over N seconds
  81. 'mysql_foreign_keys' => false), // if set, enables experimental foreign key support on MySQL
  82. 'fix' =>
  83. array('fancyurls' => true, // makes sure aliases in WebFinger etc. are not f'd by index.php/ URLs
  84. 'legacy_http' => false, // set this to true if you have upgraded your site from http=>https
  85. ),
  86. 'log' => [
  87. 'debugtrace' => false, // index.php handleError function, whether to include exception backtrace in log
  88. ],
  89. 'syslog' =>
  90. array('appname' => 'statusnet', # for syslog
  91. 'priority' => 'debug', # XXX: currently ignored
  92. 'facility' => LOG_USER),
  93. 'queue' =>
  94. array('enabled' => true,
  95. 'daemon' => false, # Use queuedaemon. Default to false
  96. 'threads' => null, # an empty value here uses processor count to determine
  97. 'subsystem' => 'db', # default to database, or 'stomp'
  98. 'stomp_server' => null,
  99. 'queue_basename' => '/queue/statusnet/',
  100. 'control_channel' => '/topic/statusnet/control', // broadcasts to all queue daemons
  101. 'stomp_username' => null,
  102. 'stomp_password' => null,
  103. 'stomp_persistent' => true, // keep items across queue server restart, if persistence is enabled
  104. 'stomp_transactions' => true, // use STOMP transactions to aid in detecting failures (supported by ActiveMQ, but not by all)
  105. 'stomp_acks' => true, // send acknowledgements after successful processing (supported by ActiveMQ, but not by all)
  106. 'stomp_manual_failover' => true, // if multiple servers are listed, treat them as separate (enqueue on one randomly, listen on all)
  107. 'monitor' => null, // URL to monitor ping endpoint (work in progress)
  108. 'softlimit' => '90%', // total size or % of memory_limit at which to restart queue threads gracefully
  109. 'spawndelay' => 1, // Wait at least N seconds between (re)spawns of child processes to avoid slamming the queue server with subscription startup
  110. 'debug_memory' => false, // true to spit memory usage to log
  111. 'breakout' => [], // List queue specifiers to break out when using Stomp queue.
  112. // Default will share all queues for all sites within each group.
  113. // Specify as <group>/<queue> or <group>/<queue>/<site>,
  114. // using nickname identifier as site.
  115. //
  116. // 'main/distrib' separate "distrib" queue covering all sites
  117. // 'xmpp/xmppout/mysite' separate "xmppout" queue covering just 'mysite'
  118. 'max_retries' => 10, // drop messages after N failed attempts to process (Stomp)
  119. 'dead_letter_dir' => false, // set to directory to save dropped messages into (Stomp)
  120. ),
  121. 'license' =>
  122. array('type' => 'cc', # can be 'cc', 'allrightsreserved', 'private'
  123. 'owner' => null, # can be name of content owner e.g. for enterprise
  124. 'url' => 'https://creativecommons.org/licenses/by/3.0/',
  125. 'title' => 'Creative Commons Attribution 3.0',
  126. 'image' => $_path . '/theme/licenses/cc_by_3.0_80x15.png'),
  127. 'mail' =>
  128. array('backend' => 'mail',
  129. 'params' => null,
  130. 'domain_check' => true),
  131. 'nickname' =>
  132. array('blacklist' => [],
  133. 'featured' => []),
  134. 'profile' =>
  135. array('banned' => [],
  136. 'biolimit' => null,
  137. 'changenick' => false,
  138. 'allowprivate' => false, // whether to allow setting stream to private ("only followers can read")
  139. 'backup' => false, // can cause DoS, so should be done via CLI
  140. 'restore' => false,
  141. 'delete' => false,
  142. 'move' => true),
  143. 'image' =>
  144. array('jpegquality' => 85),
  145. 'avatar' =>
  146. array('server' => null,
  147. 'dir' => INSTALLDIR . '/file/avatar/',
  148. 'url_base' => $_path . '/avatar/',
  149. 'ssl' => null,
  150. 'maxsize' => 300),
  151. 'foaf' =>
  152. array(
  153. 'mbox_sha1sum' => false,
  154. ),
  155. 'public' =>
  156. array('localonly' => false,
  157. 'blacklist' => [],
  158. 'autosource' => []),
  159. 'theme' =>
  160. array('server' => null,
  161. 'dir' => null,
  162. 'path' => null,
  163. 'ssl' => null),
  164. 'usertheme' =>
  165. array('linkcolor' => 'black',
  166. 'backgroundcolor' => 'black'),
  167. 'theme_upload' =>
  168. array('enabled' => extension_loaded('zip')),
  169. 'javascript' =>
  170. array('server' => null,
  171. 'path' => null,
  172. 'ssl' => null,
  173. 'bustframes' => true),
  174. 'local' => // To override path/server for themes in 'local' dir (not currently applied to local plugins)
  175. array('server' => null,
  176. 'dir' => null,
  177. 'path' => null,
  178. 'ssl' => null),
  179. 'throttle' =>
  180. array('enabled' => false, // whether to throttle edits; false by default
  181. 'count' => 20, // number of allowed messages in timespan
  182. 'timespan' => 600), // timespan for throttling
  183. 'invite' =>
  184. array('enabled' => true),
  185. 'tag' =>
  186. array('dropoff' => 864000.0, # controls weighting based on age
  187. 'cutoff' => 86400 * 90), # only look at notices posted in last 90 days
  188. 'popular' =>
  189. array('dropoff' => 864000.0, # controls weighting based on age
  190. 'cutoff' => 86400 * 90), # only look at notices favorited in last 90 days
  191. 'daemon' =>
  192. array('piddir' => sys_get_temp_dir(),
  193. 'user' => false,
  194. 'group' => false),
  195. 'emailpost' =>
  196. array('enabled' => false),
  197. 'sms' =>
  198. array('enabled' => false),
  199. 'twitterimport' =>
  200. array('enabled' => false),
  201. 'integration' =>
  202. array('source' => 'StatusNet', # source attribute for Twitter
  203. 'taguri' => null), # base for tag URIs
  204. 'twitter' =>
  205. array('signin' => true,
  206. 'consumer_key' => null,
  207. 'consumer_secret' => null),
  208. 'cache' =>
  209. array('base' => null),
  210. 'ping' =>
  211. array('notify' => [],
  212. 'timeout' => 2),
  213. 'inboxes' =>
  214. array('enabled' => true), # ignored after 0.9.x
  215. 'newuser' =>
  216. array('default' => null,
  217. 'welcome' => null),
  218. 'linkify' => array(
  219. // "bare" below means "without schema", like domain.com vs. https://domain.com
  220. 'bare_domains' => false, // convert domain.com to <a href="http://domain.com/" ...>domain.com</a> ?
  221. 'bare_ipv4' => false, // convert IPv4 addresses to hyperlinks?
  222. 'bare_ipv6' => false, // convert IPv6 addresses to hyperlinks?
  223. ),
  224. 'attachments' =>
  225. array('server' => null,
  226. 'dir' => INSTALLDIR . '/file/',
  227. 'path' => $_path . '/file/',
  228. 'sslserver' => null,
  229. 'sslpath' => null,
  230. 'ssl' => null,
  231. 'supported' => array(
  232. 'application/vnd.oasis.opendocument.chart' => 'odc',
  233. 'application/vnd.oasis.opendocument.formula' => 'odf',
  234. 'application/vnd.oasis.opendocument.graphics' => 'odg',
  235. 'application/vnd.oasis.opendocument.graphics-template' => 'otg',
  236. 'application/vnd.oasis.opendocument.image' => 'odi',
  237. 'application/vnd.oasis.opendocument.presentation' => 'odp',
  238. 'application/vnd.oasis.opendocument.presentation-template' => 'otp',
  239. 'application/vnd.oasis.opendocument.spreadsheet' => 'ods',
  240. 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots',
  241. 'application/vnd.oasis.opendocument.text' => 'odt',
  242. 'application/vnd.oasis.opendocument.text-master' => 'odm',
  243. 'application/vnd.oasis.opendocument.text-template' => 'ott',
  244. 'application/vnd.oasis.opendocument.text-web' => 'oth',
  245. 'application/pdf' => 'pdf',
  246. 'application/zip' => 'zip',
  247. 'application/x-bzip2' => 'bz2',
  248. 'application/x-go-sgf' => 'sgf',
  249. 'application/xml' => 'xml',
  250. 'application/gpx+xml' => 'gpx',
  251. image_type_to_mime_type(IMAGETYPE_PNG) => image_type_to_extension(IMAGETYPE_PNG),
  252. image_type_to_mime_type(IMAGETYPE_JPEG) => image_type_to_extension(IMAGETYPE_JPEG),
  253. image_type_to_mime_type(IMAGETYPE_GIF) => image_type_to_extension(IMAGETYPE_GIF),
  254. 'image/svg+xml' => 'svg', // No built-in constant
  255. image_type_to_mime_type(IMAGETYPE_ICO) => image_type_to_extension(IMAGETYPE_ICO),
  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' => 'like'),
  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. );