mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 03:13:11 -06:00
go fmt && fix dataSources
Signed-off-by: Maximilian Seifert <max.seifert@drglitch.net>
This commit is contained in:
parent
7edf1a038a
commit
e53c293a70
|
|
@ -14,6 +14,7 @@ import (
|
||||||
var dataSource string
|
var dataSource string
|
||||||
var insideCi = false
|
var insideCi = false
|
||||||
var insideDocker = false
|
var insideDocker = false
|
||||||
|
|
||||||
const dbName = "dendrite_device"
|
const dbName = "dendrite_device"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
@ -32,12 +33,11 @@ func init() {
|
||||||
if insideCi {
|
if insideCi {
|
||||||
dataSource = fmt.Sprintf("postgres://postgres@localhost/%s?sslmode=disable", dbName)
|
dataSource = fmt.Sprintf("postgres://postgres@localhost/%s?sslmode=disable", dbName)
|
||||||
} else if insideDocker {
|
} else if insideDocker {
|
||||||
dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost/%s?sslmode=disable", dbName)
|
dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@postgres/%s?sslmode=disable", dbName)
|
||||||
} else {
|
} else {
|
||||||
dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost:15432/%s?sslmode=disable", dbName)
|
dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost:15432/%s?sslmode=disable", dbName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if insideCi {
|
if insideCi {
|
||||||
database := "dendrite_device"
|
database := "dendrite_device"
|
||||||
cmd := exec.Command("psql", database)
|
cmd := exec.Command("psql", database)
|
||||||
|
|
@ -52,8 +52,6 @@ func init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type deviceSpec struct {
|
type deviceSpec struct {
|
||||||
localPart string
|
localPart string
|
||||||
devID string
|
devID string
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import (
|
||||||
var dataSource string
|
var dataSource string
|
||||||
var insideCi = false
|
var insideCi = false
|
||||||
var insideDocker = false
|
var insideDocker = false
|
||||||
|
|
||||||
const dbName = "dendrite_syncapi"
|
const dbName = "dendrite_syncapi"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
@ -34,7 +35,7 @@ func init() {
|
||||||
if insideCi {
|
if insideCi {
|
||||||
dataSource = fmt.Sprintf("postgres://postgres@localhost/%s?sslmode=disable", dbName)
|
dataSource = fmt.Sprintf("postgres://postgres@localhost/%s?sslmode=disable", dbName)
|
||||||
} else if insideDocker {
|
} else if insideDocker {
|
||||||
dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost/%s?sslmode=disable", dbName)
|
dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@postgres/%s?sslmode=disable", dbName)
|
||||||
} else {
|
} else {
|
||||||
dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost:15432/%s?sslmode=disable", dbName)
|
dataSource = fmt.Sprintf("postgres://dendrite:itsasecret@localhost:15432/%s?sslmode=disable", dbName)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue