aboutsummaryrefslogtreecommitdiff
path: root/setup/config/config_userapi.go
diff options
context:
space:
mode:
Diffstat (limited to 'setup/config/config_userapi.go')
-rw-r--r--setup/config/config_userapi.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/setup/config/config_userapi.go b/setup/config/config_userapi.go
index 4aa3b57b..d1e2b7fe 100644
--- a/setup/config/config_userapi.go
+++ b/setup/config/config_userapi.go
@@ -26,19 +26,22 @@ const DefaultOpenIDTokenLifetimeMS = 3600000 // 60 minutes
func (c *UserAPI) Defaults(generate bool) {
c.InternalAPI.Listen = "http://localhost:7781"
c.InternalAPI.Connect = "http://localhost:7781"
+ c.BCryptCost = bcrypt.DefaultCost
+ c.OpenIDTokenLifetimeMS = DefaultOpenIDTokenLifetimeMS
c.AccountDatabase.Defaults(10)
if generate {
c.AccountDatabase.ConnectionString = "file:userapi_accounts.db"
}
- c.BCryptCost = bcrypt.DefaultCost
- c.OpenIDTokenLifetimeMS = DefaultOpenIDTokenLifetimeMS
}
func (c *UserAPI) Verify(configErrs *ConfigErrors, isMonolith bool) {
- checkURL(configErrs, "user_api.internal_api.listen", string(c.InternalAPI.Listen))
- checkURL(configErrs, "user_api.internal_api.connect", string(c.InternalAPI.Connect))
+ checkPositive(configErrs, "user_api.openid_token_lifetime_ms", c.OpenIDTokenLifetimeMS)
if c.Matrix.DatabaseOptions.ConnectionString == "" {
checkNotEmpty(configErrs, "user_api.account_database.connection_string", string(c.AccountDatabase.ConnectionString))
}
- checkPositive(configErrs, "user_api.openid_token_lifetime_ms", c.OpenIDTokenLifetimeMS)
+ if isMonolith { // polylith required configs below
+ return
+ }
+ checkURL(configErrs, "user_api.internal_api.listen", string(c.InternalAPI.Listen))
+ checkURL(configErrs, "user_api.internal_api.connect", string(c.InternalAPI.Connect))
}