15572: Updated install docs for keep components, login/SSO
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 5 Dec 2019 21:43:04 +0000 (16:43 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Mon, 9 Dec 2019 21:24:13 +0000 (16:24 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

doc/_config.yml
doc/install/google-auth.html.textile.liquid [new file with mode: 0644]
doc/install/install-api-server.html.textile.liquid
doc/install/install-keep-balance.html.textile.liquid
doc/install/install-keep-web.html.textile.liquid
doc/install/install-keepproxy.html.textile.liquid
doc/install/install-postgresql.html.textile.liquid
doc/install/install-sso.html.textile.liquid
doc/install/setup-login.html.textile.liquid [new file with mode: 0644]

index 450c7aaa6cedbf1a2956134d0bdc8a807ec0d584..4ce347b50245305524db09cc5658bd1d7ed6f83b 100644 (file)
@@ -204,6 +204,7 @@ navbar:
       - install/install-keep-web.html.textile.liquid
       - install/install-keep-balance.html.textile.liquid
     - User interface:
+      - install/setup-login.html.textile.liquid
       - install/install-sso.html.textile.liquid
       - install/install-workbench-app.html.textile.liquid
       - install/install-workbench2-app.html.textile.liquid
@@ -226,3 +227,4 @@ navbar:
       - install/install-postgresql.html.textile.liquid
       - install/ruby.html.textile.liquid
       - install/nginx.html.textile.liquid
+      - install/google-auth.html.textile.liquid
diff --git a/doc/install/google-auth.html.textile.liquid b/doc/install/google-auth.html.textile.liquid
new file mode 100644 (file)
index 0000000..ef45a84
--- /dev/null
@@ -0,0 +1,26 @@
+---
+layout: default
+navsection: installguide
+title: Setting up Google auth
+...
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
+
+In order to use Google for authentication, you must use the <a href="https://console.developers.google.com" target="_blank">Google Developers Console</a> to create a set of client credentials.
+
+# Go to the <a href="https://console.developers.google.com" target="_blank">Google Developers Console</a> and select or create a project; this will take you to the project page.
+# On the sidebar, click on *APIs & auth* then select *APIs*.
+## Search for *Contacts API* and click on *Enable API*.
+## Search for *Google+ API* and click on *Enable API*.
+# On the sidebar, click on *Credentials*; under *OAuth* click on *Create new Client ID* to bring up the *Create Client ID* dialog box.
+# Under *Application type* select *Web application*.
+# If the authorization origins are not displayed, clicking on *Create Client ID* will take you to *Consent screen* settings.
+## On consent screen settings, enter the appropriate details and click on *Save*.
+## This will return you to the *Create Client ID* dialog box.
+# You must set the authorization origins.  Edit @auth.your.domain@ to the appropriate hostname that you will use to access the SSO service:
+## JavaScript origin should be @https://auth.example.com/@
+## Redirect URI should be @https://auth.example.com/users/auth/google_oauth2/callback@
+# Copy the values of *Client ID* and *Client secret* from the Google Developers Console and add them to the appropriate configuration.
index 72bacd13e05768c4f612d51e929f281cff9417ef..1f885f909aa19724202cd9fa3ba4be231f3e9364 100644 (file)
@@ -130,15 +130,15 @@ geo $external_client {
 
 # This is the port where nginx expects to contact arvados-controller.
 upstream controller {
-  server     127.0.0.1:8003  fail_timeout=10s;
+  server     xxxxx.example.com:8003  fail_timeout=10s;
 }
 
 server {
   # This configures the public https port that clients will actually connect to,
   # the request is reverse proxied to the upstream 'controller'
 
-  listen       <span class="userinput">[TODO: replace with your public IP address]</span>:443 ssl;
-  server_name  <span class="userinput">[TODO: replace with the api server hostname]</span>;
+  listen       <span class="userinput">xxxxx.example.com</span>:443 ssl;
+  server_name  <span class="userinput">xxxxx.example.com</span>;
 
   ssl on;
   ssl_certificate     <span class="userinput">/TODO/YOUR/PATH/TO/cert.pem</span>;
@@ -166,7 +166,7 @@ server {
   # This configures the Arvados API server.  It is written using Ruby
   # on Rails and uses the Passenger application server.
 
-  listen 127.0.0.1:8004;
+  listen <span class="userinput">xxxxx.example.com:8004</span>;
   server_name localhost-api;
 
   root /var/www/arvados-api/current/public;
@@ -193,14 +193,14 @@ h2(#install-packages). Install arvados-api-server and arvados-controller
 h3. Centos 7
 
 <notextile>
-<pre><code># <span class="userinput">yum install bison make automake gcc gcc-c++ libcurl-devel git arvados-api-server arvados-controller</span>
+<pre><code># <span class="userinput">yum install arvados-api-server arvados-controller</span>
 </code></pre>
 </notextile>
 
 h3. Debian and Ubuntu
 
 <notextile>
-<pre><code># <span class="userinput">apt-get --no-install-recommends install bison build-essential libcurl4-openssl-dev git zlib1g-dev arvados-api-server arvados-controller</span>
+<pre><code># <span class="userinput">apt-get --no-install-recommends install arvados-api-server arvados-controller</span>
 </code></pre>
 </notextile>
 
index d29166459c95bd307e555eee42f6cbd82e1be323..09bc04114dfba60c43650258b72dc2d6583d7868 100644 (file)
@@ -9,6 +9,13 @@ Copyright (C) The Arvados Authors. All rights reserved.
 SPDX-License-Identifier: CC-BY-SA-3.0
 {% endcomment %}
 
+# "Introduction":#introduction
+# "Update config.yml":#update-config
+# "Install keep-balance package":#install-packages
+# "Start the service":#start-service
+
+h2(#introduction). Introduction
+
 Keep-balance deletes unreferenced and overreplicated blocks from Keep servers, makes additional copies of underreplicated blocks, and moves blocks into optimal locations as needed (e.g., after adding new servers). See "Balancing Keep servers":{{site.baseurl}}/admin/keep-balance.html for usage details.
 
 {% include 'notebox_begin' %}
@@ -17,61 +24,49 @@ If you are installing keep-balance on an existing system with valuable data, you
 
 {% include 'notebox_end' %}
 
-h2. Install keep-balance
-
-Keep-balance can be installed anywhere with network access to Keep services. Typically it runs on the same host as keepproxy.
-
-*A cluster should have only one keep-balance process running at a time.*
+h2(#update-config). Update the cluster config
 
-On Debian-based systems:
+Edit the cluster config at @/etc/arvados/config.yml@ and set @Services.Keepbalance.InternalURLs@.  This port is only used to publish metrics.
 
 <notextile>
-<pre><code>~$ <span class="userinput">sudo apt-get install keep-balance</span>
+<pre><code>    Services:
+      Keepbalance:
+        InternalURLs:
+          "http://keep.ClusterID.example.com:9005/": {}
 </code></pre>
 </notextile>
 
-On Red Hat-based systems:
+Ensure your cluster configuration has @Collections.BlobTrash: true@ (this is the default).
 
 <notextile>
-<pre><code>~$ <span class="userinput">sudo yum install keep-balance</span>
+<pre><code># arvados-server config-dump | grep BlobTrash:
+      BlobTrash: true
 </code></pre>
 </notextile>
 
-Verify that @keep-balance@ is functional:
+If BlobTrash is false, unneeded blocks will be counted and logged by keep-balance, but they will not be deleted.
 
-<notextile>
-<pre><code>~$ <span class="userinput">keep-balance -h</span>
-...
-Usage of ./keep-balance:
-  -commit-pulls
-       send pull requests (make more replicas of blocks that are underreplicated or are not in optimal rendezvous probe order)
-  -commit-trash
-       send trash requests (delete unreferenced old blocks, and excess replicas of overreplicated blocks)
-...
-</code></pre>
-</notextile>
+h2(#install-packages). Install keep-balance package
+
+Keep-balance can be installed anywhere with network access to Keep services. Typically it runs on the same host as keepproxy.
 
-h3. Update the cluster config
+*A cluster should have only one instance of keep-balance running at a time.*
 
-Edit the cluster config at @/etc/arvados/config.yml@ and set @Services.Keepbalance.InternalURLs@. Replace @uuid_prefix@ with your cluster id.
+h3. Centos 7
 
 <notextile>
-<pre><code>Clusters:
-  <span class="userinput">uuid_prefix</span>:
-    Services:
-      Keepbalance:
-        InternalURLs:
-          "http://localhost:9005/": {}
-    TLS:
-      Insecure: false
+<pre><code># <span class="userinput">yum install keep-balance</span>
 </code></pre>
 </notextile>
 
-Set @TLS.Insecure: true@ if your API server’s TLS certificate is not signed by a recognized CA.
+h3. Debian and Ubuntu
 
-h3. Start the service (option 1: systemd)
+<notextile>
+<pre><code># <span class="userinput">apt-get install keep-balance</span>
+</code></pre>
+</notextile>
 
-If your system does not use systemd, skip this section and follow the "runit instructions":#runit instead.
+h2(#start-service). Start the service
 
 If your system uses systemd, the keep-balance service should already be set up. Start it and check its status:
 
@@ -92,46 +87,3 @@ Feb 14 18:56:01 zzzzz.arvadosapi.com keep-balance[541]: 2017/02/14 18:56:01 skip
 Feb 14 18:56:01 zzzzz.arvadosapi.com keep-balance[541]: 2017/02/14 18:56:01 clearing existing trash lists, in case the new rendezvous order differs from previous run
 </code></pre>
 </notextile>
-
-h3(#runit). Start the service (option 2: runit)
-
-Install runit to supervise the keep-balance daemon.  {% include 'install_runit' %}
-
-Create a supervised service.
-
-<notextile>
-<pre><code>~$ <span class="userinput">sudo mkdir /etc/service/keep-balance</span>
-~$ <span class="userinput">cd /etc/service/keep-balance</span>
-~$ <span class="userinput">sudo mkdir log log/main</span>
-~$ <span class="userinput">printf '#!/bin/sh\nexec keep-balance -commit-pulls -commit-trash 2>&1\n' | sudo tee run</span>
-~$ <span class="userinput">printf '#!/bin/sh\nexec svlogd main\n' | sudo tee log/run</span>
-~$ <span class="userinput">sudo chmod +x run log/run</span>
-~$ <span class="userinput">sudo sv exit .</span>
-~$ <span class="userinput">cd -</span>
-</code></pre>
-</notextile>
-
-Use @sv stat@ and check the log file to verify the service is running.
-
-<notextile>
-<pre><code>~$ <span class="userinput">sudo sv stat /etc/service/keep-balance</span>
-run: /etc/service/keep-balance: (pid 12520) 2s; run: log: (pid 12519) 2s
-~$ <span class="userinput">tail /etc/service/keep-balance/log/main/current</span>
-2017/02/14 18:46:01 starting up: will scan every 10m0s and on SIGUSR1
-2017/02/14 18:56:01 Run: start
-2017/02/14 18:56:01 skipping zzzzz-bi6l4-rbtrws2jxul6i4t with service type "proxy"
-2017/02/14 18:56:01 clearing existing trash lists, in case the new rendezvous order differs from previous run
-</code></pre>
-</notextile>
-
-h2. Enable garbage collection
-
-Ensure your cluster configuration has @Collections.BlobTrash: true@ (this is the default).
-
-<notextile>
-<pre><code>~$ arvados-server config-dump | grep BlobTrash:
-      BlobTrash: true
-</code></pre>
-</notextile>
-
-If BlobTrash is false, unneeded blocks will be counted and logged by keep-balance, but they will not be deleted.
index 4318802979e93651db86020cf91bb4c110342ed4..f949d0a6c8f08a5c2ce527d5104c1039bbb8aa01 100644 (file)
@@ -11,7 +11,7 @@ SPDX-License-Identifier: CC-BY-SA-3.0
 
 # "Introduction":#introduction
 # "Configure DNS":#introduction
-# "Update config.yml":#update-config
+# "Configure anonymous user token.yml":#update-config
 # "Update nginx configuration":#update-nginx
 # "Install keep-web package":#install-packages
 # "Start the service":#start-service
@@ -20,120 +20,91 @@ SPDX-License-Identifier: CC-BY-SA-3.0
 
 h2(#introduction). Introduction
 
-The Keep-web server provides read/write HTTP (WebDAV) access to files stored in Keep. It serves public data to unauthenticated clients, and serves private data to clients that supply Arvados API tokens. It can be installed anywhere with access to Keep services, typically behind a web proxy that provides TLS support. See the "godoc page":http://godoc.org/github.com/curoverse/arvados/services/keep-web for more detail.
+The Keep-web server provides read/write HTTP (WebDAV) access to files stored in Keep.  This makes it easy to access files in Keep from a browser, or mount Keep as a network folder using WebDAV support in various operating systems. It serves public data to unauthenticated clients, and serves private data to clients that supply Arvados API tokens. It can be installed anywhere with access to Keep services, typically behind a web proxy that provides TLS support. See the "godoc page":http://godoc.org/github.com/curoverse/arvados/services/keep-web for more detail.
 
-By convention, we use the following hostnames for the Keep-web service:
+h2(#dns). Configure DNS
 
-<notextile>
-<pre><code>download.<span class="userinput">uuid_prefix</span>.your.domain
-collections.<span class="userinput">uuid_prefix</span>.your.domain
-*.collections.<span class="userinput">uuid_prefix</span>.your.domain
-</code></pre>
-</notextile>
+It is important to properly configure the keep-web service to so it does not open up cross-site-scripting (XSS) attacks.  A HTML file can be stored in collection.  If an attacker causes a victim to visit that HTML file through Workbench, it will be rendered by the browser.  If all collections are served at the same domain, the browser will consider collections as coming from the same origin and thus have access to the same browsing data (such as API token), enabling malicious Javascript in the HTML file to access Arvados as the victim.
 
-The above hostnames should resolve from anywhere on the internet.
+There are two approaches to mitigate this.
 
-h2(#dns). Configure DNS
+# The service can tell the browser that all files should go to download instead of in-browser preview, except in situations where an attacker is unlikely to be able to gain access to anything they didn't already have access to.
+# Each each collection served by @keep-web@ is served on its own virtual host.  This allows for file with executable content to be displayed in-browser securely.  The virtual host embeds the collection uuid or portable data hash in the hostname.  For example, a collection with uuid @xxxxx-4zz18-tci4vn4fa95w0zx@ could be served as @xxxxx-4zz18-tci4vn4fa95w0zx.collections.ClusterID.example.com@ .  The portable data hash @dd755dbc8d49a67f4fe7dc843e4f10a6+54@ could be served at @dd755dbc8d49a67f4fe7dc843e4f10a6-54.collections.ClusterID.example.com@ .  This requires "wildcard DNS record":https://en.wikipedia.org/wiki/Wildcard_DNS_record and "wildcard TLS certificate.":https://en.wikipedia.org/wiki/Wildcard_certificate
 
-It is important to properly configure the download service to migitate cross-site-scripting (XSS) attacks.  A HTML page can be stored in collection.  If an attacker causes a victim to visit that page through Workbench, it will be rendered by the browser.  If all collections are served at the same domain, the browser will consider collections as coming from the same origin and having access to the same browsing data, enabling malicious Javascript on that page to access Arvados on behalf of the victim.
+h3. Collections download URL
 
-Browser security is based on domain names.  We  having separate domains for each collection
+Downloads links will served from the the URL in @Services.WebDAVDownload.ExternalURL@ .  The collection uuid or PDH is put in the URL path.
 
+If blank, serve links to WebDAV with @disposition=attachment@ query param.  Unlike preview links, browsers do not render attachments, so there is no risk of XSS.
 
+If @WebDAVDownload@ is blank, and @WebDAV@ has a single origin (not wildcard, see below), then Workbench will show an error page
 
-        # Serve preview links using uuid or pdh in subdomain
-        # (requires wildcard DNS and TLS certificate)
-        #   https://*.collections.ClusterID.example.com
-        #
-        # Serve preview links using uuid or pdh in main domain
-        # (requires wildcard DNS and TLS certificate)
-        #   https://*--collections.ClusterID.example.com
+<pre>
+    Services:
+      WebDAVDownload:
+        ExternalURL: https://download.ClusterID.example.com
+</pre>
 
+h3. Collections preview URL
 
-limiting preview to circumstances where the collection is not accessed with the user's regular full-access token.
+Collections will be served using the URL pattern in @Services.WebDAV.ExternalURL@ .  If blank, use @Services.WebDAVDownload.ExternalURL@ instead, and disable inline preview.  If both are empty, downloading collections from workbench will be impossible.
 
-        # Serve preview links by setting uuid or pdh in the path.
-        # This configuration only allows previews of public data or
-        # collection-sharing links, because these use the anonymous
-        # user token or the token is already embedded in the URL.
-        # Other data must be handled as downloads via WebDAVDownload:
-        #   https://collections.ClusterID.example.com
+h4. In their own subdomain
 
-The configuration option @Services.WebDAV.ExternalURL@ is the base URL for Workbench inline preview.  If blank, use WebDAVDownload instead, and disable inline preview.  If both are empty, downloading collections from workbench will be impossible.
+Collections can be served from their own subdomain:
 
+<pre>
+    Services:
+      WebDAV:
+        ExternalURL: https://*.collections.ClusterID.example.com
+</pre>
 
+h4. Under the main domain
 
+Alternately, they can go under the main domain by including @--@:
 
-        # Base URL for download links. If blank, serve links to WebDAV
-        # with disposition=attachment query param.  Unlike preview links,
-        # browsers do not render attachments, so there is no risk of XSS.
-        #
-        # If WebDAVDownload is blank, and WebDAV uses a
-        # single-origin form, then Workbench will show an error page
-        #
-        # Serve download links by setting uuid or pdh in the path:
-        #   https://download.ClusterID.example.com
+<pre>
+    Services:
+      WebDAV:
+        ExternalURL: https://*--collections.ClusterID.example.com
+</pre>
 
+h4. From a single domain
 
-Configure your DNS servers so the following names resolve to your keep-web server's public IP address.
-* @download.ClusterID.example.com@
-* @collections.ClusterID.example.com@
-* @*--collections.ClusterID.example.com@, if you have a wildcard TLS certificate valid for @*.ClusterID.example.com@ and your DNS server allows this without interfering with other DNS names.
-* @*.collections.ClusterID.example.com@, if you have a wildcard TLS certificate valid for these names.
+Serve preview links from a single domain, setting uuid or pdh in the path (similar to downloads).  This configuration only allows previews of public data or collection-sharing links, because these use the anonymous user token or the token is already embedded in the URL.  Authenticated requests will always result in file downloads from @Services.WebDAVDownload.ExternalURL@.
 
-If neither of the above wildcard options is feasible, you have two choices:
-# Serve web content at @collections.ClusterID.example.com@, but only for unauthenticated requests (public data and collection sharing links). Authenticated requests will always result in file downloads, using the @download@ name. For example, the Workbench "preview" button and the "view entire log file" link will invoke file downloads instead of displaying content in the browser window.
-# In the special case where you know you are immune to XSS exploits, you can enable the "trust all content" mode in Keep-web and Workbench (setting @Collections.TrustAllContent: true@ on the config file). With this enabled, inline web content can be served from a single @collections@ host name; no wildcard DNS or certificate is needed. Do not do this without understanding the security implications described in the "Keep-web documentation":http://godoc.org/github.com/curoverse/arvados/services/keep-web.
+<pre>
+    Services:
+      WebDAV:
+        ExternalURL: https://collections.ClusterID.example.com
+</pre>
 
-h2(#update-config). Update config.yml
+h2(#update-config). Configure anonymous user token
 
 {% assign railscmd = "bundle exec ./script/get_anonymous_user_token.rb --get" %}
 {% assign railsout = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" %}
 If you intend to use Keep-web to serve public data to anonymous clients, configure it with an anonymous token. Use the following command on the <strong>API server</strong> to create an anonymous user token. {% include 'install_rails_command' %}
 
-Update @Services.WebDAV@ and @Services.WebDAVDownload@ in config.yml:
-
 <notextile>
-<pre><code>    Services:
-      WebDAV:
-        InternalURLs:
-          <span class="userinput">"http://collections.<span class="userinput">ClusterID</span>.example.com:9002/": {}</span>
-        ExternalURL: "https://collections.<span class="userinput">ClusterID</span>.example.com"
-      WebDAVDownload:
-        InternalURLs:
-          <span class="userinput">"http://download.<span class="userinput">ClusterID</span>.example.com:9002/": {}</span>
-        ExternalURL: "https://download.<span class="userinput">ClusterID</span>.example.com"
-    Users:
+<pre><code>    Users:
       AnonymousUserToken: "{{railsout}}"
-    Collections:
-      TrustAllContent: false
 </code></pre>
 </notextile>
 
 Set @Users.AnonymousUserToken: ""@ (empty string) or leave it out if you do not want to serve public data.
 
-Workbench has features like "download file from collection" and "show image" which work better if the content is served by Keep-web rather than Workbench itself. We recommend using the two different hostnames ("download" and "collections" above) for file downloads and inline content respectively.
+h2. Set InternalURL
 
-Additionally, one of the following entries on your cluster configuration file (depending on your DNS setup) tells Workbench which URL will be used to serve user content that can be displayed in the browser, like image previews and static HTML pages.
-
-<notextile>
-<pre><code>Clusters:
-  <span class="userinput">uuid_prefix</span>:
+<pre>
     Services:
       WebDAV:
-        ExternalURL: "https://*--collections.<span class="userinput">uuid_prefix</span>.example.com"
-        ExternalURL: "https://*.collections.<span class="userinput">uuid_prefix</span>.example.com"
-        ExternalURL: "https://collections.<span class="userinput">uuid_prefix</span>.example.com"
-</code></pre>
-</notextile>
+        InternalURL:
+         "http://collections.ClusterID.example.com:9002": {}
+</pre>
 
 h3. Update nginx configuration
 
-The Keep-web service will be accessible from anywhere on the internet, so we recommend using TLS for transport encryption.
-
-This is best achieved by putting a reverse proxy with TLS support in front of Keep-web, running on port 443 and passing requests to Keep-web on port 9002 (or whatever port you chose in your run script).
-
-Note: A wildcard TLS certificate is required in order to support a full-featured secure Keep-web service. Without it, Keep-web can offer file downloads for all Keep data; however, in order to avoid cross-site scripting vulnerabilities, Keep-web refuses to serve private data as web content except when it is accessed using a "secret link" share. With a wildcard TLS certificate and DNS configured appropriately, all data can be served as web content.
+Put a reverse proxy with SSL support in front of keep-web.  Keep-web itself runs on the port 25107 (or whatever is specified in @Services.Keepproxy.InternalURL@) the reverse proxy runs on port 443 and forwards requests to Keepproxy.
 
 Use a text editor to create a new file @/etc/nginx/conf.d/keep-web.conf@ with the following configuration. Options that need attention are marked with “TODO”.
 
@@ -153,8 +124,8 @@ server {
   proxy_read_timeout    300s;
 
   ssl                   on;
-  ssl_certificate       <span class="userinput"/>YOUR/PATH/TO/cert.pem</span>;
-  ssl_certificate_key   <span class="userinput"/>YOUR/PATH/TO/cert.key</span>;
+  ssl_certificate       <span class="userinput">/TODO/YOUR/PATH/TO/cert.pem</span>;
+  ssl_certificate_key   <span class="userinput">/TODO/YOUR/PATH/TO/cert.key</span>;
 
   location / {
     proxy_pass          http://keep-web;
@@ -169,7 +140,11 @@ server {
 </pre></notextile>
 
 {% include 'notebox_begin' %}
-If you restrict access to your Arvados services based on network topology -- for example, your proxy server is not reachable from the public internet -- additional proxy configuration might be needed to thwart cross-site scripting attacks that would circumvent your restrictions. Read the "'Intranet mode' section of the Keep-web documentation":https://godoc.org/github.com/curoverse/arvados/services/keep-web#hdr-Intranet_mode now.
+If you restrict access to your Arvados services based on network topology -- for example, your proxy server is not reachable from the public internet -- additional proxy configuration might be needed to thwart cross-site scripting attacks that would circumvent your restrictions.
+
+Normally, Keep-web accepts requests for multiple collections using the same host name, provided the client's credentials are not being used. This provides insufficient XSS protection in an installation where the "anonymously accessible" data is not truly public, but merely protected by network topology.
+
+In such cases -- for example, a site which is not reachable from the internet, where some data is world-readable from Arvados's perspective but is intended to be available only to users within the local network -- the downstream proxy should configured to return 401 for all paths beginning with "/c="
 {% include 'notebox_end' %}
 
 h2. Install Keep-web package
@@ -179,26 +154,24 @@ Typically Keep-web runs on the same host as Keepproxy.
 h3. Centos 7
 
 <notextile>
-<pre><code># <span class="userinput">yum install keepproxy</span>
+<pre><code># <span class="userinput">yum install keep-web</span>
 </code></pre>
 </notextile>
 
 h3. Debian and Ubuntu
 
 <notextile>
-<pre><code># <span class="userinput">apt-get install keepproxy</span>
+<pre><code># <span class="userinput">apt-get install keep-web</span>
 </code></pre>
 </notextile>
 
 h2(#start-service). Start the service
 
-If your system does not use systemd, skip this section and follow the "runit instructions":#runit instead.
-
 If your system uses systemd, the keep-web service should already be set up. Start it and check its status:
 
 <notextile>
-<pre><code>~$ <span class="userinput">sudo systemctl restart keep-web</span>
-~$ <span class="userinput">sudo systemctl status keep-web</span>
+<pre><code># <span class="userinput">systemctl restart keep-web</span>
+# <span class="userinput">systemctl status keep-web</span>
 &#x25cf; keep-web.service - Arvados Keep web gateway
    Loaded: loaded (/lib/systemd/system/keep-web.service; enabled)
    Active: active (running) since Sat 2019-08-10 10:33:21 UTC; 3 days ago
@@ -209,3 +182,28 @@ If your system uses systemd, the keep-web service should already be set up. Star
 [...]
 </code></pre>
 </notextile>
+
+h2(#restart-api). Restart the API server and controller
+
+After adding WebDAV to the Services section, make sure the cluster config file is up to date on the API server host, and restart the API server and controller processes to ensure the changes are applied.
+
+<notextile>
+<pre><code># <span class="userinput">systemctl restart nginx arvados-controller</span>
+</code></pre>
+</notextile>
+
+h2(#confirm-working). Confirm working installation
+
+Adjust for your configuration.
+
+<pre>
+$ curl -H "Authorization: Bearer $system_root_token" https://download.ClusterID.example.com/c=59389a8f9ee9d399be35462a0f92541c-53/_/hello.txt
+</pre>
+
+<pre>
+$ curl -H "Authorization: Bearer $system_root_token" https://collections.ClusterID.example.com/c=59389a8f9ee9d399be35462a0f92541c-53/_/hello.txt
+</pre>
+
+<pre>
+$ curl -H "Authorization: Bearer $system_root_token" https://59389a8f9ee9d399be35462a0f92541c-53.collections.ClusterID.example.com/hello.txt
+</pre>
index 2b2c56e23692713ed1bfaa08cd1644b6418ad09c..458ee9690a73baad0105e02f2c5d63b2d15abee3 100644 (file)
@@ -49,7 +49,7 @@ Edit the cluster config at @/etc/arvados/config.yml@ and set @Services.Keepproxy
 
 h2(#update-nginx). Update Nginx configuration
 
-Put a reverse proxy with SSL support in front of Keepproxy. Keepproxy itself runs on port 25107 by default; the reverse proxy runs on port 443 and forwards requests to Keepproxy on port 25107.
+Put a reverse proxy with SSL support in front of Keepproxy. Keepproxy itself runs on the port 25107 (or whatever is specified in @Services.Keepproxy.InternalURL@) the reverse proxy runs on port 443 and forwards requests to Keepproxy.
 
 Use a text editor to create a new file @/etc/nginx/conf.d/keepproxy.conf@ with the following configuration. Options that need attention are marked with “TODO”.
 
index 02254f4a368da9fac90d3a2c2d22d21263296e2c..d7bf4c2d2df0acafe826ea80895c02f7b8be72ed 100644 (file)
@@ -42,13 +42,3 @@ Ubuntu 14.04 (Trusty) requires an updated PostgreSQL version, see "the PostgreSQ
   <notextile><pre># <span class="userinput">systemctl enable postgresql</span></pre></notextile>
 # Start PostgreSQL
   <notextile><pre># <span class="userinput">systemctl start postgresql</span></pre></notextile>
-
-{% comment %}
-h2(#sso). Set up SSO server credentials and database
-
-{% assign service_role = "arvados_sso" %}
-{% assign service_database = "arvados_sso_production" %}
-{% assign use_contrib = false %}
-{% include 'install_postgres_database' %}
-
-{% endcomment %}
index fbed12495b6d5f541f2d01286d929ead4ff5113b..3bc975ddd3642cef40059cf55e5f73af2ec37a55 100644 (file)
@@ -9,63 +9,79 @@ Copyright (C) The Arvados Authors. All rights reserved.
 SPDX-License-Identifier: CC-BY-SA-3.0
 {% endcomment %}
 
-h2(#dependencies). Install prerequisites
+# "Install dependencies":#dependencies
+# "Set up database":#database-setup
+# "Update config.yml":#update-config
+# "Configure the SSO server":#create-application-yml
+# "Update Nginx configuration":#update-nginx
+# "Install arvados-sso-server":#install-packages
+# "Create arvados-server client record":#client
+# "Restart the API server and controller":#restart-api
 
-The Arvados package repository includes an SSO server package that can help automate much of the deployment.
+h2(#dependencies). Install dependencies
 
-h3(#install_ruby_and_bundler). Install Ruby and Bundler
+# "Install PostgreSQL":install-postgresql.html
+# "Install Ruby and Bundler":ruby.html  Important!  The Single Sign On server only supports Ruby 2.3, to avoid version conflicts we recommend installing it on a different server from the API server.  When installing Ruby, ensure that you get the right version by installing the "ruby2.3" package, or by using RVM with @--ruby=2.3@
+# "Install nginx":nginx.html
+# "Install Phusion Passenger":https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/install_passenger_main.html
 
-{% include 'install_ruby_and_bundler_sso' %}
+h2(#database-setup). Set up the database
 
-h3(#install_web_server). Set up a Web server
+{% assign service_role = "arvados_sso" %}
+{% assign service_database = "arvados_sso_production" %}
+{% assign use_contrib = false %}
+{% include 'install_postgres_database' %}
 
-For best performance, we recommend you use Nginx as your Web server frontend with a Passenger backend to serve the SSO server. The Passenger team provides "Nginx + Passenger installation instructions":https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/install_passenger_main.html.
+Now create @/etc/arvados/sso/database.yml@
 
-Follow the instructions until you see the section that says you are ready to deploy your Ruby application on the production server.
-
-h2(#install). Install the SSO server
+<pre>
+production:
+  adapter: postgresql
+  encoding: utf8
+  database: arvados_sso_production
+  username: arvados_sso
+  password: $password
+  host: localhost
+  template: template0
+</pre>
 
-On a Debian-based system, install the following package:
+h2(#update-config). Update config.yml
 
-<notextile>
-<pre><code>~$ <span class="userinput">sudo apt-get install arvados-sso-server</span>
-</code></pre>
-</notextile>
+<pre>
+    Services:
+      SSO:
+        ExternalURL: auth.ClusterID.example.com
+    Login:
+      ProviderAppID: "arvados-server"
+      ProviderAppSecret: $app_secret
+</pre>
 
-On a Red Hat-based system, install the following package:
+Generate @ProviderAppSecret@:
 
 <notextile>
-<pre><code>~$ <span class="userinput">sudo yum install arvados-sso-server</span>
-</code></pre>
-</notextile>
-
-h2(#configure). Configure the SSO server
-
-The package has installed three configuration files in @/etc/arvados/sso@:
+<pre><code>~$ <span class="userinput">ruby -e 'puts rand(2**400).to_s(36)'</span>
+zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+</code></pre></notextile>
 
-<notextile>
-<pre><code>/etc/arvados/sso/application.yml
-/etc/arvados/sso/database.yml
-/etc/arvados/sso/production.rb
-</code></pre>
-</notextile>
+h2(#create-application-yml). Configure the SSO server
 
-The SSO server runs from the @/var/www/arvados-sso/current/@ directory. The files @/var/www/arvados-sso/current/config/application.yml@, @/var/www/arvados-sso/current/config/database.yml@ and @/var/www/arvados-sso/current/config/environments/production.rb@ are symlinked to the configuration files in @/etc/arvados/sso/@.
+The SSO server runs from the @/var/www/arvados-sso/current/@ directory. The files @/var/www/arvados-sso/current/config/application.yml@ and @/var/www/arvados-sso/current/config/database.yml@ will be symlinked to the configuration files in @/etc/arvados/sso/@.
 
 The SSO server reads the @config/application.yml@ file, as well as the @config/application.defaults.yml@ file. Values in @config/application.yml@ take precedence over the defaults that are defined in @config/application.defaults.yml@. The @config/application.yml.example@ file is not read by the SSO server and is provided for installation convenience only.
 
 Consult @config/application.default.yml@ for a full list of configuration options.  Local configuration goes in @/etc/arvados/sso/application.yml@, do not edit @config/application.default.yml@.
 
-h3(#uuid_prefix). uuid_prefix
+Create @/etc/arvados/sso/application.yml@ and add these keys:
 
-Generate a uuid prefix for the single sign on service.  This prefix is used to identify user records as originating from this site.  It must be exactly 5 lowercase ASCII letters and/or digits.  You may use the following snippet to generate a uuid prefix:
+<pre>
+production:
+  uuid_prefix: xxxxx
+  secret_token: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+</pre>
 
-<notextile>
-<pre><code>~$ <span class="userinput">ruby -e 'puts "#{rand(2**64).to_s(36)[0,5]}"'</span>
-abcde
-</code></pre></notextile>
+h3(#uuid_prefix). uuid_prefix
 
-Edit @/etc/arvados/sso/application.yml@ and set @uuid_prefix@ in the "common" section.
+Most of the time, you want this to be the same as your @ClusterID@.  If not, generate a new one from the command line listed previously.
 
 h3(#secret_token). secret_token
 
@@ -76,97 +92,11 @@ Generate a new secret token for signing cookies:
 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
 </code></pre></notextile>
 
-Edit @/etc/arvados/sso/application.yml@ and set @secret_token@ in the "common" section.
-
-There are other configuration options in @/etc/arvados/sso/application.yml@. See the "Authentication methods":install-sso.html#authentication_methods section below for more details.
-
-h2(#database). Set up the database
-
-Configure the SSO server to connect to your database by updating @/etc/arvados/sso/database.yml@. Replace the @xxxxxxxx@ database password placeholder with the "password you generated during database setup":install-postgresql.html#sso. Be sure to update the @production@ section.
-
-<notextile>
-<pre><code>~$ <span class="userinput">editor /etc/arvados/sso/database.yml</span>
-</code></pre></notextile>
-
-h2(#reconfigure_package). Reconfigure the package
-
-{% assign railspkg = "arvados-sso-server" %}
-{% include 'install_rails_reconfigure' %}
-
-h2(#client). Create arvados-server client
-
-{% assign railshost = "" %}
-{% assign railsdir = "/var/www/arvados-sso/current" %}
-Use @rails console@ to create a @Client@ record that will be used by the Arvados API server.  {% include 'install_rails_command' %}
-
-Enter the following commands at the console.  The values that appear after you assign @app_id@ and @app_secret@ correspond to the values for @sso_app_id@ and @sso_app_secret@, respectively, in the "API server's SSO settings":install-api-server.html#omniauth.
-
-<notextile>
-<pre><code>:001 &gt; <span class="userinput">c = Client.new</span>
-:002 &gt; <span class="userinput">c.name = "joshid"</span>
-:003 &gt; <span class="userinput">c.app_id = "arvados-server"</span>
-:004 &gt; <span class="userinput">c.app_secret = rand(2**400).to_s(36)</span>
-=&gt; "<strong>save this string for your API server's sso_app_secret</strong>"
-:005 &gt; <span class="userinput">c.save!</span>
-:006 &gt; <span class="userinput">quit</span>
-</code></pre>
-</notextile>
-
-h2(#configure_web_server). Configure your web server
-
-Edit the http section of your Nginx configuration to run the Passenger server and act as a frontend for it. You might add a block like the following, adding SSL and logging parameters to taste:
-
-<notextile>
-<pre><code>server {
-  listen 127.0.0.1:8900;
-  server_name localhost-sso;
-
-  root   /var/www/arvados-sso/current/public;
-  index  index.html;
-
-  passenger_enabled on;
-  # If you're not using RVM, comment out the line below.
-  passenger_ruby /usr/local/rvm/wrappers/default/ruby;
-}
-
-upstream sso {
-  server     127.0.0.1:8900  fail_timeout=10s;
-}
-
-proxy_http_version 1.1;
-
-server {
-  listen       <span class="userinput">[your public IP address]</span>:443 ssl;
-  server_name  auth.<span class="userinput">your.domain</span>;
-
-  ssl on;
-  ssl_certificate     <span class="userinput">/YOUR/PATH/TO/cert.pem</span>;
-  ssl_certificate_key <span class="userinput">/YOUR/PATH/TO/cert.key</span>;
+h3(#authentication_methods). Authentication methods
 
-  index  index.html;
+Authentication methods are configured in @application.yml@.  Currently three authentication methods are supported: local accounts, LDAP, and Google.  If neither Google nor LDAP are enabled, the SSO server defaults to local user accounts.   Only one authentication mechanism should be in use at a time.  Choose your authentication method and add the listed configuration items to the @production@ section.
 
-  location / {
-    proxy_pass            http://sso;
-    proxy_redirect        off;
-    proxy_connect_timeout 90s;
-    proxy_read_timeout    300s;
-
-    proxy_set_header      X-Forwarded-Proto https;
-    proxy_set_header      Host $http_host;
-    proxy_set_header      X-Real-IP $remote_addr;
-    proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;
-  }
-}
-</code></pre>
-</notextile>
-
-Finally, restart Nginx and your Arvados SSO server should be up and running. You can verify that by visiting the URL you configured your Nginx web server to listen on in the server section above (port 443). Read on if you want to configure your Arvados SSO server to use a different authentication backend.
-
-h2(#authentication_methods). Authentication methods
-
-Authentication methods are configured in @application.yml@.  Currently three authentication methods are supported: local accounts, LDAP, and Google+.  If neither Google+ nor LDAP are enabled, the SSO server defaults to local user accounts.   Only one authentication mechanism should be in use at a time.
-
-h3(#local_accounts). Local account authentication
+h4(#local_accounts). Local account authentication
 
 There are two configuration options for local accounts:
 
@@ -194,7 +124,7 @@ Enter the following commands at the console.
 </code></pre>
 </notextile>
 
-h3(#ldap). LDAP authentication
+h4(#ldap). LDAP authentication
 
 The following options are available to configure LDAP authentication.  Note that you must preserve the indentation of the fields listed under @use_ldap@.
 
@@ -223,25 +153,81 @@ table(table).
 |bind_dn|If required by server, username to log with in before performing directory lookup|
 |password|If required by server, password to log with before performing directory lookup|
 
-h3(#google). Google+ authentication
+h4(#google). Google authentication
 
-In order to use Google+ authentication, you must use the <a href="https://console.developers.google.com" target="_blank">Google Developers Console</a> to create a set of client credentials.
+First, visit "Setting up Google auth.":google-auth.html
 
-# Go to the <a href="https://console.developers.google.com" target="_blank">Google Developers Console</a> and select or create a project; this will take you to the project page.
-# On the sidebar, click on *APIs & auth* then select *APIs*.
-## Search for *Contacts API* and click on *Enable API*.
-## Search for *Google+ API* and click on *Enable API*.
-# On the sidebar, click on *Credentials*; under *OAuth* click on *Create new Client ID* to bring up the *Create Client ID* dialog box.
-# Under *Application type* select *Web application*.
-# If the authorization origins are not displayed, clicking on *Create Client ID* will take you to *Consent screen* settings.
-## On consent screen settings, enter the appropriate details and click on *Save*.
-## This will return you to the *Create Client ID* dialog box.
-# You must set the authorization origins.  Edit @auth.your.domain@ to the appropriate hostname that you will use to access the SSO service:
-## JavaScript origin should be @https://auth.your.domain/@
-## Redirect URI should be @https://auth.your.domain/users/auth/google_oauth2/callback@
-# Copy the values of *Client ID* and *Client secret* from the Google Developers Console into the Google section of @config/application.yml@, like this:
+Next, copy the values of *Client ID* and *Client secret* from the Google Developers Console into the Google section of @config/application.yml@, like this:
 
 <notextile>
 <pre><code>  # Google API tokens required for OAuth2 login.
   google_oauth2_client_id: <span class="userinput">"---YOUR---CLIENT---ID---HERE--"-</span>
   google_oauth2_client_secret: <span class="userinput">"---YOUR---CLIENT---SECRET---HERE--"-</span></code></pre></notextile>
+
+h2(#update-nginx). Update nginx configuration
+
+Use a text editor to create a new file @/etc/nginx/conf.d/arvados-sso.conf@ with the following configuration.  Options that need attention are marked with "TODO".
+
+<notextile>
+<pre><code>server {
+  listen       <span class="userinput">auth.ClusterID.example.com</span>:443 ssl;
+  server_name  <span class="userinput">auth.ClusterID.example.com</span>;
+
+  ssl on;
+  ssl_certificate     <span class="userinput">/TODO/YOUR/PATH/TO/cert.pem</span>;
+  ssl_certificate_key <span class="userinput">/TODO/YOUR/PATH/TO/cert.key</span>;
+
+  root   /var/www/arvados-sso/current/public;
+  index  index.html;
+
+  passenger_enabled on;
+
+  # TODO: If you are using RVM, uncomment the line below.
+  # If you're using system ruby, leave it commented out.
+  #passenger_ruby /usr/local/rvm/wrappers/default/ruby;
+}
+</code></pre>
+</notextile>
+
+h2(#install-packages). Install arvados-sso-server package
+
+h3. Centos 7
+
+<notextile>
+<pre><code># <span class="userinput">yum install arvados-sso-server</span>
+</code></pre>
+</notextile>
+
+h3. Debian and Ubuntu
+
+<notextile>
+<pre><code># <span class="userinput">apt-get --no-install-recommends arvados-sso-server</span>
+</code></pre>
+</notextile>
+
+h2(#client). Create arvados-server client record
+
+{% assign railshost = "" %}
+{% assign railsdir = "/var/www/arvados-sso/current" %}
+Use @rails console@ to create a @Client@ record that will be used by the Arvados API server.  {% include 'install_rails_command' %}
+
+Enter the following commands at the console.  The values that appear after you assign @app_id@ and @app_secret@ will be copied to  @Login.ProviderAppID@ and @Login.ProviderAppSecret@ in @config.yml@.
+
+<notextile>
+<pre><code>:001 &gt; <span class="userinput">c = Client.new</span>
+:002 &gt; <span class="userinput">c.name = "joshid"</span>
+:003 &gt; <span class="userinput">c.app_id = "arvados-server"</span>
+:004 &gt; <span class="userinput">c.app_secret = "the value of Login.ProviderAppSecret"</span>
+:005 &gt; <span class="userinput">c.save!</span>
+:006 &gt; <span class="userinput">quit</span>
+</code></pre>
+</notextile>
+
+h2(#restart-api). Restart the API server and controller
+
+After adding the SSO server to the Services section, make sure the cluster config file is up to date on the API server host, and restart the API server and controller processes to ensure the changes are applied.
+
+<notextile>
+<pre><code># <span class="userinput">systemctl restart nginx arvados-controller</span>
+</code></pre>
+</notextile>
diff --git a/doc/install/setup-login.html.textile.liquid b/doc/install/setup-login.html.textile.liquid
new file mode 100644 (file)
index 0000000..46f1687
--- /dev/null
@@ -0,0 +1,29 @@
+---
+layout: default
+navsection: installguide
+title: Set up web based login
+...
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
+
+# "Option 1: Google login through Arvados controller":#controller
+# "Option 2: Separate single-sign-on (SSO) server (Google, LDAP, local database)":#sso
+
+h2(#controller). Option 1: Google login through Arvados controller
+
+First, visit "Setting up Google auth.":google-auth.html
+
+Next, copy the values of *Client ID* and *Client secret* from the Google Developers Console into @Login.GoogleClientID@ and @Login.GoogleClientSecret@ of @config.yml@ :
+
+<pre>
+    Login:
+      GoogleClientID: ""
+      GoogleClientSecret: ""
+</pre>
+
+h2(#sso). Option 2: Separate single-sign-on (SSO) server (supports Google, LDAP, local database)
+
+See "Install the Single Sign On (SSO) server":#install-sso.html