Use bundled images instead of old webroot files
This commit is contained in:
@@ -2,6 +2,7 @@ package data
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
@@ -9,6 +10,7 @@ import (
|
||||
|
||||
"github.com/owncast/owncast/config"
|
||||
"github.com/owncast/owncast/models"
|
||||
"github.com/owncast/owncast/static"
|
||||
"github.com/owncast/owncast/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -583,12 +585,10 @@ func VerifySettings() error {
|
||||
|
||||
logoPath := GetLogoPath()
|
||||
if !utils.DoesFileExists(filepath.Join(config.DataDirectory, logoPath)) {
|
||||
defaultLogo := filepath.Join(config.WebRoot, "img/logo.svg")
|
||||
log.Traceln(logoPath, "not found in the data directory. copying a default logo.")
|
||||
if err := utils.Copy(defaultLogo, filepath.Join(config.DataDirectory, "logo.svg")); err != nil {
|
||||
log.Errorln("error copying default logo: ", err)
|
||||
}
|
||||
if err := SetLogoPath("logo.svg"); err != nil {
|
||||
logo := static.GetLogo()
|
||||
os.WriteFile(filepath.Join(config.DataDirectory, "logo.png"), logo, 0o600)
|
||||
if err := SetLogoPath("logo.png"); err != nil {
|
||||
log.Errorln("unable to set default logo to logo.svg", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user