mirror of
https://github.com/grafana/grafana.git
synced 2025-09-20 05:02:31 +08:00
Secure socks proxy: allow for UI to be disabled (#69408)
This commit is contained in:

committed by
GitHub

parent
cb4ad588b9
commit
29a4e3d7da
@ -1587,3 +1587,5 @@ client_cert =
|
|||||||
server_name =
|
server_name =
|
||||||
# The address of the socks5 proxy datasources should connect to
|
# The address of the socks5 proxy datasources should connect to
|
||||||
proxy_address =
|
proxy_address =
|
||||||
|
# Determines if the secure socks proxy should be shown on the datasources page, defaults to true if the feature is enabled
|
||||||
|
show_ui = false
|
@ -1491,3 +1491,4 @@
|
|||||||
; server_name =
|
; server_name =
|
||||||
# The address of the socks5 proxy datasources should connect to
|
# The address of the socks5 proxy datasources should connect to
|
||||||
; proxy_address =
|
; proxy_address =
|
||||||
|
; show_ui = true
|
||||||
|
@ -149,7 +149,7 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
|
|||||||
TrustedTypesDefaultPolicyEnabled: trustedTypesDefaultPolicyEnabled,
|
TrustedTypesDefaultPolicyEnabled: trustedTypesDefaultPolicyEnabled,
|
||||||
CSPReportOnlyEnabled: hs.Cfg.CSPReportOnlyEnabled,
|
CSPReportOnlyEnabled: hs.Cfg.CSPReportOnlyEnabled,
|
||||||
DateFormats: hs.Cfg.DateFormats,
|
DateFormats: hs.Cfg.DateFormats,
|
||||||
SecureSocksDSProxyEnabled: hs.Cfg.SecureSocksDSProxy.Enabled,
|
SecureSocksDSProxyEnabled: hs.Cfg.SecureSocksDSProxy.Enabled && hs.Cfg.SecureSocksDSProxy.ShowUI,
|
||||||
|
|
||||||
Auth: dtos.FrontendSettingsAuthDTO{
|
Auth: dtos.FrontendSettingsAuthDTO{
|
||||||
OAuthSkipOrgRoleUpdateSync: hs.Cfg.OAuthSkipOrgRoleUpdateSync,
|
OAuthSkipOrgRoleUpdateSync: hs.Cfg.OAuthSkipOrgRoleUpdateSync,
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
type SecureSocksDSProxySettings struct {
|
type SecureSocksDSProxySettings struct {
|
||||||
Enabled bool
|
Enabled bool
|
||||||
|
ShowUI bool
|
||||||
ClientCert string
|
ClientCert string
|
||||||
ClientKey string
|
ClientKey string
|
||||||
RootCA string
|
RootCA string
|
||||||
@ -24,6 +25,7 @@ func readSecureSocksDSProxySettings(iniFile *ini.File) (SecureSocksDSProxySettin
|
|||||||
s.RootCA = secureSocksProxySection.Key("root_ca_cert").MustString("")
|
s.RootCA = secureSocksProxySection.Key("root_ca_cert").MustString("")
|
||||||
s.ProxyAddress = secureSocksProxySection.Key("proxy_address").MustString("")
|
s.ProxyAddress = secureSocksProxySection.Key("proxy_address").MustString("")
|
||||||
s.ServerName = secureSocksProxySection.Key("server_name").MustString("")
|
s.ServerName = secureSocksProxySection.Key("server_name").MustString("")
|
||||||
|
s.ShowUI = secureSocksProxySection.Key("show_ui").MustBool(true)
|
||||||
|
|
||||||
if !s.Enabled {
|
if !s.Enabled {
|
||||||
return s, nil
|
return s, nil
|
||||||
|
Reference in New Issue
Block a user