-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.jsonc
More file actions
879 lines (835 loc) · 38.5 KB
/
Copy pathconfig.jsonc
File metadata and controls
879 lines (835 loc) · 38.5 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
{
// alphanumeric unique identifier; for internal use and logging
"abbr": "",
// company name; for internal use and discord notifications
"name": "",
// company language code; see /src/languages for available codes
"language": "en",
// metric | imperial; for display purpose; all data stored in metric
"distance_unit": "metric",
// when true, user info will be redacted for non-authenticated requests
// otherwise, user info except sensitive info will not be redacted
// sensitive info includes but is not limited to email, discordid etc
"privacy": false,
// authentication security level
// level 0 disables IP/country check
// level 1 requires requests to be from same country as login time
// level 2 requires requests to be from same IP block as login time
"security_level": 1,
// company color scheme (no leading #); for discord embeds and member banner
"hex_color": "FFFFFF",
// company logo url (must be valid url); for discord embeds and member banner
// note: image must be <= 10MB and <= 3400x3400
// if logo cannot be fetched, then banner background will not be rendered
"logo_url": "https://{domain}/images/logo.png",
// member banner configuration (/member/banner)
// background image url (note: image must be <= 10MB and <= 3400x3400)
"banner_background_url": "",
// background image opacity (decimal in [0, 1])
"banner_background_opacity": 0.15,
// information to display on first row of second column
// rank: always display rank of default rank type
// division: always display division (N/A if not in division)
// division_first: display division, use rank if not in division
// note, other info section is not customizable
"banner_info_first_row": "rank",
// when true, /doc will use swagger ui to display interactive api resources
// openapi.json must be placed in the same directory as the server program
// note: this is a per-drivers-hub route,
// global doc may be configured with command line arguments
"openapi": true,
// urls to various client resources; for discord messages and emails
"frontend_urls": {
"member": "https://{domain}/member/{userid}",
"delivery": "https://{domain}/delivery/{logid}",
"email_confirm": "https://{domain}/auth/email?secret={secret}"
},
// domain of api server
// note: this may be the same as user-facing drivers hub domain
// however, a different domain may be used to host api server separately
// in that case, CORS must be configured at reverse-proxy level
"domain": "",
// prefix of all api routes; typically we use '/{abbr}'
// e.g. requests to /member/banner should hit '{prefix}/member/banner'
// note: this is mainly used for running multiple drivers hubs,
// but it is required when running single drivers hub as well.
// if running a single drivershub, we can use '/api' and
// set 'domain' to user-facing drivers hub domain to consolidate routing
"prefix": "",
// host and port to bind server program to
"server_host": "127.0.0.1",
"server_port": 7777,
// number of processes to spawn by uvicorn
"server_workers": 1,
// list of IPs to whitelist from ratelimit and 'security_level' check
// note: use specific IPs; IP subnet is not supported
"whitelist_ips": [],
// discord webhook to send server-side errors
// typically involves 500 code-related errors and 503 database-related errors
"webhook_error": "",
// database configuration
// note: host, user, password, pool_size may be overriden by command line arguments
// when running multiple drivers hubs; in that case, this config will be ignored
// also note: db_name is still used because drivers hub data is stored in separate dbs
// database type: only 'mysql' is supported ('mariadb' is considered as 'mysql')
"database": "mysql",
// host, port, user, password, name of database
"db_host": "localhost",
"db_port": 3306,
"db_user": "",
"db_password": "",
"db_name": "_drivershub",
// data directory of database to store information outside main directory
// a list of tables stored here can be found by searching "DATA DIRECTORY" in /src/db.py
// this is helpful when main server disk is limited and a block storage is mounted
// the data directory must be correctly initialized (i.e. mysql_install_db + permissions)
// if no data directory is configured, use main directory /var/lib/mysql/
"db_data_directory": "/var/lib/mysqlext/",
// the size of database connection pool
"db_pool_size": 10,
// keywords for common database errors that can be ignored in error forwarding
// if not ignored, the error will be sent to 'webhook_error'
"db_error_keywords": ["lost connection", "deadlock", "readexactly", "timeout", "[aiosql]"],
// captcha service (for password authentication)
"captcha": {
// hcaptcha|cloudflare (turnstile)
"provider": "hcaptcha",
// server-side secret for captcha api
"secret": ""
},
// redis database configuration
// note: redis is only used for caching and inter-process communication purpose;
// no permanent data is stored;
// occasionally, a FLUSHDB / FLUSHALL is needed to clear cache
"redis_host": "127.0.0.1",
"redis_port": 6379,
"redis_db": 0,
"redis_password": null,
// plugins to enable; below is a list of all plugins
"plugins": ["announcements", "applications", "banner", "challenges", "divisions", "downloads", "events", "polls", "route"],
// external plugins (addons) to enable
// note: external plugins must be placed in 'external_plugins' directory inside server program's directory;
// omit ".py" extension in the list, i.e. use "example" when the file is "example.py";
// read /docs/extension.md for more information on creating and using external plugins (addons)
"external_plugins": [],
// synchronize email from discord on login or connect account
// when user does not have an email on file, discord email will always be synced when possible
// otherwise, existing email on file will be kept if sync_discord_email = false
"sync_discord_email": true,
// require user to join discord server ('discord_guild_id') when submitting an application
// this takes precedence over 'required_connections' and forces 'discord' connection
// this only affects the application plugin, and does not affect member acceptance etc
"must_join_guild": true,
// use discord server nickname rather than user display name when syncing username from discord
// this occurs on sign up and manual profile sync from discord
// note: discord profile (e.g. name, avatar) is not synced automatically on login
"use_server_nickname": true,
// allow user to set custom profile that is not synced from discord/steam/truckersmp
"allow_custom_profile": true,
// when use_custom_activity = false, then built-in activities based on api calls are used
// when use_custom_activity = true, then built-in activities are not set,
// and client may set custom activity with PATCH /user/activity
// note: 'last_seen' is always set automatically regardless of the value of the attribute
"use_custom_activity": false,
// the domains that are allowed in user avatar url
// this prevents urls from untrusted sources which could lead to privacy issues at client-side
// note: all subdomains of whitelisted domains are allowed, e.g. *.steamstatic.com
"avatar_domain_whitelist": ["charlws.com", "cdn.discordapp.com", "steamstatic.com"],
// account connections required when user submits an application (of any type),
// before user is accepted as member by a staff or through trucky webhook
// value can include email, discord, steam, truckersmp
"required_connections": ["discord", "steam"],
// methods allowed for registration
// value can include email, discord, steam
// note: relevant configuration (such as smtp/discord application) must be set
// except for steam where user can still sign up without 'steam_api_key' being configured
// when 'steam_api_key' is not configured, then steam profile cannot be fetched
"register_methods": ["discord", "steam"],
// in-game job trackers
// note: when updating this through API, secrets for all trackers must be provided,
// regardless of which tracker being updated, i.e. secrets cannot be left empty for "no-change"
"trackers": [{
// trucky|unitracker|tracksim|custom
// note: when using custom tracker, the webhook data format must follow tracksim's data format
// see /docs/tracker.md for more information
"type": "trucky",
// for all optional fields below, use an empty string
// company id on tracker platform; no longer used
"company_id": "",
// api token from tracker platform; for adding/removing drivers
"api_token": "",
// webhook secret from tracker platform; used to verify webhook data integrity
"webhook_secret": "",
// IP whitelist for webhook; leave empty to allow all IPs
// note: it is recommended to leave empty unless you can confirm that sender IP is static
"ip_whitelist": ["109.106.1.243"]
}],
// rules for accepting jobs/deliveries
"delivery_rules": {
// maximum speed in km/h
"max_speed": 180,
// maximum profit (numeric amount, agnostic to currency)
"max_profit": 1000000,
// maximum xp
"max_xp": 100000,
// maximum warp (game speed), only for trucky
"max_warp": 1,
// required realistics settings, only for trucky
// choose from: bad_weather_factor, detected, detours, fatigue,
// fuel_similation, hardcore_simulation, hud_speed_limit,
// parking_difficulty, police, road_events, show_game_blockers,
// simple_parking_doubles, traffic_enabled, trailer_advanced_coupling
"required_realistic_settings": [],
// action if job/delivery does not satisfy the rules
// block: reject webhook, tracker will see a failed webhook request
// drop: accept webhook, but does not keep job/delivery in drivers hub
// bypass: accept webhook, and keep job/delivery in drivers hub, this disables delivery rules
"action": "block"
},
// discord webhook for job/delivery
"hook_delivery_log": {
// provide either channel_id or webhook_url
// note: when both are provided, channel_id takes precedence
"channel_id": "",
"webhook_url": ""
},
// embed image url for delivery webhook
// a random image will be selected from the list for each webhook
// note: this is the only customizable part of the delivery webhook
// full customization for webhook embed is not supported
// due to the high complexity of parsing and processing data to be readable
// in order to fully customizable the webhook, you must use an external plugin
"delivery_webhook_image_urls": ["https://c.tenor.com/fjTTED8MZxIAAAAC/truck.gif",
"https://c.tenor.com/QhMgCV8uMvIAAAAC/airtime-weeee.gif",
"https://c.tenor.com/VYt4iLQJWhcAAAAd/kid-spin.gif",
"https://c.tenor.com/_aICF_XLbR4AAAAC/ck8car-driving.gif",
"https://c.tenor.com/jEW-3JELMG4AAAAM/skidding-white-pick-up.gif",
"https://c.tenor.com/JGw-jxHDAGoAAAAC/truck-lol.gif",
"https://c.tenor.com/2B9tkbj7CVEAAAAM/explode-truck.gif",
"https://c.tenor.com/Tl6l934qO70AAAAC/driving-truck.gif",
"https://c.tenor.com/1SPfoAWWejEAAAAC/chevy-truck.gif",
"https://c.tenor.com/MfGOJIgU22UAAAAC/ford-f100-truck.gif"],
// discord and steam integration
"discord_guild_id": "",
"discord_client_id": "",
"discord_client_secret": "",
"discord_bot_token": "",
// https://steamcommunity.com/dev/apikey
"steam_api_key": "",
// regex rules for processing messages sent to discord server
// this may be useful for replacing keywords or redacting data
"discord_guild_message_replace_rules": {"matching_regex": "replacing_regex"},
// smtp/email integration
// if not configured correctly, email-related functionalities will get a SMTP config error
"smtp_host": "",
"smtp_port": "",
"smtp_email": "",
"smtp_password": "",
// you may customize the email with the templates below
// register, update_email, reset_password are the only types of emails that would be sent
"email_template": {
"register": {
"subject": "Register Account",
"from_email": "VTC <email>",
"html": "You are registering an account in Drivers Hub. Please click the link below to verify your email.<br>{link}",
"plain": "You are registering an account in Drivers Hub. Please click the link below to verify your email.\n{link}"
},
"update_email": {
"subject": "Update Email",
"from_email": "VTC <email>",
"html": "You are updating your email in Drivers Hub. Please click the link below to verify your email.<br>{link}",
"plain": "You are updating your email in Drivers Hub. Please click the link below to verify your email.\n{link}"
},
"reset_password": {
"subject": "Reset Password",
"from_email": "VTC <email>",
"html": "You are resetting your password in Drivers Hub. Please click the link below to continue.<br>{link}",
"plain": "You are resetting your password in Drivers Hub. Please click the link below to continue.\n{link}"
}
},
// user permissions
// key: permission name
// value: list of role IDs to be granted the permission
// note: all roles/permissions are set in config file, i.e. not in database
// to learn more about a specific permission, search for it in the codebase,
// in order to find relevant routes that use the permission
"perms": {
// 'administrator' has all permissions except 'driver' permission
// since 'driver' permission is also a 'driver' flag that is linked exclusively to the permission
"administrator": [0],
"update_config": [],
"reload_config": [],
"restart_service": [],
"accept_members": [],
"dismiss_members": [],
"update_roles": [],
"update_points": [],
"update_connections": [],
"disable_mfa": [],
"delete_notifications": [],
"manage_profiles": [],
"view_sensitive_profile": [],
"view_privacy_protected_data": [],
"view_global_note": [],
"update_global_note": [],
"view_external_user_list": [],
"ban_users": [],
"delete_users": [],
"import_dlogs": [],
"delete_dlogs": [],
"view_audit_log": [],
"manage_applications": [],
"delete_applications": [],
"manage_challenges": [],
"manage_divisions": [],
"manage_downloads": [],
"manage_economy": [],
"manage_economy_balance": [],
"manage_economy_truck": [],
"manage_economy_garage": [],
"manage_economy_merch": [],
"manage_events": [],
"manage_polls": [],
"manage_public_tasks": [],
// driver is a special permission that flags certain roles as driver
// this is used in a few special cases, where we need to distinguish drivers from members
// for example, adding/removing user on tracker platform, and aggregating statistics
// it must be added to all members that are supposed to be drivers, otherwise strange errors may occur
"driver": [100]
},
// user roles
// role ID must be unique and may not be changed if any user has the role
// changing the role ID may lead to a user losing permission to certain resources,
// and the client may render the role as unknown and prevent it from being removed
// note: while updating config through API should protect admin from losing admin permission,
// updating role/permission in config file directly does not protect against such case
// (it is supposed to be allowed for *real* admin to override config anyway)
// a user with a higher-order role may manage users with lower-order roles if permission is granted
// discord_role_id is optional, if set, drivers hub will attempt to update user discord role
// when their drivers hub role is updated
// note: an optional 'color' attribute may be used at client-side for rendering purposes;
// it is not enforced server-side; while it was considered for member banner use,
// we decided to use a single color (company theme color) rather than using role color
"roles": [
{"id": 0, "order_id": 0, "name": "root", "discord_role_id": ""},
{"id": 1, "order_id": 100, "name": "Driver", "discord_role_id": ""},
{"id": 2, "order_id": 200, "name": "Construction Division", "discord_role_id": ""}
],
// discord webhook(s) for audit log
// a list of webhooks may be provided for audit log of different categories
"hook_audit_log": [{
// use comma separated list for category
// choose category from: * (any), announcement, application, auth, challenge, discord,
// division, dlog, downloads, economy, event, member, poll, system, tracker, user
// note: 'discord' is a special category. audit logs of this category are not stored in
// the drivers hub database and are directly forwarded to discord
// if no discord-category webhook is configured, the logs will be dropped
// hint: discord-category audit logs include errors on discord api requests
"category": "*",
// provide either channel_id or webhook_url
// note: when both are provided, channel_id takes precedence
"channel_id": "",
"webhook_url": ""
}],
// NOTE: the following fields are related to configuring discord embeds
// member_accept, member_leave, driver_role_add, driver_role_remove,
// rank_up, announcement_forwarding, challenge_forwarding, challenge_completed_forwarding,
// downloads_forwarding, event_forwarding, event_upcoming_forwarding, poll_forwarding
// the structures are highly similar and relatively self-explanatory
// documentation will be provided case-by-case for specific extra attributes
// note: multiple embeds with different channel_id/webhook_url may be set for each field
// if channel_id/webhook_url are the same, the embeds *may* be combined into one message
// the discord message handling mechanism is discussed in /docs/discord.md
// variables are supported in discord messages, see /docs/config.md for more information
// note: if the embed structure/data is invalid, it will be rejected by discord
// the drivers hub may send an error in the audit log channel in such case
// member_accept, member_leave, driver_role_add, driver_role_remove are all user-related messages
// 'role_change' defines how the relevant user's role should be updated
// use positive values for adding roles, and negative values for removing roles
// both string and integer are accepted for items in 'role_change' list
"member_accept": [{
"channel_id": "",
"webhook_url": "",
"content": "{mention}",
"embeds": [{
"title": "",
"description": "{name} has joined **VTC**.",
"image": {
"url": ""
},
"footer": {
"text": "",
"icon_url": ""
},
"timestamp": true
}],
"role_change": []
},{
"channel_id": "",
"webhook_url": "",
"content": "{mention}",
"embeds": [{
"title": "",
"description": "Welcome {name}.",
"footer": {
"text": "You are our #{userid} member",
"icon_url": ""
},
"timestamp": true
}],
"role_change": []
}],
"member_leave": [{
"channel_id": "",
"webhook_url": "",
"content": "{mention}",
"embeds": [{
"title": "",
"description": "Bye {name}.",
"footer": {
"text": "Goodbye!",
"icon_url": ""
},
"timestamp": true
}],
"role_change": []
}],
"driver_role_add": [{
"channel_id": "",
"webhook_url": "",
"content": "{mention}",
"embeds": [{
"title": "",
"description": "{name} became a driver!",
"footer": {
"text": "Hooray!",
"icon_url": ""
},
"timestamp": true
}],
"role_change": []
}],
"driver_role_remove": [{
"channel_id": "",
"webhook_url": "",
"content": "{mention}",
"embeds": [{
"title": "",
"description": "{name} left as a driver!",
"footer": {
"text": "Oops!",
"icon_url": ""
},
"timestamp": true
}],
"role_change": []
}],
// discord message sent when a user ranks up
// note: this is manually triggered when the user calls PATCH /member/roles/rank
// which updates the user's discord rank role if applicable
// hint: drivers hub does not keep track of the 'rank' of a user
// 'rank' at server-side is calculated real-time based on points and rank rules
// 'rank' is completely managed client-side and on discord
// i.e. you may manually 'derank' a user by modifying their discord roles
// and drivers hub will 'uprank' the user (again) when they request rank-up
"rank_up": [{
"channel_id": "",
"webhook_url": "",
"content": "{mention}",
"embeds": [{
"title": "",
"description": "GG {mention}! You have ranked up to {rank}!",
"image": {
"url": ""
},
"footer": {
"text": "",
"icon_url": ""
},
"timestamp": true
}]
}],
// rank types
"rank_types": [{
// id of rank type, used in API calls for requesting rank-up of a non-default rank-type
"id": 1,
// name of rank type
"name": "Default",
// whether rank type is default
// note: only one rank type should be default,
// otherwise only the first default rank type is considered default
"default": true,
// types of points that should be considered when calculating points for ranking
// note: the points are naively summed up; weighing point types is not supported
"point_types": ["distance", "challenge", "division", "event", "bonus"],
"details": [
{
// ranks of the rank type
// points: minimum points needed to achieve the rank
// a user's rank is defined as, the highest rank where the user's points >= 'points'
// name: name of rank
// color: color of rank, used by client
// discord_role_id: discord role to be added when a user ranks-up
// all lower-rank roles will be removed
// it is possible that a user ranks-down
// in that case, higher-rank roles will be removed
// distance_bonus: configuration for distance bonus points
// distance bonus points are added to 'bonus' points on delivery webhook
// daily_bonus: configuration for daily bonus points
// daily bonus points are added to 'bonus' points when the user claims daily bonus
// see /docs/config.md for more information on distance_bonus and daily_bonus
"points": 0,
"name": "Trial Driver",
"color": "#CCCCCC",
"discord_role_id": "",
"distance_bonus": {
"min_distance": 0,
"max_distance": 1000,
"probability": 0.5,
"type": "fixed_value",
"value": 100
},
"daily_bonus": {
"type": "fixed",
"base": 100
}
}
]
}],
// announcement types
"announcement_types": [
{
// staff_role_ids: list of integer role IDs
// users with any role in the list may send announcement of corresponding type
"id": 0,
"name": "Information",
"staff_role_ids": [
20
]
}
],
"announcement_forwarding": [{
// whether the announcement is private
// null: discord message applies to both private and public announcements
// true: discord message applies to only private announcements
// false: discord message applies to only public announcements
"is_private": null,
"channel_id": "",
"webhook_url": "",
"content": "{type} announcement",
"embeds": [{
"title": "{title}",
"description": "{description}",
"footer": {
"text": "By {name} | Announcement #{id}",
"icon_url": ""
},
"author": {
"name": "{name}",
"icon_url": "{avatar}"
},
"timestamp": true
}]
}],
// application types
"application_types": [
{
// discord_role_change: update user discord roles on application submission
// positive integer adds role, negative integer removes role
// staff_role_ids: users with these roles may manage applications of corresponding type
// channel_id|webhook_url: discord integration for forwarding new applications
// an embed containing applicant info and form data will be sent
// message: the message content attached to the embed
// typically, this is a role ping <@&role-id>
// required_connections: account connections required before submitting the application
// accepted values: email, discord, steam, truckersmp
// required_member_state: 0: user must not be a member when submitting the application
// 1: user must be a member when submitting the application
// other values: disable member state check
// required_either_user_role_ids: the user must have any of the roles to submit the application
// required_all_user_role_ids: the user must have all of the roles to submit the application
// prohibited_either_user_role_ids: the user with any of the roles may not submit the application
// prohibited_all_user_role_ids: the user with all of the roles may not submit the application
// cooldown_hours: minimum hours required before the same user can submit a second application
// allow_multiple_pending: whether the user may submit a new application if they have a pending
// application of the same type
"id": 1,
"name": "Driver",
"discord_role_change": [],
"staff_role_ids": [
20
],
"message": "",
"channel_id": "",
"webhook_url": "",
"required_connections": [
"discord",
"steam"
],
"required_member_state": 0,
"required_either_user_role_ids": [],
"required_all_user_role_ids": [],
"prohibited_either_user_role_ids": [],
"prohibited_all_user_role_ids": [],
"cooldown_hours": 2,
"allow_multiple_pending": false
}
],
"challenge_forwarding": [{
"channel_id": "",
"webhook_url": "",
"content": "",
"embeds": [{
"title": "{title}",
"description": "{description}\n\nEither of the following roles is required to join the challenge: {required_roles}",
"fields": [
{"name": "Reward Points", "value": "{reward_points}", "inline": true},
{"name": "Delivery Count", "value": "{delivery_count}", "inline": true},
{"name": "Required Distance", "value": "{required_distance}", "inline": true},
{"name": "Start Time", "value": "<t:{start_timestamp}>", "inline": true},
{"name": "End Time", "value": "<t:{end_timestamp}>", "inline": true}
],
"footer": {
"text": "By {name} | Challenge #{id}",
"icon_url": ""
},
"author": {
"name": "{name}",
"icon_url": "{avatar}"
},
"timestamp": true
}]
}],
"challenge_completed_forwarding": [{
"channel_id": "",
"webhook_url": "",
"content": "",
"embeds": [{
"title": "Challenge Completed",
"description": "{mention} earned **{earned_points} points** for completing **{title}**",
"footer": {
"text": "Challenge #{id}",
"icon_url": ""
},
"author": {
"name": "{name}",
"icon_url": "{avatar}"
},
"timestamp": true
}]
}],
// divisions
"divisions": [
{
// role_id: the role related to the division
// users with the role will be considered a driver for the division
// i.e. they may submit the delivery for validation within the division
// a user may be in multiple divisions, but only one will be displayed on banner
// points: reward points for each division
// - mode: static: reward 'value' amount of points for each delivery
// ratio: reward 'value' * distance (km) amount of points for each delivery
// staff_role_ids: users with these roles may manage the corresponding division
// i.e. they may accept/decline division delivery validation
// channel_id|webhook_url: discord integration for forwarding delivery validation requests
// an embed containing driver info and delivery link will be sent
// message: the message content attached to the embed
// typically, this is a role ping <@&role-id>
"id": 1,
"name": "Construction",
"role_id": 251,
"points": {
"mode": "static",
"value": 500
},
"staff_role_ids": [
70
],
"message": "",
"channel_id": "",
"webhook_url": ""
}
],
"downloads_forwarding": [{
"channel_id": "",
"webhook_url": "",
"content": "",
"embeds": [{
"title": "{title}",
"description": "{description}",
"url": "{link}",
"footer": {
"text": "By {name} | Downloadable Item #{id}",
"icon_url": ""
},
"author": {
"name": "{name}",
"icon_url": "{avatar}"
},
"timestamp": true
}]
}],
// economy
// see /docs/plugins/economy.md for more information
// note: a sample data exported from the game is provided; this may be outdated
// a more recent data may be found at
// https://map.charlws.com/<ets2|ats>/<base|promods>/info/<Cities|CompanyDefs>.json
"economy": {
// trucks: a list of {id, brand, model, price}
"trucks": [
{
"id": "volvo.fh3",
"brand": "Volvo",
"model": "FH16 2009",
"price": 195000
},
{
"id": "volvo.fh16_2012",
"brand": "Volvo",
"model": "FH16 2012",
"price": 210000
}
],
// garages: a list of {id, name, x, z, price, base_slots_slot_price}
// price refers to the price to purchase the garage
// base_slots refers to the number of "parking slots" included in the garage purchase
// slot_price refers to the price to purchase additional slots in the garage
"garages": [
{
"id": "germany.berlin",
"name": "Berlin, Germany",
"x": 9682.941,
"z": -10721.3594,
"price": 100000,
"base_slots": 3,
"slot_price": 10000
},
{
"id": "switzerland.zurich",
"name": "Zürich, Switzerland",
"x": -8773.934,
"z": 17498.34,
"price": 100000,
"base_slots": 3,
"slot_price": 10000
}
],
// merch: a list of virtual (or, maybe, physical) merchandise
"merch": [{
"id": "nitro_giftcard",
"name": "Nitro Giftcard",
"buy_price": 1000000,
"sell_price": 10000
}
],
// x_refund: percentage refund based on purchase price when user sells the item
"truck_refund": 0.3,
"scrap_refund": 0.1,
"garage_refund": 0.5,
"slot_refund": 0.5,
// currency_name: any string; note: only one single currency is supported by economy plugin
"currency_name": "coin",
// x_to_coin: conversion ratio from in-game currency to economy plugin currency
"usd_to_coin": 0.5,
"eur_to_coin": 0.6,
// wear_ratio: truck wear ratio (multiplier) based on in-game truck damage
"wear_ratio": 1,
// revenue_share_to_company: the 'cut' sent to company's account for each delivery a driver completes
// the driver would keep (1-revenue_share_to_company)*revenue
"revenue_share_to_company": 0.4,
// truck_rental_cost: the cost of using a truck that the user does not own
// this is a static cost, i.e. not based on distance of delivery
"truck_rental_cost": 5000,
// max_wear_before_service: maximum wear allowed on truck before service is required
// when this value is reached, the truck will be disabled,
// and all new deliveries on the truck will be registered as rental
// (because we cannot prevent the driver from using the truck in game)
"max_wear_before_service": 0.1,
// max_distance_before_scrap: maximum distance allowed on truck before it must be scraped
"max_distance_before_scrap": 500000,
// unit_service_price: cost to service the truck for every 1% of damage
"unit_service_price": 1200,
// allow_purchase_x: whether the user is allowed to purchase x
// if general user is not allowed to purchase x, the item may be purchased by
// a user with manage_economy_x permission and then transferred over
"allow_purchase_truck": true,
"allow_purchase_garage": true,
"allow_purchase_slot": true,
// enable_balance_leaderboard: whether to enable balance leaderboard
// user must make their balance public to join the leaderboard
// users with 'manage_economy_balance' can always see all users' balances
"enable_balance_leaderboard": true
},
"event_forwarding": [{
"is_private": null,
"channel_id": "",
"webhook_url": "",
"content": "",
"embeds": [{
"title": "{title}",
"description": "{description}",
"url": "{link}",
"fields": [
{"name": "Departure", "value": "{departure}", "inline": true},
{"name": "Destination", "value": "{destination}", "inline": true},
{"name": "Distance", "value": "{distance}", "inline": true},
{"name": "Meetup Time", "value": "<t:{meetup_timestamp}:R>", "inline": true},
{"name": "Departure Time", "value": "<t:{departure_timestamp}:R>", "inline": true}
],
"footer": {
"text": "By {name} | Event #{id}",
"icon_url": ""
},
"author": {
"name": "{name}",
"icon_url": "{avatar}"
},
"timestamp": true
}]
}],
"event_upcoming_forwarding": [{
"is_private": null,
"seconds_ahead": 3600,
"channel_id": "",
"webhook_url": "",
"content": "The event is starting soon!",
"embeds": [{
"title": "{title}",
"description": "{description}",
"url": "{link}",
"fields": [
{"name": "Departure", "value": "{departure}", "inline": true},
{"name": "Destination", "value": "{destination}", "inline": true},
{"name": "Distance", "value": "{distance}", "inline": true},
{"name": "Meetup Time", "value": "<t:{meetup_timestamp}:R>", "inline": true},
{"name": "Departure Time", "value": "<t:{departure_timestamp}:R>", "inline": true}
],
"footer": {
"text": "By {name} | Event #{id}",
"icon_url": ""
},
"author": {
"name": "{name}",
"icon_url": "{avatar}"
},
"timestamp": true
}]
}],
"poll_forwarding": [{
"channel_id": "",
"webhook_url": "",
"content": "",
"embeds": [{
"title": "{title}",
"description": "{description}",
"footer": {
"text": "By {name} | Poll #{id}",
"icon_url": ""
},
"author": {
"name": "{name}",
"icon_url": "{avatar}"
},
"timestamp": true
}]
}]
}