Versions in this module Expand all Collapse all v1 v1.0.0 Feb 3, 2026 Changes in this version + const ProjectName + const ProjectOrg + var BuildDate = "unknown" + var CommitID = "unknown" + var OfficialSite = "https://scour.li" + var Version = "dev" + func EnsureDirectories() error + func EnsureSensitiveFile(path string) error + func EnsureSystemDirectories(userName string) error + func GetAdminPath() string + func GetAllDomains() []string + func GetArch() string + func GetBackupDir() string + func GetBinaryPath() string + func GetCacheDir() string + func GetColorMode() string + func GetConfigDir() string + func GetConfigPath() string + func GetCurrentGID() int + func GetCurrentUID() int + func GetDataDir() string + func GetDatabaseDir() string + func GetDatabaseDriver() string + func GetDatabaseURL() string + func GetDirectoryPermissions() os.FileMode + func GetDomain() string + func GetEmailTemplatesDir() string + func GetFileOwnership(path string) (uid, gid int, err error) + func GetGeoIPDir() string + func GetLogDir() string + func GetOS() string + func GetPIDFile() string + func GetRandomPort() int + func GetSSLDir() string + func GetSecurityDir() string + func GetSensitiveDirectoryPermissions() os.FileMode + func GetSensitiveFilePermissions() os.FileMode + func GetServiceFile() string + func GetTemplatesDir() string + func GetTorDir() string + func GetTorKeysDir() string + func GetWebDataDir() string + func GetWellKnownDir() string + func IsColorEnabled() bool + func IsFalsy(s string) bool + func IsPrivileged() bool + func IsRunningInContainer() bool + func IsTorAvailable() bool + func IsTruthy(s string) bool + func IsValidEmail(email string) bool + func IsValidHost(host string, devMode bool, projectName string) bool + func IsValidPort(port int) bool + func IsValidSSLHost(host string) bool + func LogValidationWarnings(warnings []ValidationWarning) + func MustParseBool(s string, defaultVal bool) bool + func ParseBool(s string, defaultVal bool) (bool, error) + func ParseBoolDefault(val string, defaultVal bool) bool + func ParseDuration(val string) (int, error) + func ParseFormBool(val string) bool + func ParseInt(val string, defaultVal int) int + func ResolvePort(port int) int + func SetAdminPathOverride(path string) + func SetBackupDirOverride(dir string) + func SetCacheDirOverride(dir string) + func SetColorMode(mode string) + func SetConfigDirOverride(dir string) + func SetDataDirOverride(dir string) + func SetFileOwnership(path string, uid, gid int) error + func SetLogDirOverride(dir string) + func SetPIDFileOverride(path string) + func TrimmedFormValue(r *http.Request, key string) string + func TrimmedPostFormValue(r *http.Request, key string) string + type AdminConfig struct + APIToken string + Email string + Enabled bool + Password string + Token string + Username string + type Announcement struct + Dismissible bool + End string + ID string + Message string + Start string + Title string + Type string + type AnnouncementsConfig struct + Enabled bool + Messages []Announcement + func (c *AnnouncementsConfig) ActiveAnnouncements() []Announcement + type AuthConfig struct + LDAP []LDAPConfig + OIDC []OIDCProviderConfig + type BackupConfig struct + Encryption BackupEncryptionConfig + Retention BackupRetentionConfig + type BackupEncryptionConfig struct + Enabled bool + Hint string + type BackupRetentionConfig struct + KeepMonthly int + KeepWeekly int + KeepYearly int + MaxBackups int + type BangConfig struct + Aliases []string + Category string + Description string + Name string + Shortcut string + URL string + type BangsConfig struct + Custom []BangConfig + Enabled bool + ProxyRequests bool + type BrandingConfig struct + Description string + FaviconURL string + FooterText string + LogoURL string + PrimaryColor string + Tagline string + Theme string + Title string + type CacheConfig struct + Cluster bool + ClusterNodes []string + DB int + Host string + MinIdle int + Password string + PoolSize int + Port int + Prefix string + TTL int + Timeout string + Type string + URL string + type ComplianceConfig struct + Enabled bool + type CompressionConfig struct + Brotli bool + DisableProxy bool + Enabled bool + Gzip bool + Level int + MimeTypes []string + MinSize int + type Config struct + Engines map[string]EngineConfig + Search SearchConfig + Server ServerConfig + func DefaultConfig() *Config + func Initialize() (*Config, error) + func Load(path string) (*Config, error) + func LoadOrCreate(path string) (*Config, bool, error) + func (c *Config) ApplyEnv(env *EnvConfig) + func (c *Config) Get() ServerConfig + func (c *Config) GetAddress() string + func (c *Config) GetEncryptionKey() []byte + func (c *Config) GetPath() string + func (c *Config) IsDebug() bool + func (c *Config) IsDevelopment() bool + func (c *Config) IsFirstRun() bool + func (c *Config) IsProduction() bool + func (c *Config) Reload() error + func (c *Config) Save(path string) error + func (c *Config) SetPath(path string) + func (c *Config) Update(fn func(*ServerConfig)) + func (c *Config) ValidateAndApplyDefaults() []ValidationWarning + type ConfigSync struct + func NewConfigSync(db *sql.DB, config *Config, configPath string, isCluster bool) *ConfigSync + func (cs *ConfigSync) IsClusterMode() bool + func (cs *ConfigSync) LastSync() time.Time + func (cs *ConfigSync) LoadFromSource() error + func (cs *ConfigSync) SaveSetting(key string, value interface{}) error + func (cs *ConfigSync) StartPeriodicSync(interval time.Duration) + func (cs *ConfigSync) SyncToLocal() error + type ContactConfig struct + Email string + Enabled bool + type CookieConsentConfig struct + Enabled bool + Message string + PolicyURL string + TrackingID string + type CryptoWidgetConfig struct + Currency string + DefaultCoins []string + Enabled bool + type DNS01Config struct + CredentialsEncrypted string + Provider string + ValidatedAt string + type EmailConfig struct + Enabled bool + From EmailFromConfig + SMTP SMTPConfig + type EmailFromConfig struct + Email string + Name string + type EngineConfig struct + APIKey string + Categories []string + Enabled bool + Priority int + Timeout int + Weight float64 + type EnvConfig struct + Autocomplete string + BaseURL string + BindAddress string + ConfigDir string + DataDir string + DatabaseDriver string + DatabaseURL string + Debug bool + Domain string + EnableBing bool + EnableDuckDuckGo bool + EnableGoogle bool + ImageProxyKey string + ImageProxyURL string + InstanceName string + LogDir string + Mode string + Port string + SMTPFromEmail string + SMTPFromName string + SMTPHost string + SMTPPassword string + SMTPPort int + SMTPTLS string + SMTPUsername string + Secret string + SettingsPath string + func LoadFromEnv() *EnvConfig + func (e *EnvConfig) GetMode() string + func (e *EnvConfig) IsDevelopment() bool + func (e *EnvConfig) IsProduction() bool + type GeoIPConfig struct + ASN bool + AllowedCountries []string + City bool + Country bool + DenyCountries []string + Dir string + Enabled bool + Update string + WHOIS bool + type I18nConfig struct + AutoDetect bool + DefaultLanguage string + Enabled bool + FallbackLanguage string + RTLLanguages []string + ShowSelector bool + SupportedLanguages []string + TranslationsDir string + type ImageProxyConfig struct + Enabled bool + Key string + URL string + type LDAPConfig struct + AdminGroups []string + BaseDN string + BindDN string + BindPassword string + EmailAttr string + Enabled bool + GroupFilter string + GroupMemberAttr string + Host string + ID string + Name string + Port int + SkipTLSVerify bool + UseTLS bool + UserFilter string + UsernameAttr string + type LimitsConfig struct + IdleTimeout string + MaxBodySize string + ReadTimeout string + WriteTimeout string + func (l *LimitsConfig) GetMaxBodySizeBytes() int64 + type LogsConfig struct + Access struct{ ... } + Audit struct{ ... } + Debug struct{ ... } + Error struct{ ... } + File string + Format string + Level string + Security struct{ ... } + Server struct{ ... } + type MetricsConfig struct + DurationBuckets []float64 + Enabled bool + Endpoint string + IncludeRuntime bool + IncludeSystem bool + SizeBuckets []float64 + Token string + type NewsWidgetConfig struct + Enabled bool + MaxItems int + Sources []string + type OIDCProviderConfig struct + AdminGroups []string + AutoCreate bool + ClientID string + ClientSecret string + Enabled bool + GroupsClaim string + ID string + Issuer string + Name string + RedirectURL string + Scopes []string + type OpenGraphConfig struct + Description string + Enabled bool + Image string + SiteName string + Type string + type OpenSearchConfig struct + Contact string + Description string + Enabled bool + Image string + LongName string + ShortName string + Tags string + type PagesConfig struct + About struct{ ... } + Contact struct{ ... } + Help struct{ ... } + Privacy struct{ ... } + Terms struct{ ... } + type RSSWidgetConfig struct + Enabled bool + MaxFeeds int + MaxItems int + type RateLimitConfig struct + Blacklist []string + BurstSize int + ByIP bool + ByUser bool + Enabled bool + RequestsPerDay int + RequestsPerHour int + RequestsPerMinute int + Whitelist []string + type SEOConfig struct + Canonical bool + DefaultDescription string + DefaultTitle string + Enabled bool + Keywords []string + MetaTags map[string]string + NoIndex bool + OpenGraph OpenGraphConfig + Sitemap bool + TitleSeparator string + Twitter TwitterConfig + type SMTPConfig struct + Host string + Password string + Port int + TLS string + Username string + type SSLConfig struct + AutoTLS bool + CertFile string + DNS01 DNS01Config + Enabled bool + KeyFile string + LetsEncrypt struct{ ... } + type SchedulerConfig struct + CatchUpWindow string + Tasks SchedulerTasksConfig + Timezone string + type SchedulerTasksConfig struct + BackupDaily TaskConfig + BackupHourly TaskConfig + BlocklistUpdate TaskConfig + CVEUpdate TaskConfig + GeoIPUpdate TaskConfig + type SearchConfig struct + Autocomplete string + Bangs BangsConfig + DefaultCategories []string + DefaultLang string + MaxConcurrent int + OpenSearch OpenSearchConfig + ResultsPerPage int + SafeSearch int + Timeout int + Widgets WidgetsConfig + type SecurityConfig struct + CORS struct{ ... } + CSRF struct{ ... } + Headers struct{ ... } + TrustedProxies []string + type ServerConfig struct + Address string + Admin AdminConfig + Auth AuthConfig + Backup BackupConfig + BaseURL string + Branding BrandingConfig + Cache CacheConfig + Compliance ComplianceConfig + Compression CompressionConfig + Contact ContactConfig + Description string + Email EmailConfig + GeoIP GeoIPConfig + HTTPSPort int + I18n I18nConfig + ImageProxy ImageProxyConfig + Limits LimitsConfig + Logs LogsConfig + MaintenanceMode bool + Metrics MetricsConfig + Mode string + Pages PagesConfig + Port int + RateLimit RateLimitConfig + SEO SEOConfig + SSL SSLConfig + Scheduler SchedulerConfig + SecretKey string + Security SecurityConfig + Session SessionConfig + Title string + Tor TorConfig + Users UsersConfig + Web WebConfig + func (c *ServerConfig) GetHTTPPort() int + func (c *ServerConfig) GetHTTPSPort() int + func (c *ServerConfig) IsDualPortMode() bool + type SessionConfig struct + Admin SessionTypeConfig + CookieHTTPOnly bool + CookieName string + CookieSameSite string + CookieSecure bool + Duration string + ExtendOnActivity bool + HTTPOnly bool + SameSite string + Secure string + User SessionTypeConfig + func (s *SessionConfig) GetAdminCookieName() string + func (s *SessionConfig) GetAdminMaxAge() int + func (s *SessionConfig) GetIdleTimeout() int + func (s *SessionConfig) GetSameSite() string + func (s *SessionConfig) GetUserCookieName() string + func (s *SessionConfig) GetUserMaxAge() int + func (s *SessionConfig) IsHTTPOnly() bool + func (s *SessionConfig) IsSecure(sslEnabled bool) bool + type SessionTypeConfig struct + CookieName string + IdleTimeout int + MaxAge int + type SportsWidgetConfig struct + DefaultLeagues []string + Enabled bool + type StocksWidgetConfig struct + DefaultSymbols []string + Enabled bool + type TaskConfig struct + Enabled bool + Schedule string + type TorConfig struct + AllowUserPreference bool + BandwidthBurst string + BandwidthRate string + Binary string + BootstrapTimeout int + CircuitTimeout int + CloseCircuitOnStreamLimit bool + Enabled bool + HiddenServicePort int + MaxCircuits int + MaxMonthlyBandwidth string + MaxStreamsPerCircuit int + NumIntroPoints int + OnionAddress string + SafeLogging bool + UseNetwork bool + type TwitterConfig struct + Card string + Creator string + Enabled bool + Site string + type UsersConfig struct + Auth struct{ ... } + Enabled bool + Limits struct{ ... } + Profile struct{ ... } + Registration struct{ ... } + Roles struct{ ... } + SSO struct{ ... } + Tokens struct{ ... } + func (u *UsersConfig) GetSessionDurationDays() int + type ValidationWarning struct + Default interface{} + Field string + Message string + type WeatherWidgetConfig struct + DefaultCity string + Enabled bool + Units string + type WebConfig struct + Announcements AnnouncementsConfig + CORS string + CookieConsent CookieConsentConfig + Robots struct{ ... } + Security struct{ ... } + type WidgetsConfig struct + CacheTTL int + Crypto CryptoWidgetConfig + DefaultWidgets []string + Enabled bool + News NewsWidgetConfig + RSS RSSWidgetConfig + Sports SportsWidgetConfig + Stocks StocksWidgetConfig + Weather WeatherWidgetConfig