diff --git a/changelog/unreleased/exit-on-unresolved-assets.md b/changelog/unreleased/exit-on-unresolved-assets.md new file mode 100644 index 0000000000..0d639dc518 --- /dev/null +++ b/changelog/unreleased/exit-on-unresolved-assets.md @@ -0,0 +1,7 @@ +Bugfix: exit when assets are not found + +When a non-existing assets folders is specified, there was only a warning log statement and the service served +the builtin assets instead. It is safe to exit the service in such a scenario, instead of serving other assets +than specified. We changed the log level to `Fatal` on non-existing assets. + +https://github.com/owncloud/ocis-phoenix/pull/76 diff --git a/pkg/assets/assets.go b/pkg/assets/assets.go index 9c94e5b2ec..2668c5d29f 100644 --- a/pkg/assets/assets.go +++ b/pkg/assets/assets.go @@ -36,9 +36,9 @@ func (a assets) Open(original string) (http.File, error) { return f, nil } } else { - a.logger.Warn(). + a.logger.Fatal(). Str("path", a.config.Asset.Path). - Msg("Assets directory doesn't exist") + Msg("assets directory doesn't exist") } }