From 2deb1a867e572592e0691084d5c92357f85c8cce Mon Sep 17 00:00:00 2001 From: Ben West Date: Fri, 31 Oct 2014 10:43:33 -0700 Subject: [PATCH 1/5] detect deployed git HEAD in azure When deployed on MS azure, the available git commit used to deploy the software is available in the SCM_COMMIT_ID environment variable. We encourage all hosting providers to provide some similar facility to avoid spawning spurious processes. Thanks to @shanselman for reminders and pointers to the fix. --- env.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/env.js b/env.js index 19a69f89789..8b3061b9554 100644 --- a/env.js +++ b/env.js @@ -23,10 +23,14 @@ function config ( ) { if (readENV('SCM_GIT_EMAIL') == 'windowsazure' && readENV('ScmType') == 'GitHub') { git.cwd('/home/site/repository'); } - git.short(function record_git_head (head) { - console.log("GIT HEAD", head); - env.head = head; - }); + if (readENV('SCM_COMMIT_ID')) { + env.head = readENV('SCM_COMMIT_ID'); + } else { + git.short(function record_git_head (head) { + console.log("GIT HEAD", head); + env.head = head; + }); + } env.version = software.version; env.name = software.name; From 2acba2aa3364bba1b59eb926c47e48df52e7fc86 Mon Sep 17 00:00:00 2001 From: Scott Hanselman Date: Fri, 31 Oct 2014 11:46:31 -0700 Subject: [PATCH 2/5] Forcing SSL for Azure Forcing SSL for Azure Node Debugging Support for Azure Correct Git Attributes Node web.config for Azure, and removed it from gitignore --- .gitattributes | 14 +++++++++++++ .gitignore | 3 +-- web.config | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 .gitattributes create mode 100644 web.config diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..c6439c8d70e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,14 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 2b70a086095..62cdda04fa1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,4 @@ static/bower_components/ .DS_Store .vagrant -/iisnode -/web.config \ No newline at end of file +/iisnode \ No newline at end of file diff --git a/web.config b/web.config new file mode 100644 index 00000000000..bcd8b00cbba --- /dev/null +++ b/web.config @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 0b53c07956a4aeacbf420a969b60893a23934f4a Mon Sep 17 00:00:00 2001 From: Scott Hanselman Date: Fri, 31 Oct 2014 12:58:14 -0700 Subject: [PATCH 3/5] Enabling Websockets! Enabling Websockets if they are on. Need to confirm if they need to be turned on manually. --- lib/websocket.js | 4 ++-- web.config | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/websocket.js b/lib/websocket.js index 97c132ee0a1..603b8d46ebd 100644 --- a/lib/websocket.js +++ b/lib/websocket.js @@ -54,9 +54,9 @@ var dir2Char = { // reduce logging io.set('log level', 0); - //Windows Azure Web Sites does not currently support WebSockets, so use long-polling + //Try for Websockets (Azure Supports if it's on) then fallback io.configure(function () { - io.set('transports', ['xhr-polling']); + io.set('transports', ['websocket','xhr-polling']); }); } diff --git a/web.config b/web.config index bcd8b00cbba..03403d3f04d 100644 --- a/web.config +++ b/web.config @@ -1,7 +1,8 @@ - + + handlers> From 5f3425053dafbdee2dfa11f5cd525fe28f4a1989 Mon Sep 17 00:00:00 2001 From: Scott Hanselman Date: Fri, 31 Oct 2014 13:02:35 -0700 Subject: [PATCH 4/5] Typo --- web.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web.config b/web.config index 03403d3f04d..ba9967ed0ea 100644 --- a/web.config +++ b/web.config @@ -2,7 +2,7 @@ - handlers> + From db947fe902b3cc251bb7f49cb5de6dd314090ab1 Mon Sep 17 00:00:00 2001 From: Scott Hanselman Date: Fri, 31 Oct 2014 15:32:39 -0700 Subject: [PATCH 5/5] Enabling node websockets Counter-intuitively this needs to be FALSE so IIS can let go of websockets and node can take over. --- web.config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web.config b/web.config index ba9967ed0ea..6b7f5e92f66 100644 --- a/web.config +++ b/web.config @@ -1,7 +1,8 @@ - + +