-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.yaml
257 lines (222 loc) · 9.53 KB
/
config.yaml
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
path_separator: \
admin_key: myadminkey
storage_path: C:\root\Dropbox\root\Digifujam\storage
port: 8081
host_prefix: http://localhost:8081
# StaticHostPrefix: http://localhost:8081/uploads
# LocalStaticHostPrefix: http://localhost:8081/uploads
log_command: supervisorctl tail -9000 7jam
room_json:
- 7jam.json
- pub.json
- maj7.json
- hall.json
defaultRoomID: 7jam
#google_client_id: ...
#google_client_secret: ...
#google_redirect_url: ... # i think this should become obsolete
#discord_bot_token: ...
#discord_client_id: ...
jam_tracker_max_duration: 8hours
ActivityDatasourcesBackupInterval: 5m 17s
variables:
# to detect "some users", precondition: (< x users for y duration), then wait z, and check if (>= x users for z duration)
someUserPreDuration: 5m
someUserCount: 3
someUserDelay: 5m
# same logic for "many users"
manyUserPreDuration: 5m
manyUserCount: 5
manyUserDelay: 5m
discord_log_member_count: 0 # to avoid massive log spam when dumping discord data at startup.
activity_hook_data_sources:
UserCounts:
engine: UserCounts
maxAge: 24h
userFilter: 7jam # see UserCountsDataSource for a list
NonAdminUserCounts:
engine: UserCounts
maxAge: 24h
userFilter: 7jamNonAdmins # see UserCountsDataSource for a list
RoomNoteCount:
engine: NoteCount
binDuration: 20s # heavily impacts the nuances in timing. a big bin means the end of a jam may have a LOT of notes then 0 instantly.
maxAge: 24h
DbgRoomNoteCount:
engine: NoteCount
binDuration: 5s
maxAge: 24h
discord_integrations:
#---------- concrete user count notifications ------------------------------------------------------
LoneUser:
engine: UserCountNotification
verboseDebugLogging: 0
dataSourceID: NonAdminUserCounts
messageKey: "%userName%" # rate-limit sending based on the same message key. the message content may be generic, but we want to track unique users so put username here to key off of.
uniqueMessageAge: 8h # remember message keys this long before allowing a dupe to be sent.
join:
# this should be long enough to reduce spam of quick pop-ins, but
# short enough to actually catch users that may need a welcome.
delay: 7s
query: "maintains [1] during [6s]"
messageContent: "Someone has joined 7jam via %roomName%!"
part:
interval: 10s # once we register 7jam as non-empty, we check periodically to see if they are gone and staying gone.
query: "maintains [0] during [30s]"
messageContent: "7jam is now empty after someone left %roomName%"
AllJoins:
engine: AllJoinsNotification
verboseDebugLogging: 0
dataSourceID: UserCounts
startupMessageContent: "7jam has started ========================================="
joinMessageContent: "%userName% has joined 7jam via %roomName%. Global pop = %globalPopulation%"
partMessageContent: "%userName% has left 7jam via %roomName%. Global pop = %globalPopulation%"
# #---------- fuzzy user count notifications ------------------------------------------------------
# UserCount_Some:
# # When user count rises a bit more, notify that a jam is forming.
# # Longer condition duration, because we don't need to ALWAYS fire this. We
# # want this only when things are escalating from a longer-time-idle state.
# engine: UserCountNotification
# dataSourceID: UserCounts
# # detect RISING from below thresh to above thresh.
# # but let's not try to avoid something like 2 jams back-to-back with a small "valley".
# # so this duration is basically the valley. now
# # if there are small fluctuations, the "touches" takes care of this.
# userCountType: room
# conditionOnUserCount: "touches [<%someUserCount%] during [%someUserPreDuration%]"
# delay: "%someUserDelay% 1s" # add 1s so the trigger cond is always guaranteed to be AFTER the precondition
# triggerOnUserCount: "maintains [%someUserCount%,%manyUserCount%] during [%someUserDelay%]"
# messageContent: "%roomUserCount% people are currently hanging out in %roomName%"
# UserCount_Many:
# engine: UserCountNotification
# dataSourceID: UserCounts
# # Similar to above, detect RISING. and use TOUCHES so we don't miss the notification
# # based on little fluctuations.
# userCountType: room
# conditionOnUserCount: "touches [<%manyUserCount%] during [%manyUserPreDuration%]"
# # Then, make sure we're maintaining many users during a significant amount of time.
# delay: "%manyUserDelay% 1s"
# triggerOnUserCount: "maintains [>=%manyUserCount%] during [%manyUserDelay%]"
# messageContent: "A party of %roomUserCount% is happening in %roomName%"
#---------- jam status PROD notifications ------------------------------------------------------
JamTracker:
engine: JamStatusNotification
noteDataSourceID: RoomNoteCount
userCountDataSourceID: NonAdminUserCounts
noteCountBacktrack: 30minutes # when notifying new jam, how far back to include note count
verboseDebugLogging: 0
jamStart:
delay: 2m
noteTrigger: "sum [>=200] during [10min]"
userCountTrigger: "maintains [>=2] during [5min]"
userCountType: global
messageContent: "A jam session is warming up in %roomName%."
messageFields:
Current Players: "%roomUserCount%"
jamOngoing:
interval: 31m
noteTrigger: "sum [>=600] during [30min]"
messageContent: "The jam goes on in %roomName%"
messageFields:
Jam Duration: "%jamDuration%"
Jam Notes: "%jamNotes%"
Current Players: "%roomUserCount%"
jamEnd:
noteTrigger: "sum [<50] during [15min]"
messageContent: "All great jams must come to an end. Till next time in %roomName%!"
messageFields:
Jam duration: "%jamDuration%"
Jam notes: "%jamNotes%"
NPS: "%jamNotesPerSecond%"
Unique users: "%jamUniqueUsers%"
Max user count: "%jamMaxUserCount%"
#---------- jam status DEBUG notifications ------------------------------------------------------
DbgJamTracker:
engine: JamStatusNotification
noteDataSourceID: DbgRoomNoteCount
userCountDataSourceID: UserCounts
noteCountBacktrack: 30minutes # when notifying new jam, how far back to include note count
verboseDebugLogging: 0
# to detect jam start, we immediately check condition, delay, and check it again
jamStart:
delay: "16s"
noteTrigger: "sum [>=20] during [10s]"
userCountTrigger: "maintains [>=2] during [10s]"
userCountType: global
messageContent: "(dbg) A jam session is warming up in %roomName%."
messageFields:
Current Players: "%roomUserCount%"
jamOngoing:
interval: "20s"
noteTrigger: "sum [>=20] during [20s]"
messageContent: "(dbg) The jam goes on in %roomName%"
messageFields:
Jam Duration: "%jamDuration%"
Jam Notes: "%jamNotes%"
Current Players: "%roomUserCount%"
jamEnd:
noteTrigger: "sum [<20] during [10s]"
messageContent: "All great jams must come to an end. Till next time in %roomName%!"
messageFields:
Jam duration: "%jamDuration%"
Jam notes: "%jamNotes%"
NPS: "%jamNotesPerSecond%"
Unique users: "%jamUniqueUsers%"
Min user count: "%jamMinUserCount%"
Max user count: "%jamMaxUserCount%"
Instrument changes: "%jamInstrumentChanges%"
#---------- misc notifications ------------------------------------------------------
serverUp:
engine: ServerUpDiscordNotification
delaySec: 10
manualSend: 1 # don't send automatically; requires an admin to manually send it from the admin console.
messageContent: 7jam is now live!
messageFields:
Notes played: "%serverNoteCount%"
Instruments: "%instrumentCount%"
Rooms: "%roomCount%"
URL: "%homeURL%"
WelcomeMessage1:
engine: WelcomeMessage
delay: 8s
delayPerMessage: 5s
roomUserCount: 1
messages:
- Hey, %userName%! Welcome to 7jam!
- To get started, select an instrument from the Instrument Closet. You'll need a MIDI keyboard, and it only works on desktop (not mobile yet)
- If nobody's around, head to our [Discord](https://discord.gg/kkf9gQfKAd) to discover upcoming events and hang out
WelcomeMessageSome:
engine: WelcomeMessage
delay: 5s
delayPerMessage: 5s
roomUserCount: 2,3
messages:
- Hey, %userName%! Welcome to 7jam!
- To get started, select an instrument from the Instrument Closet. You'll need a MIDI keyboard, and it only works on desktop (not mobile yet)
WelcomeMessageMany:
engine: WelcomeMessage
delay: 5s
delayPerMessage: 5s
roomUserCount: 4,10
messages:
- Hey, %userName%! Welcome to 7jam!
# Note: this forwards ALL messages, no delay, buffer, or aggregation.
ForwardAllMessageFrom7jamToDiscord:
engine: ForwardMessageFrom7jamToDiscord
# Note: this forwards raw 7jam messages to discord only when a single user is present in the room
ForwardLonelyMessageFrom7jamToDiscord:
engine: ForwardMessageFrom7jamToDiscord
sevenJamRoomUserCount: 1 # a range spec
# Note: this forwards ALL messages, no delay, buffer, or aggregation.
ForwardMessageDiscordTo7jam:
engine: ForwardMessageDiscordTo7jam
UserListSyncOnly:
engine: UserListSyncOnly
discord_subscriptions:
# This is an array of mappings. We're mapping 7jam room to Discord channel, and specifying the integrations which should be instantiated there.
# This is the format...
#- discord_channel_id: "...."
# 7jam_room_id: maj7
# integrations:
# - ForwardMessageFrom7jamToDiscord
# - ForwardMessageDiscordTo7jam