conf

package
v1.829.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppConfig = &config{data: map[string]string{}}

AppConfig is the process configuration, populated from conf/app.conf on startup (when present) and overridable via Set. The embedded runtime ships without app.conf and runs env-only.

Functions

func DisablePreviewMode added in v1.790.3

func DisablePreviewMode() bool

DisablePreviewMode resolves the disablePreviewMode toggle. It is the ONE place the preview-mode value is read, so it can never be resolved two ways. Preview mode is the UNAUTHENTICATED, development-only relaxation; disabling it is what production wants.

Resolution order (env beats file so ops can flip it on the DEPLOYED cloud CR with NO rebuild — the reversible, durable lever):

  1. DISABLE_PREVIEW_MODE env — "true" (case-insensitive) => preview OFF.
  2. disablePreviewMode app.conf key (standalone/local dev).

A security kill-switch gets its own explicit UPPER_SNAKE env name rather than riding the generic GetConfigString passthrough (whose env key would be the camelCase config name) — one unambiguous lever for one decision.

func FileExist

func FileExist(path string) bool

func GetConfigBool

func GetConfigBool(key string) bool

func GetConfigDataSourceName

func GetConfigDataSourceName() string

func GetConfigInt

func GetConfigInt(key string) int

func GetConfigString

func GetConfigString(key string) string

func GetLanguage

func GetLanguage(language string) string

func GetStringArray

func GetStringArray(key string) []string

func IsDemoMode

func IsDemoMode() bool

func IsPreviewMode added in v1.790.3

func IsPreviewMode() bool

IsPreviewMode reports whether the server is in preview mode: the unauthenticated dev relaxation. It is the semantic every caller wants; it and DisablePreviewMode are the ONLY readers of the toggle. Callers must use these and never read the raw config key, so the env lever governs every call site.

func LoadAppConfig added in v1.823.0

func LoadAppConfig(format, path string) error

LoadAppConfig parses a flat "key = value" ini file into AppConfig: it skips blank lines, ";"/"#" comments and "[section]" headers, trims whitespace and strips surrounding double quotes. The format argument is accepted for call compatibility; only ini is supported.

func ReadGlobalConfigTokens

func ReadGlobalConfigTokens() []string

func ReadStringFromPath

func ReadStringFromPath(path string) string

Types

type WebConfig

type WebConfig struct {
	AuthConfig struct {
		ServerUrl        string `json:"serverUrl"`
		ClientId         string `json:"clientId"`
		AppName          string `json:"appName"`
		OrganizationName string `json:"organizationName"`
		RedirectPath     string `json:"redirectPath"`
	} `json:"authConfig"`
	EnableExtraPages   bool     `json:"enableExtraPages"`
	ShortcutPageItems  []string `json:"shortcutPageItems"`
	UsageEndpoints     []string `json:"usageEndpoints"`
	IframeUrl          string   `json:"iframeUrl"`
	ForceLanguage      string   `json:"forceLanguage"`
	DefaultLanguage    string   `json:"defaultLanguage"`
	StaticBaseUrl      string   `json:"staticBaseUrl"`
	HtmlTitle          string   `json:"htmlTitle"`
	FaviconUrl         string   `json:"faviconUrl"`
	LogoUrl            string   `json:"logoUrl"`
	NavbarHtml         string   `json:"navbarHtml"`
	FooterHtml         string   `json:"footerHtml"`
	AppUrl             string   `json:"appUrl"`
	ShowGithubCorner   bool     `json:"showGithubCorner"`
	IsDemoMode         bool     `json:"isDemoMode"`
	DisablePreviewMode bool     `json:"disablePreviewMode"`
	ThemeDefault       struct {
		ThemeType    string `json:"themeType"`
		ColorPrimary string `json:"colorPrimary"`
		BorderRadius int    `json:"borderRadius"`
		IsCompact    bool   `json:"isCompact"`
	} `json:"themeDefault"`
	AvatarErrorUrl string `json:"avatarErrorUrl"`
}

func GetWebConfig

func GetWebConfig() *WebConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL