2014-11-11 04:11:09 +08:00
|
|
|
# Global configurations file
|
|
|
|
|
|
|
|
# load the local configs
|
|
|
|
# config = require("./config_local")
|
|
|
|
config = {}
|
|
|
|
|
2014-11-11 21:58:28 +08:00
|
|
|
# BigBlueButton configs
|
|
|
|
config.bbb = {}
|
|
|
|
# TODO: move secret to a config_local file
|
2014-11-12 04:48:23 +08:00
|
|
|
config.bbb.sharedSecret = "33e06642a13942004fd83b3ba6e4104a"
|
2014-11-12 01:07:05 +08:00
|
|
|
config.bbb.apiPath = "/bigbluebutton/api"
|
|
|
|
|
2014-11-11 21:58:28 +08:00
|
|
|
# Web server configs
|
|
|
|
config.server = {}
|
|
|
|
config.server.port = 3005
|
|
|
|
|
|
|
|
# Web hooks configs
|
|
|
|
config.hooks = {}
|
|
|
|
config.hooks.pchannel = "bigbluebutton:*"
|
2014-11-12 02:43:41 +08:00
|
|
|
config.hooks.meetingsChannel = "bigbluebutton:from-bbb-apps:meeting"
|
2014-11-11 21:58:28 +08:00
|
|
|
|
2014-11-11 04:11:09 +08:00
|
|
|
# Filters to the events we want to generate callback calls for
|
2014-11-11 21:58:28 +08:00
|
|
|
config.hooks.events = [
|
2014-11-11 04:11:09 +08:00
|
|
|
{ channel: "bigbluebutton:from-bbb-apps:meeting", name: "meeting_created_message" },
|
|
|
|
{ channel: "bigbluebutton:from-bbb-apps:meeting", name: "meeting_destroyed_event" },
|
|
|
|
{ channel: "bigbluebutton:from-bbb-apps:users", name: "user_joined_message" },
|
|
|
|
{ channel: "bigbluebutton:from-bbb-apps:users", name: "presenter_assigned_message" },
|
|
|
|
{ channel: "bigbluebutton:from-bbb-apps:users", name: "user_left_message" }
|
|
|
|
# { channel: "bigbluebutton:from-bbb-apps:meeting", name: "user_registered_message" },
|
|
|
|
]
|
|
|
|
|
2014-11-13 04:07:29 +08:00
|
|
|
# Retry intervals for failed attempts for perform callback calls.
|
|
|
|
# In ms. Totals to around 5min.
|
|
|
|
config.hooks.retryIntervals = [
|
|
|
|
100, 500, 1000, 2000, 4000, 8000, 10000, 30000, 60000, 60000, 60000, 60000
|
|
|
|
]
|
|
|
|
|
2014-11-13 02:35:25 +08:00
|
|
|
# Redis
|
|
|
|
config.redis = {}
|
|
|
|
config.redis.keys = {}
|
|
|
|
config.redis.keys.hook = (id) -> "bigbluebutton:webhooks:hook:#{id}"
|
|
|
|
config.redis.keys.hooks = "bigbluebutton:webhooks:hooks"
|
|
|
|
config.redis.keys.mappings = "bigbluebutton:webhooks:mappings"
|
|
|
|
|
2014-11-12 01:48:36 +08:00
|
|
|
config.api = {}
|
|
|
|
config.api.responses = {}
|
|
|
|
config.api.responses.failure = (key, msg) ->
|
|
|
|
"<response> \
|
|
|
|
<returncode>FAILED</returncode> \
|
2014-11-12 03:54:00 +08:00
|
|
|
<messageKey>#{key}</messageKey> \
|
|
|
|
<message>#{msg}</message> \
|
2014-11-12 01:48:36 +08:00
|
|
|
</response>"
|
|
|
|
config.api.responses.checksumError =
|
|
|
|
config.api.responses.failure("checksumError", "You did not pass the checksum security check.")
|
|
|
|
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.hookSuccess = (id) ->
|
2014-11-12 01:48:36 +08:00
|
|
|
"<response> \
|
|
|
|
<returncode>SUCCESS</returncode> \
|
2014-11-12 21:28:49 +08:00
|
|
|
<hookID>#{id}</hookID> \
|
2014-11-12 01:48:36 +08:00
|
|
|
</response>"
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.hookFailure =
|
|
|
|
config.api.responses.failure("createHookError", "An error happened while creating your hook. Check the logs.")
|
|
|
|
config.api.responses.hookDuplicated = (id) ->
|
2014-11-12 02:56:15 +08:00
|
|
|
"<response> \
|
|
|
|
<returncode>SUCCESS</returncode> \
|
2014-11-12 21:28:49 +08:00
|
|
|
<hookID>#{id}</hookID> \
|
2014-11-12 02:56:15 +08:00
|
|
|
<messageKey>duplicateWarning</messageKey> \
|
2014-11-12 21:28:49 +08:00
|
|
|
<message>There is already a hook for this callback URL.</message> \
|
2014-11-12 02:56:15 +08:00
|
|
|
</response>"
|
2014-11-12 01:48:36 +08:00
|
|
|
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.destroySuccess =
|
2014-11-12 01:48:36 +08:00
|
|
|
"<response> \
|
|
|
|
<returncode>SUCCESS</returncode> \
|
2014-11-12 21:28:49 +08:00
|
|
|
<removed>true</removed> \
|
2014-11-12 01:48:36 +08:00
|
|
|
</response>"
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.destroyFailure =
|
|
|
|
config.api.responses.failure("destroyHookError", "An error happened while removing your hook. Check the logs.")
|
|
|
|
config.api.responses.destroyNoHook =
|
|
|
|
config.api.responses.failure("destroyMissingHook", "The hook informed was not found.")
|
2014-11-12 01:48:36 +08:00
|
|
|
|
|
|
|
config.api.responses.missingParamCallbackURL =
|
|
|
|
config.api.responses.failure("missingParamCallbackURL", "You must specify a callbackURL in the parameters.")
|
2014-11-12 21:28:49 +08:00
|
|
|
config.api.responses.missingParamHookID =
|
|
|
|
config.api.responses.failure("missingParamHookID", "You must specify a hookID in the parameters.")
|
2014-11-12 01:48:36 +08:00
|
|
|
|
2014-11-11 04:11:09 +08:00
|
|
|
module.exports = config
|