-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.toml
136 lines (115 loc) · 6.5 KB
/
config.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# recent-messages2-specifc configuration options
[app]
# How often should the database be checked for expired channels and those channels then be parted (default: 30 minutes)
#vacuum_channels_every = "30 minutes"
# A channel is no longer listened to if it has not been accessed by anyone for at least this long (default: 24 hours)
#channels_expire_after = "24 hours"
# How often to start checking each channel for expired messages
#vacuum_messages_every = "30 minutes"
# After what time is a message considered expired?
#messages_expire_after = "24 hours"
# Maximum number of messages that will be stored for a channel. Defaults to 500.
# If a message is received and this limit is exceeded, then the oldest message stored for the channel
# will be deleted to make room.
#max_buffer_size = 500
[irc]
# Rate limit for connecting new IRC connections to Twitch.
#new_connection_every = "550ms"
# Messages received from Twitch are forwarded to the database in chunks, separated by this fixed time interval.
#forwarder_run_every = "100ms"
# Configure the built-in web server and API service
[web]
# address the web server should bind to. Supports IPv4, IPv6 and Unix sockets. Defaults to TCP, 127.0.0.1:2790
#listen_address = { type = "tcp", address = "127.0.0.1:2790" }
#listen_address = { type = "unix", path = "/var/run/recent_messages2/server.sock" }
# Twitch API access credentials, register an application at https://dev.twitch.tv/
# Must be specified, otherwise application will not start
client_id = "abc"
client_secret = "def"
redirect_uri = "https://example.com/"
# Settings for API authorization (used by web frontend).
# Sessions totally expire after this period (no refresh possible after this).
#sessions_expire_after = "7 days"
# Re-validate that the user has not disconnected the Twitch integration after this period.
#recheck_twitch_auth_after = "1 hour"
# After how many seconds should any webserver requests time out and result in an error?
#request_timeout = "10 seconds"
# Specify how we should connect to the PostgreSQL database server
# most options are additionally documented here: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
# recent_messages2 uses at least one main database and can additional spread the load of storing the messages
# across zero or more additional [[shard_db]]s (see below)
# the possible values for [main_db] and [[shard_db]] are the same
[main_db]
# Optional. Name the database server/connection, you could for example enter a hostname here to allow you to more
# easily tell which DB is which in the grafana monitoring or in the log files
#name = "main_db_server_hostname"
# Username to log into the database server as. Required
user = "db_username"
# Optional password for login, not needed e.g. if you use unix sockets with peer authentication
#password = "a_password"
# Name of the database to connect to. Required
dbname = "recent_messages2"
# A list of TCP or Unix addresses to try. Required (at least 1 must be specified).
# Specify a list of addresses to try, in the other that they should be tried.
# A TCP address can be specified like this:
# { hostname = "example.com", port = 5432 }
# { hostname = "example.com" } (uses default port 5432)
# A unix socket can be specified like this:
# { path = "/var/run/postgresql", port = 5432 }
# { path = "/var/run/postgresql" } (uses default port 5432)
# Unix sockets can only be specified on Unix systems. On Windows and other systems a config specifying Unix
# sockets will fail to parse.
host = [ { path = "/var/run/postgresql" } ]
# Control options passed to the PostgreSQL server.
# Below is just an example, see https://www.postgresql.org/docs/current/config-setting.html#id-1.6.6.4.5
# (the format is like in the PGOPTIONS environment variable)
# See also the accompanying chapter 19: https://www.postgresql.org/docs/current/runtime-config.html
#options = "-c search_path=my_custom_schema -c another_setting=another_value"
# Maximum wait for connection
# Supported duration format: https://docs.rs/humantime/2.0.1/humantime/fn.parse_duration.html
#connect_timeout = "10s"
# Controls whether client-side TCP keepalives are used. Defaults to true
#keepalives = true
# Controls the number of seconds of inactivity after which TCP should send a keepalive message to the server.
# Defaults to 2 hours
#keepalives_idle = "2 hours"
# Configure whether SSL is used. Valid values: "disable", "prefer", "require"
# The certificate presented by the PostgreSQL server is validated against the webpki roots (i.e. you'll need
# a certificate from Let's Encrypt or similar)
# If this is not acceptable in your use case, feel free to make a GitHub issue about it, support for custom
# root certificates could be added in the future.
#sslmode = "prefer"
# more supported options: application_name, target_session_attrs, channel_binding
# (usually irrelevant, search them up if you need them)
# TLS (SSL) is not supported at the moment because there has been no demand. It can be added if needed.
# Create a GitHub issue if you need TLS in your use case.
[main_db.pool]
# maximum number of connections the DB connection pool will create
# up this setting in case you run into issues on larger deployments,
# and increase max_connections_count on the PostgreSQL server config (as needed) as well
# default value is the number of CPUs on the system, multiplied by four
#max_size = 32
# Timeout for creating a new database connection
#create_timeout = "5 seconds"
# Timeout for waiting for a connection from the pool to become available
#wait_timeout = "5 seconds"
# Timeout for "recycling", that is checking and putting an object back into the pool
#recycle_timeout = "5 seconds"
# If you specify [[shard_db]] entries, messages will be partitioned into roughly equal divisions
# to allow you to spread the load between multiple servers.
# Note! If you change the number of partitions, you will lose out on messages that are afterwards stored
# on the wrong partition. You'll simply have to wait until the buffer fills up again.
#[[shard_db]]
#name = "secondary_server_hostname"
#user = "recent_messages"
#password = "hunter2"
#dbname = "recent_messages2"
#host = [ { hostname = "server2.my-domain.com" } ]
#sslmode = "require" # postgres server will need to present a valid certificate for server2.my-domain.com
#[[shard_db]]
#name = "a_third_server_hostname"
#user = "recent_messages"
#password = "hunter3"
#dbname = "recent_messages2"
#host = [ { hostname = "server3.my-domain.com" } ]
#sslmode = "require" # postgres server will need to present a valid certificate for server3.my-domain.com