default.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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-gnu',
  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. '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. 'mysql_foreign_keys' => false), // if set, enables experimental foreign key support on MySQL
  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' => PUBLICDIR . '/avatar/',
  147. 'path' => $_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. 'audio/ogg' => 'ogg',
  256. 'audio/mpeg' => 'mpg',
  257. 'audio/x-speex' => 'spx',
  258. 'application/ogg' => 'ogx',
  259. 'text/plain' => 'txt',
  260. 'video/mpeg' => 'mpeg',
  261. 'video/mp4' => 'mp4',
  262. 'video/ogg' => 'ogv',
  263. 'video/quicktime' => 'mov',
  264. 'video/webm' => 'webm',
  265. ),
  266. 'file_quota' => common_get_preferred_php_upload_limit(),
  267. 'user_quota' => 50000000,
  268. 'monthly_quota' => 15000000,
  269. 'uploads' => true,
  270. 'show_html' => false, // show (filtered) text/html attachments (and oEmbed HTML etc.). Doesn't affect AJAX calls.
  271. 'show_thumbs' => true, // show thumbnails in notice lists for uploaded images, and photos and videos linked remotely that provide oEmbed info
  272. 'process_links' => true, // check linked resources for embeddable photos and videos; this will hit referenced external web sites when processing new messages.
  273. 'extblacklist' => [],
  274. 'memory_limit' => '1024M' // PHP's memory limit to use temporarily when handling images
  275. ),
  276. 'thumbnail' => [
  277. 'dir' => null, // falls back to File::path('thumb') (equivalent to ['attachments']['dir'] . '/thumb/')
  278. 'path' => null, // falls back to generating a URL with File::url('thumb/$filename') (equivalent to ['attachments']['path'] . '/thumb/')
  279. 'server' => null, // Only used if ['thumbnail']['path'] is NOT empty, and then it falls back to ['site']['server'], schema is decided from GNUsocial::useHTTPS()
  280. 'crop' => false, // overridden to true if thumb height === null
  281. 'maxsize' => 1000, // thumbs with an edge larger than this will not be generated
  282. 'width' => 450,
  283. 'height' => 600,
  284. 'upscale' => false,
  285. 'animated' => false, // null="UseFileAsThumbnail", false="can use still frame". true requires ImageMagickPlugin
  286. ],
  287. 'application' =>
  288. array('desclimit' => null),
  289. 'group' =>
  290. array('maxaliases' => 3,
  291. 'desclimit' => null,
  292. 'addtag' => true),
  293. 'peopletag' =>
  294. array('maxtags' => 100, // maximum number of tags a user can create.
  295. 'maxpeople' => 500, // maximum no. of people with the same tag by the same user
  296. 'allow_tagging' => array('all' => true), // equivalent to array('local' => true, 'remote' => true)
  297. 'desclimit' => null),
  298. 'search' =>
  299. array('type' => 'like'),
  300. 'sessions' =>
  301. array('handle' => false, // whether to handle sessions ourselves
  302. 'debug' => false, // debugging output for sessions
  303. 'gc_limit' => 1000), // max sessions to expire at a time
  304. 'htmlfilter' => [ // remove tags from user/remotely generated HTML if they are === true
  305. 'img' => true,
  306. 'video' => true,
  307. 'audio' => true,
  308. ],
  309. 'htmlpurifier' => [ // configurable options for HTMLPurifier
  310. 'Cache.DefinitionImpl' => 'Serializer',
  311. 'Cache.SerializerPath' => implode(DIRECTORY_SEPARATOR, [sys_get_temp_dir(), 'gnusocial']),
  312. ],
  313. 'notice' =>
  314. array('contentlimit' => null,
  315. 'allowprivate' => false, // whether to allow users to "check the padlock" to publish notices available for their subscribers.
  316. 'defaultscope' => null, // null means 1 if site/private, 0 otherwise
  317. 'hidespam' => true), // Whether to hide silenced users from timelines
  318. 'message' =>
  319. array('contentlimit' => null),
  320. 'location' =>
  321. array('share' => 'user', // whether to share location; 'always', 'user', 'never'
  322. 'sharedefault' => false),
  323. 'logincommand' =>
  324. array('disabled' => true),
  325. 'plugins' =>[
  326. 'core' => [
  327. 'Activity' => [],
  328. 'ActivityModeration' => [],
  329. 'ActivityVerb' => [],
  330. 'ActivityVerbPost' => [],
  331. 'AuthCrypt' => [],
  332. 'Favorite' => [],
  333. 'HTMLPurifierSchemes' => [],
  334. 'Share' => [],
  335. ],
  336. 'default' => [
  337. 'AccountManager' => [],
  338. 'AntiBrute' => [],
  339. 'Blacklist' => [],
  340. 'Bookmark' => [],
  341. 'ClientSideShorten' => [],
  342. 'Cronish' => [],
  343. 'DefaultLayout' => [],
  344. 'DirectionDetector' => [],
  345. 'DirectMessage' => [],
  346. 'Directory' => [],
  347. 'EmailAuthentication' => [],
  348. 'Embed' => [],
  349. 'Event' => [],
  350. 'LRDD' => [],
  351. 'Nodeinfo' => [],
  352. 'OpenID' => [],
  353. 'OpportunisticQM' => [],
  354. 'RemoteFollow' => [],
  355. 'ActivityPub' => [], // The order is important here (IT HAS TO COME BEFORE OSTATUS)
  356. 'OStatus' => [],
  357. 'Poll' => [],
  358. 'SimpleCaptcha' => [],
  359. 'TagSub' => [],
  360. 'UnQueue' => [],
  361. 'WebFinger' => [],
  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. 'timeout' => intval(ini_get('default_socket_timeout')), // effectively should be this by default already, but this makes it more explicitly configurable for you users .)
  395. 'proxy_host' => null,
  396. 'proxy_port' => null,
  397. 'proxy_user' => null,
  398. 'proxy_password' => null,
  399. 'proxy_auth_scheme' => null,
  400. ),
  401. 'router' =>
  402. array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel
  403. 'discovery' =>
  404. array('cors' => false), // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
  405. 'performance' => array('high' => false) // disable some features for higher performance; default false
  406. );