ClusterID string
Domain string
PostgreSQLPassword string
+ Login string
+ TLS string
}
func (initcmd *initCommand) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
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")
- err = flags.Parse(args)
- if err == flag.ErrHelp {
- err = nil
- return 0
- } else if err != nil {
- return 2
+ flags.StringVar(&initcmd.Login, "login", "", "login `backend`: test, pam, or ''")
+ flags.StringVar(&initcmd.TLS, "tls", "none", "tls certificate `source`: acme, auto, insecure, or none")
+ if ok, code := cmd.ParseFlags(flags, prog, args, "", stderr); !ok {
+ return code
} else if *versionFlag {
return cmd.Version.RunCommand(prog, args, stdin, stdout, stderr)
- } else if len(flags.Args()) > 0 {
- err = fmt.Errorf("unrecognized command line arguments: %v", flags.Args())
- return 2
} else if !regexp.MustCompile(`^[a-z][a-z0-9]{4}`).MatchString(initcmd.ClusterID) {
err = fmt.Errorf("cluster ID %q is invalid; must be an ASCII letter followed by 4 alphanumerics (try -help)", initcmd.ClusterID)
return 1
Services:
Controller:
InternalURLs:
- "http://0.0.0.0:8003/": {}
- ExternalURL: {{printf "%q" ( print "https://" .Domain "/" ) }}
+ "http://0.0.0.0:9000/": {}
+ ExternalURL: {{printf "%q" ( print "https://" .Domain ":4440/" ) }}
RailsAPI:
InternalURLs:
- "http://0.0.0.0:8004/": {}
+ "http://0.0.0.0:9001/": {}
Websocket:
InternalURLs:
"http://0.0.0.0:8005/": {}
- ExternalURL: {{printf "%q" ( print "wss://ws." .Domain "/" ) }}
+ ExternalURL: {{printf "%q" ( print "wss://" .Domain ":4436/" ) }}
Keepbalance:
InternalURLs:
- "http://0.0.0.0:9005/": {}
+ "http://0.0.0.0:9019/": {}
GitHTTP:
InternalURLs:
- "http://0.0.0.0:9001/": {}
- ExternalURL: {{printf "%q" ( print "https://git." .Domain "/" ) }}
+ "http://0.0.0.0:9005/": {}
+ ExternalURL: {{printf "%q" ( print "https://" .Domain ":4445/" ) }}
DispatchCloud:
InternalURLs:
"http://0.0.0.0:9006/": {}
Keepproxy:
InternalURLs:
- "http://0.0.0.0:25108/": {}
- ExternalURL: {{printf "%q" ( print "https://keep." .Domain "/" ) }}
+ "http://0.0.0.0:9007/": {}
+ ExternalURL: {{printf "%q" ( print "https://" .Domain ":4447/" ) }}
WebDAV:
InternalURLs:
- "http://0.0.0.0:9002/": {}
- ExternalURL: {{printf "%q" ( print "https://*.collections." .Domain "/" ) }}
+ "http://0.0.0.0:9008/": {}
+ ExternalURL: {{printf "%q" ( print "https://" .Domain ":4448/" ) }}
WebDAVDownload:
InternalURLs:
- "http://0.0.0.0:8004/": {}
- ExternalURL: {{printf "%q" ( print "https://download." .Domain "/" ) }}
+ "http://0.0.0.0:9009/": {}
+ ExternalURL: {{printf "%q" ( print "https://" .Domain ":4449/" ) }}
Keepstore:
InternalURLs:
- "http://0.0.0.0:25107/": {}
+ "http://0.0.0.0:9010/": {}
Composer:
- ExternalURL: {{printf "%q" ( print "https://workbench." .Domain "/composer" ) }}
+ ExternalURL: {{printf "%q" ( print "https://" .Domain ":4459/composer" ) }}
Workbench1:
InternalURLs:
- "http://0.0.0.0:8001/": {}
- ExternalURL: {{printf "%q" ( print "https://workbench." .Domain "/" ) }}
- #Workbench2:
- # InternalURLs:
- # "http://0.0.0.0:8002/": {}
- # ExternalURL: {{printf "%q" ( print "https://workbench2." .Domain "/" ) }}
+ "http://0.0.0.0:9002/": {}
+ ExternalURL: {{printf "%q" ( print "https://" .Domain ":4442/" ) }}
+ Workbench2:
+ InternalURLs:
+ "http://0.0.0.0:9003/": {}
+ ExternalURL: {{printf "%q" ( print "https://" .Domain "/" ) }}
Health:
InternalURLs:
- "http://0.0.0.0:9007/": {}
+ "http://0.0.0.0:9011/": {}
Collections:
BlobSigningKey: {{printf "%q" ( .RandomHex 50 )}}
+ {{if eq .TLS "insecure"}}
+ TrustAllContent: true
+ {{end}}
Containers:
DispatchPrivateKey: {{printf "%q" .GenerateSSHPrivateKey}}
+ CloudVMs:
+ Enable: true
+ Driver: loopback
ManagementToken: {{printf "%q" ( .RandomHex 50 )}}
PostgreSQL:
Connection:
password: {{printf "%q" .PostgreSQLPassword}}
SystemRootToken: {{printf "%q" ( .RandomHex 50 )}}
TLS:
+ {{if eq .TLS "insecure"}}
Insecure: true
+ {{else if eq .TLS "auto"}}
+ Automatic: true
+ {{else if eq .TLS "acme"}}
+ Certificate: {{printf "%q" (print "/var/lib/acme/live/" .Domain "/cert")}}
+ Key: {{printf "%q" (print "/var/lib/acme/live/" .Domain "/privkey")}}
+ {{else}}
+ {}
+ {{end}}
Volumes:
{{.ClusterID}}-nyw5e-000000000000000:
Driver: Directory
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