config

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 6 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	BaseURL            string
	Organisation       string
	SecureCookies      bool
	AdminEmails        []string
	OnlyAdminCanCreate bool
	SMTPEnabled        bool // True if SMTP is configured (for email reminders)
	AuthRateLimit      int  // Global auth rate limit (requests per minute), default: 5
	DocumentRateLimit  int  // Document creation rate limit (requests per minute), default: 10
	GeneralRateLimit   int  // General API rate limit (requests per minute), default: 100
	ImportMaxSigners   int  // Maximum signers per CSV import, default: 500
}

type AuthConfig

type AuthConfig struct {
	OAuthEnabled            bool
	MagicLinkEnabled        bool
	MagicLinkRateLimitEmail int // Max requests per email per window (default: 3)
	MagicLinkRateLimitIP    int // Max requests per IP per window (default: 10)
}

type ChecksumConfig

type ChecksumConfig struct {
	MaxBytes           int64
	TimeoutMs          int
	MaxRedirects       int
	AllowedContentType []string
	SkipSSRFCheck      bool // For testing only - DO NOT use in production
	InsecureSkipVerify bool // For testing only - DO NOT use in production
}

type Config

type Config struct {
	App      AppConfig
	Server   ServerConfig
	Database DatabaseConfig
	Checksum ChecksumConfig
	Auth     AuthConfig
	OAuth    OAuthConfig
	Mail     MailConfig
	Logger   LoggerConfig
}

func Load

func Load() (*Config, error)

Load loads configuration from environment variables

type DatabaseConfig

type DatabaseConfig struct {
	DSN string
}

type LoggerConfig

type LoggerConfig struct {
	Level  string
	Format string // "classic" or "json"
}

type MailConfig

type MailConfig struct {
	Host               string
	Port               int
	Username           string
	Password           string
	TLS                bool
	StartTLS           bool
	InsecureSkipVerify bool
	Timeout            string
	From               string
	FromName           string
	SubjectPrefix      string
	TemplateDir        string
	DefaultLocale      string
}

type OAuthConfig

type OAuthConfig struct {
	ClientID      string
	ClientSecret  string
	AuthURL       string
	TokenURL      string
	UserInfoURL   string
	LogoutURL     string
	Scopes        []string
	AllowedDomain string
	CookieSecret  []byte
	AutoLogin     bool
}

type ServerConfig

type ServerConfig struct {
	ListenAddr string
}

Jump to

Keyboard shortcuts

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