Skip to content

Configuration

Akito Iwakura edited this page Aug 28, 2018 · 6 revisions

Configuration

Before using Airin you need to configure it. Airin stores the most of configuration in the database but uses config file for database connection and server settings.

Configuration file

Airin's config is a simple INI-formatted file. It has three sections: server, which describes generic server settings (port, TLS capability, etc), external_auth (it has only one parameter) and database (obviously, database connection settings).

server section

Name Description Default value
log_level Log verbosity. 0 means no logging, 4 is for maximal verbosity 4
log_file Log facility. Set stdout to output logs to your console stdout
port Port that Airin will use to listen for new connections 1337
init_timeout Time in milliseconds when Airin will close connection in case of inactivity. 0 means never 0
secure_salt Cryptographic salt that will be used to enhash users' IP addresses _replace_me_plz
secure_mode Tells Airin to use WebSocket Secure (WSS) or not 0
ssl_certificate If secure_mode is set to 1, specifies the SSL/TLS certificate file for WSS empty
ssl_intermediate_cert Optional intermediate CA certificate file empty
ssl_key SSL key for the certificate empty
continue_on_db_fault Tells Airin to work even when database is inaccessible or not. When set to 1, Airin will accept any connection and any message but will not keep them. 0

database section

Name Description Default value
dbms Database management system that will be used. Can be mysql or pgsql mysql
hostname DBMS server's hostname localhost
database Database name to connect airin
username Database user name airin
password Database password paswd
server_ping By default MySQL server disconnects after 8 hours of inactivity. If this parameter is set, Airin will execute SELECT 1 every n milliseconds to prevent this behavior. 0 disables this feature 0
reconnect_attempts Number of attempts that Airin will do when a database connection is lost. 0 means never. 0
reconnect_timeout Time Airin will wait for between reconnection attemtps in milliseconds. 1000

external_auth section

Name Description Default value
enable If set to 0, Airin will accept any connection without authorization 1

Runtime configuration

Airin stores its runtime configuration in the database. If the database is not available and continue_on_db_fault parameter of the INI file is set to 1, Airin will use its defaults. Runtime configuration management is done by sending /config command directly to the chat by the privileged user. See Chat commands and User authentication for more information.

Configurable values

Name Description Default value
message_amount_max Maximal message amount which user can request using LOG command 500
message_amount_default Default message amount which user can request using LOG command 20
use_log_request_queue Use LOG requests queue instead of immediate response to prevent server overloading 0
max_log_queue_length Maximal LOG request queue size. If reached, LOG requests will be declined 50
log_queue_flush_timeout Time (in milliseconds) that should pass before the next LOG request queue item will be sent 500
message_length Maximal length of the message that user can send 2048
max_name_length Maximal nickname length that user can set 20
default_username Username that will be used when no nickname is set Anonyamous
force_default_name Force default username and ignore users' one 0
ping_poll_time Ping poll timeout in milliseconds. Used to detect and remove hung users 10000
ping_miss_tolerance Maximal amount of missed ping requests. User will be disconnected if reached 5
color_reset_max Maximal amount of nickname color resetting tries. 0 disables this feature 0
message_delay Delay between messages sent by a user in seconds. This delay prevents chat flooding 5
delay_troll If set to 1, user will be blocked from sending messages every time they try before message_delay time 0
allow_readonly Allow users to log in using readonly mode 1
disclose_user_ids If set to 1, Airin will send users' external logins to the chat, otherwise null will be sent 0
use_misc_as_name Use miscellaneous info from the database as users' nicknames 0
use_xff_header Use X-Forwarded-For header to determine user's IP address. Useful when Airin is behind the reverse proxy 0
deprecation_message A message that will be shown to user when they use old API level Your API Level is deprecated, use higher one!

Clone this wiki locally