nginx config, avoid :3000

This commit is contained in:
Anton Georgiev 2015-03-02 16:46:14 +00:00
parent ea590bbdb9
commit 146e6552e5
3 changed files with 37 additions and 28 deletions

View File

@ -18,7 +18,7 @@ config.maxChatLength = 140
config.app = {}
# server ip
config.app.logOutUrl = "http://192.168.0.119/demo/demoHTML5.jsp" # TODO temporary
config.app.logOutUrl = "http://23.253.43.151/demo/demoHTML5.jsp" # TODO temporary
# Configs for redis
config.redis = {}
@ -54,3 +54,15 @@ if Meteor.isServer
transports: transports
Meteor.config = config
# NGINX configuration:
#file: /etc/bigbluebutton/nginx/html5client.nginx
#location /html5client {
# root /var/www/bigbluebutton;
# proxy_pass http://23.253.43.151:3000;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "Upgrade";
#}

View File

@ -1,31 +1,15 @@
@Router.configure layoutTemplate: 'layout'
@Router.map ->
@route "login",
path: "/login"
action: ->
@route "main",
path: "/html5client"
onBeforeAction: ->
meetingId = @params.query.meeting_id
userId = @params.query.user_id
authToken = @params.query.auth_token
if meetingId? and userId? and authToken?
Meteor.call("validateAuthToken", meetingId, userId, authToken)
applyNewSessionVars = ->
setInSession("authToken", authToken)
setInSession("meetingId", meetingId)
setInSession("userId", userId)
Router.go('/')
clearSessionVar(applyNewSessionVars)
@route "main",
path: "/"
onBeforeAction: ->
authToken = getInSession 'authToken'
meetingId = getInSession 'meetingId'
userId = getInSession 'userId'
# catch if any of the user's meeting data is invalid
if not authToken? or not meetingId? or not userId?
# if their data is invalid, redirect the user to the logout url
@ -33,12 +17,24 @@
# to the login page
document.location = Meteor.config.app.logOutUrl
else
Meteor.call("validateAuthToken", meetingId, userId, authToken)
applyNewSessionVars = ->
setInSession("authToken", authToken)
setInSession("meetingId", meetingId)
setInSession("userId", userId)
clearSessionVar(applyNewSessionVars)
onErrorFunction = (error, result) ->
if error
# Was unable to authorize the user. Redirect to the home page
# alert error.reason
clearSessionVar alert "Please sign in again"
document.location = Meteor.config.app.logOutUrl
console.log "ONERRORFUNCTION"
#if error
# # Was unable to authorize the user. Redirect to the home page
# # alert error.reason
# clearSessionVar alert "Please sign in again"
# document.location = Meteor.config.app.logOutUrl
return
Meteor.subscribe 'chat', meetingId, userId, authToken, onError: onErrorFunction, onReady: =>

View File

@ -1,4 +1,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 meteor
JASMINE_SERVER_UNIT=0 JASMINE_SERVER_INTEGRATION=0 JASMINE_CLIENT_INTEGRATION=0 JASMINE_BROWSER=PhantomJS JASMINE_MIRROR_PORT=3000 ROOT_URL=http://23.253.43.151/html5client meteor
# ROOT_URL_PATH_PREFIX=html5client meteor