incubator-rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1229198 - /incubator/rave/site/trunk/content/rave/documentation/configure-locked-domain.mdtext
Date Mon, 09 Jan 2012 15:22:40 GMT
Author: jcian
Date: Mon Jan  9 15:22:39 2012
New Revision: 1229198

Adding locked domain configuration documentation.

      - copied, changed from r1229162, incubator/rave/site/trunk/content/rave/documentation/configure-ssl.mdtext

Copied: incubator/rave/site/trunk/content/rave/documentation/configure-locked-domain.mdtext
(from r1229162, incubator/rave/site/trunk/content/rave/documentation/configure-ssl.mdtext)
--- incubator/rave/site/trunk/content/rave/documentation/configure-ssl.mdtext (original)
+++ incubator/rave/site/trunk/content/rave/documentation/configure-locked-domain.mdtext Mon
Jan  9 15:22:39 2012
@@ -1,4 +1,4 @@
-Title:  Configuring Rave for SSL
+Title:  Configuring Shindig Locked Domain Support in Rave
 Notice:    Licensed to the Apache Software Foundation (ASF) under one
            or more contributor license agreements.  See the NOTICE file
            distributed with this work for additional information
@@ -20,182 +20,105 @@ Notice:    Licensed to the Apache Softwa
 To follow these instructions you'll need a working copy of Rave up and running under Tomcat
6.  Please see the [Installing Rave][1] page for instructions on how to get up and running.
-These instructions are written assuming a Tomcat installation path of /temp/tomcat so you
may want to use that path for testing while you follow these instructions.
+## Enabling Locked Domain Support in Rave
-Also note that these instructions were written and tested using Tomcat running on Windows.
 Tomcat on other platforms *should* be exaclty the same except for startup scripts (.bat vs
.sh) and file locations (c:\ vs /).
+These instructions demonstrate how to get Shindig locked domain support up and running in
Rave.  Locked domains take advantage of the web browsers domain-based sandboxing policies
to isolate gadgets from each other and the main container page.  The Shindig mailing list
is a good source of information for more details regarding locked domains.
-## Enabling SSL in Tomcat
+Enabling locked domain support within Rave is achieved via a combination of DNS and Shindig
configuration changes.  To fully support locked domain in a production environment you'll
likely need to setup and configure your locked domain with wildcard DNS (otherwise you'd have
to create manual DNS entries for every single gadget that you want to run on a locked domain).
 For the purposes of experimenting with locked domain however just adding entries to the "hosts"
