Skip to content
This repository was archived by the owner on Aug 6, 2022. It is now read-only.

II.1. Configuration

Andrey Bogdanov edited this page Mar 12, 2016 · 21 revisions

Refer to I.4. Basic configuration for instructions on how to create a configuration file.

Contents

Configuration example

Note: See also config.json.example for an example.

Actual file name must be config.json.

Example:

{
    "system": {
        "workerCount": 1,
        "log": {
            "targets": [
                "console",
                "file"
            ],
            "maxSize": 1048576,
            "backups": 100,
            "middleware": {
                "before": "ddos",
                "exclude": [
                    { "string": "/action/deletePost" },
                    {
                        "regexp": "^/action/create[a-z]+$",
                        "flags": "i"
                    }
                ],
                "verbosity": "all"
            }
        },
        "fileDownloadProxy": "",
        "fileDownloadProxyAuth": "",
        "searchLimit": 100,
        "tmpPath": "/tmp/ramdisk",
        "regenerateCacheOnStartup": false,
        "redis": {
            "port": 6379,
            "host": "127.0.0.1",
            "family": 4,
            "password": "",
            "db": 0
        }
    },
    "server": {
        "port": 8080,
        "ddosProtection": {
            "enabled": true,
            "static": false,
            "errorData": "Not so fast!",
            "errorCode": 429,
            "weight": 1,
            "maxWeight": 10,
            "checkInterval": 1000,
            "rules": [
                {
                    "regexp": "^/api.*",
                    "maxWeight": 6,
                    "queueSize": 4
                },
                {
                    "string": "/action/search",
                    "maxWeight": 1
                },
                {
                    "regexp": ".*",
                    "maxWeight": 16
                }
            ]
        },
        "rss": {
            "enabled": true,
            "ttl": 60,
            "postCount": 500
        },
        "chat": {
            "ttl": 10080
        },
        "youtubeApiKey": ""
    },
    "permissions": {
        "seeUserIp": "ADMIN"
    },
    "site": {
        "locale": "en",
        "protocol": "http",
        "domain": "localhost:8080",
        "dateFormat": "MM/DD/YYYY HH:mm:ss",
        "timeOffset": 0,
        "tripcodeSalt": "ololo",
        "maxSearchQueryLength": 50,
        "vkontakte": {
            "integrationEnabled": false,
            "appId": "Your VK app ID",
            "accessToken": "Your VK access token"
        },
        "twitter": {
            "integrationEnabled": true
        },
        "extraScripts": {
            "boardPage": [
                { "fileName": "custom/myScript.js" },
                { "source": "http://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js" }
            ]
        }
    },
    "board": {
        "bumpLimit": 500,
        "postLimit": 1000,
        "threadLimit": 200,
        "threadsPerPage": 20,
        "archiveLimit": 1000,
        "captchaEnabled": true,
        "captchaQuota": 10,
        "launchDate": "2015-02-12T21:00:00",
        "maxFileSize": 15728640,
        "b": {
            "captchaQuota": 0,
            "skippedGetOrder": 3
        },
        "soc": {
            "hidden": true,
            "launchDate": "2015-02-16T20:00:00"
        },
        "int": {
            "showWhois": true
        },
        "rf": {
            "postingEnabled": false
        },
        "3dpd": {
            "maxFileCount": 3
        },
        "echo": {
            "acceptedExternalBoardLinks": [
                "http://iichan.hk/[a-z]+/res/\\d+\\.html",
                "http://dobrochan.ru/[a-z]+/res/\\d+\\.xhtml",
                "https?://410chan.org/[a-z]+/res/\\d+\\.html",
                "https://boards.4chan.org/[a-z]+/thread/\\d+/[a-zA-Z0-9\\-_]+",
                "https?://2ch.hk/[a-z]+/res/\\d+\\.html"
            ]
        }
    },
    "captcha": {
        "google-recaptcha": {
            "privateKey": "Your Google reCAPTCHA private key",
            "publicKey": "Your Google reCAPTCHA public key"
        },
        "google-recaptcha-v1": {
            "privateKey": "Your Google reCAPTCHA v1 private key",
            "publicKey": "Your Google reCAPTCHA v1 public key"
        },
        "yandex-captcha-elatm": {
            "privateKey": "Your Yandex captcha private key"
        },
        "yandex-captcha-estd": {
            "privateKey": "Your Yandex captcha private key"
        },
        "yandex-captcha-rus": {
            "privateKey": "Your Yandex captcha private key"
        },
        "codecha": {
            "privateKey": "Your Codecha private key",
            "publicKey": "Your Codecha public key"
        }
    }
}

Clone this wiki locally