18700: Use different ports for WebDAV and WebDAVDownload ext URLs.
[arvados.git] / lib / install / init.go
index adfa64b3b39bd9c672aaa04a201c89fcbd9c0395..db78a282f33ef52e155472723f2b88adf26dc551 100644 (file)
@@ -33,6 +33,7 @@ type initCommand struct {
        ClusterID          string
        Domain             string
        PostgreSQLPassword string
+       Login              string
 }
 
 func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
@@ -59,6 +60,7 @@ func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Read
        versionFlag := flags.Bool("version", false, "Write version information to stdout and exit 0")
        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 ''")
        if ok, code := cmd.ParseFlags(flags, prog, args, "", stderr); !ok {
                return code
        } else if *versionFlag {
@@ -110,25 +112,25 @@ func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Read
       Websocket:
         InternalURLs:
           "http://0.0.0.0:8005/": {}
-        ExternalURL: {{printf "%q" ( print "wss://." .Domain ":4436/" ) }}
+        ExternalURL: {{printf "%q" ( print "wss://" .Domain ":4435/websocket" ) }}
       Keepbalance:
         InternalURLs:
           "http://0.0.0.0:9005/": {}
       GitHTTP:
         InternalURLs:
           "http://0.0.0.0:9001/": {}
-        ExternalURL: {{printf "%q" ( print "https://" .Domain ":4437/" ) }}
+        ExternalURL: {{printf "%q" ( print "https://" .Domain ":4436/" ) }}
       DispatchCloud:
         InternalURLs:
           "http://0.0.0.0:9006/": {}
       Keepproxy:
         InternalURLs:
           "http://0.0.0.0:25108/": {}
-        ExternalURL: {{printf "%q" ( print "https://" .Domain ":4438/" ) }}
+        ExternalURL: {{printf "%q" ( print "https://" .Domain ":4437/" ) }}
       WebDAV:
         InternalURLs:
           "http://0.0.0.0:9002/": {}
-        ExternalURL: {{printf "%q" ( print "https://" .Domain ":4439/" ) }}
+        ExternalURL: {{printf "%q" ( print "https://" .Domain ":4438/" ) }}
       WebDAVDownload:
         InternalURLs:
           "http://0.0.0.0:8004/": {}
@@ -169,6 +171,26 @@ func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Read
         Replication: 2
     Workbench:
       SecretKeyBase: {{printf "%q" ( .RandomHex 50 )}}
+    Login:
+      {{if eq .Login "pam"}}
+      PAM:
+        Enable: true
+      {{else if eq .Login "test"}}
+      Test:
+        Enable: true
+        Users:
+          admin:
+            Email: admin@example.com
+            Password: admin
+      {{else}}
+      {}
+      {{end}}
+    Users:
+      {{if eq .Login "test"}}
+      AutoAdminUserWithEmail: admin@example.com
+      {{else}}
+      {}
+      {{end}}
 `)
        if err != nil {
                return 1