mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-08 23:43:11 -06:00
cmd/dendrite-media-api-server: Add SERVER_NAME configuration
This commit is contained in:
parent
deee6f84c7
commit
ff3009ffdd
|
|
@ -22,6 +22,7 @@ import (
|
||||||
"github.com/matrix-org/dendrite/mediaapi/config"
|
"github.com/matrix-org/dendrite/mediaapi/config"
|
||||||
"github.com/matrix-org/dendrite/mediaapi/routing"
|
"github.com/matrix-org/dendrite/mediaapi/routing"
|
||||||
"github.com/matrix-org/dendrite/mediaapi/storage"
|
"github.com/matrix-org/dendrite/mediaapi/storage"
|
||||||
|
"github.com/matrix-org/dendrite/mediaapi/types"
|
||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
@ -30,6 +31,7 @@ var (
|
||||||
bindAddr = os.Getenv("BIND_ADDRESS")
|
bindAddr = os.Getenv("BIND_ADDRESS")
|
||||||
dataSource = os.Getenv("DATABASE")
|
dataSource = os.Getenv("DATABASE")
|
||||||
logDir = os.Getenv("LOG_DIR")
|
logDir = os.Getenv("LOG_DIR")
|
||||||
|
serverName = os.Getenv("SERVER_NAME")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
@ -39,8 +41,12 @@ func main() {
|
||||||
log.Panic("No BIND_ADDRESS environment variable found.")
|
log.Panic("No BIND_ADDRESS environment variable found.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if serverName == "" {
|
||||||
|
serverName = "localhost"
|
||||||
|
}
|
||||||
|
|
||||||
cfg := &config.MediaAPI{
|
cfg := &config.MediaAPI{
|
||||||
ServerName: "localhost",
|
ServerName: types.ServerName(serverName),
|
||||||
BasePath: "/Users/robertsw/dendrite",
|
BasePath: "/Users/robertsw/dendrite",
|
||||||
MaxFileSize: 10 * 1024 * 1024,
|
MaxFileSize: 10 * 1024 * 1024,
|
||||||
DataSource: dataSource,
|
DataSource: dataSource,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue