Storage: externalize allow_unsanitized_svg_upload (#52703)
This commit is contained in:
@@ -443,6 +443,8 @@ type Cfg struct {
|
||||
|
||||
DashboardPreviews DashboardPreviewsSettings
|
||||
|
||||
Storage StorageSettings
|
||||
|
||||
// Access Control
|
||||
RBACEnabled bool
|
||||
RBACPermissionCache bool
|
||||
@@ -1014,6 +1016,7 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
|
||||
cfg.readDataSourcesSettings()
|
||||
|
||||
cfg.DashboardPreviews = readDashboardPreviewsSettings(iniFile)
|
||||
cfg.Storage = readStorageSettings(iniFile)
|
||||
|
||||
if VerifyEmailEnabled && !cfg.Smtp.Enabled {
|
||||
cfg.Logger.Warn("require_email_validation is enabled but smtp is disabled")
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package setting
|
||||
|
||||
import (
|
||||
"gopkg.in/ini.v1"
|
||||
)
|
||||
|
||||
type StorageSettings struct {
|
||||
AllowUnsanitizedSvgUpload bool
|
||||
}
|
||||
|
||||
func readStorageSettings(iniFile *ini.File) StorageSettings {
|
||||
s := StorageSettings{}
|
||||
storageSection := iniFile.Section("storage")
|
||||
s.AllowUnsanitizedSvgUpload = storageSection.Key("allow_unsanitized_svg_upload").MustBool(false)
|
||||
return s
|
||||
}
|
||||
Reference in New Issue
Block a user