use more general defaults in config
This commit is contained in:
parent
45ff736001
commit
a9fd1542e9
|
@ -15,7 +15,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
cnf = common.Configure()
|
cnf = &common.Config{
|
||||||
|
BaseURL: "http://localhost:1337/",
|
||||||
|
Port: 1337,
|
||||||
|
Token: "miauwkes",
|
||||||
|
AllowedWebmentionSources: []string{"brainbaking.com"},
|
||||||
|
Blacklist: []string{},
|
||||||
|
Whitelist: []string{"brainbaking.com"},
|
||||||
|
}
|
||||||
repo db.MentionRepo
|
repo db.MentionRepo
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -132,13 +132,13 @@ func config() *Config {
|
||||||
|
|
||||||
func defaultConfig() *Config {
|
func defaultConfig() *Config {
|
||||||
defaultConfig := &Config{
|
defaultConfig := &Config{
|
||||||
AdminEmail: "wouter@brainbaking.com",
|
AdminEmail: "admin@mycooldomain.com",
|
||||||
BaseURL: "https://jam.brainbaking.com/",
|
BaseURL: "http://localhost:1337/",
|
||||||
Port: 1337,
|
Port: 1337,
|
||||||
Token: "miauwkes",
|
Token: "miauwkes",
|
||||||
AllowedWebmentionSources: []string{"brainbaking.com", "jefklakscodex.com"},
|
AllowedWebmentionSources: []string{"mycooldomain.com", "myotherdomain.com"},
|
||||||
Blacklist: []string{"youtube.com"},
|
Blacklist: []string{"youtube.com"},
|
||||||
Whitelist: []string{"brainbaking.com"},
|
Whitelist: []string{"mycooldomain.com"},
|
||||||
}
|
}
|
||||||
defaultConfig.Save()
|
defaultConfig.Save()
|
||||||
return defaultConfig
|
return defaultConfig
|
||||||
|
|
|
@ -17,7 +17,7 @@ func TestReadFromJsonMalformedReversToDefaults(t *testing.T) {
|
||||||
t.Cleanup(cleanupConfig)
|
t.Cleanup(cleanupConfig)
|
||||||
|
|
||||||
config := Configure()
|
config := Configure()
|
||||||
assert.Contains(t, config.AllowedWebmentionSources, "brainbaking.com")
|
assert.Contains(t, config.AllowedWebmentionSources, "mycooldomain.com")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestReadFromJsonWithCorrectJsonData(t *testing.T) {
|
func TestReadFromJsonWithCorrectJsonData(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue