mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-07 14:13:11 -06:00
Avoid warning about open registration
This commit is contained in:
parent
9722df46f8
commit
d456cb5240
|
|
@ -100,7 +100,10 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
b := base.NewBaseDendrite(cfg, "", base.CreateAccountMode)
|
// avoid warning about open registration
|
||||||
|
cfg.ClientAPI.RegistrationDisabled = true
|
||||||
|
|
||||||
|
b := base.NewBaseDendrite(cfg, "")
|
||||||
defer b.Close() // nolint: errcheck
|
defer b.Close() // nolint: errcheck
|
||||||
|
|
||||||
accountDB, err := storage.NewUserAPIDatabase(
|
accountDB, err := storage.NewUserAPIDatabase(
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,6 @@ const (
|
||||||
DisableMetrics BaseDendriteOptions = iota
|
DisableMetrics BaseDendriteOptions = iota
|
||||||
UseHTTPAPIs
|
UseHTTPAPIs
|
||||||
PolylithMode
|
PolylithMode
|
||||||
CreateAccountMode
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewBaseDendrite creates a new instance to be used by a component.
|
// NewBaseDendrite creates a new instance to be used by a component.
|
||||||
|
|
@ -111,7 +110,6 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base
|
||||||
useHTTPAPIs := false
|
useHTTPAPIs := false
|
||||||
enableMetrics := true
|
enableMetrics := true
|
||||||
isMonolith := true
|
isMonolith := true
|
||||||
createAccountMode := false
|
|
||||||
for _, opt := range options {
|
for _, opt := range options {
|
||||||
switch opt {
|
switch opt {
|
||||||
case DisableMetrics:
|
case DisableMetrics:
|
||||||
|
|
@ -121,9 +119,6 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base
|
||||||
case PolylithMode:
|
case PolylithMode:
|
||||||
isMonolith = false
|
isMonolith = false
|
||||||
useHTTPAPIs = true
|
useHTTPAPIs = true
|
||||||
case CreateAccountMode:
|
|
||||||
createAccountMode = true
|
|
||||||
cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,7 +137,7 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base
|
||||||
|
|
||||||
logrus.Infof("Dendrite version %s", internal.VersionString())
|
logrus.Infof("Dendrite version %s", internal.VersionString())
|
||||||
|
|
||||||
if !createAccountMode && !cfg.ClientAPI.RegistrationDisabled && cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled {
|
if !cfg.ClientAPI.RegistrationDisabled && cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled {
|
||||||
logrus.Warn("Open registration is enabled")
|
logrus.Warn("Open registration is enabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue