Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/proxsave/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@
bootstrap.Printf("Custom keys that would be preserved (not present in template) (%d): %s",
len(result.ExtraKeys), strings.Join(result.ExtraKeys, ", "))
}
if len(result.CaseConflictKeys) > 0 {
bootstrap.Printf("Keys that differ only by case from the template (%d): %s",
len(result.CaseConflictKeys), strings.Join(result.CaseConflictKeys, ", "))
}
bootstrap.Println("Dry run only: no files were modified. Use --upgrade-config to apply these changes.")
return types.ExitSuccess.Int()
}
Expand Down Expand Up @@ -468,6 +472,10 @@
bootstrap.Printf("- Kept %d custom key(s) not present in the template: %s",
len(result.ExtraKeys), strings.Join(result.ExtraKeys, ", "))
}
if len(result.CaseConflictKeys) > 0 {
bootstrap.Printf("- Preserved %d key(s) that differ only by case: %s",
len(result.CaseConflictKeys), strings.Join(result.CaseConflictKeys, ", "))
}
if result.BackupPath != "" {
bootstrap.Printf("- Backup saved to: %s", result.BackupPath)
}
Expand Down Expand Up @@ -1561,7 +1569,7 @@
}
fmt.Printf("\r Remaining: %ds ", int(remaining.Seconds()))

select {

Check failure on line 1572 in cmd/proxsave/main.go

View workflow job for this annotation

GitHub Actions / security

should use a simple channel send/receive instead of select with a single case (S1000)

Check failure on line 1572 in cmd/proxsave/main.go

View workflow job for this annotation

GitHub Actions / security

should use a simple channel send/receive instead of select with a single case (S1000)

Check failure on line 1572 in cmd/proxsave/main.go

View workflow job for this annotation

GitHub Actions / security

should use a simple channel send/receive instead of select with a single case (S1000)
case <-ticker.C:
continue
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/proxsave/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ func runUpgrade(ctx context.Context, args *cli.Args, bootstrap *logging.Bootstra
bootstrap.Warning("Upgrade: configuration upgrade failed: %v", cfgUpgradeErr)
}
}
if sessionLogger != nil && cfgUpgradeResult != nil && len(cfgUpgradeResult.MissingKeys) > 0 {
sessionLogger.Info("Upgrade: configuration updated with %d missing key(s): %s", len(cfgUpgradeResult.MissingKeys), strings.Join(cfgUpgradeResult.MissingKeys, ", "))
}

