diff --git a/build/release/Dockerfile-build b/build/release/Dockerfile-build index e14edaba9..4ad4cd228 100644 --- a/build/release/Dockerfile-build +++ b/build/release/Dockerfile-build @@ -25,5 +25,4 @@ COPY --from=build /build/owncast /app/owncast COPY --from=build /build/webroot /app/webroot COPY --from=build /build/static /app/static COPY --from=build /build/data /app/data -COPY --from=build /build/webroot/img/logo.svg app/data/logo.svg CMD ["/app/owncast"] diff --git a/build/release/build.sh b/build/release/build.sh index d228ba64f..5fe9fd794 100755 --- a/build/release/build.sh +++ b/build/release/build.sh @@ -69,7 +69,6 @@ build() { cp "${TMPDIR}tailwind.min.css" ./dist/${NAME}/webroot/js/web_modules/tailwindcss/dist/tailwind.min.css cp -R static/ dist/${NAME}/static cp README.md dist/${NAME} - cp webroot/img/logo.svg dist/${NAME}/data/logo.svg pushd dist/${NAME} >> /dev/null diff --git a/config/constants.go b/config/constants.go index 5ef56c119..885f74d94 100644 --- a/config/constants.go +++ b/config/constants.go @@ -17,6 +17,8 @@ const ( FfmpegSuggestedVersion = "v4.1.5" // Requires the v // BackupDirectory is the directory we write backup files to. BackupDirectory = "backup" + // DataDirectory is the directory we save data to. + DataDirectory = "data" ) var ( diff --git a/core/data/config.go b/core/data/config.go index 1655fc211..134336410 100644 --- a/core/data/config.go +++ b/core/data/config.go @@ -2,12 +2,14 @@ package data import ( "errors" + "path/filepath" "sort" "strings" "time" "github.com/owncast/owncast/config" "github.com/owncast/owncast/models" + "github.com/owncast/owncast/utils" log "github.com/sirupsen/logrus" ) @@ -469,6 +471,16 @@ func VerifySettings() error { return errors.New("no stream key set. Please set one in your config file") } + logoPath := GetLogoPath() + if !utils.DoesFileExists(filepath.Join(config.DataDirectory, logoPath)) { + defaultLogo := filepath.Join(config.WebRoot, "img/logo.svg") + log.Infoln(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) + } + SetLogoPath("logo.svg") + } + return nil } diff --git a/data/logo.svg b/data/logo.svg deleted file mode 100644 index 833026294..000000000 --- a/data/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file