Skip to content

Commit 4f4c1a1

Browse files
yardenshohamGiteaBot
authored andcommitted
Warn that DISABLE_QUERY_AUTH_TOKEN is false only if it's explicitly defined (go-gitea#28783)
So we don't warn on default behavior - Fixes go-gitea#28758 - Follows go-gitea#28390 Signed-off-by: Yarden Shoham <git@yardenshoham.com>
1 parent 89960c3 commit 4f4c1a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/setting/security.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,13 @@ func loadSecurityFrom(rootCfg ConfigProvider) {
161161
}
162162
}
163163

164+
sectionHasDisableQueryAuthToken := sec.HasKey("DISABLE_QUERY_AUTH_TOKEN")
165+
164166
// TODO: default value should be true in future releases
165167
DisableQueryAuthToken = sec.Key("DISABLE_QUERY_AUTH_TOKEN").MustBool(false)
166168

167-
if !DisableQueryAuthToken {
169+
// warn if the setting is set to false explicitly
170+
if sectionHasDisableQueryAuthToken && !DisableQueryAuthToken {
168171
log.Warn("Enabling Query API Auth tokens is not recommended. DISABLE_QUERY_AUTH_TOKEN will default to true in gitea 1.23 and will be removed in gitea 1.24.")
169172
}
170173
}

0 commit comments

Comments
 (0)