file for the gadgets on a default Rave page should be sufficient.  The Shindig configuration
changes required are enabling locked domain support in the top level Shindig configuration
and then configuring the individual Shindig container via the container.js file.
-These instructions demonstrate how to get Tomcat 6 running over SSL using a self signed certificate.
+The sample locked domain we'll use here will be "".
- - Copy the default cacerts file to /temp/tomcat (this allows you to not have to pollute
your real cacerts file with test certs).
-        cp "%JAVA_HOME%/jre/lib/security/cacerts" "/temp/tomcat/custom-cacerts"
- - Generate a self signed certificate that you'll use with Tomcat.
-        "%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA -validity 365 -storepass
changeit -keystore /temp/tomcat/custom-cacerts
-        What is your first and last name?  
-          [Unknown]:  
-        What is the name of your organizational unit?  
-          [Unknown]:  example unit  
-        What is the name of your organization?  
-          [Unknown]:  example organization  
-        What is the name of your City or Locality?  
-          [Unknown]:  example city  
-        What is the name of your State or Province?  
-          [Unknown]:  example state  
-        What is the two-letter country code for this unit?  
-          [Unknown]:  US  
-        Is, OU=example unit, O=example organization, L=example
city, ST=example state, C=US correct?  
-          [no]:  yes  
-        Enter key password for <tomcat>  
-                (RETURN if same as keystore password):  
- - Edit Tomcats startup.bat file to get the JVM to use our alternate cacerts file.  It is
important for the JVM to trust our self signed certificate because Rave makes HTTP requests
to Shindig to fetch gadget metadata, and if those requests are over SSL then the JVM must
trust the certificate being used for the SSL communication.
-    (added the following line above the "call "%EXECUTABLE%" start ..." line)
-        set JAVA_OPTS=%JAVA_OPTS%\temp\tomcat\custom-cacerts
- - Edit Tomcats server.xml to enable an SSL listener on port 443 using our alternate cacerts
file.  By default Tomcat looks for a certificate with the alias "tomcat" which is what we
used to create our self signed certificate.
-    (did a search and replace of 8443 with 443)    
-    (uncommented the HTTPS connector and configured it to use our custom cacerts file)
-        <Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
-                   maxThreads="150" scheme="https" secure="true"
-                   keystoreFile="c:\temp\tomcat\custom-cacerts" keystorePass="changeit"
-                   clientAuth="false" sslProtocol="TLS" />
- - Startup Tomcat and verify that Rave still runs properly on http://localhost:8080/portal/
- - Make sure you can access the Rave login page at
-    Note - if you already have an authenticated session open in your browser you'll probably
need to close and re-open your browser to access the login page.
-    Also note that the rest of Rave wont work over SSL yet.
-## Configure Rave and Shindig to run over SSL.
- - Edit the /temp/tomcat/webapps/portal/WEB-INF/classes/ file to configure
Rave to use SSL.
-    (updated the following values at the top of the config file with)
-        portal.opensocial_engine.protocol=https
-        portal.opensocial_engine.gadget_path=/gadgets
- - Edit the /temp/tomcat/webapps/ROOT/WEB-INF/classes/ and /temp/tomcat/webapps/ROOT/WEB-INF/classes/containers/default/container.js
files to configure Shindig to use SSL.
-    Note - there may be other ways to get Shindig to use SSL but this method does work.
-    Also note - the changes to container.js are a search and replace of http:// with https://
-    (updated the following values at the top of the config file with)
-        shindig.port=
-        shindig.contextroot=
- - Startup Tomcat and verify that Rave runs properly on
+The default locked domain implementation within Shindig generates locked domain URL's by
taking a hash of the gadget specification URL and pre-pending it onto the configured locked
domain suffix.  Here are the locked domain entries that were added to my local "hosts" file
to support the default gadgets on a Rave page at the time this documentation was written:
+For the Shindig configuration changes please refer to the patch generated from my local changes
below.  With these changes in place you should be able to fire up Rave, access the default
page as one of the sample users and see the locked domains being utilized in the gadget iframe
 ## Complete diff of modified files follows
