aboutsummaryrefslogtreecommitdiff
path: root/internal/cli/cli.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/cli.go')
-rw-r--r--internal/cli/cli.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go
index f56bb959..56cf13fa 100644
--- a/internal/cli/cli.go
+++ b/internal/cli/cli.go
@@ -4,6 +4,7 @@
package cli // import "miniflux.app/v2/internal/cli"
import (
+ "errors"
"flag"
"fmt"
"io"
@@ -225,6 +226,17 @@ func Parse() {
return
}
+ if config.Opts.DisableLocalAuth() {
+ switch {
+ case config.Opts.OAuth2Provider() == "" && config.Opts.AuthProxyHeader() == "":
+ printErrorAndExit(errors.New("DISABLE_LOCAL_AUTH is enabled but neither OAUTH2_PROVIDER nor AUTH_PROXY_HEADER is not set. Please enable at least one authentication source"))
+ case config.Opts.OAuth2Provider() != "" && !config.Opts.IsOAuth2UserCreationAllowed():
+ printErrorAndExit(errors.New("DISABLE_LOCAL_AUTH is enabled and an OAUTH2_PROVIDER is configured, but OAUTH2_USER_CREATION is not enabled"))
+ case config.Opts.AuthProxyHeader() != "" && !config.Opts.IsAuthProxyUserCreationAllowed():
+ printErrorAndExit(errors.New("DISABLE_LOCAL_AUTH is enabled and an AUTH_PROXY_HEADER is configured, but AUTH_PROXY_USER_CREATION is not enabled"))
+ }
+ }
+
startDaemon(store)
}