default.php 21 KB

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