hide/ignore ssl_cert when on windows

x509.SystemCertPool is unavailable on windows, so any value is ignored
and the setting is hidden on the web UI.
This commit is contained in:
Harvey Tindall
2021-05-17 01:16:59 +01:00
parent 76bbb3f147
commit 057f306ed9
2 changed files with 25 additions and 0 deletions
+10
View File
@@ -1398,6 +1398,16 @@ func (app *appContext) GetConfig(gc *gin.Context) {
}
}
}
if PLATFORM == "windows" {
delete(resp.Sections["smtp"].Settings, "ssl_cert")
for i, v := range resp.Sections["smtp"].Order {
if v == "ssl_cert" {
sect := resp.Sections["smtp"]
sect.Order = append(sect.Order[:i], sect.Order[i+1:]...)
resp.Sections["smtp"] = sect
}
}
}
for sectName, section := range resp.Sections {
for settingName, setting := range section.Settings {
val := app.config.Section(sectName).Key(settingName)