-diff -r tomcat-vanilla\bin\startup.bat tomcat\bin\startup.bat
-<br>> set JAVA_OPTS=%JAVA_OPTS%\temp\tomcat\custom-cacerts
-<br>diff -r tomcat-vanilla\conf\server.xml tomcat\conf\server.xml
-<br><                redirectPort="8443" />
-<br>>                redirectPort="443" />
-<br><                redirectPort="8443" />
-<br>>                redirectPort="443" />
-<br><     &lt;!-- Define a SSL HTTP/1.1 Connector on port 8443
-<br>>     &lt;!-- Define a SSL HTTP/1.1 Connector on port 443
-<br><     &lt;!--
-<br><     &lt;Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
-<br>>     &lt;Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
-<br>> 			   keystoreFile="c:\temp\tomcat\custom-cacerts" keystorePass="changeit"
-<br><     -->
-<br><     &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
-<br>>     &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
-<br>diff -r tomcat-vanilla\webapps\portal\WEB-INF\classes\ tomcat\webapps\portal\WEB-INF\classes\
-<br>< portal.opensocial_engine.protocol=http
-<br>< portal.opensocial_engine.root=localhost:8080
-<br>> portal.opensocial_engine.protocol=https
-<br>diff -r tomcat-vanilla\webapps\ROOT\WEB-INF\classes\containers\default\container.js
-<br><  *
-<br>>  *
-<br>< "gadgets.jsUriTemplate" : "http://%host%${CONTEXT_ROOT}/gadgets/js/%js%",
-<br>> "gadgets.jsUriTemplate" : "https://%host%${CONTEXT_ROOT}/gadgets/js/%js%",
-<br>< "" : "",
-<br>> "" : "",
-<br>< "gadgets.osDataUri" : "http://%host%${CONTEXT_ROOT}/rpc",
-<br>> "gadgets.osDataUri" : "https://%host%${CONTEXT_ROOT}/rpc",
-<br>< //"defaultShindigTestHost": "http://${SERVER_HOST}:${SERVER_PORT}",
-<br>< "defaultShindigTestHost":"http://%authority%",
-<br>> //"defaultShindigTestHost": "https://${SERVER_HOST}:${SERVER_PORT}",
-<br>> "defaultShindigTestHost":"https://%authority%",
-<br><       "urlTemplate" : "http://localhost${CONTEXT_ROOT}/gadgets/profile?{var}",
-<br>>       "urlTemplate" : "https://localhost${CONTEXT_ROOT}/gadgets/profile?{var}",
-<br><       "urlTemplate" : "http://localhost${CONTEXT_ROOT}/gadgets/canvas?{var}",
-<br>>       "urlTemplate" : "https://localhost${CONTEXT_ROOT}/gadgets/canvas?{var}",
-<br><     "path" : "http://%host%${CONTEXT_ROOT}/rpc",
-<br>>     "path" : "https://%host%${CONTEXT_ROOT}/rpc",
-<br><     "invalidatePath" : "http://%host%${CONTEXT_ROOT}/rpc",
-<br>>     "invalidatePath" : "https://%host%${CONTEXT_ROOT}/rpc",
-<br><     "endPoints" : [ "http://%host%${CONTEXT_ROOT}/rpc" ]
-<br>>     "endPoints" : [ "https://%host%${CONTEXT_ROOT}/rpc" ]
+<br>Index: rave-project/rave-shindig/src/main/webapp/WEB-INF/classes/containers/default/container.js
+<br>--- rave-project/rave-shindig/src/main/webapp/WEB-INF/classes/containers/default/container.js
(revision 1228369)
+<br>+++ rave-project/rave-shindig/src/main/webapp/WEB-INF/classes/containers/default/container.js
(revision )
+<br>@@ -59,15 +59,15 @@
+<br> "gadgets.parent" : null,
+<br> // Should all gadgets be forced on to a locked domain?
+<br>-"gadgets.uri.iframe.lockedDomainRequired" : false,
+<br>+"gadgets.uri.iframe.lockedDomainRequired" : true,
+<br> // DNS domain on which gadgets should render.
+<br> // Default Uri config: these must be overridden - specified here for testing purposes
+<br>-"gadgets.uri.iframe.unlockedDomain": "${Cur['defaultShindigTestAuthority']}",
+<br>+"gadgets.uri.iframe.unlockedDomain": "localhost:8080",
+<br> // When setting up the server to enable locked domains, you should set this to
something that does not
+<br> // attempt to use the authority at all.  Ideally it would be another hostname
that points to this server.
+<br> // Example: unlockedDomain="" lockedDomainSuffix=""
+<br>-"gadgets.uri.iframe.lockedDomainSuffix": "${Cur['defaultShindigTestAuthority']}",
+<br>+"gadgets.uri.iframe.lockedDomainSuffix": "",
+<br> // Origins for CORS requests and/or Referer validation
+<br> // Indicate a set of origins or an entry with * to indicate that all origins are
+<br>@@ -84,11 +84,8 @@
+<br> // jsUriTemplate will have %host% and %js% substituted.
+<br> // No locked domain special cases, but jsUriTemplate must
+<br> // never conflict with a lockedDomainSuffix.
+<br>-"gadgets.jsUriTemplate" : "http://%host%${CONTEXT_ROOT}/gadgets/js/%js%",
+<br>+"gadgets.jsUriTemplate" : "http://${Cur['gadgets.uri.iframe.unlockedDomain']}{CONTEXT_ROOT}/gadgets/js/%js%",
+<br>-"" : "",
+<br>-"gadgets.uri.js.path" : "${CONTEXT_ROOT}/gadgets/js",
+<br> // Callback URL.  Scheme relative URL for easy switch between https/http.
+<br> "gadgets.uri.oauth.callbackTemplate" : "//%host%${CONTEXT_ROOT}/gadgets/oauthcallback",
+<br>@@ -124,16 +121,16 @@
+<br> "defaultShindigProxyConcatAuthority":"%authority%",
+<br> // Default Js Uri config: also must be overridden.
+<br>-"": "//${Cur['defaultShindigTestAuthority']}",
+<br>+"": "//${Cur['gadgets.uri.iframe.unlockedDomain']}",
+<br> "gadgets.uri.js.path": "${CONTEXT_ROOT}/gadgets/js",
+<br> // Default concat Uri config; used for testing.
+<br>-"" : "${Cur['defaultShindigProxyConcatAuthority']}",
+<br>+"" : "${Cur['gadgets.uri.iframe.unlockedDomain']}",
+<br> "gadgets.uri.concat.path" : "${CONTEXT_ROOT}/gadgets/concat",
+<br> "gadgets.uri.concat.js.splitToken" : "false",
+<br> // Default proxy Uri config; used for testing.
+<br>-"" : "${Cur['defaultShindigProxyConcatAuthority']}",
+<br>+"" : "${Cur['gadgets.uri.iframe.unlockedDomain']}",
+<br> "gadgets.uri.proxy.path" : "${CONTEXT_ROOT}/gadgets/proxy",
+<br> //Enables/Disables feature administration
+<br>@@ -153,7 +150,7 @@
+<br>     // Note: /proxy is an open proxy. Be careful how you expose this!
+<br>     // Note: Here // is replaced with the current protocol http/https
+<br>    //"proxyUrl" : "//%host%${CONTEXT_ROOT}/gadgets/proxy?container=%container%%rewriteMime%&refresh=%refresh%&gadget=%gadget%/%rawurl%",
+<br>-    "proxyUrl" : "//%host%${CONTEXT_ROOT}/gadgets/proxy?container=%container%&refresh=%refresh%&url=%url%%rewriteMime%",
+<br>+    "proxyUrl" : "//${Cur['gadgets.uri.iframe.unlockedDomain']}${CONTEXT_ROOT}/gadgets/proxy?container=%container%&refresh=%refresh%&url=%url%%rewriteMime%",
+<br>     "jsonProxyUrl" : "//%host%${CONTEXT_ROOT}/gadgets/makeRequest"
+<br>   },
+<br>   "views" : {
+<br>Index: rave-project/rave-shindig/src/main/resources/
+<br>--- rave-project/rave-shindig/src/main/resources/	(revision
+<br>+++ rave-project/rave-shindig/src/main/resources/	(revision
+<br>@@ -96,7 +96,7 @@
+<br> shindig.signing.viewer-access-tokens-enabled=false
+<br> # If enabled here, configuration values can be found in container configuration
+<br> # TODO: This needs to be moved to container configuration.
+<br> shindig.content-rewrite.only-allow-excludes=false
-<br>diff -r tomcat-vanilla\webapps\ROOT\WEB-INF\classes\ tomcat\webapps\ROOT\WEB-INF\classes\
-<br>< shindig.port=8080
-<br>> shindig.port=
 [1]: installing.html
\ No newline at end of file

View raw message