mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00

* feat(database): SQLite database backups * feat(database): do not produce SQL injections * feat(database): retain all backups if 0 or less refactor(database): specify database driver in func names * refactor(database): return early on cleanup * refactor(database): do not call cleanup func if max backups set to 0 * refactor(database): backup retention behavior * feat(database): improve logging --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
40 lines
1.6 KiB
Go
40 lines
1.6 KiB
Go
// Copyright (c) 2021 - 2024, Ludvig Lundgren and the autobrr contributors.
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
package domain
|
|
|
|
type Config struct {
|
|
Version string
|
|
ConfigPath string
|
|
Host string `toml:"host"`
|
|
Port int `toml:"port"`
|
|
LogLevel string `toml:"logLevel"`
|
|
LogPath string `toml:"logPath"`
|
|
LogMaxSize int `toml:"logMaxSize"`
|
|
LogMaxBackups int `toml:"logMaxBackups"`
|
|
BaseURL string `toml:"baseUrl"`
|
|
SessionSecret string `toml:"sessionSecret"`
|
|
CustomDefinitions string `toml:"customDefinitions"`
|
|
CheckForUpdates bool `toml:"checkForUpdates"`
|
|
DatabaseType string `toml:"databaseType"`
|
|
DatabaseMaxBackups int `toml:"databaseMaxBackups"`
|
|
PostgresHost string `toml:"postgresHost"`
|
|
PostgresPort int `toml:"postgresPort"`
|
|
PostgresDatabase string `toml:"postgresDatabase"`
|
|
PostgresUser string `toml:"postgresUser"`
|
|
PostgresPass string `toml:"postgresPass"`
|
|
PostgresSSLMode string `toml:"postgresSSLMode"`
|
|
PostgresExtraParams string `toml:"postgresExtraParams"`
|
|
ProfilingEnabled bool `toml:"profilingEnabled"`
|
|
ProfilingHost string `toml:"profilingHost"`
|
|
ProfilingPort int `toml:"profilingPort"`
|
|
}
|
|
|
|
type ConfigUpdate struct {
|
|
Host *string `json:"host,omitempty"`
|
|
Port *int `json:"port,omitempty"`
|
|
LogLevel *string `json:"log_level,omitempty"`
|
|
LogPath *string `json:"log_path,omitempty"`
|
|
BaseURL *string `json:"base_url,omitempty"`
|
|
CheckForUpdates *bool `json:"check_for_updates,omitempty"`
|
|
}
|