Change default config path for the portal

This commit is contained in:
dawid committed 2022-05-13 22:03:36 +02:00
1 parent db46dc6b83
commit 778c8dfca8
1 file changed
+1 -5
+1 -5
View File
@@ -5,7 +5,6 @@ import (
"crypto/tls" "crypto/tls"
"fmt" "fmt"
"os" "os"
"path/filepath"
"github.com/apex/log" "github.com/apex/log"
jsonhandler "github.com/apex/log/handlers/json" jsonhandler "github.com/apex/log/handlers/json"
@@ -71,11 +70,8 @@ func Execute() {
}, },
} }
dir := "/etc/portal"
configPath := filepath.Join(dir, "config.toml")
cobra.OnInitialize(initConfig) cobra.OnInitialize(initConfig)
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", configPath, "config file") rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "config.toml", "config file")
rootCmd.PersistentFlags().StringP("loglevel", "l", "info", "Log level") rootCmd.PersistentFlags().StringP("loglevel", "l", "info", "Log level")
rootCmd.PersistentFlags().BoolP("json", "j", false, "Output logs in JSON format") rootCmd.PersistentFlags().BoolP("json", "j", false, "Output logs in JSON format")
rootCmd.Flags().IntP("port", "p", 1337, "Port to listen on for connections") rootCmd.Flags().IntP("port", "p", 1337, "Port to listen on for connections")