From 2376352190a26c5815ba300adac82ced84b48235 Mon Sep 17 00:00:00 2001 From: Ben West Date: Mon, 16 Mar 2015 14:20:36 -0700 Subject: [PATCH 1/9] does compression interfere with socket.io? Test theory with @jimsiff. --- server.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.js b/server.js index e427926d6..8f23c86fe 100644 --- a/server.js +++ b/server.js @@ -72,6 +72,11 @@ app.use(compression({filter: shouldCompress})); function shouldCompress(req, res) { //TODO: return false here if we find a condition where we don't want to compress // fallback to standard filter function + var IGNORE = /^\/socket/; + if (IGNORE.test(req.url)) { + console.log('XXXX', 'IGNORE COMPRESSION', req.url, IGNORE.test(req.url)); + return false; + } return compression.filter(req, res); } From 8cebeb3f990af1ada04137f2cb842707e6e1fa9d Mon Sep 17 00:00:00 2001 From: Ben West Date: Mon, 16 Mar 2015 15:14:49 -0700 Subject: [PATCH 2/9] turn off double compression? Maybe help, testing with @jimsiff. --- lib/websocket.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/websocket.js b/lib/websocket.js index 161d239f8..159c85413 100644 --- a/lib/websocket.js +++ b/lib/websocket.js @@ -38,7 +38,7 @@ var dir2Char = { //these only effect the socket.io.js file that is sent to the client, but better than nothing 'browser client minification': true, 'browser client etag': true, - 'browser client gzip': true + 'browser client gzip': false }); } // get data from database and setup to update every minute From ad9ea58b83d7be03d1f0c4e4d4437d965bd56757 Mon Sep 17 00:00:00 2001 From: Ben West Date: Mon, 16 Mar 2015 15:53:21 -0700 Subject: [PATCH 3/9] try different approach for azure git scm commit id --- deploy.sh | 1 + env.js | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/deploy.sh b/deploy.sh index 4bc630de4..8e78ae6e5 100755 --- a/deploy.sh +++ b/deploy.sh @@ -113,6 +113,7 @@ selectNodeVersion if [ -e "$DEPLOYMENT_TARGET/package.json" ]; then cd "$DEPLOYMENT_TARGET" eval $NPM_CMD install --production + echo "\""$SCM_COMMIT_ID\"" > scm-commit-id.json exitWithMessageOnError "npm failed" cd - > /dev/null fi diff --git a/env.js b/env.js index c063c2274..7c9fccf34 100644 --- a/env.js +++ b/env.js @@ -22,10 +22,8 @@ function config ( ) { var git = require('git-rev'); if (readENV('SCM_GIT_EMAIL') == 'windowsazure' && readENV('ScmType') == 'GitHub') { - git.cwd('/home/site/repository'); - } - if (readENV('SCM_COMMIT_ID')) { - env.head = readENV('SCM_COMMIT_ID'); + env.head = require('./scm-commit-id.json'); + console.log("SCM COMMIT ID", env.head); } else { git.short(function record_git_head (head) { console.log("GIT HEAD", head); From 5d96424fa2b3b116c88f13924615d08e43b1955b Mon Sep 17 00:00:00 2001 From: Ben West Date: Mon, 16 Mar 2015 15:54:25 -0700 Subject: [PATCH 4/9] fix deploy syntax error --- deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 8e78ae6e5..fd4416e70 100755 --- a/deploy.sh +++ b/deploy.sh @@ -113,7 +113,7 @@ selectNodeVersion if [ -e "$DEPLOYMENT_TARGET/package.json" ]; then cd "$DEPLOYMENT_TARGET" eval $NPM_CMD install --production - echo "\""$SCM_COMMIT_ID\"" > scm-commit-id.json + echo "\"$SCM_COMMIT_ID\"" > scm-commit-id.json exitWithMessageOnError "npm failed" cd - > /dev/null fi From 5c66dc810a49c849996d415882cdd4dec1653a36 Mon Sep 17 00:00:00 2001 From: Ben West Date: Mon, 16 Mar 2015 16:08:43 -0700 Subject: [PATCH 5/9] try letting kudu move everything --- deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index fd4416e70..29fbdc49d 100755 --- a/deploy.sh +++ b/deploy.sh @@ -99,6 +99,7 @@ selectNodeVersion () { # ---------- echo Handling node.js deployment. +echo "\"$SCM_COMMIT_ID\"" > $DEPLOYMENT_SOURCE/scm-commit-id.json # 1. KuduSync if [[ "$IN_PLACE_DEPLOYMENT" -ne "1" ]]; then @@ -113,7 +114,6 @@ selectNodeVersion if [ -e "$DEPLOYMENT_TARGET/package.json" ]; then cd "$DEPLOYMENT_TARGET" eval $NPM_CMD install --production - echo "\"$SCM_COMMIT_ID\"" > scm-commit-id.json exitWithMessageOnError "npm failed" cd - > /dev/null fi From ba3dda95e989ed2352f26f728e36b2d961b8ef42 Mon Sep 17 00:00:00 2001 From: Ben West Date: Mon, 16 Mar 2015 16:13:23 -0700 Subject: [PATCH 6/9] fixing casing! --- env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env.js b/env.js index 7c9fccf34..8e34a7e76 100644 --- a/env.js +++ b/env.js @@ -21,7 +21,7 @@ function config ( ) { var software = require('./package.json'); var git = require('git-rev'); - if (readENV('SCM_GIT_EMAIL') == 'windowsazure' && readENV('ScmType') == 'GitHub') { + if (readENV('SCM_GIT_EMAIL') == 'windowsazure' && readENV('SCMTYPE') == 'GitHub') { env.head = require('./scm-commit-id.json'); console.log("SCM COMMIT ID", env.head); } else { From 47a0679b4095934dd752623e84e1452ad129966b Mon Sep 17 00:00:00 2001 From: Ben West Date: Mon, 16 Mar 2015 16:34:18 -0700 Subject: [PATCH 7/9] sniff for azure differently --- env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env.js b/env.js index 8e34a7e76..81e6ad219 100644 --- a/env.js +++ b/env.js @@ -21,7 +21,7 @@ function config ( ) { var software = require('./package.json'); var git = require('git-rev'); - if (readENV('SCM_GIT_EMAIL') == 'windowsazure' && readENV('SCMTYPE') == 'GitHub') { + if (readENV('APPSETTING_ScmType') == readENV('ScmType')) { env.head = require('./scm-commit-id.json'); console.log("SCM COMMIT ID", env.head); } else { From 4e17e8e9034541aefafc91ec396cf516d6cc27d6 Mon Sep 17 00:00:00 2001 From: Ben West Date: Mon, 16 Mar 2015 23:16:57 -0700 Subject: [PATCH 8/9] check for azure and check for value Make sure the environment variables are set to GitHub. This should help guard against false positives when sniffing whether or not we're in Azure. --- env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env.js b/env.js index 81e6ad219..2669dee95 100644 --- a/env.js +++ b/env.js @@ -21,7 +21,7 @@ function config ( ) { var software = require('./package.json'); var git = require('git-rev'); - if (readENV('APPSETTING_ScmType') == readENV('ScmType')) { + if (readENV('APPSETTING_ScmType') == readENV('ScmType') && readENV('ScmType') == 'GitHub') { env.head = require('./scm-commit-id.json'); console.log("SCM COMMIT ID", env.head); } else { From b38748aee25ed4cad6c777701fe3afa49d843ad6 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Tue, 17 Mar 2015 08:01:06 -0700 Subject: [PATCH 9/9] removed first attempt to disable compression for sockets since it didn't work --- server.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/server.js b/server.js index 8f23c86fe..e427926d6 100644 --- a/server.js +++ b/server.js @@ -72,11 +72,6 @@ app.use(compression({filter: shouldCompress})); function shouldCompress(req, res) { //TODO: return false here if we find a condition where we don't want to compress // fallback to standard filter function - var IGNORE = /^\/socket/; - if (IGNORE.test(req.url)) { - console.log('XXXX', 'IGNORE COMPRESSION', req.url, IGNORE.test(req.url)); - return false; - } return compression.filter(req, res); }