Documentation
¶
Index ¶
Constants ¶
const ( // FileName is the launcher-specific settings file name. FileName = "launcher-config.json" // DefaultPort is the default port for the web launcher. DefaultPort = 18800 // EnvLauncherHost overrides launcher listen host. EnvLauncherHost = "COMPA_LAUNCHER_HOST" )
Variables ¶
This section is empty.
Functions ¶
func NormalizeCIDRs ¶
NormalizeCIDRs trims entries, removes empty values, and deduplicates CIDRs.
func PathForAppConfig ¶
PathForAppConfig returns launcher-config path near the app config file.
Types ¶
type BoolFieldSource ¶
type BoolFieldSource uint8
BoolFieldSource tracks whether a JSON boolean field was omitted, explicitly provided, or explicitly set to null. This is only used for diagnostics.
const ( BoolFieldAbsent BoolFieldSource = iota BoolFieldPresent BoolFieldNull )
type Config ¶
type Config struct {
Port int `json:"port"`
Public bool `json:"public"`
AllowedCIDRs []string `json:"allowed_cidrs,omitempty"`
AllowLocalhostBypass bool `json:"allow_localhost_bypass"`
AllowLocalhostBypassSource BoolFieldSource `json:"-"`
TrustedProxyCIDRs []string `json:"trusted_proxy_cidrs,omitempty"`
DashboardPasswordHash string `json:"dashboard_password_hash,omitempty"`
}
Config stores launch parameters for the web backend service.
type PasswordStore ¶
type PasswordStore struct {
// contains filtered or unexported fields
}
PasswordStore keeps the dashboard bcrypt hash in launcher-config.json. It is used on platforms where the SQLite-backed dashboard auth store is not available.
func NewPasswordStore ¶
func NewPasswordStore(path string, fallback Config) *PasswordStore
NewPasswordStore returns a config-backed password store.
func (*PasswordStore) IsInitialized ¶
func (s *PasswordStore) IsInitialized(ctx context.Context) (bool, error)
IsInitialized reports whether a dashboard password hash exists in config.
func (*PasswordStore) SetPassword ¶
func (s *PasswordStore) SetPassword(ctx context.Context, plain string) error
SetPassword hashes plain with bcrypt and writes it to launcher-config.json.
func (*PasswordStore) VerifyPassword ¶
VerifyPassword returns true iff plain matches the stored bcrypt hash.