2020-08-10 13:18:04 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-09-03 09:12:11 +00:00
|
|
|
"flag"
|
2020-08-10 13:18:04 +00:00
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/matrix-org/dendrite/internal/config"
|
|
|
|
"gopkg.in/yaml.v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2020-09-03 09:12:11 +00:00
|
|
|
defaultsForCI := flag.Bool("ci", false, "sane defaults for CI testing")
|
|
|
|
flag.Parse()
|
|
|
|
|
2020-08-10 13:18:04 +00:00
|
|
|
cfg := &config.Dendrite{}
|
|
|
|
cfg.Defaults()
|
2020-08-11 12:21:26 +00:00
|
|
|
cfg.Global.TrustedIDServers = []string{
|
|
|
|
"matrix.org",
|
|
|
|
"vector.im",
|
|
|
|
}
|
2020-08-10 13:18:04 +00:00
|
|
|
cfg.Logging = []config.LogrusHook{
|
|
|
|
{
|
|
|
|
Type: "file",
|
|
|
|
Level: "info",
|
|
|
|
Params: map[string]interface{}{
|
|
|
|
"path": "/var/log/dendrite",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2020-08-11 12:21:26 +00:00
|
|
|
cfg.ServerKeyAPI.KeyPerspectives = config.KeyPerspectives{
|
|
|
|
{
|
|
|
|
ServerName: "matrix.org",
|
|
|
|
Keys: []config.KeyPerspectiveTrustKey{
|
|
|
|
{
|
|
|
|
KeyID: "ed25519:auto",
|
|
|
|
PublicKey: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
KeyID: "ed25519:a_RXGa",
|
|
|
|
PublicKey: "l8Hft5qXKn1vfHrg3p4+W8gELQVo8N13JkluMfmn2sQ",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
cfg.MediaAPI.ThumbnailSizes = []config.ThumbnailSize{
|
|
|
|
{
|
|
|
|
Width: 32,
|
|
|
|
Height: 32,
|
|
|
|
ResizeMethod: "crop",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Width: 96,
|
|
|
|
Height: 96,
|
|
|
|
ResizeMethod: "crop",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Width: 640,
|
|
|
|
Height: 480,
|
|
|
|
ResizeMethod: "scale",
|
|
|
|
},
|
|
|
|
}
|
2020-08-10 13:18:04 +00:00
|
|
|
|
2020-09-03 09:12:11 +00:00
|
|
|
if *defaultsForCI {
|
|
|
|
cfg.ClientAPI.RateLimiting.Enabled = false
|
|
|
|
cfg.FederationSender.DisableTLSValidation = true
|
|
|
|
}
|
|
|
|
|
2020-08-10 13:18:04 +00:00
|
|
|
j, err := yaml.Marshal(cfg)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println(string(j))
|
|
|
|
}
|