From f52fbdf5eebbfb99634d9ba8e78f073a84ea28dd Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 13 Aug 2020 12:44:43 +0200 Subject: [PATCH 1/2] Switch log level to `Fatal` when specified assets don't exist If the service is started with an assets path and it doesn't exist, the service should exit instead of just logging a warning and defaulting to the builtin assets. --- pkg/assets/assets.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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") } } From 7843a2e07e9c987e0e549fa6477222b7ce7699d5 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 13 Aug 2020 12:50:04 +0200 Subject: [PATCH 2/2] Add changelog --- changelog/unreleased/exit-on-unresolved-assets.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelog/unreleased/exit-on-unresolved-assets.md 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