X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/767e1199d0e1bdf2b564b5c58a91d29141eb67d7..908261de15c98553a4200f01aff1f26ef57c8fb8:/doc/install/install-keep-web.html.textile.liquid diff --git a/doc/install/install-keep-web.html.textile.liquid b/doc/install/install-keep-web.html.textile.liquid index 0a00ca85f1..9e271d3c27 100644 --- a/doc/install/install-keep-web.html.textile.liquid +++ b/doc/install/install-keep-web.html.textile.liquid @@ -6,14 +6,15 @@ title: Install the keep-web server The keep-web server provides read-only HTTP 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 SSL support. See the "godoc page":http://godoc.org/github.com/curoverse/arvados/services/keep-web for more detail. -By convention, we use the following hostname for the keep-web service: +By convention, we use the following hostnames for the keep-web service: -
collections.uuid_prefix.your.domain
+
download.uuid_prefix.your.domain
+collections.uuid_prefix.your.domain
 
-This hostname should resolve from anywhere on the internet. +The above hostnames should resolve from anywhere on the internet. h2. Install keep-web @@ -36,33 +37,35 @@ Verify that @keep-web@ is functional:
~$ keep-web -h
 Usage of keep-web:
-  -address string
-        Address to listen on: "host:port", or ":port" to listen on all interfaces. (default ":80")
-  -anonymous-token value
-        API token to try when none of the tokens provided in an HTTP request succeed in reading the desired collection. If this flag is used more than once, each token will be attempted in turn until one works. (default [])
+  -allow-anonymous
+        Serve public data to anonymous clients. Try the token supplied in the ARVADOS_API_TOKEN environment variable when none of the tokens provided in an HTTP request succeed in reading the desired collection. (default false)
   -attachment-only-host string
         Accept credentials, and add "Content-Disposition: attachment" response headers, for requests at this hostname:port. Prohibiting inline display makes it possible to serve untrusted and non-public content from a single origin, i.e., without wildcard DNS or SSL.
+  -listen string
+        Address to listen on: "host:port", or ":port" to listen on all interfaces. (default ":80")
   -trust-all-content
         Serve non-public content from a single origin. Dangerous: read docs before using!
 
-If you intend to use Keep-web to serve public data to anonymous clients, configure it with an anonymous token. You can use the same one you used when you set up your Keepproxy server, or use the following command on the API server to create another: - - -
/var/www/arvados-api/current/script$ RAILS_ENV=production bundle exec ./get_anonymous_user_token.rb
-hoShoomoo2bai3Ju1xahg6aeng1siquuaZ1yae2gi2Uhaeng2r
-
+{% assign railscmd = "bundle exec ./script/get_anonymous_user_token.rb" %} +{% assign railsout = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" %} +If you intend to use Keep-web to serve public data to anonymous clients, configure it with an anonymous token. You can use the same one you used when you set up your Keepproxy server, or use the following command on the API server to create another. {% include 'install_rails_command' %} We recommend running @keep-web@ under "runit":https://packages.debian.org/search?keywords=runit or a similar supervisor. The basic command to start @keep-web@ is:
export ARVADOS_API_HOST=uuid_prefix.your.domain
-exec sudo -u nobody keep-web -address=:9002 -anonymous-token=hoShoomoo2bai3Ju1xahg6aeng1siquuaZ1yae2gi2Uhaeng2r 2>&1
+export ARVADOS_API_TOKEN="{{railsout}}"
+exec sudo -u nobody keep-web \
+ -listen=:9002 \
+ -attachment-only-host=download.uuid_prefix.your.domain \
+ -allow-anonymous \
+ 2>&1
 
-Omit the @-anonymous-token@ arguments if you do not want to serve public data. +Omit the @-allow-anonymous@ argument if you do not want to serve public data. Set @ARVADOS_API_HOST_INSECURE=1@ if your API server's SSL certificate is not signed by a recognized CA. @@ -72,7 +75,7 @@ The keep-web service will be accessible from anywhere on the internet, so we rec This is best achieved by putting a reverse proxy with SSL 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 SSL certificate is required in order to proxy keep-web effectively. +Note: A wildcard SSL 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 SSL certificate and DNS configured appropriately, all data can be served as web content. For example, using Nginx: @@ -83,7 +86,10 @@ upstream keep-web { server { listen [your public IP address]:443 ssl; - server_name collections.uuid_prefix.your.domain *.collections.uuid_prefix.your.domain ~.*--collections.uuid_prefix.your.domain; + server_name download.uuid_prefix.your.domain + collections.uuid_prefix.your.domain + *.collections.uuid_prefix.your.domain + ~.*--collections.uuid_prefix.your.domain; proxy_connect_timeout 90s; proxy_read_timeout 300s; @@ -103,17 +109,29 @@ server { h3. Configure DNS Configure your DNS servers so the following names resolve to your Nginx proxy's public IP address. -* @*--collections.uuid_prefix.your.domain@, if your DNS server allows this without interfering with other DNS names; or -* @*.collections.uuid_prefix.your.domain@, if you have a wildcard SSL certificate valid for these names; or -* @collections.uuid_prefix.your.domain@, if neither of the above options is feasible. In this case, only unauthenticated requests will be served, i.e., public data and collection sharing links. +* @download.uuid_prefix.your.domain@ +* @collections.uuid_prefix.your.domain@ +* @*--collections.uuid_prefix.your.domain@, if you have a wildcard SSL certificate valid for @*.uuid_prefix.your.domain@ and your DNS server allows this without interfering with other DNS names. +* @*.collections.uuid_prefix.your.domain@, if you have a wildcard SSL certificate valid for these names. + +If neither of the above wildcard options is feasible, only unauthenticated requests (public data and collection sharing links) will be served as web content at @collections.uuid_prefix.your.domain@. The @download@ name will be used to serve authenticated content, but only as file downloads. h3. Tell Workbench about the keep-web service -Add *one* of the following entries to your Workbench configuration file (@/etc/arvados/workbench/application.yml@), depending on your DNS setup: +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. + +Add the following entry to your Workbench configuration file (@/etc/arvados/workbench/application.yml@). This URL will be used for file downloads. + + +
keep_web_download_url: https://download.uuid_prefix.your.domain/c=%{uuid_or_pdh}
+
+
+ +Additionally, add *one* of the following entries to your Workbench configuration file, depending on your DNS setup. This URL will be used to serve user content that can be displayed in the browser, like image previews and static HTML pages.
keep_web_url: https://%{uuid_or_pdh}--collections.uuid_prefix.your.domain
 keep_web_url: https://%{uuid_or_pdh}.collections.uuid_prefix.your.domain
-keep_web_url: https://collections.uuid_prefix.your.domain
+keep_web_url: https://collections.uuid_prefix.your.domain/c=%{uuid_or_pdh}