working commit

This commit is contained in:
2026-02-21 20:07:37 +02:00
parent c6ce50308d
commit 685880c8a8
45 changed files with 255 additions and 453 deletions
-27
View File
@@ -10,7 +10,6 @@
package config
import (
"flag"
"fmt"
"io/ioutil"
"os"
@@ -103,32 +102,6 @@ func (conf *Config) ReadConfigfile() error {
return err
}
func (conf *Config) ReadOptions() error {
var err error
exename := filepath.Base(os.Args[0])
// TODO: make local scope of flags
flagSet := flag.NewFlagSet(exename, flag.ExitOnError)
flagSet.Int64Var(&conf.Service.Port, "port", conf.Service.Port, "listen port")
flagSet.BoolVar(&conf.AsDaemon, "daemon", conf.AsDaemon, "run as daemon")
help := func() {
fmt.Println("")
fmt.Printf("Usage: %s [option]\n", exename)
fmt.Println("")
fmt.Println("Options:")
flagSet.PrintDefaults()
fmt.Println("")
}
flagSet.Usage = help
args := flag.Args()
if len(args) > 1 {
flagSet.Parse(args)
}
return err
}
func (conf *Config) ReadX509Cert() error {
var err error
if conf.Certpath != "" && conf.Keypath != "" {