mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
add dev flag to aid UI development (#8789)
This commit is contained in:
parent
5ef1bbeae9
commit
d9bf269c60
1 changed files with 15 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import (
|
|||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/fleetdm/fleet/v4/server/authz"
|
||||
authz_ctx "github.com/fleetdm/fleet/v4/server/contexts/authz"
|
||||
|
|
@ -43,6 +44,14 @@ type appConfigResponseFields struct {
|
|||
Logging *fleet.Logging `json:"logging,omitempty"`
|
||||
// SandboxEnabled is true if fleet serve was ran with server.sandbox_enabled=true
|
||||
SandboxEnabled bool `json:"sandbox_enabled,omitempty"`
|
||||
// MDMEnabled is true if fleet serve was ran with FLEET_DEV_MDM_ENABLED=1
|
||||
//
|
||||
// This is used only for UI development, for more details check
|
||||
// https://github.com/fleetdm/fleet/issues/8751
|
||||
//
|
||||
// TODO: remove this flag once the MDM feature is ready for
|
||||
// release.
|
||||
MDMEnabled bool `json:"mdm_enabled,omitempty"`
|
||||
|
||||
Err error `json:"error,omitempty"`
|
||||
}
|
||||
|
|
@ -135,6 +144,12 @@ func getAppConfigEndpoint(ctx context.Context, request interface{}, svc fleet.Se
|
|||
License: license,
|
||||
Logging: loggingConfig,
|
||||
SandboxEnabled: svc.SandboxEnabled(),
|
||||
// Undocumented feature flag for MDM, used only for UI development, for
|
||||
// more details check https://github.com/fleetdm/fleet/issues/8751
|
||||
//
|
||||
// TODO: remove this flag once the MDM feature is ready for
|
||||
// release.
|
||||
MDMEnabled: os.Getenv("FLEET_DEV_MDM_ENABLED") == "1",
|
||||
},
|
||||
}
|
||||
return response, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue