From ff63742a2fa138c230fb2e080708d03ed888c248 Mon Sep 17 00:00:00 2001 From: Ahmed AbdelHalim Date: Sun, 7 Sep 2025 17:50:36 +0200 Subject: Add basic login and clean up config --- internal/config.go | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'internal/config.go') diff --git a/internal/config.go b/internal/config.go index 8d9d961..558630d 100644 --- a/internal/config.go +++ b/internal/config.go @@ -7,22 +7,17 @@ import ( "gopkg.in/yaml.v3" ) -type ServerConfig struct { - Host string `yaml:"host"` - Port string `yaml:"port"` - Title string `yaml:"title"` -} - type Config struct { - Server ServerConfig `yaml:"server"` + Host string `yaml:"host"` + Port string `yaml:"port"` + PasswordHash string `yaml:"password_hash"` } // Default configuration values func DefaultConfig() *Config { config := &Config{} - config.Server.Host = "0.0.0.0" - config.Server.Port = "8080" - config.Server.Title = "WireGuard Gateway Portal" + config.Host = "0.0.0.0" + config.Port = "8080" return config } @@ -52,5 +47,5 @@ func LoadConfig(configPath string) (*Config, error) { // GetAddress returns the server address in host:port format func (c *Config) GetAddress() string { - return fmt.Sprintf("%s:%s", c.Server.Host, c.Server.Port) + return fmt.Sprintf("%s:%s", c.Host, c.Port) } -- cgit v1.2.3