From 8e7b1d6317b8e7b09c5b4269c057711ea94620e0 Mon Sep 17 00:00:00 2001 From: Lajellu Date: Wed, 17 Aug 2016 08:48:03 -0700 Subject: [PATCH 1/6] HTML5 - Changes config organization and all files dependant on config files --- bigbluebutton-html5/Gruntfile.js | 2 +- .../server/methods/sendChatMessagetoServer.js | 5 ++-- .../server/modifiers/addChatToCollection.js | 5 ++-- .../imports/api/common/server/helpers.js | 1 + .../modifiers/addMeetingToCollection.js | 4 +-- .../imports/api/phone/index.js | 14 ++++++----- .../server/methods/publishVoteMessage.js | 4 +-- .../server/methods/switchSlideMessage.js | 4 +-- .../server/modifiers/eventHandlers.js | 6 ++--- .../server/modifiers/addSlideToCollection.js | 4 +-- .../api/users/server/methods/kickUser.js | 4 +-- .../server/methods/listenOnlyRequestToggle.js | 6 ++--- .../api/users/server/methods/muteUser.js | 4 +-- .../users/server/methods/setUserPresenter.js | 4 +-- .../api/users/server/methods/unmuteUser.js | 4 +-- .../api/users/server/methods/userSetEmoji.js | 4 +-- .../users/server/methods/validateAuthToken.js | 4 +-- .../server/modifiers/requestUserLeaving.js | 6 ++--- .../api/users/server/modifiers/userJoined.js | 11 ++++---- .../imports/api/verto/index.js | 10 ++++---- .../imports/startup/client/routes.js | 3 ++- .../imports/startup/server/EventQueue.js | 2 +- .../imports/startup/server/RedisPubSub.js | 13 ++++++---- .../imports/startup/server/index.js | 9 ++++--- .../imports/ui/components/chat/container.jsx | 3 ++- .../imports/ui/components/chat/service.js | 15 +++++------ .../user-list/chat-list-item/component.jsx | 3 ++- .../ui/components/user-list/service.js | 6 +++-- .../ui/services/unread-messages/index.js | 5 ++-- .../imports/utils/lineEndings.js | 11 ++++++++ .../config/development/public/app.yaml | 4 +++ .../private/config/production/public/app.yaml | 4 +++ .../private/config/public/app.yaml | 25 +++++++++++++++++++ .../private/config/public/chat.yaml | 15 +++++++++++ .../private/config/public/media.yaml | 10 ++++++++ .../private/config/public/user.yaml | 2 ++ bigbluebutton-html5/settings-development.json | 3 --- bigbluebutton-html5/settings-production.json | 3 --- bigbluebutton-html5/start.sh | 2 ++ 39 files changed, 163 insertions(+), 81 deletions(-) mode change 100644 => 100755 bigbluebutton-html5/imports/startup/server/index.js mode change 100644 => 100755 bigbluebutton-html5/imports/ui/components/chat/container.jsx mode change 100644 => 100755 bigbluebutton-html5/imports/ui/components/chat/service.js mode change 100644 => 100755 bigbluebutton-html5/imports/ui/components/user-list/service.js mode change 100644 => 100755 bigbluebutton-html5/imports/ui/services/unread-messages/index.js create mode 100755 bigbluebutton-html5/imports/utils/lineEndings.js create mode 100755 bigbluebutton-html5/private/config/development/public/app.yaml create mode 100755 bigbluebutton-html5/private/config/production/public/app.yaml create mode 100755 bigbluebutton-html5/private/config/public/app.yaml create mode 100755 bigbluebutton-html5/private/config/public/chat.yaml create mode 100755 bigbluebutton-html5/private/config/public/media.yaml create mode 100755 bigbluebutton-html5/private/config/public/user.yaml diff --git a/bigbluebutton-html5/Gruntfile.js b/bigbluebutton-html5/Gruntfile.js index 1c5b3e8664..704fce9830 100755 --- a/bigbluebutton-html5/Gruntfile.js +++ b/bigbluebutton-html5/Gruntfile.js @@ -66,7 +66,7 @@ module.exports = function (grunt) { command: METEOR_DEV_COMMAND, }, start_meteor_production: { - command: METEOR_DEV_COMMAND, + command: METEOR_PROD_COMMAND, }, }, diff --git a/bigbluebutton-html5/imports/api/chat/server/methods/sendChatMessagetoServer.js b/bigbluebutton-html5/imports/api/chat/server/methods/sendChatMessagetoServer.js index ad6cb76ce5..769d370e42 100755 --- a/bigbluebutton-html5/imports/api/chat/server/methods/sendChatMessagetoServer.js +++ b/bigbluebutton-html5/imports/api/chat/server/methods/sendChatMessagetoServer.js @@ -3,7 +3,6 @@ import { isAllowedTo } from '/imports/startup/server/userPermissions'; import { appendMessageHeader } from '/imports/api/common/server/helpers'; import { translateHTML5ToFlash } from '/imports/api/common/server/helpers'; import { logger } from '/imports/startup/server/logger'; -import { redisConfig } from '/config'; import RegexWebUrl from '/imports/utils/regex-weburl'; @@ -37,6 +36,8 @@ Meteor.methods({ // requesterUserId: the userId of the user sending chat // requesterToken: the authToken of the requester sendChatMessagetoServer(credentials, chatObject) { + const REDIS_CONFIG = Meteor.settings.redis; + const { meetingId, requesterUserId, requesterToken } = credentials; let message; @@ -70,7 +71,7 @@ Meteor.methods({ }; message = appendMessageHeader(eventName, message); logger.info('publishing chat to redis'); - publish(redisConfig.channels.toBBBApps.chat, message); + publish(REDIS_CONFIG.channels.toBBBApps.chat, message); } }, }); diff --git a/bigbluebutton-html5/imports/api/chat/server/modifiers/addChatToCollection.js b/bigbluebutton-html5/imports/api/chat/server/modifiers/addChatToCollection.js index 618c63b16a..83e489876c 100755 --- a/bigbluebutton-html5/imports/api/chat/server/modifiers/addChatToCollection.js +++ b/bigbluebutton-html5/imports/api/chat/server/modifiers/addChatToCollection.js @@ -1,13 +1,12 @@ import Chat from '/imports/api/chat'; import { logger } from '/imports/startup/server/logger'; - -const BREAK_TAG = '
'; +import { BREAK_LINE } from '/imports/utils/lineEndings.js'; const parseMessage = (message) => { message = message || ''; // Replace \r and \n to
- message = message.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + BREAK_TAG + '$2'); + message = message.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + BREAK_LINE + '$2'); // Replace flash links to html valid ones message = message.split(` { message = message || ''; // Replace \r and \n to
- message = message.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + BREAK_TAG + '$2'); + message = message.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + BREAK_LINE + '$2'); // Replace flash links to html valid ones message = message.split(`
{ }; export function userJoined(meetingId, user, callback) { + const APP_CONFIG = Meteor.settings.public.app; let welcomeMessage; const userId = user.userid; const userObject = Users.findOne({ @@ -87,11 +86,11 @@ export function userJoined(meetingId, user, callback) { meetingId: meetingId, }); if (meetingObject != null) { - welcomeMessage = clientConfig.defaultWelcomeMessage.replace(/%%CONFNAME%%/, + welcomeMessage = APP_CONFIG.defaultWelcomeMessage.replace(/%%CONFNAME%%/, meetingObject.meetingName); } - welcomeMessage = welcomeMessage + clientConfig.defaultWelcomeMessageFooter; + welcomeMessage = welcomeMessage + APP_CONFIG.defaultWelcomeMessageFooter; // add the welcome message if it's not there already OR update time_of_joining return Chat.upsert({ diff --git a/bigbluebutton-html5/imports/api/verto/index.js b/bigbluebutton-html5/imports/api/verto/index.js index 703c7aa19e..14a0519f2d 100755 --- a/bigbluebutton-html5/imports/api/verto/index.js +++ b/bigbluebutton-html5/imports/api/verto/index.js @@ -1,5 +1,4 @@ import Auth from '/imports/ui/services/auth'; -import { clientConfig } from '/config'; import { getVoiceBridge } from '/imports/api/phone'; function createVertoUserName() { @@ -18,6 +17,7 @@ function watchVertoVideo(options) { } function joinVertoCall(options) { + const MEDIA_CONFIG = Meteor.settings.public.media; console.log('joinVertoCall'); const extension = options.extension || getVoiceBridge(); @@ -25,12 +25,12 @@ function joinVertoCall(options) { return; } - if (!clientConfig.useSIPAudio) { + if (!MEDIA_CONFIG.useSIPAudio) { const vertoServerCredentials = { - vertoPort: clientConfig.media.vertoPort, - hostName: clientConfig.media.vertoServerAddress, + vertoPort: MEDIA_CONFIG.vertoPort, + hostName: MEDIA_CONFIG.vertoServerAddress, login: conferenceIdNumber, - password: clientConfig.media.freeswitchProfilePassword, + password: MEDIA_CONFIG.freeswitchProfilePassword, }; let wasCallSuccessful = false; diff --git a/bigbluebutton-html5/imports/startup/client/routes.js b/bigbluebutton-html5/imports/startup/client/routes.js index b8982f225d..cbb0f2f399 100755 --- a/bigbluebutton-html5/imports/startup/client/routes.js +++ b/bigbluebutton-html5/imports/startup/client/routes.js @@ -10,7 +10,8 @@ import ChatContainer from '/imports/ui/components/chat/container'; import UserListContainer from '/imports/ui/components/user-list/container'; const browserHistory = useRouterHistory(createHistory)({ - basename: '/html5client', + // Name displayed in the brower URL + basename: Meteor.settings.public.app.basename, }); export const renderRoutes = () => ( diff --git a/bigbluebutton-html5/imports/startup/server/EventQueue.js b/bigbluebutton-html5/imports/startup/server/EventQueue.js index 6d848e01e0..dcc59adf6a 100755 --- a/bigbluebutton-html5/imports/startup/server/EventQueue.js +++ b/bigbluebutton-html5/imports/startup/server/EventQueue.js @@ -98,7 +98,7 @@ const logRedisMessage = function (eventName, json) { // For DEVELOPMENT purposes only // Dynamic shapes' updates will slow down significantly - if (Meteor.settings.public.mode == 'development') { + if (Meteor.settings.runtime.env == 'development') { logger.info(`redis incoming message ${eventName} `, { message: json, }); diff --git a/bigbluebutton-html5/imports/startup/server/RedisPubSub.js b/bigbluebutton-html5/imports/startup/server/RedisPubSub.js index 991eacfcea..d666963f4f 100755 --- a/bigbluebutton-html5/imports/startup/server/RedisPubSub.js +++ b/bigbluebutton-html5/imports/startup/server/RedisPubSub.js @@ -1,20 +1,23 @@ import { logger } from '/imports/startup/server/logger'; -import { redisConfig } from '/config'; import { myQueue } from '/imports/startup/server'; import { indexOf, publish } from '/imports/api/common/server/helpers'; export class RedisPubSub { constructor() { + const REDIS_CONFIG = Meteor.settings.redis; + logger.info('constructor RedisPubSub'); this.pubClient = redis.createClient(); this.subClient = redis.createClient(); - logger.info(`Subscribing message on channel: ${redisConfig.channels.fromBBBApps}`); + logger.info(`Subscribing message on channel: ${REDIS_CONFIG.channels.fromBBBApps}`); this.subClient.on('psubscribe', Meteor.bindEnvironment(this._onSubscribe)); this.subClient.on('pmessage', Meteor.bindEnvironment(this._addToQueue)); - this.subClient.psubscribe(redisConfig.channels.fromBBBApps); + this.subClient.psubscribe(REDIS_CONFIG.channels.fromBBBApps); } _onSubscribe(channel, count) { + const REDIS_CONFIG = Meteor.settings.redis; + let message; logger.info(`Subscribed to ${channel}`); @@ -25,7 +28,7 @@ export class RedisPubSub { }, payload: {}, // I need this, otherwise bbb-apps won't recognize the message }; - return publish(redisConfig.channels.toBBBApps.meeting, message); + return publish(REDIS_CONFIG.channels.toBBBApps.meeting, message); } _addToQueue(pattern, channel, jsonMsg) { @@ -40,7 +43,7 @@ export class RedisPubSub { // For DEVELOPMENT purposes only // Dynamic shapes' updates will slow down significantly - if (Meteor.settings.public.mode == 'development') { + if (Meteor.settings.public.runtime.env == 'development') { logger.info(`Q ${eventName} ${myQueue.total()}`); } diff --git a/bigbluebutton-html5/imports/startup/server/index.js b/bigbluebutton-html5/imports/startup/server/index.js old mode 100644 new mode 100755 index 06ebbbb497..553ad06e3e --- a/bigbluebutton-html5/imports/startup/server/index.js +++ b/bigbluebutton-html5/imports/startup/server/index.js @@ -3,13 +3,16 @@ import '/server/server'; import { RedisPubSub } from '/imports/startup/server/RedisPubSub'; import { EventQueue } from '/imports/startup/server/EventQueue'; import { clearCollections } from '/imports/api/common/server/helpers'; -import { clientConfig } from '/config'; Meteor.startup(function () { + redisPubSub = new RedisPubSub(); + clearCollections(); + const APP_CONFIG = Meteor.settings.public.app; + let determineConnectionType = function() { let baseConnection = 'HTTP'; - if(clientConfig.app.httpsConnection) { + if(APP_CONFIG.httpsConnection){ baseConnection += ('S'); } return baseConnection; @@ -29,4 +32,4 @@ export const myQueue = new EventQueue(); export const eventEmitter = new (Npm.require('events').EventEmitter); -export const redisPubSub = new RedisPubSub(); +export let redisPubSub = {}; diff --git a/bigbluebutton-html5/imports/ui/components/chat/container.jsx b/bigbluebutton-html5/imports/ui/components/chat/container.jsx old mode 100644 new mode 100755 index 2615b7edcd..d434a09ce5 --- a/bigbluebutton-html5/imports/ui/components/chat/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/container.jsx @@ -2,7 +2,8 @@ import React, { Component, PropTypes } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; import { createContainer } from 'meteor/react-meteor-data'; -const PUBLIC_CHAT_KEY = 'public'; +const CHAT_CONFIG = Meteor.settings.public.chat; +const PUBLIC_CHAT_KEY = CHAT_CONFIG.public_id; import Chat from './component'; import ChatService from './service'; diff --git a/bigbluebutton-html5/imports/ui/components/chat/service.js b/bigbluebutton-html5/imports/ui/components/chat/service.js old mode 100644 new mode 100755 index d67426f3f3..37140f3eec --- a/bigbluebutton-html5/imports/ui/components/chat/service.js +++ b/bigbluebutton-html5/imports/ui/components/chat/service.js @@ -7,15 +7,16 @@ import UnreadMessages from '/imports/ui/services/unread-messages'; import { callServer } from '/imports/ui/services/api'; -const GROUPING_MESSAGES_WINDOW = 60000; +const CHAT_CONFIG = Meteor.settings.public.chat; +const GROUPING_MESSAGES_WINDOW = CHAT_CONFIG.grouping_messages_window; -const SYSTEM_CHAT_TYPE = 'SYSTEM_MESSAGE'; -const PUBLIC_CHAT_TYPE = 'PUBLIC_CHAT'; -const PRIVATE_CHAT_TYPE = 'PRIVATE_CHAT'; +const SYSTEM_CHAT_TYPE = CHAT_CONFIG.type_system; +const PUBLIC_CHAT_TYPE = CHAT_CONFIG.type_public; +const PRIVATE_CHAT_TYPE = CHAT_CONFIG.type_private; -const PUBLIC_CHAT_ID = 'public'; -const PUBLIC_CHAT_USERID = 'public_chat_userid'; -const PUBLIC_CHAT_USERNAME = 'public_chat_username'; +const PUBLIC_CHAT_ID = CHAT_CONFIG.public_id; +const PUBLIC_CHAT_USERID = CHAT_CONFIG.public_userid; +const PUBLIC_CHAT_USERNAME = CHAT_CONFIG.public_username; const ScrollCollection = new Mongo.Collection(null); diff --git a/bigbluebutton-html5/imports/ui/components/user-list/chat-list-item/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/chat-list-item/component.jsx index d7f0a2d027..41dbf9ded0 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/chat-list-item/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/chat-list-item/component.jsx @@ -6,7 +6,8 @@ import { withRouter } from 'react-router'; import { Link } from 'react-router'; import cx from 'classnames'; -const PRIVATE_CHAT_PATH = 'users/chat/'; +const CHAT_CONFIG = Meteor.settings.public.chat; +const PRIVATE_CHAT_PATH = CHAT_CONFIG.private_path; const propTypes = { chat: React.PropTypes.shape({ diff --git a/bigbluebutton-html5/imports/ui/components/user-list/service.js b/bigbluebutton-html5/imports/ui/components/user-list/service.js old mode 100644 new mode 100755 index cac459c1e4..46e031889b --- a/bigbluebutton-html5/imports/ui/components/user-list/service.js +++ b/bigbluebutton-html5/imports/ui/components/user-list/service.js @@ -5,9 +5,11 @@ import UnreadMessages from '/imports/ui/services/unread-messages'; import { callServer } from '/imports/ui/services/api'; -const ROLE_MODERATOR = 'MODERATOR'; +const CHAT_CONFIG = Meteor.settings.public.chat; +const USER_CONFIG = Meteor.settings.public.user; +const ROLE_MODERATOR = USER_CONFIG.role_moderator; const EMOJI_STATUSES = ['raiseHand', 'happy', 'smile', 'neutral', 'sad', 'confused', 'away']; -const PRIVATE_CHAT_TYPE = 'PRIVATE_CHAT'; +const PRIVATE_CHAT_TYPE = CHAT_CONFIG.type_private; /* TODO: Same map is done in the chat/service we should share this someway */ diff --git a/bigbluebutton-html5/imports/ui/services/unread-messages/index.js b/bigbluebutton-html5/imports/ui/services/unread-messages/index.js old mode 100644 new mode 100755 index 320b62272f..c4b00a9532 --- a/bigbluebutton-html5/imports/ui/services/unread-messages/index.js +++ b/bigbluebutton-html5/imports/ui/services/unread-messages/index.js @@ -4,8 +4,9 @@ import Storage from '/imports/ui/services/storage/session'; import Auth from '/imports/ui/services/auth'; import Chats from '/imports/api/chat'; -const PUBLIC_CHAT_USERID = 'public_chat_userid'; -const STORAGE_KEY = 'UNREAD_CHATS'; +const CHAT_CONFIG = Meteor.settings.public.chat; +const PUBLIC_CHAT_USERID = CHAT_CONFIG.public_userid; +const STORAGE_KEY = CHAT_CONFIG.storage_key; class UnreadMessagesTracker { constructor() { diff --git a/bigbluebutton-html5/imports/utils/lineEndings.js b/bigbluebutton-html5/imports/utils/lineEndings.js new file mode 100755 index 0000000000..0aeea6eb5b --- /dev/null +++ b/bigbluebutton-html5/imports/utils/lineEndings.js @@ -0,0 +1,11 @@ +// Used in Flash and HTML to show a legitimate break in the line +const BREAK_LINE = '
'; + +// Soft return in HTML to signify a broken line without +// displaying the escaped '
' line break text +const CARRIAGE_RETURN = '\r'; + +// Handle this the same as carriage return, in case text copied has this +const NEW_LINE = '\n'; + +export { BREAK_LINE, CARRIAGE_RETURN, NEW_LINE }; diff --git a/bigbluebutton-html5/private/config/development/public/app.yaml b/bigbluebutton-html5/private/config/development/public/app.yaml new file mode 100755 index 0000000000..580749b74b --- /dev/null +++ b/bigbluebutton-html5/private/config/development/public/app.yaml @@ -0,0 +1,4 @@ +# Application configurations +app: + # Flag for HTTPS. + httpsConnection: false diff --git a/bigbluebutton-html5/private/config/production/public/app.yaml b/bigbluebutton-html5/private/config/production/public/app.yaml new file mode 100755 index 0000000000..a9b0bf8f4b --- /dev/null +++ b/bigbluebutton-html5/private/config/production/public/app.yaml @@ -0,0 +1,4 @@ +# Application configurations +app: + # Flag for HTTPS. + httpsConnection: true diff --git a/bigbluebutton-html5/private/config/public/app.yaml b/bigbluebutton-html5/private/config/public/app.yaml new file mode 100755 index 0000000000..4946f06ea9 --- /dev/null +++ b/bigbluebutton-html5/private/config/public/app.yaml @@ -0,0 +1,25 @@ +# Application configurations +app: + # Default font sizes for mobile / desktop + mobileFont: 16 + desktopFont: 14 + + # Will offer the user to join the audio when entering the meeting + autoJoinAudio: false + listenOnly: false + skipCheck: false + + # Flag for HTTPS - true on production + httpsConnection: false + + # Default global variables + appName: "BigBlueButton HTML5 Client" + bbbServerVersion: "1.0" + copyrightYear: "2015" + html5ClientBuild: "NNNN" + defaultWelcomeMessage: Welcome to %%CONFNAME%%!\r\rFor help on using BigBlueButton see these (short)
tutorial videos.\r\rTo join the audio bridge click the gear icon (upper-right hand corner). Use a headset to avoid causing background noise for others.\r\r\r + lockOnJoin: true + defaultWelcomeMessageFooter: This server is running a build of BigBlueButton 1.0. + + # Name displayed in the brower URL + basename: '/html5client' diff --git a/bigbluebutton-html5/private/config/public/chat.yaml b/bigbluebutton-html5/private/config/public/chat.yaml new file mode 100755 index 0000000000..98165f3c67 --- /dev/null +++ b/bigbluebutton-html5/private/config/public/chat.yaml @@ -0,0 +1,15 @@ +# Chat service configurations +chat: + grouping_messages_window: 60000 + # Chat types + type_system: 'SYSTEM_MESSAGE' + type_public: 'PUBLIC_CHAT' + type_private: 'PRIVATE_CHAT' + # Chat ids and names + public_id: 'public' + public_userid: 'public_chat_userid' + public_username: 'public_chat_username' + # Keys + storage_key: 'UNREAD_CHATS' + # Chat paths + private_path: 'users/chat/' # TODO: change private_path to path_route diff --git a/bigbluebutton-html5/private/config/public/media.yaml b/bigbluebutton-html5/private/config/public/media.yaml new file mode 100755 index 0000000000..61f6907574 --- /dev/null +++ b/bigbluebutton-html5/private/config/public/media.yaml @@ -0,0 +1,10 @@ +# Media configurations +media: + WebRTCHangupRetryInterval: 2000 + # IP address of FreeSWITCH server for use of mod_verto and WebRTC deshsharing + vertoServerAddress: "HOST" + # Allows a caller to access a FreeSWITCH dialplan + freeswitchProfilePassword: "1234" # TODO: Remove once Danny's submitted PULL + vertoPort: "8082" + # specifies whether to use SIP.js for audio over mod_verto + useSIPAudio: true diff --git a/bigbluebutton-html5/private/config/public/user.yaml b/bigbluebutton-html5/private/config/public/user.yaml new file mode 100755 index 0000000000..27e2c1ed9d --- /dev/null +++ b/bigbluebutton-html5/private/config/public/user.yaml @@ -0,0 +1,2 @@ +user: + role_moderator: 'MODERATOR' diff --git a/bigbluebutton-html5/settings-development.json b/bigbluebutton-html5/settings-development.json index cd55a59386..e665f1b73b 100755 --- a/bigbluebutton-html5/settings-development.json +++ b/bigbluebutton-html5/settings-development.json @@ -1,6 +1,3 @@ { - "public": { - "mode": "development" - }, "rootURL": "http://127.0.0.1/html5client" } diff --git a/bigbluebutton-html5/settings-production.json b/bigbluebutton-html5/settings-production.json index 2bb1505c54..a5369609fd 100755 --- a/bigbluebutton-html5/settings-production.json +++ b/bigbluebutton-html5/settings-production.json @@ -1,7 +1,4 @@ { - "public": { - "mode": "production" - }, "rootURL": "http://127.0.0.1/html5client", "home": "/usr/share/meteor" } diff --git a/bigbluebutton-html5/start.sh b/bigbluebutton-html5/start.sh index 9d97a072f5..51dc3c95b2 100755 --- a/bigbluebutton-html5/start.sh +++ b/bigbluebutton-html5/start.sh @@ -2,3 +2,5 @@ # the idea is that this way we prevent test runs (for whenever needed) JASMINE_SERVER_UNIT=0 JASMINE_SERVER_INTEGRATION=0 JASMINE_CLIENT_INTEGRATION=0 JASMINE_BROWSER=PhantomJS JASMINE_MIRROR_PORT=3000 ROOT_URL=http://127.0.0.1/html5client meteor # ROOT_URL_PATH_PREFIX=html5client meteor +# Change to start meteor in production or development mode +NODE_ENV=development From 19ff007adb3c6c64fb66ffe1411adfb580975b41 Mon Sep 17 00:00:00 2001 From: Lajellu Date: Fri, 19 Aug 2016 14:08:46 -0700 Subject: [PATCH 2/6] Changes logger to NPM package. Makes RedisPubSub and logger run after Meteor.startup --- bigbluebutton-html5/.gitignore | 1 + bigbluebutton-html5/.meteor/packages | 5 +- bigbluebutton-html5/.meteor/versions | 6 +- bigbluebutton-html5/config.js | 84 ------------------- .../modifiers/addMeetingToCollection.js | 1 + .../server/modifiers/addSlideToCollection.js | 64 +++++++------- .../imports/startup/server/RedisPubSub.js | 2 +- .../imports/startup/server/index.js | 6 +- .../imports/startup/server/logger.js | 48 ++++++++--- bigbluebutton-html5/package.json | 3 +- 10 files changed, 81 insertions(+), 139 deletions(-) mode change 100755 => 100644 bigbluebutton-html5/.meteor/packages delete mode 100755 bigbluebutton-html5/config.js mode change 100644 => 100755 bigbluebutton-html5/imports/startup/server/logger.js mode change 100755 => 100644 bigbluebutton-html5/package.json diff --git a/bigbluebutton-html5/.gitignore b/bigbluebutton-html5/.gitignore index ed4963d498..e2c17b5d3e 100755 --- a/bigbluebutton-html5/.gitignore +++ b/bigbluebutton-html5/.gitignore @@ -3,3 +3,4 @@ app/build/ npm-debug.log node_modules/ .meteor/dev_bundle +private/config/server diff --git a/bigbluebutton-html5/.meteor/packages b/bigbluebutton-html5/.meteor/packages old mode 100755 new mode 100644 index b636238af1..940ab27ec9 --- a/bigbluebutton-html5/.meteor/packages +++ b/bigbluebutton-html5/.meteor/packages @@ -1,8 +1,9 @@ # Meteor packages used by this project, one per line. -# +#I # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. +4commerce:env-settings standard-app-packages mrt:redis@0.1.3 arunoda:npm@0.2.6 @@ -10,8 +11,6 @@ amplify blaze francocatena:status mrt:external-file-loader@0.1.4 -brentjanderson:winston-client@0.0.4 -duongthienduc:meteor-winston mizzao:timesync clinical:nightwatch cfs:power-queue diff --git a/bigbluebutton-html5/.meteor/versions b/bigbluebutton-html5/.meteor/versions index 18e161c9b0..59584b0e14 100644 --- a/bigbluebutton-html5/.meteor/versions +++ b/bigbluebutton-html5/.meteor/versions @@ -1,3 +1,4 @@ +4commerce:env-settings@1.2.0 aldeed:simple-schema@1.3.3 allow-deny@1.0.4 amplify@1.0.0 @@ -10,7 +11,6 @@ binary-heap@1.0.8 blaze@2.1.7 blaze-tools@1.0.8 boilerplate-generator@1.0.8 -brentjanderson:winston-client@0.2.1 caching-compiler@1.0.4 caching-html-compiler@1.0.6 callback-hook@1.0.8 @@ -28,7 +28,6 @@ ddp-common@1.2.5 ddp-server@1.2.6 deps@1.0.12 diff-sequence@1.0.5 -duongthienduc:meteor-winston@1.0.0 ecmascript@0.4.3 ecmascript-runtime@0.2.10 ejson@1.0.11 @@ -39,13 +38,13 @@ html-tools@1.0.9 htmljs@1.0.9 http@1.1.5 id-map@1.0.7 -infinitedg:winston@0.7.3 jquery@1.11.8 launch-screen@1.0.11 livedata@1.0.18 logging@1.0.12 meteor@1.1.14 meteor-platform@1.2.6 +meteorblackbelt:underscore-deep@0.0.4 meteorspark:util@0.2.0 minifier-css@1.1.11 minifier-js@1.1.11 @@ -84,6 +83,7 @@ templating@1.1.9 templating-tools@1.0.4 tmeasday:check-npm-versions@0.2.0 tracker@1.0.13 +udondan:yml@3.2.2_1 ui@1.0.11 underscore@1.0.8 url@1.0.9 diff --git a/bigbluebutton-html5/config.js b/bigbluebutton-html5/config.js deleted file mode 100755 index 78a422057a..0000000000 --- a/bigbluebutton-html5/config.js +++ /dev/null @@ -1,84 +0,0 @@ -// TODO: should be split on server and client side -// // Global configurations file - -let clientConfig = {}; - -// Default global variables - -clientConfig.appName = 'BigBlueButton HTML5 Client'; - -clientConfig.bbbServerVersion = '1.0-beta'; - -clientConfig.copyrightYear = '2015'; - -clientConfig.html5ClientBuild = 'NNNN'; - -clientConfig.defaultWelcomeMessage = - 'Welcome to %%CONFNAME%%!\r\rFor help on using BigBlueButton see ' + - 'these (short) tutorial ' + - 'videos.\r\rTo join the audio bridge click the gear icon (upper-right hand corner). ' + - ' Use a headset to avoid causing background noise for others.\r\r\r'; - -const tempString = 'This server is running a build of ' + - "BigBlueButton"; -clientConfig.defaultWelcomeMessageFooter = `${tempString} ` + - `${clientConfig.bbbServerVersion}.`; - -clientConfig.maxUsernameLength = 30; - -clientConfig.maxChatLength = 140; - -clientConfig.lockOnJoin = true; - -//// Application configurations - -clientConfig.app = {}; - -//default font sizes for mobile / desktop - -clientConfig.app.mobileFont = 16; - -clientConfig.app.desktopFont = 14; - -// Will offer the user to join the audio when entering the meeting - -clientConfig.app.autoJoinAudio = false; - -clientConfig.app.listenOnly = false; - -clientConfig.app.skipCheck = false; - -// Flag for HTTPS. True by default -clientConfig.app.httpsConnection = true; - -// The amount of time the client will wait before making another call to -// successfully hangup the WebRTC conference call - -clientConfig.media = {}; - -clientConfig.media.WebRTCHangupRetryInterval = 2000; - -// specifies whether to use SIP.js for audio over mod_verto -clientConfig.media.useSIPAudio = true; - -// Configs for redis -const redisConfig = { - host: '127.0.0.1', - post: '6379', - timeout: 5000, - channels: { - fromBBBApps: 'bigbluebutton:from-bbb-apps:*', - toBBBApps: { - pattern: 'bigbluebutton:to-bbb-apps:*', - chat: 'bigbluebutton:to-bbb-apps:chat', - meeting: 'bigbluebutton:to-bbb-apps:meeting', - presentation: 'bigbluebutton:to-bbb-apps:presentation', - users: 'bigbluebutton:to-bbb-apps:users', - voice: 'bigbluebutton:to-bbb-apps:voice', - whiteboard: 'bigbluebutton:to-bbb-apps:whiteboard', - polling: 'bigbluebutton:to-bbb-apps:polling', - }, - }, -}; - -export { clientConfig, redisConfig }; diff --git a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeetingToCollection.js b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeetingToCollection.js index be0b080f1b..abec81deca 100755 --- a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeetingToCollection.js +++ b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeetingToCollection.js @@ -5,6 +5,7 @@ import { logger } from '/imports/startup/server/logger'; export function addMeetingToCollection(meetingId, name, intendedForRecording, voiceConf, duration, callback) { const APP_CONFIG = Meteor.settings.public.app; + //check if the meeting is already in the collection Meetings.upsert({ meetingId: meetingId, diff --git a/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js b/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js index 6247359c72..5c8ef98ba0 100755 --- a/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js +++ b/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js @@ -15,38 +15,38 @@ export function addSlideToCollection(meetingId, presentationId, slideObject) { let addSlideHelper = function (response) { let contentType = response.headers['content-type']; - if (contentType.match(/svg/gi) || contentType.match(/png/gi)) { - let chunks = []; - response.on('data', Meteor.bindEnvironment(function (chunk) { - chunks.push(chunk); - })).on('end', Meteor.bindEnvironment(function () { - let buffer = Buffer.concat(chunks); - const dimensions = sizeOf(buffer); - const entry = { - meetingId: meetingId, - presentationId: presentationId, - slide: { - height_ratio: slideObject.height_ratio, - y_offset: slideObject.y_offset, - num: slideObject.num, - x_offset: slideObject.x_offset, - current: slideObject.current, - img_uri: slideObject.svg_uri != null ? slideObject.svg_uri : slideObject.png_uri, - txt_uri: slideObject.txt_uri, - id: slideObject.id, - width_ratio: slideObject.width_ratio, - swf_uri: slideObject.swf_uri, - thumb_uri: slideObject.thumb_uri, - width: dimensions.width, - height: dimensions.height, - }, - }; - Slides.insert(entry); - })); - } else { - console.log(`Slide file is not accessible or not ready yet`); - console.log(`response content-type`, response.headers['content-type']); - } + if (contentType.match(/svg/gi) || contentType.match(/png/gi)) { + let chunks = []; + response.on('data', Meteor.bindEnvironment(function (chunk) { + chunks.push(chunk); + })).on('end', Meteor.bindEnvironment(function () { + let buffer = Buffer.concat(chunks); + const dimensions = sizeOf(buffer); + const entry = { + meetingId: meetingId, + presentationId: presentationId, + slide: { + height_ratio: slideObject.height_ratio, + y_offset: slideObject.y_offset, + num: slideObject.num, + x_offset: slideObject.x_offset, + current: slideObject.current, + img_uri: slideObject.svg_uri != null ? slideObject.svg_uri : slideObject.png_uri, + txt_uri: slideObject.txt_uri, + id: slideObject.id, + width_ratio: slideObject.width_ratio, + swf_uri: slideObject.swf_uri, + thumb_uri: slideObject.thumb_uri, + width: dimensions.width, + height: dimensions.height, + }, + }; + Slides.insert(entry); + })); + } else { + console.log(`Slide file is not accessible or not ready yet`); + console.log(`response content-type`, response.headers['content-type']); + } }; // HTTPS connection diff --git a/bigbluebutton-html5/imports/startup/server/RedisPubSub.js b/bigbluebutton-html5/imports/startup/server/RedisPubSub.js index d666963f4f..f4d9fee70f 100755 --- a/bigbluebutton-html5/imports/startup/server/RedisPubSub.js +++ b/bigbluebutton-html5/imports/startup/server/RedisPubSub.js @@ -43,7 +43,7 @@ export class RedisPubSub { // For DEVELOPMENT purposes only // Dynamic shapes' updates will slow down significantly - if (Meteor.settings.public.runtime.env == 'development') { + if (Meteor.settings.runtime.env == 'development') { logger.info(`Q ${eventName} ${myQueue.total()}`); } diff --git a/bigbluebutton-html5/imports/startup/server/index.js b/bigbluebutton-html5/imports/startup/server/index.js index 553ad06e3e..9cfb714219 100755 --- a/bigbluebutton-html5/imports/startup/server/index.js +++ b/bigbluebutton-html5/imports/startup/server/index.js @@ -10,13 +10,15 @@ Meteor.startup(function () { clearCollections(); const APP_CONFIG = Meteor.settings.public.app; - let determineConnectionType = function() { + let determineConnectionType = function () { let baseConnection = 'HTTP'; - if(APP_CONFIG.httpsConnection){ + if (APP_CONFIG.httpsConnection) { baseConnection += ('S'); } + return baseConnection; }; + logger.info(`server start. Connection type:${determineConnectionType()}`); }); diff --git a/bigbluebutton-html5/imports/startup/server/logger.js b/bigbluebutton-html5/imports/startup/server/logger.js old mode 100644 new mode 100755 index cdb5da4e85..749ada3829 --- a/bigbluebutton-html5/imports/startup/server/logger.js +++ b/bigbluebutton-html5/imports/startup/server/logger.js @@ -1,15 +1,37 @@ -// Setting up a logger -const log = {}; -if (process != null && process.env != null && process.env.NODE_ENV == 'production') { - log.path = '/var/log/bigbluebutton/html5/html5client.log'; -} else { - log.path = `${process.env.PWD}/log/development.log`; -} +import { Meteor } from 'meteor/meteor'; +import Winston from 'winston'; -export let logger = new Winston.Logger({ - transports: [ - new Winston.transports.Console(), new Winston.transports.File({ - filename: log.path, - }), - ], +let Logger = new Winston.Logger(); + +Meteor.startup(() => { + const LOG_CONFIG = Meteor.settings.log || {}; + + // Determine file to write logs to + if (LOG_CONFIG.filename) { + let filename = LOG_CONFIG.filename; + + if (Meteor.settings.runtime.env == 'production') { + Logger.add(Winston.transports.File, + { filename: LOG_CONFIG.filename, + prettyPrint: true, + }); + } else { + Logger.add(Winston.transports.File, + { filename: `${process.env.PWD}/` + LOG_CONFIG.filename, + prettyPrint: true, + }); + } + } + + // Write logs to console + Logger.add(Winston.transports.Console, + { prettyPrint: true, + humanReadableUnhandledException: true, + colorize: true, + } + ); }); + +export default Logger; + +export let logger = Logger; diff --git a/bigbluebutton-html5/package.json b/bigbluebutton-html5/package.json old mode 100755 new mode 100644 index ee618a5b02..2db58b0cc2 --- a/bigbluebutton-html5/package.json +++ b/bigbluebutton-html5/package.json @@ -22,7 +22,8 @@ "react-intl": "~2.1.3", "react-modal": "~1.4.0", "react-router": "~2.5.2", - "underscore": "~1.8.3" + "underscore": "~1.8.3", + "winston": "^2.2.0" }, "devDependencies": { "autoprefixer": "^6.3.6", From ce50f58c364d9218feecc48ba2f3e3c2d90301d8 Mon Sep 17 00:00:00 2001 From: Laily Ajellu Date: Tue, 23 Aug 2016 07:35:06 -0700 Subject: [PATCH 3/6] HTML5 - removes old settings and changes setting dependant files --- bigbluebutton-html5/.gitignore | 4 +++- bigbluebutton-html5/Gruntfile.js | 23 ++++++++----------- .../user-list/chat-list-item/component.jsx | 2 +- .../config/production/server/shell.yaml | 2 ++ .../private/config/public/chat.yaml | 2 +- .../private/config/server/redis.yaml | 15 ++++++++++++ .../private/config/server/shell.yaml | 2 ++ bigbluebutton-html5/settings-development.json | 3 --- bigbluebutton-html5/settings-production.json | 4 ---- 9 files changed, 34 insertions(+), 23 deletions(-) create mode 100755 bigbluebutton-html5/private/config/production/server/shell.yaml create mode 100755 bigbluebutton-html5/private/config/server/redis.yaml create mode 100755 bigbluebutton-html5/private/config/server/shell.yaml delete mode 100755 bigbluebutton-html5/settings-development.json delete mode 100755 bigbluebutton-html5/settings-production.json diff --git a/bigbluebutton-html5/.gitignore b/bigbluebutton-html5/.gitignore index e2c17b5d3e..9ba5df4a0d 100755 --- a/bigbluebutton-html5/.gitignore +++ b/bigbluebutton-html5/.gitignore @@ -3,4 +3,6 @@ app/build/ npm-debug.log node_modules/ .meteor/dev_bundle -private/config/server +private/config/server/* +!private/config/server/redis.yaml +!private/config/server/shell.yaml diff --git a/bigbluebutton-html5/Gruntfile.js b/bigbluebutton-html5/Gruntfile.js index 704fce9830..845e83002c 100755 --- a/bigbluebutton-html5/Gruntfile.js +++ b/bigbluebutton-html5/Gruntfile.js @@ -6,26 +6,23 @@ module.exports = function (grunt) { require('load-grunt-tasks')(grunt); // importing the Meteor settings: - var SETTINGS_DEV = require('./settings-development.json'); - var SETTINGS_PROD = require('./settings-production.json'); + var SHELL_CONFIG = require('./private/config/server/shell.yaml'); + var PROD_SHELL_CONFIG = require('./private/config/production/server/shell.yaml'); // root URL in development/production: - var devRootURL = (SETTINGS_DEV.rootURL == undefined) + var rootURL = (SHELL_CONFIG.rootURL == undefined) ? 'http://127.0.0.1/html5client' - : SETTINGS_DEV.rootURL; - var prodRootURL = (SETTINGS_PROD.rootURL == undefined) - ? 'http://127.0.0.1/html5client' - : SETTINGS_PROD.rootURL; + : SHELL_CONFIG.rootURL; - // command line string containing the Meteor's home directory in development/production: - var devHomeStr = (SETTINGS_DEV.home == undefined) ? '' : ('HOME=' + SETTINGS_DEV.home + ' '); - var prodHomeStr = (SETTINGS_PROD.home == undefined) ? '' : ('HOME=' + SETTINGS_PROD.home + ' '); + // command line string containing the Meteor's home directory in production: + var prodHomeStr = + (PROD_SHELL_CONFIG.home == undefined) ? '' : ('HOME=' + SETTINGS_PROD.home + ' '); // final commands: - var METEOR_DEV_COMMAND = devHomeStr + 'ROOT_URL=' + - devRootURL + ' meteor --settings settings-development.json'; + var METEOR_DEV_COMMAND = 'ROOT_URL=' + + rootURL + ' NODE_ENV=development' + ' meteor'; var METEOR_PROD_COMMAND = prodHomeStr + 'ROOT_URL=' + - prodRootURL + ' meteor --settings settings-production.json'; + rootURL + ' NODE_ENV=production' + ' meteor'; // configure Grunt grunt.initConfig({ diff --git a/bigbluebutton-html5/imports/ui/components/user-list/chat-list-item/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/chat-list-item/component.jsx index 41dbf9ded0..231bd54882 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/chat-list-item/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/chat-list-item/component.jsx @@ -7,7 +7,7 @@ import { Link } from 'react-router'; import cx from 'classnames'; const CHAT_CONFIG = Meteor.settings.public.chat; -const PRIVATE_CHAT_PATH = CHAT_CONFIG.private_path; +const PRIVATE_CHAT_PATH = CHAT_CONFIG.path_route; const propTypes = { chat: React.PropTypes.shape({ diff --git a/bigbluebutton-html5/private/config/production/server/shell.yaml b/bigbluebutton-html5/private/config/production/server/shell.yaml new file mode 100755 index 0000000000..87c8d32962 --- /dev/null +++ b/bigbluebutton-html5/private/config/production/server/shell.yaml @@ -0,0 +1,2 @@ +shell: + home: "/usr/share/meteor" diff --git a/bigbluebutton-html5/private/config/public/chat.yaml b/bigbluebutton-html5/private/config/public/chat.yaml index 98165f3c67..2ae01424b0 100755 --- a/bigbluebutton-html5/private/config/public/chat.yaml +++ b/bigbluebutton-html5/private/config/public/chat.yaml @@ -12,4 +12,4 @@ chat: # Keys storage_key: 'UNREAD_CHATS' # Chat paths - private_path: 'users/chat/' # TODO: change private_path to path_route + path_route: 'users/chat/' diff --git a/bigbluebutton-html5/private/config/server/redis.yaml b/bigbluebutton-html5/private/config/server/redis.yaml new file mode 100755 index 0000000000..cc49d11d41 --- /dev/null +++ b/bigbluebutton-html5/private/config/server/redis.yaml @@ -0,0 +1,15 @@ +redis: + host: '127.0.0.1' + post: '6379' + timeout: 5000 + channels: + fromBBBApps: 'bigbluebutton:from-bbb-apps:*' + toBBBApps: + pattern: 'bigbluebutton:to-bbb-apps:*' + chat: 'bigbluebutton:to-bbb-apps:chat' + meeting: 'bigbluebutton:to-bbb-apps:meeting' + presentation: 'bigbluebutton:to-bbb-apps:presentation' + users: 'bigbluebutton:to-bbb-apps:users' + voice: 'bigbluebutton:to-bbb-apps:voice' + whiteboard: 'bigbluebutton:to-bbb-apps:whiteboard' + polling: 'bigbluebutton:to-bbb-apps:polling' diff --git a/bigbluebutton-html5/private/config/server/shell.yaml b/bigbluebutton-html5/private/config/server/shell.yaml new file mode 100755 index 0000000000..0e33d00a8f --- /dev/null +++ b/bigbluebutton-html5/private/config/server/shell.yaml @@ -0,0 +1,2 @@ +shell: + rootURL: "http://127.0.0.1/html5client" diff --git a/bigbluebutton-html5/settings-development.json b/bigbluebutton-html5/settings-development.json deleted file mode 100755 index e665f1b73b..0000000000 --- a/bigbluebutton-html5/settings-development.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "rootURL": "http://127.0.0.1/html5client" -} diff --git a/bigbluebutton-html5/settings-production.json b/bigbluebutton-html5/settings-production.json deleted file mode 100755 index a5369609fd..0000000000 --- a/bigbluebutton-html5/settings-production.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "rootURL": "http://127.0.0.1/html5client", - "home": "/usr/share/meteor" -} From 2105e911ef82756b05150888970f04431c44b914 Mon Sep 17 00:00:00 2001 From: Laily Ajellu Date: Tue, 23 Aug 2016 14:35:28 -0700 Subject: [PATCH 4/6] HTML5 - Adds more yaml, adds correct properties to objects in Gruntfile, cleans up logger.js --- bigbluebutton-html5/.gitignore | 8 ++++ bigbluebutton-html5/.meteor/packages | 2 +- bigbluebutton-html5/Gruntfile.js | 8 ++-- .../imports/startup/server/logger.js | 38 +++++++++---------- .../config/development/server/log.yaml | 2 + .../private/config/production/server/log.yaml | 2 + 6 files changed, 34 insertions(+), 26 deletions(-) mode change 100644 => 100755 bigbluebutton-html5/.meteor/packages create mode 100755 bigbluebutton-html5/private/config/development/server/log.yaml create mode 100755 bigbluebutton-html5/private/config/production/server/log.yaml diff --git a/bigbluebutton-html5/.gitignore b/bigbluebutton-html5/.gitignore index 9ba5df4a0d..2df8a85420 100755 --- a/bigbluebutton-html5/.gitignore +++ b/bigbluebutton-html5/.gitignore @@ -3,6 +3,14 @@ app/build/ npm-debug.log node_modules/ .meteor/dev_bundle + private/config/server/* !private/config/server/redis.yaml !private/config/server/shell.yaml + +private/config/development/server/* +!private/config/development/server/log.yaml + +private/config/production/server/* +!private/config/production/server/log.yaml +!private/config/production/server/shell.yaml diff --git a/bigbluebutton-html5/.meteor/packages b/bigbluebutton-html5/.meteor/packages old mode 100644 new mode 100755 index 940ab27ec9..a12ac4fcb1 --- a/bigbluebutton-html5/.meteor/packages +++ b/bigbluebutton-html5/.meteor/packages @@ -1,5 +1,5 @@ # Meteor packages used by this project, one per line. -#I +# # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. diff --git a/bigbluebutton-html5/Gruntfile.js b/bigbluebutton-html5/Gruntfile.js index 845e83002c..96d8012b1b 100755 --- a/bigbluebutton-html5/Gruntfile.js +++ b/bigbluebutton-html5/Gruntfile.js @@ -10,13 +10,13 @@ module.exports = function (grunt) { var PROD_SHELL_CONFIG = require('./private/config/production/server/shell.yaml'); // root URL in development/production: - var rootURL = (SHELL_CONFIG.rootURL == undefined) + var rootURL = (SHELL_CONFIG.shell.rootURL == undefined) ? 'http://127.0.0.1/html5client' - : SHELL_CONFIG.rootURL; + : SHELL_CONFIG.shell.rootURL; // command line string containing the Meteor's home directory in production: - var prodHomeStr = - (PROD_SHELL_CONFIG.home == undefined) ? '' : ('HOME=' + SETTINGS_PROD.home + ' '); + var prodHomeStr = (PROD_SHELL_CONFIG.shell.home == undefined) ? '' + : ('HOME=' + PROD_SHELL_CONFIG.shell.home + ' '); // final commands: var METEOR_DEV_COMMAND = 'ROOT_URL=' + diff --git a/bigbluebutton-html5/imports/startup/server/logger.js b/bigbluebutton-html5/imports/startup/server/logger.js index 749ada3829..45ffc85109 100755 --- a/bigbluebutton-html5/imports/startup/server/logger.js +++ b/bigbluebutton-html5/imports/startup/server/logger.js @@ -3,33 +3,29 @@ import Winston from 'winston'; let Logger = new Winston.Logger(); +// Write logs to console +Logger.add(Winston.transports.Console, { + prettyPrint: true, + humanReadableUnhandledException: true, + colorize: true, +}); + Meteor.startup(() => { const LOG_CONFIG = Meteor.settings.log || {}; + let filename = LOG_CONFIG.filename; // Determine file to write logs to - if (LOG_CONFIG.filename) { - let filename = LOG_CONFIG.filename; - - if (Meteor.settings.runtime.env == 'production') { - Logger.add(Winston.transports.File, - { filename: LOG_CONFIG.filename, - prettyPrint: true, - }); - } else { - Logger.add(Winston.transports.File, - { filename: `${process.env.PWD}/` + LOG_CONFIG.filename, - prettyPrint: true, - }); + if (filename) { + if (Meteor.settings.runtime.env === 'development') { + const path = Npm.require('path'); + filename = path.join(process.env.PWD, filename); } + + Logger.add(Winston.transports.File, { + filename: filename, + prettyPrint: true, + }); } - - // Write logs to console - Logger.add(Winston.transports.Console, - { prettyPrint: true, - humanReadableUnhandledException: true, - colorize: true, - } - ); }); export default Logger; diff --git a/bigbluebutton-html5/private/config/development/server/log.yaml b/bigbluebutton-html5/private/config/development/server/log.yaml new file mode 100755 index 0000000000..df4be33c80 --- /dev/null +++ b/bigbluebutton-html5/private/config/development/server/log.yaml @@ -0,0 +1,2 @@ +log: + filename: '/log/development.log' diff --git a/bigbluebutton-html5/private/config/production/server/log.yaml b/bigbluebutton-html5/private/config/production/server/log.yaml new file mode 100755 index 0000000000..03860722aa --- /dev/null +++ b/bigbluebutton-html5/private/config/production/server/log.yaml @@ -0,0 +1,2 @@ +log: + filename: '/var/log/bigbluebutton/html5/html5client.log' From 361ce7f19ff34abe9d3c18bc538cea32b87106d0 Mon Sep 17 00:00:00 2001 From: Laily Ajellu Date: Tue, 23 Aug 2016 16:48:11 -0700 Subject: [PATCH 5/6] HTML5 - adds captions to config file --- bigbluebutton-html5/private/config/server/redis.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/bigbluebutton-html5/private/config/server/redis.yaml b/bigbluebutton-html5/private/config/server/redis.yaml index cc49d11d41..83b198d9d2 100755 --- a/bigbluebutton-html5/private/config/server/redis.yaml +++ b/bigbluebutton-html5/private/config/server/redis.yaml @@ -7,6 +7,7 @@ redis: toBBBApps: pattern: 'bigbluebutton:to-bbb-apps:*' chat: 'bigbluebutton:to-bbb-apps:chat' + captions: 'bigbluebutton:to-bbb-apps:caption' meeting: 'bigbluebutton:to-bbb-apps:meeting' presentation: 'bigbluebutton:to-bbb-apps:presentation' users: 'bigbluebutton:to-bbb-apps:users' From 401a5294504effc0214fa52e072ae2e2e5f74f42 Mon Sep 17 00:00:00 2001 From: Laily Ajellu Date: Wed, 24 Aug 2016 07:23:50 -0700 Subject: [PATCH 6/6] HTML5 - removes config.js and removes a package not needed anymore from .meteor/packages --- bigbluebutton-html5/.meteor/packages | 1 - bigbluebutton-html5/config.js | 85 ---------------------------- 2 files changed, 86 deletions(-) delete mode 100755 bigbluebutton-html5/config.js diff --git a/bigbluebutton-html5/.meteor/packages b/bigbluebutton-html5/.meteor/packages index 8d65cbef09..a31f5196f4 100755 --- a/bigbluebutton-html5/.meteor/packages +++ b/bigbluebutton-html5/.meteor/packages @@ -4,7 +4,6 @@ # but you can also edit it by hand. 4commerce:env-settings -mrt:redis@0.1.3 standard-app-packages@1.0.9 arunoda:npm@0.2.6 amplify diff --git a/bigbluebutton-html5/config.js b/bigbluebutton-html5/config.js deleted file mode 100755 index 2c3b512295..0000000000 --- a/bigbluebutton-html5/config.js +++ /dev/null @@ -1,85 +0,0 @@ -// TODO: should be split on server and client side -// // Global configurations file - -let clientConfig = {}; - -// Default global variables - -clientConfig.appName = 'BigBlueButton HTML5 Client'; - -clientConfig.bbbServerVersion = '1.0-beta'; - -clientConfig.copyrightYear = '2015'; - -clientConfig.html5ClientBuild = 'NNNN'; - -clientConfig.defaultWelcomeMessage = - 'Welcome to %%CONFNAME%%!\r\rFor help on using BigBlueButton see ' + - 'these (short) tutorial ' + - 'videos.\r\rTo join the audio bridge click the gear icon (upper-right hand corner). ' + - ' Use a headset to avoid causing background noise for others.\r\r\r'; - -const tempString = 'This server is running a build of ' + - "BigBlueButton"; -clientConfig.defaultWelcomeMessageFooter = `${tempString} ` + - `${clientConfig.bbbServerVersion}.`; - -clientConfig.maxUsernameLength = 30; - -clientConfig.maxChatLength = 140; - -clientConfig.lockOnJoin = true; - -//// Application configurations - -clientConfig.app = {}; - -//default font sizes for mobile / desktop - -clientConfig.app.mobileFont = 16; - -clientConfig.app.desktopFont = 14; - -// Will offer the user to join the audio when entering the meeting - -clientConfig.app.autoJoinAudio = false; - -clientConfig.app.listenOnly = false; - -clientConfig.app.skipCheck = false; - -// Flag for HTTPS. True by default -clientConfig.app.httpsConnection = true; - -// The amount of time the client will wait before making another call to -// successfully hangup the WebRTC conference call - -clientConfig.media = {}; - -clientConfig.media.WebRTCHangupRetryInterval = 2000; - -// specifies whether to use SIP.js for audio over mod_verto -clientConfig.media.useSIPAudio = true; - -// Configs for redis -const redisConfig = { - host: '127.0.0.1', - post: '6379', - timeout: 5000, - channels: { - fromBBBApps: 'bigbluebutton:from-bbb-apps:*', - toBBBApps: { - pattern: 'bigbluebutton:to-bbb-apps:*', - chat: 'bigbluebutton:to-bbb-apps:chat', - captions: 'bigbluebutton:to-bbb-apps:caption', - meeting: 'bigbluebutton:to-bbb-apps:meeting', - presentation: 'bigbluebutton:to-bbb-apps:presentation', - users: 'bigbluebutton:to-bbb-apps:users', - voice: 'bigbluebutton:to-bbb-apps:voice', - whiteboard: 'bigbluebutton:to-bbb-apps:whiteboard', - polling: 'bigbluebutton:to-bbb-apps:polling', - }, - }, -}; - -export { clientConfig, redisConfig };