// Refresh docs/symlinks/cron/identity (configuration upgrade is handled separately)
logging.DebugStepBootstrap(bootstrap, "upgrade workflow", "refreshing docs and symlinks")
Expand Down Expand Up @@ -578,6 +581,9 @@ func printUpgradeFooter(upgradeErr error, version, configPath, baseDir, telegram
if len(cfgUpgradeResult.ExtraKeys) > 0 {
fmt.Printf(" Preserved %d custom key(s) not present in the template.\n", len(cfgUpgradeResult.ExtraKeys))
}
if len(cfgUpgradeResult.CaseConflictKeys) > 0 {
fmt.Printf(" Preserved %d key(s) that differ only by case from the template.\n", len(cfgUpgradeResult.CaseConflictKeys))
}
}
if cfgUpgradeResult.BackupPath != "" {
fmt.Printf(" Backup saved to: %s\n", cfgUpgradeResult.BackupPath)
Expand Down
8 changes: 4 additions & 4 deletions docs/RESTORE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2723,10 +2723,10 @@ A: Yes, in two ways:
# Use BACKUP_PATH / SECONDARY_PATH or browse the mount directly
```

In questo caso puoi:
- copiare i bundle dal mount (`/mnt/cloud/...`) nella cartella di backup locale;
- oppure indicare il path montato quando il tool chiede il percorso dei backup
(CLI) o sfogliare la directory montata prima di lanciare ProxSave.
In this case you can:
- copy the bundles from the mount (`/mnt/cloud/...`) into the local backup directory;
- or provide the mounted path when the tool asks for the backup location
(CLI) or browse the mounted directory before launching ProxSave.

---

Expand Down
6 changes: 3 additions & 3 deletions internal/backup/archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func defaultArchiverDeps() ArchiverDeps {
}
}

// WithLookPathOverride temporaneamente sostituisce lookPath (per i test) e
// restituisce una funzione di ripristino da invocare con defer.
// WithLookPathOverride temporarily replaces lookPath (for tests) and
// returns a restore function to call with defer.
func WithLookPathOverride(fn func(string) (string, error)) func() {
original := lookPath
lookPath = fn
Expand Down Expand Up @@ -71,7 +71,7 @@ type ArchiverConfig struct {
ExcludePatterns []string
}

// CompressionError rappresenta un errore di compressione esterna (xz/zstd)
// CompressionError represents an external compression error (xz/zstd).
type CompressionError struct {
Algorithm string
Err error
Expand Down
16 changes: 8 additions & 8 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
}
)

// Config contiene tutta la configurazione del sistema di backup
// Config contains the full backup system configuration.
type Config struct {
// General settings
BackupEnabled bool
Expand Down Expand Up @@ -254,7 +254,7 @@ type Config struct {
raw map[string]string
}

// LoadConfig legge il file di configurazione backup.env
// LoadConfig reads the backup.env configuration file.
func LoadConfig(configPath string) (*Config, error) {
if !utils.FileExists(configPath) {
return nil, fmt.Errorf("configuration file not found: %s", configPath)
Expand Down Expand Up @@ -326,10 +326,10 @@ func (c *Config) loadEnvOverrides() {
}
}

// parse interpreta i valori raw della configurazione
// Supporta sia il formato legacy che quello nuovo del backup.env
// parse interpreta i valori raw della configurazione
// Supporta sia il formato legacy che quello nuovo del backup.env
// parse interprets raw configuration values.
// It supports both legacy and new backup.env formats.
// parse interprets raw configuration values.
// It supports both legacy and new backup.env formats.
Comment on lines +331 to +332
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment block for the parse function is duplicated. Lines 331-332 repeat exactly what's on lines 329-330.

Suggested change
// parse interprets raw configuration values.
// It supports both legacy and new backup.env formats.

Copilot uses AI. Check for mistakes.
func (c *Config) parse() error {
c.parseGeneralSettings()
c.parseCompressionSettings()
Expand Down Expand Up @@ -1034,13 +1034,13 @@ func sanitizeMinDisk(value float64) float64 {
return value
}

// Get restituisce un valore raw dalla configurazione
// Get returns a raw value from the configuration.
func (c *Config) Get(key string) (string, bool) {
val, ok := c.raw[key]
return val, ok
}

// Set imposta un valore nella configurazione
// Set sets a value in the configuration.
func (c *Config) Set(key, value string) {
c.raw[key] = value
}
Expand Down
8 changes: 4 additions & 4 deletions internal/config/templates/backup.env
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ BACKUP_BLACKLIST="
# ----------------------------------------------------------------------
# Security and permissions
# ----------------------------------------------------------------------
SKIP_PERMISSION_CHECK=false # true = non eseguire i controlli di permesso (solo test)
BACKUP_USER=backup # Utente proprietario delle directory di backup/log
BACKUP_GROUP=backup # Gruppo proprietario delle directory di backup/log
SET_BACKUP_PERMISSIONS=false # true = applica chown/chmod stile Bash su backup/log
SKIP_PERMISSION_CHECK=false # true = skip permission checks (test only)
BACKUP_USER=backup # Owner user for backup/log directories
BACKUP_GROUP=backup # Owner group for backup/log directories
SET_BACKUP_PERMISSIONS=false # true = apply Bash-style chown/chmod on backup/log

# ==============================================================================
# End file
Expand Down
Loading
Loading