Cfg: Add a setting to configure if the local file system is available (#83616)
* Introduce environment.local_filesystem_available * Only show TLS client cert, client key, client ca when local_filesystem_available is true * Rename LocalFSAvailable to LocalFileSystemAvailable
This commit is contained in:
@@ -260,4 +260,6 @@ type FrontendSettingsDTO struct {
|
||||
// Enterprise
|
||||
Licensing *FrontendSettingsLicensingDTO `json:"licensing,omitempty"`
|
||||
Whitelabeling *FrontendSettingsWhitelabelingDTO `json:"whitelabeling,omitempty"`
|
||||
|
||||
LocalFileSystemAvailable bool `json:"localFileSystemAvailable"`
|
||||
}
|
||||
|
||||
@@ -220,6 +220,7 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
|
||||
PublicDashboardsEnabled: hs.Cfg.PublicDashboardsEnabled,
|
||||
SharedWithMeFolderUID: folder.SharedWithMeFolderUID,
|
||||
RootFolderUID: accesscontrol.GeneralFolderUID,
|
||||
LocalFileSystemAvailable: hs.Cfg.LocalFileSystemAvailable,
|
||||
|
||||
BuildInfo: dtos.FrontendSettingsBuildInfoDTO{
|
||||
HideVersion: hideVersion,
|
||||
|
||||
@@ -366,6 +366,8 @@ type Cfg struct {
|
||||
StackID string
|
||||
Slug string
|
||||
|
||||
LocalFileSystemAvailable bool
|
||||
|
||||
// Deprecated
|
||||
ForceMigration bool
|
||||
|
||||
@@ -1063,6 +1065,7 @@ func (cfg *Cfg) parseINIFile(iniFile *ini.File) error {
|
||||
cfg.Env = valueAsString(iniFile.Section(""), "app_mode", "development")
|
||||
cfg.StackID = valueAsString(iniFile.Section("environment"), "stack_id", "")
|
||||
cfg.Slug = valueAsString(iniFile.Section("environment"), "stack_slug", "")
|
||||
cfg.LocalFileSystemAvailable = iniFile.Section("environment").Key("local_file_system_available").MustBool(true)
|
||||
//nolint:staticcheck
|
||||
cfg.ForceMigration = iniFile.Section("").Key("force_migration").MustBool(false)
|
||||
cfg.InstanceName = valueAsString(iniFile.Section(""), "instance_name", "unknown_instance_name")
|
||||
|
||||
Reference in New Issue
Block a user