config/template: Use os.Hostname() as default

This commit is contained in:
Tom Wiesing 2024-04-08 23:23:26 +02:00
parent 8ad8cf7994
commit 626798c86d
No known key found for this signature in database
3 changed files with 5 additions and 23 deletions

View file

@ -2,12 +2,12 @@ package config
import (
"crypto/rand"
"os"
"path/filepath"
"time"
"github.com/FAU-CDI/wisski-distillery/internal/bootstrap"
"github.com/FAU-CDI/wisski-distillery/internal/passwordx"
"github.com/tkw1536/pkglib/hostname"
"github.com/tkw1536/pkglib/password"
)
@ -33,7 +33,10 @@ func (tpl *Template) SetDefaults() (err error) {
}
if tpl.DefaultDomain == "" {
tpl.DefaultDomain = hostname.FQDN()
tpl.DefaultDomain, err = os.Hostname()
if err != nil {
return err
}
}
if tpl.TSAdminUser == "" {