8000 [pull] main from miniflux:main by pull[bot] · Pull Request #282 · suhaoGe/miniflux · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module miniflux.app/v2
// +heroku goVersion go1.26
go 1.26.0


require (
github.com/PuerkitoBio/goquery v1.12.0
github.com/andybalholm/brotli v1.2.1
Expand Down
8 changes: 4 additions & 4 deletions internal/config/options_parsing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1799,8 +1799,8 @@ func TestValidateDisableLocalAuthWithOAuth2ButNoUserCreation(t *testing.T) {
}); err != nil {
t.Fatalf("Unexpected parse error: %v", err)
}
if err := configParser.options.Validate(); err == nil {
t.Fatal("Expected error when local auth is disabled with OAuth2 but without user creation")
if err := configParser.options.Validate(); err != nil {
t.Fatalf("Unexpected error: %v", err)
}
}

Expand Down Expand Up @@ -1829,8 +1829,8 @@ func TestValidateDisableLocalAuthWithAuthProxyButNoUserCreation(t *testing.T) {
}); err != nil {
t.Fatalf("Unexpected parse error: %v", err)
}
if err := configParser.options.Validate(); err == nil {
t.Fatal("Expected error when local auth is disabled with auth proxy but without user creation")
if err := configParser.options.Validate(); err != nil {
t.Fatalf("Unexpected error: %v", err)
}
}

Expand Down
7 changes: 1 addition & 6 deletions internal/config/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,8 @@ func (c *configOptions) Validate() error {
}

if c.DisableLocalAuth() {
switch {
case c.OAuth2Provider() == "" && c.AuthProxyHeader() == "":
if c.OAuth2Provider() == "" && c.AuthProxyHeader() == "" {
return errors.New("DISABLE_LOCAL_AUTH is enabled but neither OAUTH2_PROVIDER nor AUTH_PROXY_HEADER is set. Please enable at least one authentication source")
case c.OAuth2Provider() != "" && !c.IsOAuth2UserCreationAllowed():
return errors.New("DISABLE_LOCAL_AUTH is enabled and an OAUTH2_PROVIDER is configured, but OAUTH2_USER_CREATION FA39 is not enabled")
case c.AuthProxyHeader() != "" && !c.IsAuthProxyUserCreationAllowed():
return errors.New("DISABLE_LOCAL_AUTH is enabled and an AUTH_PROXY_HEADER is configured, but AUTH_PROXY_USER_CREATION is not enabled")
}
}

Expand Down
8 changes: 8 additions & 0 deletions miniflux.1
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ Default is empty.
.B AUTH_PROXY_USER_CREATION
Set to 1 to create users based on proxy authentication information\&.
.br
When disabled, users must already exist in Miniflux to sign in through the proxy\&.
.br
Disabled by default\&.
.TP
.B BASE_URL
Expand Down Expand Up @@ -267,6 +269,10 @@ Disable local authentication\&.
When set to true, the username/password form is hidden from the login screen, and the
options to change username/password or unlink OAuth2 account are hidden from the settings page.
.br
This option requires an alternative authentication source such as OAuth2 or auth proxy\&.
.br
If remote user creation is disabled, only existing users can sign in\&.
.br
Default is false\&.
.TP
.B DISABLE_SCHEDULER_SERVICE
Expand Down Expand Up @@ -502,6 +508,8 @@ Default is empty\&.
.B OAUTH2_USER_CREATION
Set to 1 to authorize OAuth2 user creation\&.
.br
When disabled, users must already exist in Miniflux or have a linked OAuth2 account to sign in\&.
.br
Disabled by default\&.
.TP
.B POLLING_FREQUENCY
Expand Down
Loading
0