· 5 years ago · Aug 11, 2020, 02:04 PM
1; Servatrice configuration file
2;
3; This is the main configuration file for Servatrice; while using a configuration is not mandatory,
4; you may want to customize some aspects of your servatrice instance, like its name, port or the way
5; users can authenticate to the server.
6;
7; Can be passed to servatrice with --config /path/to/servatrice.ini
8
9[server]
10
11; This is the name that servatrice exposes to the users; the default value is pretty boring
12name="423-MTG"
13
14; Multiple servatrice servers can run on the same host using the same database; each server instance
15; must have a different id; the default id is 1
16id=1
17
18; The IP address servatrice will listen on for clients; defaults to "any" to listen on all the interfaces,
19; a specific IPv4/v6 addresses can be used, eg for localhost-only 127.0.0.1 for IPv4 or ::1 for IPv6.
20
21host=any
22
23; The TCP port number servatrice will listen on for clients; default is 4747
24port=4747
25
26; Servatrice can scale up to serve big number of users using more than one parallel thread of execution;
27; If your server is hosting a lot of players and they frequently report of being unable to login or
28; long delays (lag), you may want to try increasing this value; default is 1.
29; Set to 0 to disable the tcp server.
30number_pools=2
31
32; Servatrice can listen for clients on websockets, too. Unfortunately it can't support more than one thread.
33; Set to 0 to disable the websocket server.
34websocket_number_pools=1
35
36; The IP address servatrice will listen on for websockets clients; defaults to "any"
37
38websocket_host=any
39
40; The TCP port number servatrice will listen on for websockets clients; default is 4748
41websocket_port=4748
42
43; When database is enabled, servatrice writes the server status in the "update" database table; this
44; setting defines every how many milliseconds servatrice will update its status; default is 15000 (15 secs)
45statusupdate=15000
46
47; Do you want servatrice to write important events and errors to a logfile? Default is 1 (yes).
48writelog=1
49
50; Choose a name for the log file, if enabled; you can specify an absolute path or a path relative to
51; the servatrice executable; the default file name is server.log (in the same path as servatrice)
52; Note: When running servatrice under windows you will need to use double backslashes between folder locations
53; [ex: C:\\Temp\\server.log ]
54logfile=/var/log/servatrice.log
55
56; You may want to log only certain messages in the logfile. The default log level is extremely verbose.
57; This setting should contain a comma-separated list of strings that will be selectively logged.
58; All other lines will be excluded from the log. Default is empty; example: "Registration,_Login,foobar"
59logfilters=""
60
61; Set the time interval in seconds that servatrice will use to communicate with each connected client
62; to verify the client has not timed out. Defaults is 1 seconds
63clientkeepalive=1
64
65; Maximum time in seconds a player can stay inactive with there client not even responding to pings, before is
66; considered disconnected; default is 15
67max_player_inactivity_time=30
68
69; More modern clients generate client IDs based on specific client side information. Enable this option to
70; require that clients report the client ID in order to log into the server. Default is false
71requireclientid=false
72
73; You can limit the types of clients that connect to the server by requiring different features be available
74; on the client. This setting can contain a comma-seperated list of features. if any of the features
75; listed in this line are not available on the client the client will be denied access to the server upon
76; attempting to log in. Example: "client_id,client_ver,websocket"
77requiredfeatures=""
78
79; You can define custom warnings that users are sent when the moderation staff uses the right client warn user
80; menu option. This list is comma seperated that each item will appear in the drop down list for staff members
81; to choose from. Example: "Flaming,Foul Language"
82officialwarnings="Flamming,Spamming,Causing Drama,Abusive Language"
83
84; Maximum time in seconds a player can stay connected but idle. Default is 3600 (0 = disabled)
85; Clients will be notified at the 90% time period of pending disconnection if they do not take action.
86idleclienttimeout=3600
87
88[authentication]
89
90; Servatrice can authenticate users connecting. It currently supports 3 different authentication methods:
91; * none: no authentication, accept every user;
92; * password: require users to specify a common password to log in;
93; * sql: authenticate users against the "users" table of the database;
94; Please note that only the "sql" method permits to have registered users and store their data on the server.
95method=sql
96
97; if the chosen authentication method is password, here you can define the password your users will use to log in
98password=
99
100; Accept only registered users? default is false (accept unregistered users)
101regonly=true
102
103[users]
104
105; The minimum length a username can be
106minnamelength=6
107
108; The maximum length a username can be
109maxnamelength=18
110
111; If a username should be allowed to contain lowercase chars [a-z]
112allowlowercase=true
113
114; If a username should be allowed to conatain uppercase chars [A-Z]
115allowuppercase=true
116
117; If a username should be allowed to contain numbers [0-9]
118allownumerics=true
119
120; Define punctuation allowed in usernames
121allowedpunctuation=_.-
122
123; If a username can begin with punctuation defined in allowedpunctuation
124allowpunctuationprefix=false
125
126; Disallow usernames containing these words. This list is comma seperated, e.g.
127; "admin,user,name"
128disallowedwords="admin"
129
130; Disallow usernames matching these regular expressions. This list is comma
131; separated, e.g. "\\w+\\d+,\\d{2}user", hence you cannot use commas in your
132; expressions. Backslashes must be escaped, so `\w+\d+` becomes `\\w+\\d+`.
133; WARNING: Complex expressions can be harmful to performance. Please make sure
134; your expressions are considered well formed. See this page for info:
135; http://www.regular-expressions.info/catastrophic.html
136disallowedregexp=""
137
138; Define minimum password length
139; Default 6.
140minpasswordlength = 6
141
142[registration]
143
144; Servatrice can process registration requests to add new users on the fly.
145; Enable this feature? Default false.
146enabled=true
147
148; Require users to provide an email address in order to register. Default true.
149requireemail=false
150
151; Require email activation. Newly registered users will receive an activation token by email,
152; and will be required to input back this token on cockatrice at the first login to get their
153; account activated. Default true.
154requireemailactivation=false
155
156; Set this number to the maximum number of accounts any one user can use to create new accounts
157; using the same email address. 0 = Unlimited number of accounts (default).
158maxaccountsperemail=0
159
160; You can prevent users from using certain mail domains for registration. This setting contains a
161; comma-seperated list of email provider domains that you would like to prevent users from using
162; during registration. Comparison's are implicit, so placing an entry such as mail.com will also
163; prevent users from registering accounts with providers such as gmail.com and hotmail.com
164; Example: "10minutemail.com,gmail.com"
165;emailproviderblacklist=""
166
167[forgotpassword]
168
169; Servatrice can process forgot password requests allowing users to reset their account
170; passwords in the event they forget it. Should this feature be enabled? Default: false.
171; enable=false
172
173; Forgot password request should not be allowed to stay valid forever. This settings
174; informs servatrice how long a players forgot password reset token is valid for (in minutes).
175; Default: 60
176; tokenlife=60
177
178; Servatrice can challenge users that are making forgot password requests to answer
179; questions in regards to their account to help validate they are the true owner of the account.
180; Should this feature be enabled? Default: false
181; enablechallenge=false
182
183; Email subject for the forgot password emails
184; subject="Cockatrice forgot password token"
185
186; Forgot password email body. You can use these tags here: %username %token
187; They will be substituted with the actual values in the email
188;
189; body="Hi %username, sorry to hear you forgot your password on our Cockatrice server\r\nHere's the token to use to reset your account password:\r\n\r\n%token\r\n\r\nHappy gaming!"
190
191
192[smtp]
193
194; Enable the internal smtp client to send registration emails. If you would like to
195; use some other method to send email activation tokens set this value to false. Otherwise
196; setting it to true (default) the server will send canned generated emails containing
197; activation tokens for you during update intervals. Setting this to false will require
198; you to either manually activate user accounts or manually send users the activation token
199; by whatever means.
200enableinternalsmtpclient=true
201
202; Connectin type: currently supported method are "tcp" and "ssl"; tls is autodetected if available
203connection=tcp
204
205; Accept all certificates: in ssl mode, enable this if your server is using an invalid/self signed certificate
206acceptallcerts=false;
207
208; Hostname or IP addres of the smtp server
209host=localhost
210
211; Smtp port number of the smtp server. Usual values are 25 or 587 for tcp, 465 for ssl
212port=25
213
214; Username: this typically matches the "from" email address
215username=root@localhost
216
217; Password for the username
218password=foobar
219
220; Sender email address: the "from" email address
221email=root@localhost
222
223; Sender email name
224name="Cockatrice server"
225
226; Email subject
227subject="Cockatrice server account activation token"
228
229; Email body. You can use these tags here: %username %token
230; They will be substituted with the actual values in the email
231;
232body="Hi %username, thank our for registering on our Cockatrice server\r\nHere's the activation token you need to supply for activating your account:\r\n\r\n%token\r\n\r\nHappy gaming!"
233
234[database]
235
236; Database type. Valid values are:
237; * none: no database;
238; * mysql: mysql or compatible database;
239type=mysql
240
241; Prefix used in he database for table names; default is cockatrice
242prefix=cockatrice
243
244; Database connection parameter: server hostname or IP
245hostname=192.168.1.101
246
247; Database connection parameter: database name
248database=cockatrice_prod
249
250; Database connection parameter: database user
251user=SA_ServatriceMTG_P
252
253; Database connection parameter: database user's password
254password=**********
255
256[rooms]
257
258; A servatrice server can expose to the users different "rooms" to chat and create games. Rooms can be defined
259; with two different methods:
260; config: rooms are defined in this configuration (see the following example)
261; sql: rooms are defined in the "rooms" table of the database
262method=sql
263
264; Example configuration for a server with rooms configured in the configuration file. Number of rooms defined
265roomlist\size=1
266
267; Room name for the room number 1
268roomlist\1\name="Main Room"
269
270; Room description for the room number 1
271roomlist\1\description="423-MTG Main Room"
272
273; Rooms can restrict the level of user that can join. Current supported options are none, registered, moderator, administrator.
274; Default is none.
275roomlist\1\permissionlevel=none
276
277; Rooms can restrict the permission level of users that can join, Currnetly supported options are none, privileged, vip, and donator.
278; Default is none.
279roomlist\1\privilegelevel=none
280
281; Wether to make users autojoin this room when connected to the server
282roomlist\1\autojoin=true
283
284; Message displayed to each user when he joins room number 1
285roomlist\1\joinmessage="Welcome to the 423-MTG Cockatrice server! Remember to follow the server rules, and message us in Discord if you run into any problems."
286
287; The number of chat history messages to save that gets presented to a user joining the room
288roomlist\1\chathistorysize=60
289
290; Number of game types allowed (defined) in the room number 1
291roomlist\1\game_types\size=4
292
293; Name of the three game types for the room number 1
294roomlist\1\game_types\1\name="EDH (Low Power - Max $500)"
295roomlist\1\game_types\2\name="EDH (High Power)"
296roomlist\1\game_types\3\name="Standard"
297roomlist\1\game_types\4\name="Pauper"
298
299[game]
300
301; Maximum time in seconds all players in a game can stay inactive before the game is automatically closed;
302; default is 120
303max_game_inactivity_time=600
304
305; All actions during a game are recorded and stored in the database as a replay that all participants of
306; the game can go back to and review after the game is closed. This can require a fairly large amount of
307; storage to save all the information. Disable this option to prevent the storing of replay data in
308; the database. Default value is true.
309store_replays=true
310
311; Allow users to create a new game and join it as a judge. The host will be able to execute any action on
312; the cards of every player. This is needed in order to support some games (eg. Werewolf).
313; Default off to prevent abuse on servers that are mostly running other games.
314allow_create_as_judge=false
315
316[security]
317; You may want to restrict the number of users that can connect to your server at any given time.
318enable_max_user_limit=true
319
320; Maximum number of users that can connect to the server, default is 500.
321max_users_total=100
322
323; Maximum number of users that can connect to the server using a tcp connection, default is 500.
324max_users_tcp=100
325
326; Maximum number of users that can connect to the server using a websocket connection, default is 500.
327max_users_websocket=100
328
329; Maximum number of users that can connect from the same IP address; useful to avoid bots, default is 4
330max_users_per_address=6
331
332; You may want to allow an unlimited number of users from a trusted source. This setting can contain a
333; comma-separed list of IP addresses which will allow an unlimited number of connections from each of the
334; IP addresses listed (ignoring the max_users_per_address). Default is "127.0.0.1,::1"; example: "192.73.233.244,81.4.100.74"
335trusted_sources="127.0.0.1,::1,192.168.1.100"
336
337; Servatrice can avoid users from flooding rooms with large number of messages in an interval of time.
338; This setting defines the length in seconds of the considered interval; default is 10
339message_counting_interval=10
340
341; Maximum size in characters of all messages in an interval before new messages gets dropped; default is 1000
342max_message_size_per_interval=1000
343
344; Maximum number of messages in an interval before new messages gets dropped; default is 10
345max_message_count_per_interval=10
346
347; Maximum number of games a single user can create; default is 5
348max_games_per_user=5
349
350; Servatrice can avoid users from flooding games with large number of game commands in an interval of time.
351; This setting defines the length in seconds of the considered interval; default is 10
352command_counting_interval=10
353
354; Maximum number of game commands in an interval before new commands gets dropped; default is 20
355max_command_count_per_interval=20
356
357[logging]
358; Admin/Moderators can query the stored logs for information when looking up reports by various players. This
359; option can allow or disallow them from doing so.
360; !!NOTE!! Enabling this feature puts a very high CPU and DISK load on the server, enable with caution.
361enablelogquery=false
362
363; Servatrice can log user messages to the database table cockatrice_log.
364; These messages can come from different sources; each source can be enabled separately.
365
366; Log user messages inside chat rooms
367log_user_msg_room=false
368
369; Log user messages inside games
370log_user_msg_game=false
371
372; Log user messages in private chats
373log_user_msg_chat=false
374
375; Log user messages coming from other servers in the network
376log_user_msg_isl=false
377
378[audit]
379
380; Servatrice can record certain actions being performed in the database for server operators to better understand
381; if some one may be abusing application functionality. Enabling auditing will allow servatrice to record any
382; of the below enabled audit functionality to be recorded.
383; Default: true
384enable_audit=true
385
386; Servatrice can record when users attempt a new account registration. Should we enable auditing for this action?
387; Default: true
388enable_registration_audit=true
389
390; Servatrice can record when a users attempts to reset the account password. Should we enable auditing for this action?
391; Default: true
392enable_forgotpassword_audit=true
393
394
395; EXPERIMENTAL - NOT WORKING YET
396; The following settings are relative to the server network functionality, that is not yet complete.
397; Avoid enabling it unless you are willing to test it and help its development.
398
399[servernetwork]
400
401; Servatrice servers can connect themselves and build a network. This settins enable the ability of servatrice
402; of waiting for other server's connections and connect to other servers. Other servers can be defined in the
403; "servers" table of the database. Default is 0 (disabled)
404active=0
405
406; The TCP port number servatrice will listen on for other servers; default is 14747
407port=14747
408
409; Server-to-server communication needs a valid certificate in PEM format. Enter its filename in this setting
410ssl_cert=ssl_cert.pem
411
412; Filename of the private key for the server-to-server certificate
413ssl_key=ssl_key.pem
414