system_setting

package
v1.0.0-rc.37 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultTaskArtifactInvalidRateLimitPerMinute = 60
	DefaultTaskArtifactGlobalConcurrency         = 128
	DefaultTaskArtifactIPConcurrency             = 64
	DefaultTaskArtifactObjectConcurrency         = 16
)
View Source
const (
	TaskArtifactInvalidRateLimitEnv = "TASK_ARTIFACT_INVALID_RATE_LIMIT_PER_MINUTE"
	TaskArtifactGlobalLimitEnv      = "TASK_ARTIFACT_GLOBAL_CONCURRENCY"
	TaskArtifactIPLimitEnv          = "TASK_ARTIFACT_IP_CONCURRENCY"
	TaskArtifactObjectLimitEnv      = "TASK_ARTIFACT_OBJECT_CONCURRENCY"
)
View Source
const (
	TaskArtifactStoreModeUpstream = "upstream"
	TaskArtifactStoreModeS3       = "s3"

	DefaultTaskArtifactStorePresignTTLSeconds = 900
	MaxTaskArtifactStorePresignTTLSeconds     = 7 * 24 * 60 * 60
)
View Source
const (
	TaskArtifactStoreModeEnv         = "TASK_ARTIFACT_STORE_MODE"
	TaskArtifactStoreS3EndpointEnv   = "TASK_ARTIFACT_STORE_S3_ENDPOINT"
	TaskArtifactStoreS3BucketEnv     = "TASK_ARTIFACT_STORE_S3_BUCKET"
	TaskArtifactStoreS3RegionEnv     = "TASK_ARTIFACT_STORE_S3_REGION"
	TaskArtifactStoreS3AccessKeyEnv  = "TASK_ARTIFACT_STORE_S3_ACCESS_KEY"
	TaskArtifactStoreS3SecretKeyEnv  = "TASK_ARTIFACT_STORE_S3_SECRET_KEY"
	TaskArtifactStoreS3PrefixEnv     = "TASK_ARTIFACT_STORE_S3_PREFIX"
	TaskArtifactStoreS3PresignTTLEnv = "TASK_ARTIFACT_STORE_S3_PRESIGN_TTL"
)

Variables

View Source
var ErrPasskeyRPIDInvalid = errors.New("Invalid Passkey domain. Enter a domain without a scheme, port, path or wildcard.")
View Source
var ErrPasskeyRPIDUnavailable = errors.New("This Passkey domain is not available on this website. Use its original website or another verification method.")
View Source
var ServerAddress = "http://localhost:3000"
View Source
var TaskPublicAddress = ""
View Source
var WorkerAllowHttpImageRequestEnabled = false
View Source
var WorkerUrl = ""
View Source
var WorkerValidKey = ""

Functions

func EnableWorker

func EnableWorker() bool

func NormalizePasskeyRPID

func NormalizePasskeyRPID(value string, configuredOrigins ...string) (string, error)

func ParsePasskeyRPIDs

func ParsePasskeyRPIDs(value string, configuredOrigins ...string) ([]string, error)

func ValidateTaskArtifactStoreConfig

func ValidateTaskArtifactStoreConfig(config TaskArtifactStoreConfig) error

ValidateTaskArtifactStoreConfig performs syntax checks only. It never resolves hosts, contacts an endpoint, or verifies credentials.

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

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

type LegalSettings

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

func GetLegalSettings

func GetLegalSettings() *LegalSettings

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

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"`
	LegacyRPIDs          string `json:"legacy_rp_ids"`
	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

func PasskeySettingsSnapshot

func PasskeySettingsSnapshot() PasskeySettings

PasskeySettingsSnapshot includes the effective defaults without sharing a mutable settings pointer with a WebAuthn ceremony.

func (PasskeySettings) EffectiveRPID

func (s PasskeySettings) EffectiveRPID() string

EffectiveRPID preserves the existing default and port handling for settings created before explicit Passkey domains were introduced.

func (PasskeySettings) RelyingPartyIDs

func (s PasskeySettings) RelyingPartyIDs() []string

func (PasskeySettings) WithDefaults

func (s PasskeySettings) WithDefaults(serverAddress string) PasskeySettings

type TaskArtifactAccessLimits

type TaskArtifactAccessLimits struct {
	InvalidRatePerMinute int
	GlobalConcurrency    int
	IPConcurrency        int
	ObjectConcurrency    int
}

func LoadTaskArtifactAccessLimits

func LoadTaskArtifactAccessLimits() TaskArtifactAccessLimits

LoadTaskArtifactAccessLimits reads startup configuration. Invalid and non-positive values safely fall back to the documented defaults.

type TaskArtifactStoreConfig

type TaskArtifactStoreConfig struct {
	Mode                string
	S3Endpoint          string
	S3Bucket            string
	S3Region            string
	S3AccessKey         string
	S3SecretKey         string
	S3Prefix            string
	S3PresignTTLSeconds int
}

TaskArtifactStoreConfig reserves the configuration contract for a future S3 implementation. The current release always falls back to upstream proxying.

func LoadTaskArtifactStoreConfig

func LoadTaskArtifactStoreConfig() TaskArtifactStoreConfig

LoadTaskArtifactStoreConfig reads and validates startup-only configuration. S3 mode is deliberately disabled until a storage implementation is shipped.

type TelegramSettings

type TelegramSettings struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

func GetTelegramSettings

func GetTelegramSettings() *TelegramSettings

func (*TelegramSettings) IsConfigured

func (s *TelegramSettings) IsConfigured() bool

Jump to

Keyboard shortcuts

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