[ARVADOS] updated: 6a8d940762f1b9be1a3a273e13b070d1f75ef8f1

git at public.curoverse.com git at public.curoverse.com
Thu Nov 5 10:54:17 EST 2015


Summary of changes:
 .../install-compute-node.html.textile.liquid       |  4 ++
 doc/install/install-keep-web.html.textile.liquid   | 13 ++--
 sdk/cli/bin/crunch-job                             |  7 +-
 sdk/go/arvadosclient/arvadosclient.go              | 20 ++++++
 sdk/go/arvadosclient/arvadosclient_test.go         | 78 +++++++++++++---------
 services/dockercleaner/arvados_docker/cleaner.py   | 40 ++++++++++-
 services/dockercleaner/tests/test_cleaner.py       | 74 +++++++++++++++++++-
 services/keep-web/anonymous.go                     | 23 +++++--
 services/keep-web/doc.go                           | 18 ++---
 services/keep-web/main.go                          |  4 +-
 services/keep-web/server.go                        |  2 +-
 services/keepstore/keepstore.go                    | 14 ++--
 .../arvnodeman/computenode/dispatch/__init__.py    | 22 ++++--
 .../arvnodeman/computenode/dispatch/slurm.py       |  4 +-
 services/nodemanager/arvnodeman/daemon.py          | 14 +++-
 .../nodemanager/tests/test_computenode_dispatch.py | 14 +++-
 services/nodemanager/tests/test_daemon.py          | 20 ++++++
 17 files changed, 288 insertions(+), 83 deletions(-)

       via  6a8d940762f1b9be1a3a273e13b070d1f75ef8f1 (commit)
       via  fa96bcea706312be52f1488da3dad34452f5ccf4 (commit)
       via  6b606a655410d9ed5116c3a3b6b6971bd90f9666 (commit)
       via  c74d29f1a53a1020520ffe6992ce4a39a350b5ef (commit)
       via  57d3837ca9a8c5e4e71f9741931cc67e908fb3dd (commit)
       via  0a43beae9c546b356220b281a432e1fa1986a305 (commit)
       via  21bcf992a7e4eb806ea45c851356b2a50015fa65 (commit)
       via  3c0ef3fc0cdb3f56d90442cc389ce4c2c94e8831 (commit)
       via  3bef97ac46da8f5a7c322ec31c6bba4affb8ad80 (commit)
       via  0a365f3d1a19fc27b402c9c742debf8975424b3f (commit)
       via  242d3272391baeb95eb0a5e4e51627c2d54e7bc6 (commit)
       via  59b22379a693d1fc15b4b77e58e47bac89e62660 (commit)
       via  1d1c6de3c842a33a57b7d469fdaaaa1b873433dc (commit)
       via  21006cfaf6d4d0ac3884a72803a8723bc4bb76fb (commit)
       via  9b48b17eddea5e366e0c59ed9f3540793550256c (commit)
       via  82b7adbaf524d6e7fd2b9a6403f9e490dcb3ac85 (commit)
       via  bd9722cb7b6f92b752ac786797d884ea711944cb (commit)
       via  7bde93de3260e08503c7bf9c06fd3448972d378a (commit)
       via  1057d0912fef22aeaa707fd428521a76806a21d0 (commit)
       via  e10ccaba824b4f60ddc516903304351496b5fdca (commit)
       via  b11cc5c782e4e94a422b8133be42bbb263d48dba (commit)
      from  78af1220d9e2ddf4d933d9a9487397414d8a3909 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 6a8d940762f1b9be1a3a273e13b070d1f75ef8f1
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Nov 5 10:54:13 2015 -0500

    5824: Use ARVADOS_API_TOKEN=foo + -allow-anonymous instead of -anonymous-token=foo.

diff --git a/doc/install/install-keep-web.html.textile.liquid b/doc/install/install-keep-web.html.textile.liquid
index 823a600..11a425d 100644
--- a/doc/install/install-keep-web.html.textile.liquid
+++ b/doc/install/install-keep-web.html.textile.liquid
@@ -36,8 +36,8 @@ Verify that @keep-web@ is functional:
 <notextile>
 <pre><code>~$ <span class="userinput">keep-web -h</span>
 Usage of keep-web:
-  -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
@@ -58,11 +58,12 @@ We recommend running @keep-web@ under "runit":https://packages.debian.org/search
 
 <notextile>
 <pre><code>export ARVADOS_API_HOST=<span class="userinput">uuid_prefix</span>.your.domain
-exec sudo -u nobody keep-web -listen=<span class="userinput">:9002</span> -anonymous-token=<span class="userinput">hoShoomoo2bai3Ju1xahg6aeng1siquuaZ1yae2gi2Uhaeng2r</span> 2>&1
+export ARVADOS_API_TOKEN="<span class="userinput">hoShoomoo2bai3Ju1xahg6aeng1siquuaZ1yae2gi2Uhaeng2r</span>"
+exec sudo -u nobody keep-web -listen=<span class="userinput">:9002</span> -allow-anonymous 2>&1
 </code></pre>
 </notextile>
 
-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.
 
diff --git a/services/keep-web/anonymous.go b/services/keep-web/anonymous.go
index bfc716f..15a98c2 100644
--- a/services/keep-web/anonymous.go
+++ b/services/keep-web/anonymous.go
@@ -3,22 +3,33 @@ package main
 import (
 	"flag"
 	"fmt"
+	"os"
+	"strconv"
 )
 
 var anonymousTokens tokenSet
 
 type tokenSet []string
 
