mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-18 12:23:09 -06:00
Latest hacks for js
This commit is contained in:
parent
bf6aa8cfd5
commit
dacbae001d
|
|
@ -63,6 +63,7 @@ func generateKey() ed25519.PrivateKey {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cfg := &config.Dendrite{}
|
cfg := &config.Dendrite{}
|
||||||
|
cfg.SetDefaults()
|
||||||
cfg.Kafka.UseNaffka = true
|
cfg.Kafka.UseNaffka = true
|
||||||
cfg.Database.Account = "file:dendritejs_account.db"
|
cfg.Database.Account = "file:dendritejs_account.db"
|
||||||
cfg.Database.AppService = "file:dendritejs_appservice.db"
|
cfg.Database.AppService = "file:dendritejs_appservice.db"
|
||||||
|
|
@ -80,6 +81,9 @@ func main() {
|
||||||
"matrix.org", "vector.im",
|
"matrix.org", "vector.im",
|
||||||
}
|
}
|
||||||
cfg.Matrix.PrivateKey = generateKey()
|
cfg.Matrix.PrivateKey = generateKey()
|
||||||
|
if err := cfg.Derive(); err != nil {
|
||||||
|
logrus.Fatalf("Failed to derive values from config: %s", err)
|
||||||
|
}
|
||||||
base := basecomponent.NewBaseDendrite(cfg, "Monolith")
|
base := basecomponent.NewBaseDendrite(cfg, "Monolith")
|
||||||
defer base.Close() // nolint: errcheck
|
defer base.Close() // nolint: errcheck
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -365,7 +365,7 @@ func loadConfig(
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
config.setDefaults()
|
config.SetDefaults()
|
||||||
|
|
||||||
if err = config.check(monolithic); err != nil {
|
if err = config.check(monolithic); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -398,7 +398,7 @@ func loadConfig(
|
||||||
config.Media.AbsBasePath = Path(absPath(basePath, config.Media.BasePath))
|
config.Media.AbsBasePath = Path(absPath(basePath, config.Media.BasePath))
|
||||||
|
|
||||||
// Generate data from config options
|
// Generate data from config options
|
||||||
err = config.derive()
|
err = config.Derive()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -406,9 +406,9 @@ func loadConfig(
|
||||||
return &config, nil
|
return &config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// derive generates data that is derived from various values provided in
|
// Derive generates data that is derived from various values provided in
|
||||||
// the config file.
|
// the config file.
|
||||||
func (config *Dendrite) derive() error {
|
func (config *Dendrite) Derive() error {
|
||||||
// Determine registrations flows based off config values
|
// Determine registrations flows based off config values
|
||||||
|
|
||||||
config.Derived.Registration.Params = make(map[string]interface{})
|
config.Derived.Registration.Params = make(map[string]interface{})
|
||||||
|
|
@ -433,8 +433,8 @@ func (config *Dendrite) derive() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// setDefaults sets default config values if they are not explicitly set.
|
// SetDefaults sets default config values if they are not explicitly set.
|
||||||
func (config *Dendrite) setDefaults() {
|
func (config *Dendrite) SetDefaults() {
|
||||||
if config.Matrix.KeyValidityPeriod == 0 {
|
if config.Matrix.KeyValidityPeriod == 0 {
|
||||||
config.Matrix.KeyValidityPeriod = 24 * time.Hour
|
config.Matrix.KeyValidityPeriod = 24 * time.Hour
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -18,7 +18,7 @@ require (
|
||||||
github.com/lib/pq v1.2.0
|
github.com/lib/pq v1.2.0
|
||||||
github.com/matrix-org/dugong v0.0.0-20171220115018-ea0a4690a0d5
|
github.com/matrix-org/dugong v0.0.0-20171220115018-ea0a4690a0d5
|
||||||
github.com/matrix-org/go-http-js-libp2p v0.0.0-20200126031050-234d7bbbff9a
|
github.com/matrix-org/go-http-js-libp2p v0.0.0-20200126031050-234d7bbbff9a
|
||||||
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225115056-c0aef2609ba2
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225224420-1ca1c9f64f82
|
||||||
github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26
|
github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26
|
||||||
github.com/matrix-org/gomatrixserverlib v0.0.0-20200124100636-0c2ec91d1df5
|
github.com/matrix-org/gomatrixserverlib v0.0.0-20200124100636-0c2ec91d1df5
|
||||||
github.com/matrix-org/naffka v0.0.0-20200127221512-0716baaabaf1
|
github.com/matrix-org/naffka v0.0.0-20200127221512-0716baaabaf1
|
||||||
|
|
|
||||||
6
go.sum
6
go.sum
|
|
@ -75,6 +75,12 @@ github.com/matrix-org/go-sqlite3-js v0.0.0-20200225105839-089f29e7c4bd h1:pz266H
|
||||||
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225105839-089f29e7c4bd/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo=
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225105839-089f29e7c4bd/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo=
|
||||||
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225115056-c0aef2609ba2 h1:ZgjpruDBBat81KC7Mv2dTc3nsLp5mNV/C6p637NQoqw=
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225115056-c0aef2609ba2 h1:ZgjpruDBBat81KC7Mv2dTc3nsLp5mNV/C6p637NQoqw=
|
||||||
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225115056-c0aef2609ba2/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo=
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225115056-c0aef2609ba2/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo=
|
||||||
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225214814-ffc26cc11c6c h1:anhIgTzzlpxfyMRg6zDu2ySXi6Rgm7OwjImULcb7fmU=
|
||||||
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225214814-ffc26cc11c6c/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo=
|
||||||
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225220001-0b5561bfc12f h1:OOE9IBDB9DEp3cXs+bxnEagiuANedhOocpoWTv9BbKk=
|
||||||
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225220001-0b5561bfc12f/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo=
|
||||||
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225224420-1ca1c9f64f82 h1:gFdtxNrSzfqVdMR/xGdactHjQBqb/eSPrrXwe/C/goE=
|
||||||
|
github.com/matrix-org/go-sqlite3-js v0.0.0-20200225224420-1ca1c9f64f82/go.mod h1:e+cg2q7C7yE5QnAXgzo512tgFh1RbQLC0+jozuegKgo=
|
||||||
github.com/matrix-org/gomatrix v0.0.0-20190130130140-385f072fe9af h1:piaIBNQGIHnni27xRB7VKkEwoWCgAmeuYf8pxAyG0bI=
|
github.com/matrix-org/gomatrix v0.0.0-20190130130140-385f072fe9af h1:piaIBNQGIHnni27xRB7VKkEwoWCgAmeuYf8pxAyG0bI=
|
||||||
github.com/matrix-org/gomatrix v0.0.0-20190130130140-385f072fe9af/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0=
|
github.com/matrix-org/gomatrix v0.0.0-20190130130140-385f072fe9af/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0=
|
||||||
github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26 h1:Hr3zjRsq2bhrnp3Ky1qgx/fzCtCALOoGYylh2tpS9K4=
|
github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26 h1:Hr3zjRsq2bhrnp3Ky1qgx/fzCtCALOoGYylh2tpS9K4=
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue