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