From a764910cbf96d62e822b4fbf034ee0e5178806ff Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Mon, 2 May 2011 18:17:28 -0600
Subject: [PATCH] in source urls are now all (interim == eyedee.me) live, the
 test harness subs in testing urls & hostnames

---
 authority/server/standalone.js         |  8 -------
 authority/static/.well-known/host-meta |  4 ++--
 authority/static/include.js            |  4 ++--
 primary/static/.well-known/host-meta   |  2 +-
 primary/static/include.js              |  2 +-
 primary/static/index.html              |  2 +-
 rp/index.html                          |  6 ++---
 run.js                                 | 32 +++++++++++++++++++-------
 8 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/authority/server/standalone.js b/authority/server/standalone.js
index fb1ba4249..f0f4efec6 100644
--- a/authority/server/standalone.js
+++ b/authority/server/standalone.js
@@ -11,14 +11,6 @@ var PRIMARY_PORT = 62700;
 var handler = require("./run.js");
 
 function subHostNames(data) {
-    const hostsubmap = {
-        "authority.mozilla.org": "eyedee.me"
-    };
-    for (var k in hostsubmap) {
-        var from = k;
-        var to = hostsubmap[k];
-        data = data.replace(new RegExp(from, 'g'), to);
-    }
     return data;
 }
 
diff --git a/authority/static/.well-known/host-meta b/authority/static/.well-known/host-meta
index f96a54897..1a2c6f388 100644
--- a/authority/static/.well-known/host-meta
+++ b/authority/static/.well-known/host-meta
@@ -3,9 +3,9 @@
 <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' 
      xmlns:hm='http://host-meta.net/xrd/1.0'>
 
-  <hm:Host xmlns='http://host-meta.net/xrd/1.0'>authority.mozilla.org</hm:Host>
+  <hm:Host xmlns='http://host-meta.net/xrd/1.0'>eyedee.me</hm:Host>
 
-  <Link rel='lrdd' template='http://authority.mozilla.org/users/{uri}.xml'></Link>
+  <Link rel='lrdd' template='https://eyedee.me/users/{uri}.xml'></Link>
 
   <Link rel='other' value='something-different'></Link>
 </XRD>
diff --git a/authority/static/include.js b/authority/static/include.js
index 7b51d9124..a89ffd852 100644
--- a/authority/static/include.js
+++ b/authority/static/include.js
@@ -550,7 +550,7 @@ if (!navigator.id.getVerifiedEmail || navigator.id._getVerifiedEmailIsShimmed)
   var chan = undefined;
 
   navigator.id.getVerifiedEmail = function(onsuccess, onerror) {
-    var ipServer = "http://authority.mozilla.org"
+    var ipServer = "https://eyedee.me"
     var w = window.open(
       ipServer + "/sign_in", "_mozid_signin",
       "menubar=0,location=0,resizable=0,scrollbars=0,status=0,dialog=1,width=600,height=400");
@@ -589,7 +589,7 @@ if (!navigator.id.getVerifiedEmail || navigator.id._getVerifiedEmailIsShimmed)
 
     var doc = window.document;
     iframe = document.createElement("iframe");
-    var ipServer = "http://authority.mozilla.org"
+    var ipServer = "https://eyedee.me"
     iframe.style.display = "none";
     doc.body.appendChild(iframe);
     iframe.src = ipServer + "/register_iframe";
diff --git a/primary/static/.well-known/host-meta b/primary/static/.well-known/host-meta
index ee6f0e171..9c2757bd5 100644
--- a/primary/static/.well-known/host-meta
+++ b/primary/static/.well-known/host-meta
@@ -3,7 +3,7 @@
 <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' 
      xmlns:hm='http://host-meta.net/xrd/1.0'>
 
-  <hm:Host xmlns='http://host-meta.net/xrd/1.0'>authority.mozilla.org</hm:Host>
+  <hm:Host xmlns='http://host-meta.net/xrd/1.0'>eyedee.me</hm:Host>
 
   <Link rel='lrdd' template='http://primary.mozilla.org/users/{uri}.xml'></Link>
 
diff --git a/primary/static/include.js b/primary/static/include.js
index d2847dfaf..5a12ee5ad 100644
--- a/primary/static/include.js
+++ b/primary/static/include.js
@@ -550,7 +550,7 @@ if (!navigator.id.getVerifiedEmail || navigator.id._getVerifiedEmailIsShimmed)
   var chan = undefined;
 
   navigator.id.getVerifiedEmail = function(onsuccess, onerror) {
-    var ipServer = "http://authority.mozilla.org"
+    var ipServer = "https://eyedee.me"
     var w = window.open(
       ipServer + "/sign_in", "_mozid_signin",
       "menubar=0,location=0,resizable=0,scrollbars=0,status=0,dialog=1,width=600,height=400");
diff --git a/primary/static/index.html b/primary/static/index.html
index dba8714b8..8926c7430 100644
--- a/primary/static/index.html
+++ b/primary/static/index.html
@@ -94,6 +94,6 @@
 </body>
 <!-- XXX: jquery shouldn't be used, it's too big.  we're using it now cause this is a proof of concept -->
 <script src="jquery-min.js"></script>
-<script src="http://authority.mozilla.org/include.js"></script>
+<script src="https://eyedee.me/include.js"></script>
 <script src="main.js"></script>
 </html>
diff --git a/rp/index.html b/rp/index.html
index 6d9bda4e5..fc9a139ed 100644
--- a/rp/index.html
+++ b/rp/index.html
@@ -79,7 +79,7 @@ a:hover { border-bottom: 2px solid black ; }
 
 </body>
 <script src="jquery-min.js"></script>
-<script src="http://authority.mozilla.org/include.js"></script>
+<script src="https://eyedee.me/include.js"></script>
 <script>
   function dumpObject(obj) {
     var htmlRep = "";
@@ -100,8 +100,8 @@ a:hover { border-bottom: 2px solid black ; }
         // Now we'll send this assertion over to the verification server for validation
         $("#oAssertion").empty().html(dumpObject(assertion));
 
-        var url = "http://verifier.mozilla.org/wsapi/verify?assertion=" + window.encodeURIComponent(assertion) +
-                  "&audience=" + window.encodeURIComponent("rp.mozilla.org");
+        var url = "http://verifier.eyedee.me/wsapi/verify?assertion=" + window.encodeURIComponent(assertion) +
+                  "&audience=" + window.encodeURIComponent("rp.eyedee.me");
         $("#oVerificationRequest").empty().text(url);
 
         $.ajax({
diff --git a/run.js b/run.js
index 0aac1884e..d3b551cda 100644
--- a/run.js
+++ b/run.js
@@ -29,9 +29,13 @@ function subHostNames(data) {
   for (var i = 0; i < boundServers.length; i++) {
     var o = boundServers[i]
     var a = o.server.address();
-    var from = o.name + ".mozilla.org";
-    var to = a.address + ":" + a.port;
+    var from = o.name;
+    var to = "http://" + a.address + ":" + a.port;
     data = data.replace(new RegExp(from, 'g'), to);
+
+    // now do another replacement to catch bare hostnames sans http(s)
+    from = (from.substr(5) === 'https' ? from.substr(8) : from.substr(7));
+    data = data.replace(new RegExp(from, 'g'), to.substr(7));
   }
   return data;
 }
@@ -115,12 +119,24 @@ function createServer(obj) {
 };
 
 // start up webservers on ephemeral ports for each subdirectory here.
-var dirs = [ "authority", "rp", "verifier", "primary" ].map(function(d) {
-    return {
-        name: d,
-        path: path.join(__dirname, d)
-    };
-});
+var dirs = [
+    {
+        name: "https://eyedee.me",
+        path: path.join(__dirname, "authority")
+    },
+    {
+        name: "http://rp.eyedee.me",
+        path: path.join(__dirname, "rp")
+    },
+    {
+        name: "http://verifier.eyedee.me",
+        path: path.join(__dirname, "verifier")
+    },
+    {
+        name: "http://primary.eyedee.me",
+        path: path.join(__dirname, "primary")
+    }
+];
 
 function formatLink(server, extraPath) {
   var addr = server.address();
-- 
GitLab