working commit

This commit is contained in:
2026-06-10 18:10:54 +02:00
parent b90e466316
commit 9d5d9e0607
6 changed files with 19 additions and 18 deletions
+3 -2
View File
@@ -36,6 +36,7 @@ type Config struct {
Hostname string `json:"hostname" yaml:"hostname"`
Debug bool `json:"debug" yaml:"debug"`
Build string `json:"build" yaml:"build"`
ConfPath string `json:"conffile" yaml:"conffile"`
LogPath string `json:"logfile" yaml:"logfile"`
RunPath string `json:"runfile" yaml:"runfile"`
DataDir string `json:"datadir" yaml:"datadir"`
@@ -74,6 +75,7 @@ func NewConfig() *Config {
LogLimit: 1024 * 1024 * 10, // 10 Mb
RunUser: "daemon",
}
conf.ConfPath = filepath.Join(confdirPath, configFilename)
conf.LogPath = filepath.Join(logdirPath, logFilename)
conf.RunPath = filepath.Join(rundirPath, pidFilename)
return conf
@@ -81,8 +83,7 @@ func NewConfig() *Config {
func (conf *Config) ReadFile() error {
var err error
confPath := filepath.Join(confdirPath, configFilename)
confBytes, err := os.ReadFile(confPath)
confBytes, err := os.ReadFile(conf.ConfPath)
if err != nil {
return err
}