Save Tinyboard docs (2012-10-16) from web.archive.org
This commit is contained in:
committed by
Fredrick Brennan
parent
997326af59
commit
a99c45de22
25
docs/config/boardlinks.md
Normal file
25
docs/config/boardlinks.md
Normal file
@@ -0,0 +1,25 @@
|
||||
Boardlinks
|
||||
==========
|
||||
|
||||
For lack of a better name, “boardlinks” are those sets of navigational links that appear at the top and bottom of board pages. They can be a list of links to boards and/or other pages such as status blogs and social network profiles.
|
||||
|
||||
“Groups” in the boardlinks are marked with square brackets. Tinyboard allows for infinite recursion with groups. Each `array()` in `$config['boards']` represents a new square bracket group.
|
||||
|
||||
Custom links can be defined by using `key => value` pairs.
|
||||
|
||||
Examples:
|
||||
```php
|
||||
// [ a / b / c ]
|
||||
$config['boards'] = array('a', 'b', 'c');
|
||||
|
||||
// [ a ] [ b / c ] [ d / e ] [ home ]
|
||||
$config['boards'] = array(
|
||||
array('a'),
|
||||
array('b', 'c'),
|
||||
array('d', 'e'),
|
||||
array('home' => '/')
|
||||
);
|
||||
|
||||
// PHP 5.4.0+ syntax
|
||||
$config['boards'] = [ ['a'], ['b', 'c'], ['d', 'e'], ['home' => '/'] ];
|
||||
```
|
||||
44
docs/config/cache.md
Normal file
44
docs/config/cache.md
Normal file
@@ -0,0 +1,44 @@
|
||||
Cache
|
||||
=====
|
||||
|
||||
Static files
|
||||
------------
|
||||
You may have noticed that Tinyboard uses “static” files for nearly everything — we only use `.php` files for stuff that requires immediate database interaction like posting, reporting, deleting and of course the entirety of the moderator interface. This is for performance reasons; static files load much faster than `.php` files, which query the database upon every single page load, wasting valuble processing power. Although you can create your own `index.php` to do whatever you like, Tinyboard recommends the use of our themes system which builds `.html` files when an action occurs, such as posting.
|
||||
|
||||
APC, XCache and Memcached
|
||||
-------------------------
|
||||
On top of the static file caching system, you can enable the additional caching system which is designed to minimize SQL queries and can significantly increase speeds when posting or using the moderator interface.
|
||||
|
||||
### APC
|
||||
[APC (Alternative PHP Cache)](https://web.archive.org/web/20121003095626/http://php.net/manual/en/book.apc.php) is the preferred method of caching. To enable it, add the following to your [`instance-config.php`](../../inc/instance-config.php):
|
||||
```php
|
||||
$config['cache']['enabled'] = 'apc';
|
||||
```
|
||||
You will need to install the APC extension if you don’t already have it. If you have PECL, you can use
|
||||
```
|
||||
pecl install apc
|
||||
```
|
||||
|
||||
### XCache
|
||||
|
||||
[XCache](https://web.archive.org/web/20121003095626/http://xcache.lighttpd.net/) seems to be similar to APC but has some improvements.
|
||||
```php
|
||||
$config['cache']['enabled'] = 'xcache';
|
||||
```
|
||||
You can install Xcache [from source](https://web.archive.org/web/20121003095626/http://xcache.lighttpd.net/wiki/InstallFromSource) or [from binary release](https://web.archive.org/web/20121003095626/http://xcache.lighttpd.net/wiki/InstallFromBinary).
|
||||
|
||||
### Memcached
|
||||
|
||||
To use Memcached, you have to be running a daemon memcached process at all times.
|
||||
```php
|
||||
$config['cache']['enabled'] = 'memcached';
|
||||
|
||||
$config['cache']['memcached'] = array(
|
||||
array('localhost', 11211)
|
||||
);
|
||||
```
|
||||
Install memcached with
|
||||
```
|
||||
pecl install memcached
|
||||
```
|
||||
Note: Tinyboard uses **memcached** — not **memcache**; there is a difference.
|
||||
54
docs/config/dnsbl.md
Normal file
54
docs/config/dnsbl.md
Normal file
@@ -0,0 +1,54 @@
|
||||
DNS Blacklists (DNSBL)
|
||||
======================
|
||||
|
||||
To further prevent spam and abuse, you can use DNS blacklists (DNSBL). A DNSBL is a list of IP addresses published through the Internet Domain Name Service (DNS) either as a zone file that can be used by DNS server software, or as a live DNS zone that can be queried in real-time.
|
||||
|
||||
By default, Tinyboard checks all addresses against just one blacklist:
|
||||
```
|
||||
tor.dnsbl.sectoor.de
|
||||
```
|
||||
This prevents Tor exit nodes from making posts and is recommended as a large majority of abuse comes from Tor because of the strong anonymity associated with it.
|
||||
|
||||
You can add more blacklists by [putting them in your configuration](../config.md). You should refer to the blacklist’s documentation to figure out which responses you wish to block.
|
||||
```php
|
||||
// Block "127.0.0.2" responses from this blacklist.
|
||||
$config['dnsbl'][] = array('bl.spamcannibal.org', 2);
|
||||
|
||||
// This does exactly the same thing as above:
|
||||
// $config['dnsbl'][] = array('bl.spamcannibal.org', array(2));
|
||||
// $config['dnsbl'][] = array('bl.spamcannibal.org', '127.0.0.2');
|
||||
|
||||
// Block "127.0.0.8" and "127.0.0.9" responses from this blacklist.
|
||||
$config['disbl'][] = array('dnsbl.dronebl.org', array(8, 9));
|
||||
|
||||
// Determine whether or not to block listed users with an anonymous function (PHP 5.3.0+)
|
||||
// This is especially relevant if you plan to use Http:BL.
|
||||
$config['dnsbl'][] = array('<your access key>.%.dnsbl.httpbl.org', function($ip) {
|
||||
$octets = explode('.', $ip);
|
||||
|
||||
// days since last activity
|
||||
if ($octets[1] > 14)
|
||||
return false;
|
||||
|
||||
// "threat score" (http://www.projecthoneypot.org/threat_info.php)
|
||||
if ($octets[2] < 5)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}, 'dnsbl.httpbl.org'); // hide our access key
|
||||
|
||||
|
||||
// Just block anything listed in here (ie. not NXDOMAIN)
|
||||
$config['dnsbl'][] = 'another.blacklist.net';
|
||||
```
|
||||
See [here](https://web.archive.org/web/20121003095945/http://www.dnsbl.info/dnsbl-list.php) for a larger list of blacklists.
|
||||
|
||||
This syntax for configuring DNSBL servers was stolen (with permission) from [Frank Usrs](https://web.archive.org/web/20121003095945/mailto:frankusrs@gmail.com).
|
||||
|
||||
Exceptions
|
||||
----------
|
||||
To combat false positives, administrators can add “exceptions” to these lists, meaning that certain IP addresses will skip the DNSBL check entirely.
|
||||
```php
|
||||
$config['dnsbl_exceptions'][] = '8.8.8.8';
|
||||
$config['dnsbl_exceptions'][] = '55.55.55.55';
|
||||
```
|
||||
108
docs/config/flood_filters.md
Normal file
108
docs/config/flood_filters.md
Normal file
@@ -0,0 +1,108 @@
|
||||
Custom Flood Filters
|
||||
====================
|
||||
|
||||
Custom flood filters detect known types of attacks and reject posts accordingly. They are made up of a **condition** and an **action**, for when all conditions are met.
|
||||
|
||||
Conditions
|
||||
----------
|
||||
These condition names are case-insensitive. All conditions are optional. If you don’t care about a particular value, don’t include it in your filter.
|
||||
|
||||
### ~~Posts in past X minutes~~
|
||||
Condition | Format
|
||||
--------------------------------------------- | ------
|
||||
~~posts_in_past_x_minutes~~ | array(`x`,`y`)
|
||||
~~threads_with_no_replies_in_past_x_minutes~~ | array(`x`,`y`)
|
||||
|
||||
~~Checks if there has been `x` posts or more in the past `y` minutes (on the current board).~~
|
||||
|
||||
The above conditions are currently unavailable in the latest git revision.
|
||||
|
||||
### Input
|
||||
Condition | Format
|
||||
--------- | ------
|
||||
name | Regexp
|
||||
trip | String
|
||||
email | Regexp
|
||||
subject | Regexp
|
||||
body | Regexp
|
||||
filename | Regexp
|
||||
extension | Regexp
|
||||
ip | Regexp
|
||||
OP | Boolean
|
||||
has_file | Boolean
|
||||
|
||||
### Custom
|
||||
Custom | Format
|
||||
------ | ------
|
||||
custom | Function
|
||||
|
||||
Similar to [events](../events.md) but the function must return true if the condition was met.
|
||||
```php
|
||||
$config['flood_filters'][] = array(
|
||||
'condition' => array(
|
||||
'name' => '/^Anonymous$/',
|
||||
'body' => '/h$/i',
|
||||
'OP' => false,
|
||||
'custom' => function($post) {
|
||||
if ($post['name'] == 'Anonymous')
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
),
|
||||
'action' => 'reject'
|
||||
);
|
||||
```
|
||||
|
||||
Actions
|
||||
-------
|
||||
|
||||
### Reject
|
||||
Variable | Type | Format | Default
|
||||
-------- | -------- | ------ | -------
|
||||
message | Optional | String | `"Posting throttled by flood filter."`
|
||||
|
||||
The post is rejected and an error message is displayed.
|
||||
|
||||
### Ban
|
||||
Variable | Type | Format | Default | Description
|
||||
---------- | -------- | ------- | ---------------- | -----------
|
||||
reason | Required | String | — | The displayed ban reason.
|
||||
expires | Optional | Integer | `0` (indefinite) | The ban length in seconds.
|
||||
reject | Optional | Boolean | `true` | Whether to allow the post before banning.
|
||||
message | Optional | String | `NULL` | If defined, display an error instead of the ban page.
|
||||
all_boards | Optional | Boolean | `false` | Whether to make the ban global.
|
||||
|
||||
The user is immediately banned and the post may be rejected.
|
||||
|
||||
Example
|
||||
-------
|
||||
The following example, to be added in a configuration file, blocks users posting a reply with the name “surgeon”, ending his posts with “regards, the surgeon” or similar.
|
||||
```php
|
||||
$config['flood_filters'][] = array(
|
||||
'condition' => array(
|
||||
'name' => '/^surgeon$/',
|
||||
'body' => '/regards,\s+(the )?surgeon$/i',
|
||||
'OP' => false
|
||||
),
|
||||
'action' => 'reject',
|
||||
'message' => 'Go away, spammer.'
|
||||
);
|
||||
```
|
||||
Instead of rejecting the post, you can ban the user too.
|
||||
```php
|
||||
$config['flood_filters'][] = array(
|
||||
'condition' => array(
|
||||
'name' => '/^surgeon$/',
|
||||
'body' => '/regards,\s+(the )?surgeon$/i',
|
||||
'OP' => false
|
||||
),
|
||||
'action' => 'ban',
|
||||
'expires' => 60 * 60 * 3, // 3 hours
|
||||
'reason' => 'Go away, spammer.'
|
||||
);
|
||||
```
|
||||
|
||||
See also
|
||||
--------
|
||||
* [Events](../events.md)
|
||||
56
docs/config/markup.md
Normal file
56
docs/config/markup.md
Normal file
@@ -0,0 +1,56 @@
|
||||
Markup Syntax
|
||||
=============
|
||||
|
||||
Since v0.9.6, Tinyboard’s markup syntax has become customizable. `$config['markup']` is an array of markup rules. Each markup rule is an array containing a regular expression for matching the text, and a replacement which can either be a string (using `$*` references), or a callback.
|
||||
|
||||
The input has already been HTML-escaped.
|
||||
|
||||
Defaults
|
||||
--------
|
||||
|
||||
### Code
|
||||
```php
|
||||
$config['markup'][] = array("/'''(.+?)'''/", "<strong>\$1</strong>");
|
||||
$config['markup'][] = array("/''(.+?)''/", "<em>\$1</em>");
|
||||
$config['markup'][] = array("/\*\*(.+?)\*\*/", "<span class=\"spoiler\">\$1</span>");
|
||||
$config['markup'][] = array("/^\s*==(.+?)==\s*$/m", "<span class=\"heading\">\$1</span>");
|
||||
```
|
||||
|
||||
### Translation
|
||||
(Of course this isn’t exactly how it will look.)
|
||||
|
||||
Input | Output
|
||||
--------------- | ------
|
||||
`''text''` | `<em>text</em>`
|
||||
`'''text'''` | `<strong>text</strong>`
|
||||
`**text**` | `<span style="background:#000000;color:#FFFFFF;padding:2px;">text</span>`
|
||||
`==text==` | `<span style="font-size:2em;font-weight:bold;">text</span>`
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
### Standard
|
||||
```php
|
||||
$config['markup'][] = array("/<3/", "♥");
|
||||
```
|
||||
Input | Output
|
||||
----- | ------
|
||||
`<3` | ♥
|
||||
|
||||
### Callback
|
||||
Callbacks can be used for more advanced markup.
|
||||
```php
|
||||
$config['markup'][] = array(
|
||||
'/MD5<(.+)>/',
|
||||
function($matches) {
|
||||
return md5($matches[1]);
|
||||
}
|
||||
);
|
||||
```
|
||||
Input | Output
|
||||
----------- | ------
|
||||
`MD5<test>` | 098f6bcd4621d373cade4e832627b4f6
|
||||
|
||||
See also
|
||||
--------
|
||||
* [Configuration Basics](../config.md)
|
||||
9
docs/config/recaptcha.md
Normal file
9
docs/config/recaptcha.md
Normal file
@@ -0,0 +1,9 @@
|
||||
reCAPTCHA
|
||||
=========
|
||||
|
||||
To enable reCAPTCHA, grab a public and private key pair from [here](https://web.archive.org/web/20121016193132/https://www.google.com/recaptcha/admin/create) and add them to [a config file](../config.md).
|
||||
```php
|
||||
$config['recaptcha'] = true;
|
||||
$config['recaptcha_public'] = '<your public key>';
|
||||
$config['recaptcha_private'] = '<your private Key>';
|
||||
```
|
||||
17
docs/config/word_filters.md
Normal file
17
docs/config/word_filters.md
Normal file
@@ -0,0 +1,17 @@
|
||||
Word Filters
|
||||
============
|
||||
|
||||
A wordfilter (sometimes referred to as just a “filter” or “censor”) automatically scans users’ posts as they are submitted and changes or censors particular words or phrases.
|
||||
|
||||
Standard replacement
|
||||
--------------------
|
||||
```php
|
||||
$config['wordfilters'][] = array('cat', 'dog');
|
||||
```
|
||||
|
||||
Regular expressions
|
||||
-------------------
|
||||
Using Perl Compatible Regular Expressions, you can match more words or phrases, even if they aren’t exact. To use regular expression wordfilters, you must include ‘true’ as the third element in the array. The following example changes both “cat” and “car” to “dog”.
|
||||
```php
|
||||
$config['wordfilters'][] = array('/ca[rt]/', 'dog', true);
|
||||
```
|
||||
Reference in New Issue
Block a user