backup.go 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. package settings
  2. // Backup contains configuration settings for backup operations.
  3. // This structure defines security constraints and access permissions for backup functionality.
  4. type Backup struct {
  5. // GrantedAccessPath defines the list of directory paths that are allowed for backup operations.
  6. // All backup source paths and storage destination paths must be within one of these directories.
  7. // This security measure prevents unauthorized access to sensitive system directories.
  8. //
  9. // Examples:
  10. // - "/tmp" - Allow backups in temporary directory
  11. // - "/var/backups" - Allow backups in system backup directory
  12. // - "/home/user/backups" - Allow backups in user's backup directory
  13. //
  14. // Note: Paths are checked using prefix matching, so "/tmp" allows "/tmp/backup" but not "/tmpfoo"
  15. GrantedAccessPath []string `json:"granted_access_path" ini:",,allowshadow"`
  16. }
  17. // BackupSettings is the global configuration instance for backup operations.
  18. // This variable holds the current backup security settings and access permissions.
  19. //
  20. // Default configuration:
  21. // - GrantedAccessPath: Empty list (no paths allowed by default for security)
  22. //
  23. // To enable backup functionality, administrators must explicitly configure allowed paths
  24. // through the settings interface or configuration file.
  25. var BackupSettings = &Backup{
  26. GrantedAccessPath: []string{
  27. // Default paths can be added here, but empty for security by default
  28. // Example: "/tmp", "/var/backups"
  29. },
  30. }