config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 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
	Storage   StorageConfig
	Logger    LoggerConfig
	Telemetry TelemetryConfig
}

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
}

type StorageConfig added in v1.3.0

type StorageConfig struct {
	Type      string // "local", "s3", or "" (disabled)
	MaxSizeMB int64  // Max file size in MB (default: 50)

	// Local storage
	LocalPath string // Path for local storage (default: /data/documents)

	// S3-compatible storage
	S3Endpoint  string
	S3Bucket    string
	S3AccessKey string
	S3SecretKey string
	S3Region    string
	S3UseSSL    bool
}

func (*StorageConfig) IsEnabled added in v1.3.0

func (s *StorageConfig) IsEnabled() bool

type TelemetryConfig added in v1.3.0

type TelemetryConfig struct {
	Enabled bool
	DataDir string // Directory to store identity file (must be persisted on host)
}

Jump to

Keyboard shortcuts

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