3 navsection: installguide
4 title: Install Keepproxy server
7 Copyright (C) The Arvados Authors. All rights reserved.
9 SPDX-License-Identifier: CC-BY-SA-3.0
12 The Keepproxy server is a gateway into your Keep storage. Unlike the Keepstore servers, which are only accessible on the local LAN, Keepproxy is suitable for clients located elsewhere on the internet. Specifically, in contrast to Keepstore:
13 * A client writing through Keepproxy generates less network traffic: the client sends a single copy of a data block, and Keepproxy sends copies to the appropriate Keepstore servers.
14 * A client can write through Keepproxy without precomputing content hashes. Notably, the browser-based upload feature in Workbench requires Keepproxy.
15 * Keepproxy checks API token validity before processing requests. (Clients that can connect directly to Keepstore can use it as scratch space even without a valid API token.)
17 By convention, we use the following hostname for the Keepproxy server:
20 table(table table-bordered table-condensed).
22 |keep.@uuid_prefix@.your.domain|
25 This hostname should resolve from anywhere on the internet.
29 On Debian-based systems:
32 <pre><code>~$ <span class="userinput">sudo apt-get install keepproxy</span>
36 On Red Hat-based systems:
39 <pre><code>~$ <span class="userinput">sudo yum install keepproxy</span>
43 Verify that Keepproxy is functional:
46 <pre><code>~$ <span class="userinput">keepproxy -h</span>
48 Usage: keepproxy [-config path/to/keepproxy.yml]
53 h3. Create an API token for the Keepproxy server
55 {% assign railscmd = "bundle exec ./script/get_anonymous_user_token.rb --get" %}
56 {% assign railsout = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" %}
57 The Keepproxy server needs a token to talk to the API server. On the <strong>API server</strong>, use the following command to create the token. {% include 'install_rails_command' %}
59 h3. Set up the Keepproxy service
61 Install runit to supervise the keepproxy daemon. {% include 'install_runit' %}
63 The run script for the keepproxy service should set the environment variables @ARVADOS_API_TOKEN@ (with the token you just generated), @ARVADOS_API_HOST@, and, if needed, @ARVADOS_API_HOST_INSECURE@. The core keepproxy command to run is:
66 <pre><code>ARVADOS_API_TOKEN=<span class="userinput">{{railsout}}</span> ARVADOS_API_HOST=<span class="userinput">uuid_prefix.your.domain</span> exec keepproxy
70 h3. Set up a reverse proxy with SSL support
72 Because the Keepproxy is intended for access from anywhere on the internet, it is recommended to use SSL for transport encryption.
74 This is best achieved by putting a reverse proxy with SSL support in front of Keepproxy. Keepproxy itself runs on port 25107 by default; your reverse proxy can run on port 443 and pass requests to Keepproxy on port 25107.
78 server 127.0.0.1:<span class="userinput">25107</span>;
82 listen <span class="userinput">[your public IP address]</span>:443 ssl;
83 server_name keep.<span class="userinput">uuid_prefix</span>.your.domain;
85 proxy_connect_timeout 90s;
86 proxy_read_timeout 300s;
87 proxy_set_header X-Real-IP $remote_addr;
90 ssl_certificate /etc/nginx/keep.<span class="userinput">uuid_prefix</span>.your.domain-ssl.crt;
91 ssl_certificate_key /etc/nginx/keep.<span class="userinput">uuid_prefix</span>.your.domain-ssl.key;
93 # Clients need to be able to upload blocks of data up to 64MiB in size.
94 client_max_body_size 64m;
97 proxy_pass http://keepproxy;
102 Note: if the Web uploader is failing to upload data and there are no logs from keepproxy, be sure to check the nginx proxy logs. In addition to "GET" and "PUT", The nginx proxy must pass "OPTIONS" requests to keepproxy, which should respond with appropriate Cross-origin resource sharing headers. If the CORS headers are not present, brower security policy will cause the upload request to silently fail. The CORS headers are generated by keepproxy and should not be set in nginx.
104 h3. Tell the API server about the Keepproxy server
106 The API server needs to be informed about the presence of your Keepproxy server. Please execute the following commands on your <strong>shell server</strong>.
109 <pre><code>~$ <span class="userinput">uuid_prefix=`arv --format=uuid user current | cut -d- -f1`</span>
110 ~$ <span class="userinput">echo "Site prefix is '$uuid_prefix'"</span>
111 ~$ <span class="userinput">read -rd $'\000' keepservice <<EOF; arv keep_service create --keep-service "$keepservice"</span>
112 <span class="userinput">{
113 "service_host":"<strong>keep.$uuid_prefix.your.domain</strong>",
115 "service_ssl_flag":true,
116 "service_type":"proxy"
119 </code></pre></notextile>