mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 05:42:46 +00:00
Try to sane default on jetstream base path
This commit is contained in:
parent
ec4e0302c0
commit
ee6bfe24f5
3 changed files with 13 additions and 7 deletions
|
@ -329,6 +329,7 @@ func (c *Dendrite) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
|||
}
|
||||
|
||||
func (c *Dendrite) Wiring() {
|
||||
c.Global.JetStream.Matrix = &c.Global
|
||||
c.ClientAPI.Matrix = &c.Global
|
||||
c.EDUServer.Matrix = &c.Global
|
||||
c.FederationAPI.Matrix = &c.Global
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
package config
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
type JetStream struct {
|
||||
Matrix *Global `yaml:"-"`
|
||||
|
||||
// Persistent directory to store JetStream streams in.
|
||||
StoragePath Path `yaml:"storage_path"`
|
||||
// A list of NATS addresses to connect to. If none are specified, an
|
||||
|
@ -22,7 +28,11 @@ func (c *JetStream) TopicFor(name string) string {
|
|||
func (c *JetStream) Defaults() {
|
||||
c.Addresses = []string{}
|
||||
c.TopicPrefix = "Dendrite"
|
||||
c.StoragePath = Path("./")
|
||||
reg, err := regexp.Compile(`[^a-zA-Z0-9\.]+`)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
c.StoragePath = Path("./" + reg.ReplaceAllString(string(c.Matrix.ServerName), ""))
|
||||
}
|
||||
|
||||
func (c *JetStream) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue