diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-01-20 18:00:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 18:00:38 +0100 |
commit | 1d98d205f5825f40110e6628b61a97c91ac7f72d (patch) | |
tree | 2326229027b9ba388732a912bff07ce4320aaf7c /modules/setting/setting.go | |
parent | 16d378fefc0a569f2a7aed29e6c7f288b3d83f02 (diff) | |
download | gitea-1d98d205f5825f40110e6628b61a97c91ac7f72d.tar.gz gitea-1d98d205f5825f40110e6628b61a97c91ac7f72d.zip |
Enable deprecation error for v1.17.0 (#18341)
Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 26eeda525f..3c8e009daa 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -387,6 +387,7 @@ var ( MaxTokenLength: math.MaxInt16, } + // FIXME: DEPRECATED to be removed in v1.18.0 U2F = struct { AppID string }{} @@ -563,6 +564,12 @@ func LoadForTest(extraConfigs ...string) { } } +func deprecatedSetting(oldSection, oldKey, newSection, newKey string) { + if Cfg.Section(oldSection).HasKey(oldKey) { + log.Error("Deprecated fallback `[%s]` `%s` present. Use `[%s]` `%s` instead. This fallback will be removed in v1.18.0", oldSection, oldKey, newSection, newKey) + } +} + // loadFromConf initializes configuration context. // NOTE: do not print any log except error. func loadFromConf(allowEmpty bool, extraConfig string) { @@ -1022,6 +1029,10 @@ func loadFromConf(allowEmpty bool, extraConfig string) { UI.CustomEmojisMap[emoji] = ":" + emoji + ":" } + // FIXME: DEPRECATED to be removed in v1.18.0 + if Cfg.Section("U2F").HasKey("APP_ID") { + log.Error("Deprecated setting `[U2F]` `APP_ID` present. This fallback will be removed in v1.18.0") + } sec = Cfg.Section("U2F") U2F.AppID = sec.Key("APP_ID").MustString(strings.TrimSuffix(AppURL, "/")) } |