11901: Require management token for health checks.
[arvados.git] / services / ws / config.go
index e2d69d0c68a2586b64a830b1baaabc56137c6604..cf82cf8e1064cae202132f8ee97056b72fef2e41 100644 (file)
@@ -6,31 +6,36 @@ import (
        "git.curoverse.com/arvados.git/sdk/go/arvados"
 )
 
-type Config struct {
-       Client    arvados.Client
-       Postgres  pgConfig
-       Listen    string
-       LogLevel  string
-       LogFormat string
+type wsConfig struct {
+       Client       arvados.Client
+       Postgres     pgConfig
+       PostgresPool int
+       Listen       string
+       LogLevel     string
+       LogFormat    string
 
        PingTimeout      arvados.Duration
        ClientEventQueue int
        ServerEventQueue int
+
+       ManagementToken string
 }
 
-func DefaultConfig() Config {
-       return Config{
+func defaultConfig() wsConfig {
+       return wsConfig{
                Client: arvados.Client{
                        APIHost: "localhost:443",
                },
                Postgres: pgConfig{
-                       "dbname":          "arvados_production",
-                       "user":            "arvados",
-                       "password":        "xyzzy",
-                       "host":            "localhost",
-                       "connect_timeout": "30",
-                       "sslmode":         "require",
+                       "dbname":                    "arvados_production",
+                       "user":                      "arvados",
+                       "password":                  "xyzzy",
+                       "host":                      "localhost",
+                       "connect_timeout":           "30",
+                       "sslmode":                   "require",
+                       "fallback_application_name": "arvados-ws",
                },
+               PostgresPool:     64,
                LogLevel:         "info",
                LogFormat:        "json",
                PingTimeout:      arvados.Duration(time.Minute),