Added auth
This commit is contained in:
@@ -3,21 +3,24 @@ package config
|
||||
import "flag"
|
||||
|
||||
type Config struct {
|
||||
Port int `json:"port"`
|
||||
LogPath string `json:"logPath"`
|
||||
DatabasePath string `json:"databasePath"`
|
||||
Port int `json:"port"`
|
||||
LogPath string `json:"logPath"`
|
||||
DatabasePath string `json:"databasePath"`
|
||||
AdminPassword string `json:"adminPassword"`
|
||||
}
|
||||
|
||||
func ParseFlags() Config {
|
||||
port := flag.Int("Port", 8080, "Listen port")
|
||||
logPath := flag.String("LogPath", "logs", "Path to log files")
|
||||
databasePath := flag.String("DatabasePath", "badgerdb", "Path to the database directory")
|
||||
adminPassword := flag.String("AdminPassword", "", "Admin password for the web interface, disabled if empty")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
return Config{
|
||||
Port: *port,
|
||||
LogPath: *logPath,
|
||||
DatabasePath: *databasePath,
|
||||
Port: *port,
|
||||
LogPath: *logPath,
|
||||
DatabasePath: *databasePath,
|
||||
AdminPassword: *adminPassword,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user