-func (ts *tokenSet) Set(t string) error {
-	*ts = append(*ts, t)
-	return nil
+func (ts *tokenSet) Set(s string) error {
+	v, err := strconv.ParseBool(s)
+	if v && len(*ts) == 0 {
+		*ts = append(*ts, os.Getenv("ARVADOS_API_TOKEN"))
+	} else if !v {
+		*ts = (*ts)[:0]
+	}
+	return err
 }
 
 func (ts *tokenSet) String() string {
-	return fmt.Sprintf("%+v", (*ts)[:])
+	return fmt.Sprintf("%v", len(*ts) > 0)
+}
+
+func (ts *tokenSet) IsBoolFlag() bool {
+	return true
 }
 
 func init() {
-	flag.Var(&anonymousTokens, "anonymous-token",
-		"API token to try when none of the tokens provided in an HTTP request succeed in reading the desired collection. Multiple anonymous tokens can be provided by using this flag more than once; each token will be attempted in turn until one works.")
+	flag.Var(&anonymousTokens, "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.")
 }
diff --git a/services/keep-web/doc.go b/services/keep-web/doc.go
index 4c44733..4207d7b 100644
--- a/services/keep-web/doc.go
+++ b/services/keep-web/doc.go
@@ -48,10 +48,12 @@
 //
 // Anonymous downloads
 //
-// Use the -anonymous-token option to specify a token to use when clients
-// try to retrieve files without providing their own Arvados API token.
+// Use the -allow-anonymous flag with an ARVADOS_API_TOKEN environment
+// variable to specify a token to use when clients try to retrieve
+// files without providing their own Arvados API token.
 //
-//   keep-web [...] -anonymous-token=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+//   export ARVADOS_API_TOKEN=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+//   keep-web [...] -allow-anonymous
 //
 // See http://doc.arvados.org/install/install-keep-web.html for examples.
 //
diff --git a/services/keep-web/main.go b/services/keep-web/main.go
index 751543e..135f01b 100644
--- a/services/keep-web/main.go
+++ b/services/keep-web/main.go
@@ -12,7 +12,9 @@ func init() {
 	// different token before doing anything with the client). We
 	// set this dummy value during init so it doesn't clobber the
 	// one used by "run test servers".
-	os.Setenv("ARVADOS_API_TOKEN", "xxx")
+	if os.Getenv("ARVADOS_API_TOKEN") == "" {
+		os.Setenv("ARVADOS_API_TOKEN", "xxx")
+	}
 }
 
 func main() {

commit fa96bcea706312be52f1488da3dad34452f5ccf4
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Nov 5 10:11:06 2015 -0500

    5824: Rename -address to -listen

diff --git a/doc/install/install-keep-web.html.textile.liquid b/doc/install/install-keep-web.html.textile.liquid
index 0a00ca8..823a600 100644
--- a/doc/install/install-keep-web.html.textile.liquid
+++ b/doc/install/install-keep-web.html.textile.liquid
@@ -36,12 +36,12 @@ Verify that @keep-web@ is functional:
 <notextile>
 <pre><code>~$ <span class="userinput">keep-web -h</span>
 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 [])
   -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!
 </code></pre>
@@ -58,7 +58,7 @@ We recommend running @keep-web@ under "runit":https://packages.debian.org/search
 
 <notextile>
 <pre><code>export ARVADOS_API_HOST=<span class="userinput">uuid_prefix</span>.your.domain
-exec sudo -u nobody keep-web -address=<span class="userinput">:9002</span> -anonymous-token=<span class="userinput">hoShoomoo2bai3Ju1xahg6aeng1siquuaZ1yae2gi2Uhaeng2r</span> 2>&1
+exec sudo -u nobody keep-web -listen=<span class="userinput">:9002</span> -anonymous-token=<span class="userinput">hoShoomoo2bai3Ju1xahg6aeng1siquuaZ1yae2gi2Uhaeng2r</span> 2>&1
 </code></pre>
 </notextile>
 
diff --git a/services/keep-web/doc.go b/services/keep-web/doc.go
index 5aa09e2..4c44733 100644
--- a/services/keep-web/doc.go
+++ b/services/keep-web/doc.go
@@ -12,11 +12,11 @@
 //
 // Serve HTTP requests at port 1234 on all interfaces:
 //
-//   keep-web -address=:1234
+//   keep-web -listen=:1234
 //
 // Serve HTTP requests at port 1234 on the interface with IP address 1.2.3.4:
 //
-//   keep-web -address=1.2.3.4:1234
+//   keep-web -listen=1.2.3.4:1234
 //
 // Proxy configuration
 //
@@ -209,7 +209,7 @@
 // only when the designated origin matches exactly the Host header
 // provided by the client or downstream proxy.
 //
-//   keep-web -address :9999 -attachment-only-host domain.example:9999
+//   keep-web -listen :9999 -attachment-only-host domain.example:9999
 //
 // Trust All Content mode
 //
@@ -222,12 +222,12 @@
 //
 // In such cases you can enable trust-all-content mode.
 //
-//   keep-web -address :9999 -trust-all-content
+//   keep-web -listen :9999 -trust-all-content
 //
 // When using trust-all-content mode, the only effect of the
 // -attachment-only-host option is to add a "Content-Disposition:
 // attachment" header.
 //
-//   keep-web -address :9999 -attachment-only-host domain.example:9999 -trust-all-content
+//   keep-web -listen :9999 -attachment-only-host domain.example:9999 -trust-all-content
 //
 package main
diff --git a/services/keep-web/server.go b/services/keep-web/server.go
index 2359f23..1009008 100644
--- a/services/keep-web/server.go
+++ b/services/keep-web/server.go
@@ -10,7 +10,7 @@ import (
 var address string
 
 func init() {
-	flag.StringVar(&address, "address", ":80",
+	flag.StringVar(&address, "listen", ":80",
 		"Address to listen on: \"host:port\", or \":port\" to listen on all interfaces.")
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list