mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
config: Allow overrides from the command line
This patch allows the configuration values to be overridden from the command-line, with a new -config_overrides flag. There is a fairly specific use case for this, when editing the configuration file is not feasible or convenient (e.g. running an user-supplied configuration in a managed environment).
This commit is contained in:
@@ -204,7 +204,7 @@ func userRemove() {
|
||||
|
||||
// chasquid-util aliases-resolve <address>
|
||||
func aliasesResolve() {
|
||||
conf, err := config.Load(configDir + "/chasquid.conf")
|
||||
conf, err := config.Load(configDir+"/chasquid.conf", "")
|
||||
if err != nil {
|
||||
Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
@@ -248,7 +248,7 @@ func aliasesResolve() {
|
||||
|
||||
// chasquid-util print-config
|
||||
func printConfig() {
|
||||
conf, err := config.Load(configDir + "/chasquid.conf")
|
||||
conf, err := config.Load(configDir+"/chasquid.conf", "")
|
||||
if err != nil {
|
||||
Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
@@ -260,7 +260,7 @@ func printConfig() {
|
||||
func domaininfoRemove() {
|
||||
domain := args["<domain>"].(string)
|
||||
|
||||
conf, err := config.Load(configDir + "/chasquid.conf")
|
||||
conf, err := config.Load(configDir+"/chasquid.conf", "")
|
||||
if err != nil {
|
||||
Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
@@ -290,7 +290,7 @@ func aliasesAdd() {
|
||||
Fatalf("Domain doesn't exist")
|
||||
}
|
||||
|
||||
conf, err := config.Load(configDir + "/chasquid.conf")
|
||||
conf, err := config.Load(configDir+"/chasquid.conf", "")
|
||||
if err != nil {
|
||||
Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user