The version of vichan running on lainchan.org
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1838 строки
76KB

  1. <?php
  2. /*
  3. * Copyright (c) 2010-2013 Tinyboard Development Group
  4. *
  5. * WARNING: This is a project-wide configuration file and is overwritten when upgrading to a newer
  6. * version of Tinyboard. Please leave this file unchanged, or it will be a lot harder for you to upgrade.
  7. * If you would like to make instance-specific changes to your own setup, please use instance-config.php.
  8. *
  9. * This is the default configuration. You can copy values from here and use them in
  10. * your instance-config.php
  11. *
  12. * You can also create per-board configuration files. Once a board is created, locate its directory and
  13. * create a new file named config.php (eg. b/config.php). Like instance-config.php, you can copy values
  14. * from here and use them in your per-board configuration files.
  15. *
  16. * Some directives are commented out. This is either because they are optional and examples, or because
  17. * they are "optionally configurable", and given their default values by Tinyboard's code later if unset.
  18. *
  19. * More information: http://tinyboard.org/docs/?p=Config
  20. *
  21. * Tinyboard documentation: http://tinyboard.org/docs/
  22. *
  23. */
  24. defined('TINYBOARD') or exit;
  25. /*
  26. * =======================
  27. * General/misc settings
  28. * =======================
  29. */
  30. // Global announcement -- the very simple version.
  31. // This used to be wrongly named $config['blotter'] (still exists as an alias).
  32. // $config['global_message'] = 'This is an important announcement!';
  33. $config['blotter'] = &$config['global_message'];
  34. // Automatically check if a newer version of Tinyboard is available when an administrator logs in.
  35. $config['check_updates'] = true;
  36. // How often to check for updates
  37. $config['check_updates_time'] = 43200; // 12 hours
  38. // Shows some extra information at the bottom of pages. Good for development/debugging.
  39. $config['debug'] = false;
  40. // For development purposes. Displays (and "dies" on) all errors and warnings. Turn on with the above.
  41. $config['verbose_errors'] = true;
  42. // EXPLAIN all SQL queries (when in debug mode).
  43. $config['debug_explain'] = false;
  44. // Directory where temporary files will be created.
  45. $config['tmp'] = sys_get_temp_dir();
  46. // The HTTP status code to use when redirecting. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  47. // Can be either 303 "See Other" or 302 "Found". (303 is more correct but both should work.)
  48. // There is really no reason for you to ever need to change this.
  49. $config['redirect_http'] = 303;
  50. // A tiny text file in the main directory indicating that the script has been ran and the board(s) have
  51. // been generated. This keeps the script from querying the database and causing strain when not needed.
  52. $config['has_installed'] = '.installed';
  53. // Use syslog() for logging all error messages and unauthorized login attempts.
  54. $config['syslog'] = false;
  55. // Use `host` via shell_exec() to lookup hostnames, avoiding query timeouts. May not work on your system.
  56. // Requires safe_mode to be disabled.
  57. $config['dns_system'] = false;
  58. // Check validity of the reverse DNS of IP addresses. Highly recommended.
  59. $config['fcrdns'] = true;
  60. // When executing most command-line tools (such as `convert` for ImageMagick image processing), add this
  61. // to the environment path (seperated by :).
  62. $config['shell_path'] = '/usr/local/bin';
  63. /*
  64. * ====================
  65. * Database settings
  66. * ====================
  67. */
  68. // Database driver (http://www.php.net/manual/en/pdo.drivers.php)
  69. // Only MySQL is supported by Tinyboard at the moment, sorry.
  70. $config['db']['type'] = 'mysql';
  71. // Hostname, IP address or Unix socket (prefixed with ":")
  72. $config['db']['server'] = 'localhost';
  73. // Example: Unix socket
  74. // $config['db']['server'] = ':/tmp/mysql.sock';
  75. // Login
  76. $config['db']['user'] = '';
  77. $config['db']['password'] = '';
  78. // Tinyboard database
  79. $config['db']['database'] = '';
  80. // Table prefix (optional)
  81. $config['db']['prefix'] = '';
  82. // Use a persistent database connection when possible
  83. $config['db']['persistent'] = false;
  84. // Anything more to add to the DSN string (eg. port=xxx;foo=bar)
  85. $config['db']['dsn'] = '';
  86. // Connection timeout duration in seconds
  87. $config['db']['timeout'] = 30;
  88. /*
  89. * ====================
  90. * Cache, lock and queue settings
  91. * ====================
  92. */
  93. /*
  94. * On top of the static file caching system, you can enable the additional caching system which is
  95. * designed to minimize SQL queries and can significantly increase speed when posting or using the
  96. * moderator interface. APC is the recommended method of caching.
  97. *
  98. * http://tinyboard.org/docs/index.php?p=Config/Cache
  99. */
  100. $config['cache']['enabled'] = 'php';
  101. // $config['cache']['enabled'] = 'xcache';
  102. // $config['cache']['enabled'] = 'apc';
  103. // $config['cache']['enabled'] = 'memcached';
  104. // $config['cache']['enabled'] = 'redis';
  105. // $config['cache']['enabled'] = 'fs';
  106. // Timeout for cached objects such as posts and HTML.
  107. $config['cache']['timeout'] = 60 * 60 * 48; // 48 hours
  108. // Optional prefix if you're running multiple Tinyboard instances on the same machine.
  109. $config['cache']['prefix'] = '';
  110. // Memcached servers to use. Read more: http://www.php.net/manual/en/memcached.addservers.php
  111. $config['cache']['memcached'] = array(
  112. array('localhost', 11211)
  113. );
  114. // Redis server to use. Location, port, password, database id.
  115. // Note that Tinyboard may clear the database at times, so you may want to pick a database id just for
  116. // Tinyboard to use.
  117. $config['cache']['redis'] = array('localhost', 6379, '', 1);
  118. // EXPERIMENTAL: Should we cache configs? Warning: this changes board behaviour, i'd say, a lot.
  119. // If you have any lambdas/includes present in your config, you should move them to instance-functions.php
  120. // (this file will be explicitly loaded during cache hit, but not during cache miss).
  121. $config['cache_config'] = false;
  122. // Define a lock driver.
  123. $config['lock']['enabled'] = 'fs';
  124. // Define a queue driver.
  125. $config['queue']['enabled'] = 'fs'; // xD
  126. /*
  127. * ====================
  128. * Cookie settings
  129. * ====================
  130. */
  131. // Used for moderation login.
  132. $config['cookies']['mod'] = 'mod';
  133. // Used for communicating with Javascript; telling it when posts were successful.
  134. $config['cookies']['js'] = 'serv';
  135. // Cookies path. Defaults to $config['root']. If $config['root'] is a URL, you need to set this. Should
  136. // be '/' or '/board/', depending on your installation.
  137. // $config['cookies']['path'] = '/';
  138. // Where to set the 'path' parameter to $config['cookies']['path'] when creating cookies. Recommended.
  139. $config['cookies']['jail'] = true;
  140. // How long should the cookies last (in seconds). Defines how long should moderators should remain logged
  141. // in (0 = browser session).
  142. $config['cookies']['expire'] = 60 * 60 * 24 * 30 * 6; // ~6 months
  143. // Make this something long and random for security.
  144. $config['cookies']['salt'] = 'abcdefghijklmnopqrstuvwxyz09123456789!@#$%^&*()';
  145. // Whether or not you can access the mod cookie in JavaScript. Most users should not need to change this.
  146. $config['cookies']['httponly'] = true;
  147. // Used to salt secure tripcodes ("##trip") and poster IDs (if enabled).
  148. $config['secure_trip_salt'] = ')(*&^%$#@!98765432190zyxwvutsrqponmlkjihgfedcba';
  149. /*
  150. * ====================
  151. * Flood/spam settings
  152. * ====================
  153. */
  154. /*
  155. * To further prevent spam and abuse, you can use DNS blacklists (DNSBL). A DNSBL is a list of IP
  156. * addresses published through the Internet Domain Name Service (DNS) either as a zone file that can be
  157. * used by DNS server software, or as a live DNS zone that can be queried in real-time.
  158. *
  159. * Read more: http://tinyboard.org/docs/?p=Config/DNSBL
  160. */
  161. // Prevents most Tor exit nodes from making posts. Recommended, as a lot of abuse comes from Tor because
  162. // of the strong anonymity associated with it.
  163. $config['dnsbl'][] = array('tor.dnsbl.sectoor.de', 1);
  164. // http://www.sorbs.net/using.shtml
  165. // $config['dnsbl'][] = array('dnsbl.sorbs.net', array(2, 3, 4, 5, 6, 7, 8, 9));
  166. // http://www.projecthoneypot.org/httpbl.php
  167. // $config['dnsbl'][] = array('<your access key>.%.dnsbl.httpbl.org', function($ip) {
  168. // $octets = explode('.', $ip);
  169. //
  170. // // days since last activity
  171. // if ($octets[1] > 14)
  172. // return false;
  173. //
  174. // // "threat score" (http://www.projecthoneypot.org/threat_info.php)
  175. // if ($octets[2] < 5)
  176. // return false;
  177. //
  178. // return true;
  179. // }, 'dnsbl.httpbl.org'); // hide our access key
  180. // Skip checking certain IP addresses against blacklists (for troubleshooting or whatever)
  181. $config['dnsbl_exceptions'][] = '127.0.0.1';
  182. /*
  183. * Introduction to Tinyboard's spam filter:
  184. *
  185. * In simple terms, whenever a posting form on a page is generated (which happens whenever a
  186. * post is made), Tinyboard will add a random amount of hidden, obscure fields to it to
  187. * confuse bots and upset hackers. These fields and their respective obscure values are
  188. * validated upon posting with a 160-bit "hash". That hash can only be used as many times
  189. * as you specify; otherwise, flooding bots could just keep reusing the same hash.
  190. * Once a new set of inputs (and the hash) are generated, old hashes for the same thread
  191. * and board are set to expire. Because you have to reload the page to get the new set
  192. * of inputs and hash, if they expire too quickly and more than one person is viewing the
  193. * page at a given time, Tinyboard would return false positives (depending on how long the
  194. * user sits on the page before posting). If your imageboard is quite fast/popular, set
  195. * $config['spam']['hidden_inputs_max_pass'] and $config['spam']['hidden_inputs_expire'] to
  196. * something higher to avoid false positives.
  197. *
  198. * See also: http://tinyboard.org/docs/?p=Your_request_looks_automated
  199. *
  200. */
  201. // Number of hidden fields to generate.
  202. $config['spam']['hidden_inputs_min'] = 4;
  203. $config['spam']['hidden_inputs_max'] = 12;
  204. // How many times can a "hash" be used to post?
  205. $config['spam']['hidden_inputs_max_pass'] = 12;
  206. // How soon after regeneration do hashes expire (in seconds)?
  207. $config['spam']['hidden_inputs_expire'] = 60 * 60 * 3; // three hours
  208. // Whether to use Unicode characters in hidden input names and values.
  209. $config['spam']['unicode'] = true;
  210. // These are fields used to confuse the bots. Make sure they aren't actually used by Tinyboard, or it won't work.
  211. $config['spam']['hidden_input_names'] = array(
  212. 'user',
  213. 'username',
  214. 'login',
  215. 'search',
  216. 'q',
  217. 'url',
  218. 'firstname',
  219. 'lastname',
  220. 'text',
  221. 'message'
  222. );
  223. // Always update this when adding new valid fields to the post form, or EVERYTHING WILL BE DETECTED AS SPAM!
  224. $config['spam']['valid_inputs'] = array(
  225. 'hash',
  226. 'board',
  227. 'thread',
  228. 'mod',
  229. 'name',
  230. 'email',
  231. 'subject',
  232. 'post',
  233. 'body',
  234. 'password',
  235. 'sticky',
  236. 'lock',
  237. 'raw',
  238. 'embed',
  239. 'recaptcha_challenge_field',
  240. 'recaptcha_response_field',
  241. 'spoiler',
  242. 'page',
  243. 'file_url',
  244. 'json_response',
  245. 'user_flag',
  246. 'no_country',
  247. 'tag'
  248. );
  249. // Enable reCaptcha to make spam even harder. Rarely necessary.
  250. $config['recaptcha'] = false;
  251. // Public and private key pair from https://www.google.com/recaptcha/admin/create
  252. $config['recaptcha_public'] = '6LcXTcUSAAAAAKBxyFWIt2SO8jwx4W7wcSMRoN3f';
  253. $config['recaptcha_private'] = '6LcXTcUSAAAAAOGVbVdhmEM1_SyRF4xTKe8jbzf_';
  254. // Ability to lock a board for normal users and still allow mods to post. Could also be useful for making an archive board
  255. $config['board_locked'] = false;
  256. // If poster's proxy supplies X-Forwarded-For header, check if poster's real IP is banned.
  257. $config['proxy_check'] = false;
  258. // If poster's proxy supplies X-Forwarded-For header, save it for further inspection and/or filtering.
  259. $config['proxy_save'] = false;
  260. /*
  261. * Custom filters detect certain posts and reject/ban accordingly. They are made up of a condition and an
  262. * action (for when ALL conditions are met). As every single post has to be put through each filter,
  263. * having hundreds probably isn't ideal as it could slow things down.
  264. *
  265. * By default, the custom filters array is populated with basic flood prevention conditions. This
  266. * includes forcing users to wait at least 5 seconds between posts. To disable (or amend) these flood
  267. * prevention settings, you will need to empty the $config['filters'] array first. You can do so by
  268. * adding "$config['filters'] = array();" to inc/instance-config.php. Basic flood prevention used to be
  269. * controlled solely by config variables such as $config['flood_time'] and $config['flood_time_ip'], and
  270. * it still is, as long as you leave the relevant $config['filters'] intact. These old config variables
  271. * still exist for backwards-compatability and general convenience.
  272. *
  273. * Read more: http://tinyboard.org/docs/index.php?p=Config/Filters
  274. */
  275. // Minimum time between between each post by the same IP address.
  276. $config['flood_time'] = 10;
  277. // Minimum time between between each post with the exact same content AND same IP address.
  278. $config['flood_time_ip'] = 120;
  279. // Same as above but by a different IP address. (Same content, not necessarily same IP address.)
  280. $config['flood_time_same'] = 30;
  281. // Minimum time between posts by the same IP address (all boards).
  282. $config['filters'][] = array(
  283. 'condition' => array(
  284. 'flood-match' => array('ip'), // Only match IP address
  285. 'flood-time' => &$config['flood_time']
  286. ),
  287. 'action' => 'reject',
  288. 'message' => &$config['error']['flood']
  289. );
  290. // Minimum time between posts by the same IP address with the same text.
  291. $config['filters'][] = array(
  292. 'condition' => array(
  293. 'flood-match' => array('ip', 'body'), // Match IP address and post body
  294. 'flood-time' => &$config['flood_time_ip'],
  295. '!body' => '/^$/', // Post body is NOT empty
  296. ),
  297. 'action' => 'reject',
  298. 'message' => &$config['error']['flood']
  299. );
  300. // Minimum time between posts with the same text. (Same content, but not always the same IP address.)
  301. $config['filters'][] = array(
  302. 'condition' => array(
  303. 'flood-match' => array('body'), // Match only post body
  304. 'flood-time' => &$config['flood_time_same']
  305. ),
  306. 'action' => 'reject',
  307. 'message' => &$config['error']['flood']
  308. );
  309. // Example: Minimum time between posts with the same file hash.
  310. // $config['filters'][] = array(
  311. // 'condition' => array(
  312. // 'flood-match' => array('file'), // Match file hash
  313. // 'flood-time' => 60 * 2 // 2 minutes minimum
  314. // ),
  315. // 'action' => 'reject',
  316. // 'message' => &$config['error']['flood']
  317. // );
  318. // Example: Use the "flood-count" condition to only match if the user has made at least two posts with
  319. // the same content and IP address in the past 2 minutes.
  320. // $config['filters'][] = array(
  321. // 'condition' => array(
  322. // 'flood-match' => array('ip', 'body'), // Match IP address and post body
  323. // 'flood-time' => 60 * 2, // 2 minutes
  324. // 'flood-count' => 2 // At least two recent posts
  325. // ),
  326. // '!body' => '/^$/',
  327. // 'action' => 'reject',
  328. // 'message' => &$config['error']['flood']
  329. // );
  330. // Example: Blocking an imaginary known spammer, who keeps posting a reply with the name "surgeon",
  331. // ending his posts with "regards, the surgeon" or similar.
  332. // $config['filters'][] = array(
  333. // 'condition' => array(
  334. // 'name' => '/^surgeon$/',
  335. // 'body' => '/regards,\s+(the )?surgeon$/i',
  336. // 'OP' => false
  337. // ),
  338. // 'action' => 'reject',
  339. // 'message' => 'Go away, spammer.'
  340. // );
  341. // Example: Same as above, but issuing a 3-hour ban instead of just reject the post and
  342. // add an IP note with the message body
  343. // $config['filters'][] = array(
  344. // 'condition' => array(
  345. // 'name' => '/^surgeon$/',
  346. // 'body' => '/regards,\s+(the )?surgeon$/i',
  347. // 'OP' => false
  348. // ),
  349. // 'action' => 'ban',
  350. // 'add_note' => true,
  351. // 'expires' => 60 * 60 * 3, // 3 hours
  352. // 'reason' => 'Go away, spammer.'
  353. // );
  354. // Example: PHP 5.3+ (anonymous functions)
  355. // There is also a "custom" condition, making the possibilities of this feature pretty much endless.
  356. // This is a bad example, because there is already a "name" condition built-in.
  357. // $config['filters'][] = array(
  358. // 'condition' => array(
  359. // 'body' => '/h$/i',
  360. // 'OP' => false,
  361. // 'custom' => function($post) {
  362. // if($post['name'] == 'Anonymous')
  363. // return true;
  364. // else
  365. // return false;
  366. // }
  367. // ),
  368. // 'action' => 'reject'
  369. // );
  370. // Filter flood prevention conditions ("flood-match") depend on a table which contains a cache of recent
  371. // posts across all boards. This table is automatically purged of older posts, determining the maximum
  372. // "age" by looking at each filter. However, when determining the maximum age, Tinyboard does not look
  373. // outside the current board. This means that if you have a special flood condition for a specific board
  374. // (contained in a board configuration file) which has a flood-time greater than any of those in the
  375. // global configuration, you need to set the following variable to the maximum flood-time condition value.
  376. // $config['flood_cache'] = 60 * 60 * 24; // 24 hours
  377. /*
  378. * ====================
  379. * Post settings
  380. * ====================
  381. */
  382. // Do you need a body for your reply posts?
  383. $config['force_body'] = false;
  384. // Do you need a body for new threads?
  385. $config['force_body_op'] = true;
  386. // Require an image for threads?
  387. $config['force_image_op'] = true;
  388. // Strip superfluous new lines at the end of a post.
  389. $config['strip_superfluous_returns'] = true;
  390. // Strip combining characters from Unicode strings (eg. "Zalgo").
  391. $config['strip_combining_chars'] = true;
  392. // Maximum post body length.
  393. $config['max_body'] = 1800;
  394. // Maximum number of post body lines to show on the index page.
  395. $config['body_truncate'] = 15;
  396. // Maximum number of characters to show on the index page.
  397. $config['body_truncate_char'] = 2500;
  398. // Typically spambots try to post many links. Refuse a post with X links?
  399. $config['max_links'] = 20;
  400. // Maximum number of cites per post (prevents abuse, as more citations mean more database queries).
  401. $config['max_cites'] = 45;
  402. // Maximum number of cross-board links/citations per post.
  403. $config['max_cross'] = $config['max_cites'];
  404. // Track post citations (>>XX). Rebuilds posts after a cited post is deleted, removing broken links.
  405. // Puts a little more load on the database.
  406. $config['track_cites'] = true;
  407. // Maximum filename length (will be truncated).
  408. $config['max_filename_len'] = 255;
  409. // Maximum filename length to display (the rest can be viewed upon mouseover).
  410. $config['max_filename_display'] = 30;
  411. // Allow users to delete their own posts?
  412. $config['allow_delete'] = true;
  413. // How long after posting should you have to wait before being able to delete that post? (In seconds.)
  414. $config['delete_time'] = 10;
  415. // Reply limit (stops bumping thread when this is reached).
  416. $config['reply_limit'] = 250;
  417. // Image hard limit (stops allowing new image replies when this is reached if not zero).
  418. $config['image_hard_limit'] = 0;
  419. // Reply hard limit (stops allowing new replies when this is reached if not zero).
  420. $config['reply_hard_limit'] = 0;
  421. $config['robot_enable'] = false;
  422. // Strip repeating characters when making hashes.
  423. $config['robot_strip_repeating'] = true;
  424. // Enabled mutes? Tinyboard uses ROBOT9000's original 2^x implementation where x is the number of times
  425. // you have been muted in the past.
  426. $config['robot_mute'] = true;
  427. // How long before Tinyboard forgets about a mute?
  428. $config['robot_mute_hour'] = 336; // 2 weeks
  429. // If you want to alter the algorithm a bit. Default value is 2.
  430. $config['robot_mute_multiplier'] = 2; // (n^x where x is the number of previous mutes)
  431. $config['robot_mute_descritpion'] = _('You have been muted for unoriginal content.');
  432. // Automatically convert things like "..." to Unicode characters ("…").
  433. $config['auto_unicode'] = true;
  434. // Whether to turn URLs into functional links.
  435. $config['markup_urls'] = true;
  436. // Optional URL prefix for links (eg. "http://anonym.to/?").
  437. $config['link_prefix'] = '';
  438. $config['url_ads'] = &$config['link_prefix']; // leave alias
  439. // Allow "uploading" images via URL as well. Users can enter the URL of the image and then Tinyboard will
  440. // download it. Not usually recommended.
  441. $config['allow_upload_by_url'] = false;
  442. // The timeout for the above, in seconds.
  443. $config['upload_by_url_timeout'] = 15;
  444. // Enable early 404? With default settings, a thread would 404 if it was to leave page 3, if it had less
  445. // than 3 replies.
  446. $config['early_404'] = false;
  447. $config['early_404_page'] = 3;
  448. $config['early_404_replies'] = 5;
  449. // A wordfilter (sometimes referred to as just a "filter" or "censor") automatically scans users’ posts
  450. // as they are submitted and changes or censors particular words or phrases.
  451. // For a normal string replacement:
  452. // $config['wordfilters'][] = array('cat', 'dog');
  453. // Advanced raplcement (regular expressions):
  454. // $config['wordfilters'][] = array('/ca[rt]/', 'dog', true); // 'true' means it's a regular expression
  455. // Always act as if the user had typed "noko" into the email field.
  456. $config['always_noko'] = false;
  457. // Example: Custom tripcodes. The below example makes a tripcode of "#test123" evaluate to "!HelloWorld".
  458. // $config['custom_tripcode']['#test123'] = '!HelloWorld';
  459. // Example: Custom secure tripcode.
  460. // $config['custom_tripcode']['##securetrip'] = '!!somethingelse';
  461. // Allow users to mark their image as a "spoiler" when posting. The thumbnail will be replaced with a
  462. // static spoiler image instead (see $config['spoiler_image']).
  463. $config['spoiler_images'] = false;
  464. // With the following, you can disable certain superfluous fields or enable "forced anonymous".
  465. // When true, all names will be set to $config['anonymous'].
  466. $config['field_disable_name'] = false;
  467. // When true, there will be no email field.
  468. $config['field_disable_email'] = false;
  469. // When true, there will be no subject field.
  470. $config['field_disable_subject'] = false;
  471. // When true, there will be no subject field for replies.
  472. $config['field_disable_reply_subject'] = false;
  473. // When true, a blank password will be used for files (not usable for deletion).
  474. $config['field_disable_password'] = false;
  475. // When true, users are instead presented a selectbox for email. Contains, blank, noko and sage.
  476. $config['field_email_selectbox'] = false;
  477. // When true, the sage won't be displayed
  478. $config['hide_sage'] = false;
  479. // Don't display user's email when it's not "sage"
  480. $config['hide_email'] = false;
  481. // Attach country flags to posts.
  482. $config['country_flags'] = false;
  483. // Allow the user to decide whether or not he wants to display his country
  484. $config['allow_no_country'] = false;
  485. // Load all country flags from one file
  486. $config['country_flags_condensed'] = true;
  487. $config['country_flags_condensed_css'] = 'static/flags/flags.css';
  488. // Allow the user choose a /pol/-like user_flag that will be shown in the post. For the user flags, please be aware
  489. // that you will have to disable BOTH country_flags and contry_flags_condensed optimization (at least on a board
  490. // where they are enabled).
  491. $config['user_flag'] = false;
  492. // List of user_flag the user can choose. Flags must be placed in the directory set by $config['uri_flags']
  493. $config['user_flags'] = array();
  494. /* example: 
  495. $config['user_flags'] = array (
  496. 'nz' => 'Nazi',
  497. 'cm' => 'Communist',
  498. 'eu' => 'Europe'
  499. );
  500. */
  501. // Allow dice rolling: an email field of the form "dice XdY+/-Z" will result in X Y-sided dice rolled and summed,
  502. // with the modifier Z added, with the result displayed at the top of the post body.
  503. $config['allow_roll'] = false;
  504. // Use semantic URLs for threads, like /b/res/12345/daily-programming-thread.html
  505. $config['slugify'] = false;
  506. // Max size for slugs
  507. $config['slug_max_size'] = 80;
  508. /*
  509. * ====================
  510. * Ban settings
  511. * ====================
  512. */
  513. // Require users to see the ban page at least once for a ban even if it has since expired.
  514. $config['require_ban_view'] = true;
  515. // Show the post the user was banned for on the "You are banned" page.
  516. $config['ban_show_post'] = false;
  517. // Optional HTML to append to "You are banned" pages. For example, you could include instructions and/or
  518. // a link to an email address or IRC chat room to appeal the ban.
  519. $config['ban_page_extra'] = '';
  520. // Allow users to appeal bans through Tinyboard.
  521. $config['ban_appeals'] = false;
  522. // Do not allow users to appeal bans that are shorter than this length (in seconds).
  523. $config['ban_appeals_min_length'] = 60 * 60 * 6; // 6 hours
  524. // How many ban appeals can be made for a single ban?
  525. $config['ban_appeals_max'] = 1;
  526. // Show moderator name on ban page.
  527. $config['show_modname'] = false;
  528. /*
  529. * ====================
  530. * Markup settings
  531. * ====================
  532. */
  533. // "Wiki" markup syntax ($config['wiki_markup'] in pervious versions):
  534. $config['markup'][] = array("/'''(.+?)'''/", "<strong>\$1</strong>");
  535. $config['markup'][] = array("/''(.+?)''/", "<em>\$1</em>");
  536. $config['markup'][] = array("/\*\*(.+?)\*\*/", "<span class=\"spoiler\">\$1</span>");
  537. $config['markup'][] = array("/^[ |\t]*==(.+?)==[ |\t]*$/m", "<span class=\"heading\">\$1</span>");
  538. // Code markup. This should be set to a regular expression, using tags you want to use. Examples:
  539. // "/\[code\](.*?)\[\/code\]/is"
  540. // "/```([a-z0-9-]{0,20})\n(.*?)\n?```\n?/s"
  541. $config['markup_code'] = false;
  542. // Repair markup with HTML Tidy. This may be slower, but it solves nesting mistakes. Tinyboad, at the
  543. // time of writing this, can not prevent out-of-order markup tags (eg. "**''test**'') without help from
  544. // HTML Tidy.
  545. $config['markup_repair_tidy'] = false;
  546. // Always regenerate markup. This isn't recommended and should only be used for debugging; by default,
  547. // Tinyboard only parses post markup when it needs to, and keeps post-markup HTML in the database. This
  548. // will significantly impact performance when enabled.
  549. $config['always_regenerate_markup'] = false;
  550. /*
  551. * ====================
  552. * Image settings
  553. * ====================
  554. */
  555. // Maximum number of images allowed. Increasing this number enabled multi image.
  556. // If you make it more than 1, make sure to enable the below script for the post form to change.
  557. // $config['additional_javascript'][] = 'js/multi_image.js';
  558. $config['max_images'] = 1;
  559. // Method to use for determing the max filesize.
  560. // "split" means that your max filesize is split between the images. For example, if your max filesize
  561. // is 2MB, the filesizes of all files must add up to 2MB for it to work.
  562. // "each" means that each file can be 2MB, so if your max_images is 3, each post could contain 6MB of
  563. // images. "split" is recommended.
  564. $config['multiimage_method'] = 'split';
  565. // For resizing, maximum thumbnail dimensions.
  566. $config['thumb_width'] = 255;
  567. $config['thumb_height'] = 255;
  568. // Maximum thumbnail dimensions for thread (OP) images.
  569. $config['thumb_op_width'] = 255;
  570. $config['thumb_op_height'] = 255;
  571. // Thumbnail extension ("png" recommended). Leave this empty if you want the extension to be inherited
  572. // from the uploaded file.
  573. $config['thumb_ext'] = 'png';
  574. // Maximum amount of animated GIF frames to resize (more frames can mean more processing power). A value
  575. // of "1" means thumbnails will not be animated. Requires $config['thumb_ext'] to be 'gif' (or blank) and
  576. // $config['thumb_method'] to be 'imagick', 'convert', or 'convert+gifsicle'. This value is not
  577. // respected by 'convert'; will just resize all frames if this is > 1.
  578. $config['thumb_keep_animation_frames'] = 1;
  579. /*
  580. * Thumbnailing method:
  581. *
  582. * 'gd' PHP GD (default). Only handles the most basic image formats (GIF, JPEG, PNG).
  583. * GD is a prerequisite for Tinyboard no matter what method you choose.
  584. *
  585. * 'imagick' PHP's ImageMagick bindings. Fast and efficient, supporting many image formats.
  586. * A few minor bugs. http://pecl.php.net/package/imagick
  587. *
  588. * 'convert' The command line version of ImageMagick (`convert`). Fixes most of the bugs in
  589. * PHP Imagick. `convert` produces the best still thumbnails and is highly recommended.
  590. *
  591. * 'gm' GraphicsMagick (`gm`) is a fork of ImageMagick with many improvements. It is more
  592. * efficient and gets thumbnailing done using fewer resources.
  593. *
  594. * 'convert+gifscale'
  595. * OR 'gm+gifsicle' Same as above, with the exception of using `gifsicle` (command line application)
  596. * instead of `convert` for resizing GIFs. It's faster and resulting animated
  597. * thumbnails have less artifacts than if resized with ImageMagick.
  598. */
  599. $config['thumb_method'] = 'gd';
  600. // $config['thumb_method'] = 'convert';
  601. // Command-line options passed to ImageMagick when using `convert` for thumbnailing. Don't touch the
  602. // placement of "%s" and "%d".
  603. $config['convert_args'] = '-size %dx%d %s -thumbnail %dx%d -auto-orient +profile "*" %s';
  604. // Strip EXIF metadata from JPEG files.
  605. $config['strip_exif'] = false;
  606. // Use the command-line `exiftool` tool to strip EXIF metadata without decompressing/recompressing JPEGs.
  607. // Ignored when $config['redraw_image'] is true. This is also used to adjust the Orientation tag when
  608. // $config['strip_exif'] is false and $config['convert_manual_orient'] is true.
  609. $config['use_exiftool'] = false;
  610. // Redraw the image to strip any excess data (commonly ZIP archives) WARNING: This might strip the
  611. // animation of GIFs, depending on the chosen thumbnailing method. It also requires recompressing
  612. // the image, so more processing power is required.
  613. $config['redraw_image'] = false;
  614. // Automatically correct the orientation of JPEG files using -auto-orient in `convert`. This only works
  615. // when `convert` or `gm` is selected for thumbnailing. Again, requires more processing power because
  616. // this basically does the same thing as $config['redraw_image']. (If $config['redraw_image'] is enabled,
  617. // this value doesn't matter as $config['redraw_image'] attempts to correct orientation too.)
  618. $config['convert_auto_orient'] = false;
  619. // Is your version of ImageMagick or GraphicsMagick old? Older versions may not include the -auto-orient
  620. // switch. This is a manual replacement for that switch. This is independent from the above switch;
  621. // -auto-orrient is applied when thumbnailing too.
  622. $config['convert_manual_orient'] = false;
  623. // Regular expression to check for an XSS exploit with IE 6 and 7. To disable, set to false.
  624. // Details: https://github.com/savetheinternet/Tinyboard/issues/20
  625. $config['ie_mime_type_detection'] = '/<(?:body|head|html|img|plaintext|pre|script|table|title|a href|channel|scriptlet)/i';
  626. // Allowed image file extensions.
  627. $config['allowed_ext'][] = 'jpg';
  628. $config['allowed_ext'][] = 'jpeg';
  629. $config['allowed_ext'][] = 'bmp';
  630. $config['allowed_ext'][] = 'gif';
  631. $config['allowed_ext'][] = 'png';
  632. // $config['allowed_ext'][] = 'svg';
  633. // Allowed extensions for OP. Inherits from the above setting if set to false. Otherwise, it overrides both allowed_ext and
  634. // allowed_ext_files (filetypes for downloadable files should be set in allowed_ext_files as well). This setting is useful
  635. // for creating fileboards.
  636. $config['allowed_ext_op'] = false;
  637. // Allowed additional file extensions (not images; downloadable files).
  638. // $config['allowed_ext_files'][] = 'txt';
  639. // $config['allowed_ext_files'][] = 'zip';
  640. // An alternative function for generating image filenames, instead of the default UNIX timestamp.
  641. // $config['filename_func'] = function($post) {
  642. // return sprintf("%s", time() . substr(microtime(), 2, 3));
  643. // };
  644. // Thumbnail to use for the non-image file uploads.
  645. $config['file_icons']['default'] = 'file.png';
  646. $config['file_icons']['zip'] = 'zip.png';
  647. $config['file_icons']['webm'] = 'video.png';
  648. $config['file_icons']['mp4'] = 'video.png';
  649. // Example: Custom thumbnail for certain file extension.
  650. // $config['file_icons']['extension'] = 'some_file.png';
  651. // Location of above images.
  652. $config['file_thumb'] = 'static/%s';
  653. // Location of thumbnail to use for spoiler images.
  654. $config['spoiler_image'] = 'static/spoiler.png';
  655. // Location of thumbnail to use for deleted images.
  656. $config['image_deleted'] = 'static/deleted.png';
  657. // When a thumbnailed image is going to be the same (in dimension), just copy the entire file and use
  658. // that as a thumbnail instead of resizing/redrawing.
  659. $config['minimum_copy_resize'] = false;
  660. // Maximum image upload size in bytes.
  661. $config['max_filesize'] = 10 * 1024 * 1024; // 10MB
  662. // Maximum image dimensions.
  663. $config['max_width'] = 10000;
  664. $config['max_height'] = $config['max_width'];
  665. // Reject duplicate image uploads.
  666. $config['image_reject_repost'] = true;
  667. // Reject duplicate image uploads within the same thread. Doesn't change anything if
  668. // $config['image_reject_repost'] is true.
  669. $config['image_reject_repost_in_thread'] = false;
  670. // Display the aspect ratio of uploaded files.
  671. $config['show_ratio'] = false;
  672. // Display the file's original filename.
  673. $config['show_filename'] = true;
  674. // WebM Settings
  675. $config['webm']['use_ffmpeg'] = false;
  676. $config['webm']['allow_audio'] = false;
  677. $config['webm']['max_length'] = 120;
  678. $config['webm']['ffmpeg_path'] = 'ffmpeg';
  679. $config['webm']['ffprobe_path'] = 'ffprobe';
  680. // Display image identification links for ImgOps, regex.info/exif, Google Images and iqdb.
  681. $config['image_identification'] = false;
  682. // Which of the identification links to display. Only works if $config['image_identification'] is true.
  683. $config['image_identification_imgops'] = true;
  684. $config['image_identification_exif'] = true;
  685. $config['image_identification_google'] = true;
  686. // Anime/manga search engine.
  687. $config['image_identification_iqdb'] = false;
  688. // Set this to true if you're using a BSD
  689. $config['bsd_md5'] = false;
  690. // Set this to true if you're using Linux and you can execute `md5sum` binary.
  691. $config['gnu_md5'] = false;
  692. // Use Tesseract OCR to retrieve text from images, so you can use it as a spamfilter.
  693. $config['tesseract_ocr'] = false;
  694. // Tesseract parameters
  695. $config['tesseract_params'] = '';
  696. // Tesseract preprocess command
  697. $config['tesseract_preprocess_command'] = 'convert -monochrome %s -';
  698. // Number of posts in a "View Last X Posts" page
  699. $config['noko50_count'] = 50;
  700. // Number of posts a thread needs before it gets a "View Last X Posts" page.
  701. // Set to an arbitrarily large value to disable.
  702. $config['noko50_min'] = 100;
  703. /*
  704. * ====================
  705. * Board settings
  706. * ====================
  707. */
  708. // Maximum amount of threads to display per page.
  709. $config['threads_per_page'] = 10;
  710. // Maximum number of pages. Content past the last page is automatically purged.
  711. $config['max_pages'] = 10;
  712. // Replies to show per thread on the board index page.
  713. $config['threads_preview'] = 5;
  714. // Same as above, but for stickied threads.
  715. $config['threads_preview_sticky'] = 1;
  716. // How to display the URI of boards. Usually '/%s/' (/b/, /mu/, etc). This doesn't change the URL. Find
  717. // $config['board_path'] if you wish to change the URL.
  718. $config['board_abbreviation'] = '/%s/';
  719. // The default name (ie. Anonymous). Can be an array - in that case it's picked randomly from the array.
  720. // Example: $config['anonymous'] = array('Bernd', 'Senpai', 'Jonne', 'ChanPro');
  721. $config['anonymous'] = 'Anonymous';
  722. // Number of reports you can create at once.
  723. $config['report_limit'] = 3;
  724. // Allow unfiltered HTML in board subtitle. This is useful for placing icons and links.
  725. $config['allow_subtitle_html'] = false;
  726. /*
  727. * ====================
  728. * Display settings
  729. * ====================
  730. */
  731. // Tinyboard has been translated into a few langauges. See inc/locale for available translations.
  732. $config['locale'] = 'en'; // (en, ru_RU.UTF-8, fi_FI.UTF-8, pl_PL.UTF-8)
  733. // Timezone to use for displaying dates/tiems.
  734. $config['timezone'] = 'America/Los_Angeles';
  735. // The format string passed to strftime() for displaying dates.
  736. // http://www.php.net/manual/en/function.strftime.php
  737. $config['post_date'] = '%m/%d/%y (%a) %H:%M:%S';
  738. // Same as above, but used for "you are banned' pages.
  739. $config['ban_date'] = '%A %e %B, %Y';
  740. // The names on the post buttons. (On most imageboards, these are both just "Post").
  741. $config['button_newtopic'] = _('New Topic');
  742. $config['button_reply'] = _('New Reply');
  743. // Assign each poster in a thread a unique ID, shown by "ID: xxxxx" before the post number.
  744. $config['poster_ids'] = false;
  745. // Number of characters in the poster ID (maximum is 40).
  746. $config['poster_id_length'] = 5;
  747. // Show thread subject in page title.
  748. $config['thread_subject_in_title'] = false;
  749. // Additional lines added to the footer of all pages.
  750. $config['footer'][] = _('All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.');
  751. // Characters used to generate a random password (with Javascript).
  752. $config['genpassword_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+';
  753. // Optional banner image at the top of every page.
  754. // $config['url_banner'] = '/banner.php';
  755. // Banner dimensions are also optional. As the banner loads after the rest of the page, everything may be
  756. // shifted down a few pixels when it does. Making the banner a fixed size will prevent this.
  757. // $config['banner_width'] = 300;
  758. // $config['banner_height'] = 100;
  759. // Custom stylesheets available for the user to choose. See the "stylesheets/" folder for a list of
  760. // available stylesheets (or create your own).
  761. $config['stylesheets']['Yotsuba B'] = ''; // Default; there is no additional/custom stylesheet for this.
  762. $config['stylesheets']['Yotsuba'] = 'yotsuba.css';
  763. // $config['stylesheets']['Futaba'] = 'futaba.css';
  764. // $config['stylesheets']['Dark'] = 'dark.css';
  765. // The prefix for each stylesheet URI. Defaults to $config['root']/stylesheets/
  766. // $config['uri_stylesheets'] = 'http://static.example.org/stylesheets/';
  767. // The default stylesheet to use.
  768. $config['default_stylesheet'] = array('Yotsuba B', $config['stylesheets']['Yotsuba B']);
  769. // Make stylesheet selections board-specific.
  770. $config['stylesheets_board'] = false;
  771. // Use Font-Awesome for displaying lock and pin icons, instead of the images in static/.
  772. // http://fortawesome.github.io/Font-Awesome/icon/pushpin/
  773. // http://fortawesome.github.io/Font-Awesome/icon/lock/
  774. $config['font_awesome'] = true;
  775. $config['font_awesome_css'] = 'stylesheets/font-awesome/css/font-awesome.min.css';
  776. /*
  777. * For lack of a better name, “boardlinks” are those sets of navigational links that appear at the top
  778. * and bottom of board pages. They can be a list of links to boards and/or other pages such as status
  779. * blogs and social network profiles/pages.
  780. *
  781. * "Groups" in the boardlinks are marked with square brackets. Tinyboard allows for infinite recursion
  782. * with groups. Each array() in $config['boards'] represents a new square bracket group.
  783. */
  784. // $config['boards'] = array(
  785. // array('a', 'b'),
  786. // array('c', 'd', 'e', 'f', 'g'),
  787. // array('h', 'i', 'j'),
  788. // array('k', array('l', 'm')),
  789. // array('status' => 'http://status.example.org/')
  790. // );
  791. // Whether or not to put brackets around the whole board list
  792. $config['boardlist_wrap_bracket'] = false;
  793. // Show page navigation links at the top as well.
  794. $config['page_nav_top'] = false;
  795. // Show "Catalog" link in page navigation. Use with the Catalog theme. Set to false to disable.
  796. $config['catalog_link'] = 'catalog.html';
  797. // Board categories. Only used in the "Categories" theme.
  798. // $config['categories'] = array(
  799. // 'Group Name' => array('a', 'b', 'c'),
  800. // 'Another Group' => array('d')
  801. // );
  802. // Optional for the Categories theme. This is an array of name => (title, url) groups for categories
  803. // with non-board links.
  804. // $config['custom_categories'] = array(
  805. // 'Links' => array(
  806. // 'Tinyboard' => 'http://tinyboard.org',
  807. // 'Donate' => 'donate.html'
  808. // )
  809. // );
  810. // Automatically remove unnecessary whitespace when compiling HTML files from templates.
  811. $config['minify_html'] = true;
  812. /*
  813. * Advertisement HTML to appear at the top and bottom of board pages.
  814. */
  815. // $config['ad'] = array(
  816. // 'top' => '',
  817. // 'bottom' => '',
  818. // );
  819. // Display flags (when available). This config option has no effect unless poster flags are enabled (see
  820. // $config['country_flags']). Disable this if you want all previously-assigned flags to be hidden.
  821. $config['display_flags'] = true;
  822. // Location of post flags/icons (where "%s" is the flag name). Defaults to static/flags/%s.png.
  823. // $config['uri_flags'] = 'http://static.example.org/flags/%s.png';
  824. // Width and height (and more?) of post flags. Can be overridden with the Tinyboard post modifier:
  825. // <tinyboard flag style>.
  826. $config['flag_style'] = 'width:16px;height:11px;';
  827. /*
  828. * ====================
  829. * Javascript
  830. * ====================
  831. */
  832. // Additional Javascript files to include on board index and thread pages. See js/ for available scripts.
  833. $config['additional_javascript'][] = 'js/inline-expanding.js';
  834. // $config['additional_javascript'][] = 'js/local-time.js';
  835. // Some scripts require jQuery. Check the comments in script files to see what's needed. When enabling
  836. // jQuery, you should first empty the array so that "js/query.min.js" can be the first, and then re-add
  837. // "js/inline-expanding.js" or else the inline-expanding script might not interact properly with other
  838. // scripts.
  839. // $config['additional_javascript'] = array();
  840. // $config['additional_javascript'][] = 'js/jquery.min.js';
  841. // $config['additional_javascript'][] = 'js/inline-expanding.js';
  842. // $config['additional_javascript'][] = 'js/auto-reload.js';
  843. // $config['additional_javascript'][] = 'js/post-hover.js';
  844. // $config['additional_javascript'][] = 'js/style-select.js';
  845. // Where these script files are located on the web. Defaults to $config['root'].
  846. // $config['additional_javascript_url'] = 'http://static.example.org/tinyboard-javascript-stuff/';
  847. // Compile all additional scripts into one file ($config['file_script']) instead of including them seperately.
  848. $config['additional_javascript_compile'] = false;
  849. // Minify Javascript using http://code.google.com/p/minify/.
  850. $config['minify_js'] = false;
  851. // Dispatch thumbnail loading and image configuration with JavaScript. It will need a certain javascript
  852. // code to work.
  853. $config['javascript_image_dispatch'] = false;
  854. /*
  855. * ====================
  856. * Video embedding
  857. * ====================
  858. */
  859. // Enable embedding (see below).
  860. $config['enable_embedding'] = false;
  861. // Custom embedding (YouTube, vimeo, etc.)
  862. // It's very important that you match the entire input (with ^ and $) or things will not work correctly.
  863. $config['embedding'] = array(
  864. array(
  865. '/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})(&.+)?$/i',
  866. '<iframe style="float: left;margin: 10px 20px;" width="%%tb_width%%" height="%%tb_height%%" frameborder="0" id="ytplayer" src="http://www.youtube.com/embed/$2"></iframe>'
  867. ),
  868. array(
  869. '/^https?:\/\/(\w+\.)?vimeo\.com\/(\d{2,10})(\?.+)?$/i',
  870. '<object style="float: left;margin: 10px 20px;" width="%%tb_width%%" height="%%tb_height%%"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=$2&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=$2&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="%%tb_width%%" height="%%tb_height%%"></object>'
  871. ),
  872. array(
  873. '/^https?:\/\/(\w+\.)?dailymotion\.com\/video\/([a-zA-Z0-9]{2,10})(_.+)?$/i',
  874. '<object style="float: left;margin: 10px 20px;" width="%%tb_width%%" height="%%tb_height%%"><param name="movie" value="http://www.dailymotion.com/swf/video/$2"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/$2" width="%%tb_width%%" height="%%tb_height%%" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></object>'
  875. ),
  876. array(
  877. '/^https?:\/\/(\w+\.)?metacafe\.com\/watch\/(\d+)\/([a-zA-Z0-9_\-.]+)\/(\?[^\'"<>]+)?$/i',
  878. '<div style="float:left;margin:10px 20px;width:%%tb_width%%px;height:%%tb_height%%px"><embed flashVars="playerVars=showStats=no|autoPlay=no" src="http://www.metacafe.com/fplayer/$2/$3.swf" width="%%tb_width%%" height="%%tb_height%%" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_$2" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></div>'
  879. ),
  880. array(
  881. '/^https?:\/\/video\.google\.com\/videoplay\?docid=(\d+)([&#](.+)?)?$/i',
  882. '<embed src="http://video.google.com/googleplayer.swf?docid=$1&hl=en&fs=true" style="width:%%tb_width%%px;height:%%tb_height%%px;float:left;margin:10px 20px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>'
  883. ),
  884. array(
  885. '/^https?:\/\/(\w+\.)?vocaroo\.com\/i\/([a-zA-Z0-9]{2,15})$/i',
  886. '<object style="float: left;margin: 10px 20px;" width="148" height="44"><param name="movie" value="http://vocaroo.com/player.swf?playMediaID=$2&autoplay=0"><param name="wmode" value="transparent"><embed src="http://vocaroo.com/player.swf?playMediaID=$2&autoplay=0" width="148" height="44" wmode="transparent" type="application/x-shockwave-flash"></object>'
  887. )
  888. );
  889. // Embedding width and height.
  890. $config['embed_width'] = 300;
  891. $config['embed_height'] = 246;
  892. /*
  893. * ====================
  894. * Error messages
  895. * ====================
  896. */
  897. // Error messages
  898. $config['error']['bot'] = _('You look like a bot.');
  899. $config['error']['referer'] = _('Your browser sent an invalid or no HTTP referer.');
  900. $config['error']['toolong'] = _('The %s field was too long.');
  901. $config['error']['toolong_body'] = _('The body was too long.');
  902. $config['error']['tooshort_body'] = _('The body was too short or empty.');
  903. $config['error']['noimage'] = _('You must upload an image.');
  904. $config['error']['toomanyimages'] = _('You have attempted to upload too many images!');
  905. $config['error']['nomove'] = _('The server failed to handle your upload.');
  906. $config['error']['fileext'] = _('Unsupported image format.');
  907. $config['error']['noboard'] = _('Invalid board!');
  908. $config['error']['nonexistant'] = _('Thread specified does not exist.');
  909. $config['error']['locked'] = _('Thread locked. You may not reply at this time.');
  910. $config['error']['reply_hard_limit'] = _('Thread has reached its maximum reply limit.');
  911. $config['error']['image_hard_limit'] = _('Thread has reached its maximum image limit.');
  912. $config['error']['nopost'] = _('You didn\'t make a post.');
  913. $config['error']['flood'] = _('Flood detected; Post discarded.');
  914. $config['error']['spam'] = _('Your request looks automated; Post discarded.');
  915. $config['error']['unoriginal'] = _('Unoriginal content!');
  916. $config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.');
  917. $config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.');
  918. $config['error']['dnsbl'] = _('Your IP address is listed in %s.');
  919. $config['error']['toomanylinks'] = _('Too many links; flood detected.');
  920. $config['error']['toomanycites'] = _('Too many cites; post discarded.');
  921. $config['error']['toomanycross'] = _('Too many cross-board links; post discarded.');
  922. $config['error']['nodelete'] = _('You didn\'t select anything to delete.');
  923. $config['error']['noreport'] = _('You didn\'t select anything to report.');
  924. $config['error']['toomanyreports'] = _('You can\'t report that many posts at once.');
  925. $config['error']['invalidpassword'] = _('Wrong password…');
  926. $config['error']['invalidimg'] = _('Invalid image.');
  927. $config['error']['unknownext'] = _('Unknown file extension.');
  928. $config['error']['filesize'] = _('Maximum file size: %maxsz% bytes<br>Your file\'s size: %filesz% bytes');
  929. $config['error']['maxsize'] = _('The file was too big.');
  930. $config['error']['genwebmerror'] = _('There was a problem processing your webm.');
  931. $config['error']['webmerror'] = _('There was a problem processing your webm.');//Is this error used anywhere ?
  932. $config['error']['invalidwebm'] = _('Invalid webm uploaded.');
  933. $config['error']['webmhasaudio'] = _('The uploaded webm contains an audio or another type of additional stream.');
  934. $config['error']['webmtoolong'] = _('The uploaded webm is longer than ' . $config['webm']['max_length'] . ' seconds.');
  935. $config['error']['fileexists'] = _('That file <a href="%s">already exists</a>!');
  936. $config['error']['fileexistsinthread'] = _('That file <a href="%s">already exists</a> in this thread!');
  937. $config['error']['delete_too_soon'] = _('You\'ll have to wait another %s before deleting that.');
  938. $config['error']['mime_exploit'] = _('MIME type detection XSS exploit (IE) detected; post discarded.');
  939. $config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.');
  940. $config['error']['captcha'] = _('You seem to have mistyped the verification.');
  941. // Moderator errors
  942. $config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
  943. $config['error']['invalid'] = _('Invalid username and/or password.');
  944. $config['error']['notamod'] = _('You are not a mod…');
  945. $config['error']['invalidafter'] = _('Invalid username and/or password. Your user may have been deleted or changed.');
  946. $config['error']['malformed'] = _('Invalid/malformed cookies.');
  947. $config['error']['missedafield'] = _('Your browser didn\'t submit an input when it should have.');
  948. $config['error']['required'] = _('The %s field is required.');
  949. $config['error']['invalidfield'] = _('The %s field was invalid.');
  950. $config['error']['boardexists'] = _('There is already a %s board.');
  951. $config['error']['noaccess'] = _('You don\'t have permission to do that.');
  952. $config['error']['invalidpost'] = _('That post doesn\'t exist…');
  953. $config['error']['404'] = _('Page not found.');
  954. $config['error']['modexists'] = _('That mod <a href="?/users/%d">already exists</a>!');
  955. $config['error']['invalidtheme'] = _('That theme doesn\'t exist!');
  956. $config['error']['csrf'] = _('Invalid security token! Please go back and try again.');
  957. $config['error']['badsyntax'] = _('Your code contained PHP syntax errors. Please go back and correct them. PHP says: ');
  958. /*
  959. * =========================
  960. * Directory/file settings
  961. * =========================
  962. */
  963. // The root directory, including the trailing slash, for Tinyboard.
  964. // Examples: '/', 'http://boards.chan.org/', '/chan/'.
  965. if (isset($_SERVER['REQUEST_URI'])) {
  966. $request_uri = $_SERVER['REQUEST_URI'];
  967. if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] !== '')
  968. $request_uri = substr($request_uri, 0, - 1 - strlen($_SERVER['QUERY_STRING']));
  969. $config['root'] = str_replace('\\', '/', dirname($request_uri)) == '/'
  970. ? '/' : str_replace('\\', '/', dirname($request_uri)) . '/';
  971. unset($request_uri);
  972. } else
  973. $config['root'] = '/'; // CLI mode
  974. // The scheme and domain. This is used to get the site's absolute URL (eg. for image identification links).
  975. // If you use the CLI tools, it would be wise to override this setting.
  976. $config['domain'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://' : 'http://';
  977. $config['domain'] .= isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
  978. // If for some reason the folders and static HTML index files aren't in the current working direcotry,
  979. // enter the directory path here. Otherwise, keep it false.
  980. $config['root_file'] = false;
  981. // Location of files.
  982. $config['file_index'] = 'index.html';
  983. $config['file_page'] = '%d.html'; // NB: page is both an index page and a thread
  984. $config['file_page50'] = '%d+50.html';
  985. $config['file_page_slug'] = '%d-%s.html';
  986. $config['file_page50_slug'] = '%d-%s+50.html';
  987. $config['file_mod'] = 'mod.php';
  988. $config['file_post'] = 'post.php';
  989. $config['file_script'] = 'main.js';
  990. // Board directory, followed by a forward-slash (/).
  991. $config['board_path'] = '%s/';
  992. // Misc directories.
  993. $config['dir']['img'] = 'src/';
  994. $config['dir']['thumb'] = 'thumb/';
  995. $config['dir']['res'] = 'res/';
  996. // For load balancing, having a seperate server (and domain/subdomain) for serving static content is
  997. // possible. This can either be a directory or a URL. Defaults to $config['root'] . 'static/'.
  998. // $config['dir']['static'] = 'http://static.example.org/';
  999. // Where to store the .html templates. This folder and the template files must exist.
  1000. $config['dir']['template'] = getcwd() . '/templates';
  1001. // Location of Tinyboard "themes".
  1002. $config['dir']['themes'] = getcwd() . '/templates/themes';
  1003. // Same as above, but a URI (accessable by web interface).
  1004. $config['dir']['themes_uri'] = 'templates/themes';
  1005. // Home directory. Used by themes.
  1006. $config['dir']['home'] = '';
  1007. // Location of a blank 1x1 gif file. Only used when country_flags_condensed is enabled
  1008. // $config['image_blank'] = 'static/blank.gif';
  1009. // Static images. These can be URLs OR base64 (data URI scheme). These are only used if
  1010. // $config['font_awesome'] is false (default).
  1011. // $config['image_sticky'] = 'static/sticky.png';
  1012. // $config['image_locked'] = 'static/locked.gif';
  1013. // $config['image_bumplocked'] = 'static/sage.png'.
  1014. // If you want to put images and other dynamic-static stuff on another (preferably cookieless) domain.
  1015. // This will override $config['root'] and $config['dir']['...'] directives. "%s" will get replaced with
  1016. // $board['dir'], which includes a trailing slash.
  1017. // $config['uri_thumb'] = 'http://images.example.org/%sthumb/';
  1018. // $config['uri_img'] = 'http://images.example.org/%ssrc/';
  1019. // Set custom locations for stylesheets and the main script file. This can be used for load balancing
  1020. // across multiple servers or hostnames.
  1021. // $config['url_stylesheet'] = 'http://static.example.org/style.css'; // main/base stylesheet
  1022. // $config['url_javascript'] = 'http://static.example.org/main.js';
  1023. // Website favicon.
  1024. // $config['url_favicon'] = '/favicon.gif';
  1025. // Try not to build pages when we shouldn't have to.
  1026. $config['try_smarter'] = true;
  1027. /*
  1028. * ====================
  1029. * Advanced build
  1030. * ====================
  1031. */
  1032. // Strategies for file generation. Also known as an "advanced build". If you don't have performance
  1033. // issues, you can safely ignore that part, because it's hard to configure and won't even work on
  1034. // your free webhosting.
  1035. //
  1036. // A strategy is a function, that given the PHP environment and ($fun, $array) variable pair, returns
  1037. // an $action array or false.
  1038. //
  1039. // $fun - a controller function name, see inc/controller.php. This is named after functions, so that
  1040. // we can generate the files in daemon.
  1041. //
  1042. // $array - arguments to be passed
  1043. //
  1044. // $action - action to be taken. It's an array, and the first element of it is one of the following:
  1045. // * "immediate" - generate the page immediately
  1046. // * "defer" - defer page generation to a moment a worker daemon gets to build it (serving a stale
  1047. // page in the meantime). The remaining arguments are daemon-specific. Daemon isn't
  1048. // implemented yet :DDDD inb4 while(true) { generate(Queue::Get()) }; (which is probably it).
  1049. // * "build_on_load" - defer page generation to a moment, when the user actually accesses the page.
  1050. // This is a smart_build behaviour. You shouldn't use this one too much, if you
  1051. // use it for active boards, the server may choke due to a possible race condition.
  1052. // See my blog post: https://engine.vichan.net/blog/res/2.html
  1053. //
  1054. // So, let's assume we want to build a thread 1324 on board /b/, because a new post appeared there.
  1055. // We try the first strategy, giving it arguments: 'sb_thread', array('b', 1324). The strategy will
  1056. // now return a value $action, denoting an action to do. If $action is false, we try another strategy.
  1057. //
  1058. // As I said, configuration isn't easy.
  1059. //
  1060. // 1. chmod 0777 directories: tmp/locks/ and tmp/queue/.
  1061. // 2. serve 403 and 404 requests to go thru smart_build.php
  1062. // for nginx, this blog post contains config snippets: https://engine.vichan.net/blog/res/2.html
  1063. // 3. disable indexes in your webserver
  1064. // 4. launch any number of daemons (eg. twice your number of threads?) using the command:
  1065. // $ tools/worker.php
  1066. // You don't need to do that step if you are not going to use the "defer" option.
  1067. // 5. enable smart_build_helper (see below)
  1068. // 6. edit the strategies (see inc/functions.php for the builtin ones). You can use lambdas. I will test
  1069. // various ones and include one that works best for me.
  1070. $config['generation_strategies'] = array();
  1071. // Add a sane strategy. It forces to immediately generate a page user is about to land on. Otherwise,
  1072. // it has no opinion, so it needs a fallback strategy.
  1073. $config['generation_strategies'][] = 'strategy_sane';
  1074. // Add an immediate catch-all strategy. This is the default function of imageboards: generate all pages
  1075. // on post time.
  1076. $config['generation_strategies'][] = 'strategy_immediate';
  1077. // NOT RECOMMENDED: Instead of an all-"immediate" strategy, you can use an all-"build_on_load" one (used
  1078. // to be initialized using $config['smart_build']; ) for all pages instead of those to be build
  1079. // immediately. A rebuild done in this mode should remove all your static files
  1080. // $config['generation_strategies'][1] = 'strategy_smart_build';
  1081. // Deprecated. Leave it false. See above.
  1082. $config['smart_build'] = false;
  1083. // Use smart_build.php for dispatching missing requests. It may be useful without smart_build or advanced
  1084. // build, for example it will regenerate the missing files.
  1085. $config['smart_build_helper'] = true;
  1086. // smart_build.php: when a file doesn't exist, where should we redirect?
  1087. $config['page_404'] = '/404.html';
  1088. // Extra controller entrypoints. Controller is used only by smart_build and advanced build.
  1089. $config['controller_entrypoints'] = array();
  1090. /*
  1091. * ====================
  1092. * Mod settings
  1093. * ====================
  1094. */
  1095. // Limit how many bans can be removed via the ban list. Set to false (or zero) for no limit.
  1096. $config['mod']['unban_limit'] = false;
  1097. // Whether or not to lock moderator sessions to IP addresses. This makes cookie theft ineffective.
  1098. $config['mod']['lock_ip'] = true;
  1099. // The page that is first shown when a moderator logs in. Defaults to the dashboard (?/).
  1100. $config['mod']['default'] = '/';
  1101. // Mod links (full HTML).
  1102. $config['mod']['link_delete'] = '[D]';
  1103. $config['mod']['link_ban'] = '[B]';
  1104. $config['mod']['link_bandelete'] = '[B&amp;D]';
  1105. $config['mod']['link_deletefile'] = '[F]';
  1106. $config['mod']['link_spoilerimage'] = '[S]';
  1107. $config['mod']['link_deletebyip'] = '[D+]';
  1108. $config['mod']['link_deletebyip_global'] = '[D++]';
  1109. $config['mod']['link_sticky'] = '[Sticky]';
  1110. $config['mod']['link_desticky'] = '[-Sticky]';
  1111. $config['mod']['link_lock'] = '[Lock]';
  1112. $config['mod']['link_unlock'] = '[-Lock]';
  1113. $config['mod']['link_bumplock'] = '[Sage]';
  1114. $config['mod']['link_bumpunlock'] = '[-Sage]';
  1115. $config['mod']['link_editpost'] = '[Edit]';
  1116. $config['mod']['link_move'] = '[Move]';
  1117. $config['mod']['link_cycle'] = '[Cycle]';
  1118. $config['mod']['link_uncycle'] = '[-Cycle]';
  1119. // Moderator capcodes.
  1120. $config['capcode'] = ' <span class="capcode">## %s</span>';
  1121. // "## Custom" becomes lightgreen, italic and bold:
  1122. //$config['custom_capcode']['Custom'] ='<span class="capcode" style="color:lightgreen;font-style:italic;font-weight:bold"> ## %s</span>';
  1123. // "## Mod" makes everything purple, including the name and tripcode:
  1124. //$config['custom_capcode']['Mod'] = array(
  1125. // '<span class="capcode" style="color:purple"> ## %s</span>',
  1126. // 'color:purple', // Change name style; optional
  1127. // 'color:purple' // Change tripcode style; optional
  1128. //);
  1129. // "## Admin" makes everything red and bold, including the name and tripcode:
  1130. //$config['custom_capcode']['Admin'] = array(
  1131. // '<span class="capcode" style="color:red;font-weight:bold"> ## %s</span>',
  1132. // 'color:red;font-weight:bold', // Change name style; optional
  1133. // 'color:red;font-weight:bold' // Change tripcode style; optional
  1134. //);
  1135. // Enable the moving of single replies
  1136. $config['move_replies'] = false;
  1137. // How often (minimum) to purge the ban list of expired bans (which have been seen). Only works when
  1138. // $config['cache'] is enabled and working.
  1139. $config['purge_bans'] = 60 * 60 * 12; // 12 hours
  1140. // Do DNS lookups on IP addresses to get their hostname for the moderator IP pages (?/IP/x.x.x.x).
  1141. $config['mod']['dns_lookup'] = true;
  1142. // How many recent posts, per board, to show in ?/IP/x.x.x.x.
  1143. $config['mod']['ip_recentposts'] = 5;
  1144. // Number of posts to display on the reports page.
  1145. $config['mod']['recent_reports'] = 10;
  1146. // Number of actions to show per page in the moderation log.
  1147. $config['mod']['modlog_page'] = 350;
  1148. // Number of bans to show per page in the ban list.
  1149. $config['mod']['banlist_page'] = 350;
  1150. // Number of news entries to display per page.
  1151. $config['mod']['news_page'] = 40;
  1152. // Number of results to display per page.
  1153. $config['mod']['search_page'] = 200;
  1154. // Number of entries to show per page in the moderator noticeboard.
  1155. $config['mod']['noticeboard_page'] = 50;
  1156. // Number of entries to summarize and display on the dashboard.
  1157. $config['mod']['noticeboard_dashboard'] = 5;
  1158. // Check public ban message by default.
  1159. $config['mod']['check_ban_message'] = false;
  1160. // Default public ban message. In public ban messages, %length% is replaced with "for x days" or
  1161. // "permanently" (with %LENGTH% being the uppercase equivalent).
  1162. $config['mod']['default_ban_message'] = _('USER WAS BANNED FOR THIS POST');
  1163. // $config['mod']['default_ban_message'] = 'USER WAS BANNED %LENGTH% FOR THIS POST';
  1164. // HTML to append to post bodies for public bans messages (where "%s" is the message).
  1165. $config['mod']['ban_message'] = '<span class="public_ban">(%s)</span>';
  1166. // When moving a thread to another board and choosing to keep a "shadow thread", an automated post (with
  1167. // a capcode) will be made, linking to the new location for the thread. "%s" will be replaced with a
  1168. // standard cross-board post citation (>>>/board/xxx)
  1169. $config['mod']['shadow_mesage'] = _('Moved to %s.');
  1170. // Capcode to use when posting the above message.
  1171. $config['mod']['shadow_capcode'] = 'Mod';
  1172. // Name to use when posting the above message. If false, $config['anonymous'] will be used.
  1173. $config['mod']['shadow_name'] = false;
  1174. // PHP time limit for ?/rebuild. A value of 0 should cause PHP to wait indefinitely.
  1175. $config['mod']['rebuild_timelimit'] = 0;
  1176. // PM snippet (for ?/inbox) length in characters.
  1177. $config['mod']['snippet_length'] = 75;
  1178. // Edit raw HTML in posts by default.
  1179. $config['mod']['raw_html_default'] = false;
  1180. // Automatically dismiss all reports regarding a thread when it is locked.
  1181. $config['mod']['dismiss_reports_on_lock'] = true;
  1182. // Replace ?/config with a simple text editor for editing inc/instance-config.php.
  1183. $config['mod']['config_editor_php'] = false;
  1184. /*
  1185. * ====================
  1186. * Mod permissions
  1187. * ====================
  1188. */
  1189. // Probably best not to change this unless you are smart enough to figure out what you're doing. If you
  1190. // decide to change it, remember that it is impossible to redefinite/overwrite groups; you may only add
  1191. // new ones.
  1192. $config['mod']['groups'] = array(
  1193. 10 => 'Janitor',
  1194. 20 => 'Mod',
  1195. 30 => 'Admin',
  1196. // 98 => 'God',
  1197. 99 => 'Disabled'
  1198. );
  1199. // If you add stuff to the above, you'll need to call this function immediately after.
  1200. define_groups();
  1201. // Example: Adding a new permissions group.
  1202. // $config['mod']['groups'][0] = 'NearlyPowerless';
  1203. // define_groups();
  1204. // Capcode permissions.
  1205. $config['mod']['capcode'] = array(
  1206. // JANITOR => array('Janitor'),
  1207. MOD => array('Mod'),
  1208. ADMIN => true
  1209. );
  1210. // Example: Allow mods to post with "## Moderator" as well
  1211. // $config['mod']['capcode'][MOD][] = 'Moderator';
  1212. // Example: Allow janitors to post with any capcode
  1213. // $config['mod']['capcode'][JANITOR] = true;
  1214. // Set any of the below to "DISABLED" to make them unavailable for everyone.
  1215. // Don't worry about per-board moderators. Let all mods moderate any board.
  1216. $config['mod']['skip_per_board'] = false;
  1217. /* Post Controls */
  1218. // View IP addresses
  1219. $config['mod']['show_ip'] = MOD;
  1220. // Delete a post
  1221. $config['mod']['delete'] = JANITOR;
  1222. // Ban a user for a post
  1223. $config['mod']['ban'] = MOD;
  1224. // Ban and delete (one click; instant)
  1225. $config['mod']['bandelete'] = MOD;
  1226. // Remove bans
  1227. $config['mod']['unban'] = MOD;
  1228. // Spoiler image
  1229. $config['mod']['spoilerimage'] = JANITOR;
  1230. // Delete file (and keep post)
  1231. $config['mod']['deletefile'] = JANITOR;
  1232. // Delete all posts by IP
  1233. $config['mod']['deletebyip'] = MOD;
  1234. // Delete all posts by IP across all boards
  1235. $config['mod']['deletebyip_global'] = ADMIN;
  1236. // Sticky a thread
  1237. $config['mod']['sticky'] = MOD;
  1238. // Cycle a thread
  1239. $config['mod']['cycle'] = MOD;
  1240. $config['cycle_limit'] = &$config['reply_limit'];
  1241. // Lock a thread
  1242. $config['mod']['lock'] = MOD;
  1243. // Post in a locked thread
  1244. $config['mod']['postinlocked'] = MOD;
  1245. // Prevent a thread from being bumped
  1246. $config['mod']['bumplock'] = MOD;
  1247. // View whether a thread has been bumplocked ("-1" to allow non-mods to see too)
  1248. $config['mod']['view_bumplock'] = MOD;
  1249. // Edit posts
  1250. $config['mod']['editpost'] = ADMIN;
  1251. // "Move" a thread to another board (EXPERIMENTAL; has some known bugs)
  1252. $config['mod']['move'] = DISABLED;
  1253. // Bypass "field_disable_*" (forced anonymity, etc.)
  1254. $config['mod']['bypass_field_disable'] = MOD;
  1255. // Post bypass unoriginal content check on robot-enabled boards
  1256. $config['mod']['postunoriginal'] = ADMIN;
  1257. // Bypass flood check
  1258. $config['mod']['bypass_filters'] = ADMIN;
  1259. $config['mod']['flood'] = &$config['mod']['bypass_filters'];
  1260. // Raw HTML posting
  1261. $config['mod']['rawhtml'] = ADMIN;
  1262. /* Administration */
  1263. // View the report queue
  1264. $config['mod']['reports'] = JANITOR;
  1265. // Dismiss an abuse report
  1266. $config['mod']['report_dismiss'] = JANITOR;
  1267. // Dismiss all abuse reports by an IP
  1268. $config['mod']['report_dismiss_ip'] = JANITOR;
  1269. // View list of bans
  1270. $config['mod']['view_banlist'] = MOD;
  1271. // View the username of the mod who made a ban
  1272. $config['mod']['view_banstaff'] = MOD;
  1273. // If the moderator doesn't fit the $config['mod']['view_banstaff''] (previous) permission, show him just
  1274. // a "?" instead. Otherwise, it will be "Mod" or "Admin".
  1275. $config['mod']['view_banquestionmark'] = false;
  1276. // Show expired bans in the ban list (they are kept in cache until the culprit returns)
  1277. $config['mod']['view_banexpired'] = true;
  1278. // View ban for IP address
  1279. $config['mod']['view_ban'] = $config['mod']['view_banlist'];
  1280. // View IP address notes
  1281. $config['mod']['view_notes'] = JANITOR;
  1282. // Create notes
  1283. $config['mod']['create_notes'] = $config['mod']['view_notes'];
  1284. // Remote notes
  1285. $config['mod']['remove_notes'] = ADMIN;
  1286. // Create a new board
  1287. $config['mod']['newboard'] = ADMIN;
  1288. // Manage existing boards (change title, etc)
  1289. $config['mod']['manageboards'] = ADMIN;
  1290. // Delete a board
  1291. $config['mod']['deleteboard'] = ADMIN;
  1292. // List/manage users
  1293. $config['mod']['manageusers'] = MOD;
  1294. // Promote/demote users
  1295. $config['mod']['promoteusers'] = ADMIN;
  1296. // Edit any users' login information
  1297. $config['mod']['editusers'] = ADMIN;
  1298. // Change user's own password
  1299. $config['mod']['change_password'] = JANITOR;
  1300. // Delete a user
  1301. $config['mod']['deleteusers'] = ADMIN;
  1302. // Create a user
  1303. $config['mod']['createusers'] = ADMIN;
  1304. // View the moderation log
  1305. $config['mod']['modlog'] = ADMIN;
  1306. // View IP addresses of other mods in ?/log
  1307. $config['mod']['show_ip_modlog'] = ADMIN;
  1308. // View relevant moderation log entries on IP address pages (ie. ban history, etc.) Warning: Can be
  1309. // pretty resource intensive if your mod logs are huge.
  1310. $config['mod']['modlog_ip'] = MOD;
  1311. // Create a PM (viewing mod usernames)
  1312. $config['mod']['create_pm'] = JANITOR;
  1313. // Read any PM, sent to or from anybody
  1314. $config['mod']['master_pm'] = ADMIN;
  1315. // Rebuild everything
  1316. $config['mod']['rebuild'] = ADMIN;
  1317. // Search through posts, IP address notes and bans
  1318. $config['mod']['search'] = JANITOR;
  1319. // Allow searching posts (can be used with board configuration file to disallow searching through a
  1320. // certain board)
  1321. $config['mod']['search_posts'] = JANITOR;
  1322. // Read the moderator noticeboard
  1323. $config['mod']['noticeboard'] = JANITOR;
  1324. // Post to the moderator noticeboard
  1325. $config['mod']['noticeboard_post'] = MOD;
  1326. // Delete entries from the noticeboard
  1327. $config['mod']['noticeboard_delete'] = ADMIN;
  1328. // Public ban messages; attached to posts
  1329. $config['mod']['public_ban'] = MOD;
  1330. // Manage and install themes for homepage
  1331. $config['mod']['themes'] = ADMIN;
  1332. // Post news entries
  1333. $config['mod']['news'] = ADMIN;
  1334. // Custom name when posting news
  1335. $config['mod']['news_custom'] = ADMIN;
  1336. // Delete news entries
  1337. $config['mod']['news_delete'] = ADMIN;
  1338. // Execute un-filtered SQL queries on the database (?/debug/sql)
  1339. $config['mod']['debug_sql'] = DISABLED;
  1340. // Look through all cache values for debugging when APC is enabled (?/debug/apc)
  1341. $config['mod']['debug_apc'] = ADMIN;
  1342. // Edit the current configuration (via web interface)
  1343. $config['mod']['edit_config'] = ADMIN;
  1344. // View ban appeals
  1345. $config['mod']['view_ban_appeals'] = MOD;
  1346. // Accept and deny ban appeals
  1347. $config['mod']['ban_appeals'] = MOD;
  1348. // View the recent posts page
  1349. $config['mod']['recent'] = MOD;
  1350. // Create pages
  1351. $config['mod']['edit_pages'] = MOD;
  1352. $config['pages_max'] = 10;
  1353. // Config editor permissions
  1354. $config['mod']['config'] = array();
  1355. // Disable the following configuration variables from being changed via ?/config. The following default
  1356. // banned variables are considered somewhat dangerous.
  1357. $config['mod']['config'][DISABLED] = array(
  1358. 'mod>config',
  1359. 'mod>config_editor_php',
  1360. 'mod>groups',
  1361. 'convert_args',
  1362. 'db>password',
  1363. );
  1364. $config['mod']['config'][JANITOR] = array(
  1365. '!', // Allow editing ONLY the variables listed (in this case, nothing).
  1366. );
  1367. $config['mod']['config'][MOD] = array(
  1368. '!', // Allow editing ONLY the variables listed (plus that in $config['mod']['config'][JANITOR]).
  1369. 'global_message',
  1370. );
  1371. // Example: Disallow ADMIN from editing (and viewing) $config['db']['password'].
  1372. // $config['mod']['config'][ADMIN] = array(
  1373. // 'db>password',
  1374. // );
  1375. // Example: Allow ADMIN to edit anything other than $config['db']
  1376. // (and $config['mod']['config'][DISABLED]).
  1377. // $config['mod']['config'][ADMIN] = array(
  1378. // 'db',
  1379. // );
  1380. // Allow OP to remove arbitrary posts in his thread
  1381. $config['user_moderation'] = false;
  1382. // File board. Like 4chan /f/
  1383. $config['file_board'] = false;
  1384. // Thread tags. Set to false to disable
  1385. // Example: array('A' => 'Chinese cartoons', 'M' => 'Music', 'P' => 'Pornography');
  1386. $config['allowed_tags'] = false;
  1387. /*
  1388. * ====================
  1389. * Public pages
  1390. * ====================
  1391. */
  1392. // Public post search settings
  1393. $config['search'] = array();
  1394. // Enable the search form
  1395. $config['search']['enable'] = false;
  1396. // Maximal number of queries per IP address per minutes
  1397. $config['search']['queries_per_minutes'] = Array(15, 2);
  1398. // Global maximal number of queries per minutes
  1399. $config['search']['queries_per_minutes_all'] = Array(50, 2);
  1400. // Limit of search results
  1401. $config['search']['search_limit'] = 100;
  1402. // Boards for searching
  1403. //$config['search']['boards'] = array('a', 'b', 'c', 'd', 'e');
  1404. // Enable public logs? 0: NO, 1: YES, 2: YES, but drop names
  1405. $config['public_logs'] = 0;
  1406. /*
  1407. * ====================
  1408. * Events (PHP 5.3.0+)
  1409. * ====================
  1410. */
  1411. // http://tinyboard.org/docs/?p=Events
  1412. // event_handler('post', function($post) {
  1413. // // do something
  1414. // });
  1415. // event_handler('post', function($post) {
  1416. // // do something else
  1417. //
  1418. // // return an error (reject post)
  1419. // return 'Sorry, you cannot post that!';
  1420. // });
  1421. /*
  1422. * =============
  1423. * API settings
  1424. * =============
  1425. */
  1426. // Whether or not to enable the 4chan-compatible API, disabled by default. See
  1427. // https://github.com/4chan/4chan-API for API specification.
  1428. $config['api']['enabled'] = true;
  1429. // Extra fields in to be shown in the array that are not in the 4chan-API. You can get these by taking a
  1430. // look at the schema for posts_ tables. The array should be formatted as $db_column => $translated_name.
  1431. // Example: Adding the pre-markup post body to the API as "com_nomarkup".
  1432. // $config['api']['extra_fields'] = array('body_nomarkup' => 'com_nomarkup');
  1433. /*
  1434. * ==================
  1435. * NNTPChan settings
  1436. * ==================
  1437. */
  1438. /*
  1439. * Please keep in mind that NNTPChan support in vichan isn't finished yet / is in an experimental
  1440. * state. Please join #nntpchan on Rizon in order to peer with someone.
  1441. */
  1442. $config['nntpchan'] = array();
  1443. // Enable NNTPChan integration
  1444. $config['nntpchan']['enabled'] = false;
  1445. // NNTP server
  1446. $config['nntpchan']['server'] = "localhost:1119";
  1447. // Global dispatch array. Add your boards to it to enable them. Please make
  1448. // sure that this setting is set in a global context.
  1449. $config['nntpchan']['dispatch'] = array(); // 'overchan.test' => 'test'
  1450. // Trusted peer - an IP address of your NNTPChan instance. This peer will have
  1451. // increased capabilities, eg.: will evade spamfilter.
  1452. $config['nntpchan']['trusted_peer'] = '127.0.0.1';
  1453. // Salt for message ID generation. Keep it long and secure.
  1454. $config['nntpchan']['salt'] = 'change_me+please';
  1455. // A local message ID domain. Make sure to change it.
  1456. $config['nntpchan']['domain'] = 'example.vichan.net';
  1457. // An NNTPChan group name.
  1458. // Please set this setting in your board/config.php, not globally.
  1459. $config['nntpchan']['group'] = false; // eg. 'overchan.test'
  1460. /*
  1461. * ====================
  1462. * Other/uncategorized
  1463. * ====================
  1464. */
  1465. // Meta keywords. It's probably best to include these in per-board configurations.
  1466. // $config['meta_keywords'] = 'chan,anonymous discussion,imageboard,tinyboard';
  1467. // Link imageboard to your Google Analytics account to track users and provide traffic insights.
  1468. // $config['google_analytics'] = 'UA-xxxxxxx-yy';
  1469. // Keep the Google Analytics cookies to one domain -- ga._setDomainName()
  1470. // $config['google_analytics_domain'] = 'www.example.org';
  1471. // Link imageboard to your Statcounter.com account to track users and provide traffic insights without the Google botnet.
  1472. // Extract these values from Statcounter's JS tracking code:
  1473. // $config['statcounter_project'] = '1234567';
  1474. // $config['statcounter_security'] = 'acbd1234';
  1475. // If you use Varnish, Squid, or any similar caching reverse-proxy in front of Tinyboard, you can
  1476. // configure Tinyboard to PURGE files when they're written to.
  1477. // $config['purge'] = array(
  1478. // array('127.0.0.1', 80)
  1479. // array('127.0.0.1', 80, 'example.org')
  1480. // );
  1481. // Connection timeout for $config['purge'], in seconds.
  1482. $config['purge_timeout'] = 3;
  1483. // Additional mod.php?/ pages. Look in inc/mod/pages.php for help.
  1484. // $config['mod']['custom_pages']['/something/(\d+)'] = function($id) {
  1485. // global $config;
  1486. // if (!hasPermission($config['mod']['something']))
  1487. // error($config['error']['noaccess']);
  1488. // // ...
  1489. // };
  1490. // You can also enable themes (like ukko) in mod panel like this:
  1491. // require_once("templates/themes/ukko/theme.php");
  1492. //
  1493. // $config['mod']['custom_pages']['/\*/'] = function() {
  1494. // global $mod;
  1495. //
  1496. // $ukko = new ukko();
  1497. // $ukko->settings = array();
  1498. // $ukko->settings['uri'] = '*';
  1499. // $ukko->settings['title'] = 'derp';
  1500. // $ukko->settings['subtitle'] = 'derpity';
  1501. // $ukko->settings['thread_limit'] = 15;
  1502. // $ukko->settings['exclude'] = '';
  1503. //
  1504. // echo $ukko->build($mod);
  1505. // };
  1506. // Example: Add links to dashboard (will all be in a new "Other" category).
  1507. // $config['mod']['dashboard_links']['Something'] = '?/something';
  1508. // Remote servers. I'm not even sure if this code works anymore. It might. Haven't tried it in a while.
  1509. // $config['remote']['static'] = array(
  1510. // 'host' => 'static.example.org',
  1511. // 'auth' => array(
  1512. // 'method' => 'plain',
  1513. // 'username' => 'username',
  1514. // 'password' => 'password!123'
  1515. // ),
  1516. // 'type' => 'scp'
  1517. // );
  1518. // Create gzipped static files along with ungzipped.
  1519. // This is useful with nginx with gzip_static on.
  1520. $config['gzip_static'] = false;
  1521. // Regex for board URIs. Don't add "`" character or any Unicode that MySQL can't handle. 58 characters
  1522. // is the absolute maximum, because MySQL cannot handle table names greater than 64 characters.
  1523. $config['board_regex'] = '[0-9a-zA-Z$_\x{0080}-\x{FFFF}]{1,58}';
  1524. // Youtube.js embed HTML code
  1525. $config['youtube_js_html'] = '<div class="video-container" data-video="$2">'.
  1526. '<a href="https://youtu.be/$2" target="_blank" class="file">'.
  1527. '<img style="width:360px;height:270px;" src="//img.youtube.com/vi/$2/0.jpg" class="post-image"/>'.
  1528. '</a></div>';
  1529. // Slack Report Notification
  1530. $config['slack'] = true;
  1531. $config['slack_channel'] = "reports";
  1532. $config['slack_incoming_webhook_endpoint'] = "https://hooks.slack.com/services/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";
  1533. // Password hashing function
  1534. //
  1535. // $5$ <- SHA256
  1536. // $6$ <- SHA512
  1537. //
  1538. // 25000 rounds make for ~0.05s on my 2015 Core i3 computer.
  1539. //
  1540. // https://secure.php.net/manual/en/function.crypt.php
  1541. $config['password_crypt'] = '$6$rounds=25000$';
  1542. // Password hashing method version
  1543. // If set to 0, it won't upgrade hashes using old password encryption schema, only create new.
  1544. // You can set it to a higher value, to further migrate to other password hashing function.
  1545. $config['password_crypt_version'] = 1;
  1546. // Use CAPTCHA for reports?
  1547. $config['report_captcha'] = false;
  1548. // Allowed HTML tags in ?/edit_pages.
  1549. $config['allowed_html'] = 'a[href|title],p,br,li,ol,ul,strong,em,u,h2,b,i,tt,div,img[src|alt|title],hr';