FDN-02/FDN-03/FDN-07/FDN-08: Migrations-Rollback, Objekt-Storage-Interface, go.sum-Fix, Observability
- FDN-02: Rollback-fähige Down-Migrationen (024-026), archivdms seed dev CLI - FDN-03: internal/objectstore Interface + lokaler WORM-Treiber, signierte Download-URLs - FDN-07: go.mod/go.sum vervollständigt (fehlender go-ldap/v3-Eintrag), CI-Pipeline (.gitea/workflows/ci.yml, bereits in FDN-01 committet) damit lauffähig - FDN-08: Request-ID-Middleware, /metrics-Endpoint, Panic-Recovery, Login/Logout/Me technisches Logging inkl. Access-Log je Anfrage
This commit is contained in:
@@ -25,6 +25,10 @@ type APIConfig struct {
|
||||
// TrustedProxies is a list of IP addresses or CIDR ranges whose
|
||||
// X-Forwarded-For header is trusted. Empty = trust no proxy.
|
||||
TrustedProxies []string `yaml:"trusted_proxies"`
|
||||
// MetricsAllowedIPs sind zusätzliche Quell-IPs oder CIDR-Bereiche, die den
|
||||
// unauthentifizierten Prometheus-Endpunkt GET /metrics scrapen dürfen
|
||||
// (FDN-08). Loopback ist immer erlaubt, alles andere per Default gesperrt.
|
||||
MetricsAllowedIPs []string `yaml:"metrics_allowed_ips"`
|
||||
}
|
||||
|
||||
// ServerConfig holds general server settings.
|
||||
@@ -101,6 +105,18 @@ type StorageConfig struct {
|
||||
RetentionDays int `yaml:"retention_days"`
|
||||
// MaxUploadSizeMB caps the accepted multipart upload size. 0 = default 50.
|
||||
MaxUploadSizeMB int `yaml:"max_upload_size_mb"`
|
||||
// SignedURLTTLMinutes is the default validity of signed download URLs
|
||||
// (internal/objectstore). 0 = default 15 minutes.
|
||||
SignedURLTTLMinutes int `yaml:"signed_url_ttl_minutes"`
|
||||
}
|
||||
|
||||
// ResolvedSignedURLTTL returns the configured signed-download-URL validity,
|
||||
// falling back to 15 minutes when unset (<= 0).
|
||||
func (s StorageConfig) ResolvedSignedURLTTL() time.Duration {
|
||||
if s.SignedURLTTLMinutes <= 0 {
|
||||
return 15 * time.Minute
|
||||
}
|
||||
return time.Duration(s.SignedURLTTLMinutes) * time.Minute
|
||||
}
|
||||
|
||||
// InboxPath returns the directory raw uploads are written to before hashing
|
||||
|
||||
@@ -6,6 +6,7 @@ storage:
|
||||
base_path: "/var/lib/archivdms" # enthält inbox/, store/, ocr-tmp/ (siehe README)
|
||||
retention_days: 3650 # GoBD default: 10 Jahre
|
||||
max_upload_size_mb: 50
|
||||
signed_url_ttl_minutes: 15 # Gültigkeit signierter Download-Links (Default 15)
|
||||
|
||||
ocr:
|
||||
tesseract_path: "tesseract" # muss im PATH liegen, apt install tesseract-ocr tesseract-ocr-deu
|
||||
@@ -70,6 +71,10 @@ api:
|
||||
secret: "CHANGE_ME_TO_A_LONG_RANDOM_SECRET"
|
||||
secure_cookies: true
|
||||
trusted_proxies: []
|
||||
# FDN-08: GET /metrics (Prometheus-Textformat) läuft ohne Login, dafür
|
||||
# IP-beschränkt. Loopback ist immer erlaubt; hier zusätzliche Scraper
|
||||
# freischalten (einzelne IPs oder CIDR). Leer = nur localhost.
|
||||
metrics_allowed_ips: [] # z.B. ["192.168.1.0/24"]
|
||||
|
||||
audit:
|
||||
log_path: "/var/log/archivdms/audit.log"
|
||||
|
||||
Reference in New Issue
Block a user