18700: Enable TrustAllContent in package testinstall.
authorTom Clegg <tom@curii.com>
Thu, 24 Mar 2022 18:45:29 +0000 (14:45 -0400)
committerTom Clegg <tom@curii.com>
Thu, 24 Mar 2022 18:45:29 +0000 (14:45 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

cmd/arvados-package/install.go
lib/install/init.go

index af72c2c393ae27303cec4108f90e07606d581d63..b49d1e3473d5b38a9bf31bd875f8c38cb203c62c 100644 (file)
@@ -119,7 +119,7 @@ eatmydata apt-get install --reinstall -y --no-install-recommends arvados-server-
 SUDO_FORCE_REMOVE=yes apt-get autoremove -y
 
 /etc/init.d/postgresql start
-arvados-server init -cluster-id x1234 -domain=$domain -login=test
+arvados-server init -cluster-id x1234 -domain=$domain -login=test -insecure
 exec arvados-server boot -listen-host=0.0.0.0 $bootargs
 `)
        cmd.Stdout = stdout
index db78a282f33ef52e155472723f2b88adf26dc551..c88546da93b53a4d6ca8167bf56b3fd62c8c09d7 100644 (file)
@@ -34,6 +34,7 @@ type initCommand struct {
        Domain             string
        PostgreSQLPassword string
        Login              string
+       Insecure           bool
 }
 
 func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
@@ -61,6 +62,7 @@ func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Read
        flags.StringVar(&initcmd.ClusterID, "cluster-id", "", "cluster `id`, like x1234 for a dev cluster")
        flags.StringVar(&initcmd.Domain, "domain", hostname, "cluster public DNS `name`, like x1234.arvadosapi.com")
        flags.StringVar(&initcmd.Login, "login", "", "login `backend`: test, pam, or ''")
+       flags.BoolVar(&initcmd.Insecure, "insecure", false, "accept invalid TLS certificates and configure TrustAllContent (do not use in production!)")
        if ok, code := cmd.ParseFlags(flags, prog, args, "", stderr); !ok {
                return code
        } else if *versionFlag {
@@ -151,6 +153,9 @@ func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Read
           "http://0.0.0.0:9007/": {}
     Collections:
       BlobSigningKey: {{printf "%q" ( .RandomHex 50 )}}
+      {{if .Insecure}}
+      TrustAllContent: true
+      {{end}}
     Containers:
       DispatchPrivateKey: {{printf "%q" .GenerateSSHPrivateKey}}
     ManagementToken: {{printf "%q" ( .RandomHex 50 )}}
@@ -161,8 +166,10 @@ func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Read
         user: arvados
         password: {{printf "%q" .PostgreSQLPassword}}
     SystemRootToken: {{printf "%q" ( .RandomHex 50 )}}
+    {{if .Insecure}}
     TLS:
       Insecure: true
+    {{end}}
     Volumes:
       {{.ClusterID}}-nyw5e-000000000000000:
         Driver: Directory