system_setting

package
v0.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WorkerAllowHttpImageRequestEnabled = false
View Source
var WorkerUrl = ""
View Source
var WorkerValidKey = ""

Functions

func EnableWorker

func EnableWorker() bool

func GetServerAddress

func GetServerAddress() string

GetServerAddress returns one complete runtime address generation. Callers that formerly read the exported ServerAddress variable must migrate to this accessor; the mutable variable was intentionally removed for race safety.

func SetServerAddress

func SetServerAddress(serverAddress string)

SetServerAddress publishes the supplied address as a complete runtime generation. Callers that formerly assigned ServerAddress must migrate to this setter. It intentionally preserves the existing string semantics, including empty values and trailing slashes.

func UpdatePasskeyAndServerAddress

func UpdatePasskeyAndServerAddress(serverAddress *string, passkeyValues map[string]string) error

UpdatePasskeyAndServerAddress atomically publishes a ServerAddress update together with raw Passkey option fields. It is used by the option persistence boundary after validation and a successful database commit so readers never observe a new address paired with an old Passkey generation. A nil serverAddress leaves the current address unchanged.

Types

type DiscordSettings

type DiscordSettings struct {
	Enabled      bool   `json:"enabled"`
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

func GetDiscordSettings

func GetDiscordSettings() *DiscordSettings

GetDiscordSettings returns a detached copy of one immutable runtime generation. Mutating the returned value never updates the live setting.

type FetchSetting

type FetchSetting struct {
	EnableSSRFProtection   bool     `json:"enable_ssrf_protection"` // 是否启用SSRF防护
	AllowPrivateIp         bool     `json:"allow_private_ip"`
	DomainFilterMode       bool     `json:"domain_filter_mode"`         // 域名过滤模式,true: 白名单模式,false: 黑名单模式
	IpFilterMode           bool     `json:"ip_filter_mode"`             // IP过滤模式,true: 白名单模式,false: 黑名单模式
	DomainList             []string `json:"domain_list"`                // domain format, e.g. example.com, *.example.com
	IpList                 []string `json:"ip_list"`                    // CIDR format
	AllowedPorts           []string `json:"allowed_ports"`              // port range format, e.g. 80, 443, 8000-9000
	ApplyIPFilterForDomain bool     `json:"apply_ip_filter_for_domain"` // 对域名启用IP过滤(实验性)
}

func GetFetchSetting

func GetFetchSetting() *FetchSetting

GetFetchSetting returns a detached copy of one immutable runtime generation. Mutating the returned value never updates the live setting.

type LegalSettings

type LegalSettings struct {
	UserAgreement string `json:"user_agreement"`
	PrivacyPolicy string `json:"privacy_policy"`
}

func GetLegalSettings

func GetLegalSettings() *LegalSettings

GetLegalSettings returns a detached copy of one immutable runtime generation. It preserves the legacy pointer return type for controllers and other callers, but mutations to the returned value are not configuration writes.

type OIDCSettings

type OIDCSettings struct {
	Enabled               bool   `json:"enabled"`
	DisplayName           string `json:"display_name"`
	ClientId              string `json:"client_id"`
	ClientSecret          string `json:"client_secret"`
	WellKnown             string `json:"well_known"`
	AuthorizationEndpoint string `json:"authorization_endpoint"`
	TokenEndpoint         string `json:"token_endpoint"`
	UserInfoEndpoint      string `json:"user_info_endpoint"`
}

func GetOIDCSettings

func GetOIDCSettings() *OIDCSettings

GetOIDCSettings returns a detached copy of one immutable runtime generation. Mutating the returned value never updates the live setting.

func (*OIDCSettings) GetEffectiveDisplayName

func (s *OIDCSettings) GetEffectiveDisplayName() string

GetEffectiveDisplayName returns the admin-configured display name, or the literal "OIDC" when none has been set. Centralizing this fallback keeps the default in one place for both the OAuth provider name and the public status payload.

type PasskeySettings

type PasskeySettings struct {
	Enabled              bool   `json:"enabled"`
	RPDisplayName        string `json:"rp_display_name"`
	RPID                 string `json:"rp_id"`
	Origins              string `json:"origins"`
	AllowInsecureOrigin  bool   `json:"allow_insecure_origin"`
	UserVerification     string `json:"user_verification"`
	AttachmentPreference string `json:"attachment_preference"`
}

func GetPasskeySettings

func GetPasskeySettings() *PasskeySettings

GetPasskeySettings returns a detached effective snapshot. Modifying the returned value does not persist or publish a configuration change; writers must use the registered Passkey configuration update path instead.

Jump to

Keyboard shortcuts

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