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

II.1.f. system

Andrey Bogdanov edited this page May 21, 2016 · 17 revisions

Contents

Options

system.elasticsearch

Elasticsearch configuration.

Default:

{
    "host": "localhost:9200"
}
system.embedScripts

If true, scripts will be embedded into the pages. This should make pages load faster when using mobile devices with high ping.

Default: true.

system.embedStylesheets

If true, stylesheets will be embedded into the pages. This should make pages load faster when using mobile devices with high ping.

Default: true.

Note: Some built-in stylesheets are not embedded into the page intentionally, because embedding breaks the dependencies (images specified with url).

system.fastIPRetrieving

Determines if IP addres of a connection is bound to the corresponding socket.

Note: Do NOT use when nginx-to-backend keep-alive connections are enabled.

By default, fat IP retrieving is disabled.

system.fileDownloadProxy

A proxy used to download files attached as URLs. Helps to hide the server IP address.

By default, no proxy is used.

Format: <domain/IP>[:port].

system.fileDownloadProxyAuth

Proxy authentication data for system.fileDownloadProxy.

By default, no proxy authentication is used.

Format: <username>[:password].

system.log.backups

Number of renamed log files to keep.

Defaults to 100.

system.log.maxSize

Maximum log file size.

Defaults to 1048576 (1 MB).

If a log file exceeds maximum size, it is renamed (ololord.log.1), and a new empty ololord.log file is created.

system.log.middleware.before

Point of logging at the middleware level.

Defaults to "ddos".

Possible values:

  • "all" Log immediately when an incoming request fires (not recommended; use for debug purposes only).
  • "ddos" Log after the request IP address has been mormalized, and before the DDoS protection middleware is reached (recommended).
  • "static" Log after the request has passed DDoS protection middleware, and before static content serving middleware is reached (recommended if a DDoS attack causes log files to become pollutted with denied requests).
  • "middleware" Log after the request has passed static content serving middleware, and before other middlewares are reached (recommended if static content request logs pollute the log file too much).
  • "request" Log after the request has passed all middlewares, and before an Express handler is reached.
system.log.middleware.exclude

An array of paths which must not be logged.

Defaults to [] (an empty array).

Example (exact string matching):

{ "string": "/action/deletePost" }

Example (regular expression matching):

{
    "regexp": "^/action/create[a-z]+$",
    "flags": "i"
}
system.log.middleware.verbosity

Logging verbosity.

Defaults to "ip".

Possible values:

  • "all" Log everything: the IP address, the path, the query, and the POST request form fields (if the request method is POST). Note: the forms fields are parsed only once.
  • "query" Log the IP address, the path, and the query.
  • "path" Log both the IP address and the path.
  • "ip" Log only the IP address.
system.log.targets

An array of log targets.

Defaults to ["console", "file"].

Possible array values:

  • "console"
  • "file"

log4js is used for logging. Log files are stored in the logs directory (logs/ololord.log).

system.onlineCounter.interval

Online user count is checked every N milliseconds. This option specifies the interval.

Defaults to 60000 (1 minute).

system.onlineCounter.quota

Specified for how mush time a user is considered to be online after accessing the site in any way.

Defaults to 300000 (5 minutes).

system.phash.enabled

Determines if pHash image hash generation is enabled.

Defaults to true.

pHash image hashes are used by client script to hide images similar to an image specified. The similarity is calculated based on the hash generated with pHash.

system.redis

Redis configuration.

Default:

{
    "port": 6379,
    "host": "127.0.0.1",
    "family": 4,
    "password": "",
    "db": 0
}

If the nodes filed is present, and it is a non-empty array, then the cluster mode will be enabled. In that case, the following additional options may be specified:

  • clusterRetryStrategy Default: function(times) { return Math.min(100 + times * 2, 2000); }).
  • enableReadyCheck Default: false.
  • scaleReads Default: "master".
  • maxRedirections Default: 16.
  • retryDelayOnFailover Default: 100.
  • retryDelayOnClusterDown Default: 100.
  • retryDelayOnTryAgain Default: 100.

The nodes field itself must contain an array like the following (just like the standard single-instance configuration):

"nodes": [
    {
        "port": 6379,
        "host": "127.0.0.1",
        "family": 4,
        "password": "",
        "db": 0
    },
    {
        "port": 6380,
        "host": "127.0.0.1",
        "family": 4,
        "password": "",
        "db": 0
    },
    ...
]
system.regenerateArchive

Specifis whether to regenerate archived threads when regenerating the cache on startup, or not.

Defaults to false.

Useful when developing and changing data frequently.

system.regenerateCacheOnStartup

Specifis whether to regenerate the cache on every statup, or not.

Defaults to false.

Useful when developing and changing data frequently.

system.searchLimit

Maximum post count returned when searching for posts. Used to prevent heavy search requests.

Defaults to 100.

system.tmpPath

Path to a temporary directory. Form parsing data is stored there. The path must be absolute.

Defaults to ./tmp subdirectory.

system.workerCount

Worker process count.

Defaults to CPU core count (it is the optimal value and sould not be changed normally).

Clone this wiki locally