mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Add configuration for the presence database
This commit is contained in:
parent
e96b8c0e79
commit
0ce356c45a
|
|
@ -361,6 +361,11 @@ user_api:
|
||||||
max_open_conns: 10
|
max_open_conns: 10
|
||||||
max_idle_conns: 2
|
max_idle_conns: 2
|
||||||
conn_max_lifetime: -1
|
conn_max_lifetime: -1
|
||||||
|
presence_database:
|
||||||
|
connection_string: file:userapi_presence.db
|
||||||
|
max_open_conns: 10
|
||||||
|
max_idle_conns: 2
|
||||||
|
conn_max_lifetime: -1
|
||||||
# The length of time that a token issued for a relying party from
|
# The length of time that a token issued for a relying party from
|
||||||
# /_matrix/client/r0/user/{userId}/openid/request_token endpoint
|
# /_matrix/client/r0/user/{userId}/openid/request_token endpoint
|
||||||
# is considered to be valid in milliseconds.
|
# is considered to be valid in milliseconds.
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ type UserAPI struct {
|
||||||
// The Device database stores session information for the devices of logged
|
// The Device database stores session information for the devices of logged
|
||||||
// in local users. It is accessed by the UserAPI.
|
// in local users. It is accessed by the UserAPI.
|
||||||
DeviceDatabase DatabaseOptions `yaml:"device_database"`
|
DeviceDatabase DatabaseOptions `yaml:"device_database"`
|
||||||
|
// The presence database stores information about user (local and remote) presence status.
|
||||||
|
PresenceDatabase DatabaseOptions `yaml:"presence_database"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultOpenIDTokenLifetimeMS = 3600000 // 60 minutes
|
const DefaultOpenIDTokenLifetimeMS = 3600000 // 60 minutes
|
||||||
|
|
@ -30,6 +32,7 @@ func (c *UserAPI) Defaults() {
|
||||||
c.DeviceDatabase.Defaults(10)
|
c.DeviceDatabase.Defaults(10)
|
||||||
c.AccountDatabase.ConnectionString = "file:userapi_accounts.db"
|
c.AccountDatabase.ConnectionString = "file:userapi_accounts.db"
|
||||||
c.DeviceDatabase.ConnectionString = "file:userapi_devices.db"
|
c.DeviceDatabase.ConnectionString = "file:userapi_devices.db"
|
||||||
|
c.PresenceDatabase.ConnectionString = "file:userapi_presence.db"
|
||||||
c.BCryptCost = bcrypt.DefaultCost
|
c.BCryptCost = bcrypt.DefaultCost
|
||||||
c.OpenIDTokenLifetimeMS = DefaultOpenIDTokenLifetimeMS
|
c.OpenIDTokenLifetimeMS = DefaultOpenIDTokenLifetimeMS
|
||||||
}
|
}
|
||||||
|
|
@ -39,5 +42,6 @@ func (c *UserAPI) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||||
checkURL(configErrs, "user_api.internal_api.connect", string(c.InternalAPI.Connect))
|
checkURL(configErrs, "user_api.internal_api.connect", string(c.InternalAPI.Connect))
|
||||||
checkNotEmpty(configErrs, "user_api.account_database.connection_string", string(c.AccountDatabase.ConnectionString))
|
checkNotEmpty(configErrs, "user_api.account_database.connection_string", string(c.AccountDatabase.ConnectionString))
|
||||||
checkNotEmpty(configErrs, "user_api.device_database.connection_string", string(c.DeviceDatabase.ConnectionString))
|
checkNotEmpty(configErrs, "user_api.device_database.connection_string", string(c.DeviceDatabase.ConnectionString))
|
||||||
|
checkNotEmpty(configErrs, "user_api.presence_database.connection_string", string(c.PresenceDatabase.ConnectionString))
|
||||||
checkPositive(configErrs, "user_api.openid_token_lifetime_ms", c.OpenIDTokenLifetimeMS)
|
checkPositive(configErrs, "user_api.openid_token_lifetime_ms", c.OpenIDTokenLifetimeMS)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue