145 Commits

Author SHA1 Message Date
452a56b813 feat: Implement auto-scaling encrypted containers and fix UI workflow
Refactors the encryption mechanism to use a flexible LVM-on-a-loop-device backend instead of a fixed-size file. This resolves issues with containers running out of space.

- Implements auto-resizing of the container when a backup fails due to lack of space.
- Implements transparent inspection of encrypted containers, allowing the UI to display their contents (full/incremental backups) just like unencrypted ones.
- Fixes deletion of encrypted backups by ensuring the container is unlocked before deletion.
- Fixes a bug where deleting unencrypted user backups incorrectly required root privileges.
- Fixes a UI freeze caused by calling a password dialog from a non-UI thread during deletion.
- Simplifies the UI by removing the now-obsolete "Show Encrypted Backups" button.
- Changes the default directory for encrypted user backups to `user_encrypt`.
2025-09-06 12:46:36 +02:00
0359b37ff8 Refactor: Implement new backup structure, fix paths, and resolve runtime errors. 2025-09-06 00:49:35 +02:00
77ac4f5c4f Fix: Automatisches Erkennen von vollständigen Backups, auch bei Verschlüsselung.
Die Logik zur Erkennung von vollständigen Backups wurde verbessert.
Das Programm prüft nun korrekt, ob bereits ein vollständiges Backup
vorhanden ist und schlägt in diesem Fall automatisch ein inkrementelles
Backup vor. Dies funktioniert jetzt auch für verschlüsselte Backups.
2025-09-05 16:23:19 +02:00
a19699287d add animated icon in Backup Content 2025-09-05 16:16:07 +02:00
e2fe8f9b5c fix path to encryption container 2025-09-05 15:37:50 +02:00
827f3a1e08 feat: Implement CLI script and key file support for automated backups
- Introduces `pybackup-cli.py` as a command-line interface for non-interactive backups.
- Adds support for LUKS key files in `EncryptionManager` for passwordless container operations.
- Updates `BackupManager` to pass key file arguments to encryption routines.
- Modifies `AdvancedSettingsFrame` to provide a GUI for creating and managing key files.
- Integrates `pybackup-cli.py` and key file options into `schedule_job_dialog.py` for cronjob generation.
2025-09-05 01:48:49 +02:00
4b6062981a fix: Resolve issues with encrypted backup view and logic
- Fixes a bug where the backup list would not display "orphan" incremental backups in the encrypted view.
- Fixes a bug where system backups were incorrectly shown in the user backup list.
- Prevents the app from asking for system permissions to lock an encrypted container on exit if it is not currently mounted.
- Fixes pathing inconsistencies for the encryption manager to ensure mapper names are created consistently.
- Adds debug logging to the backup list functions to help diagnose future issues.
2025-09-05 00:53:44 +02:00
2d685e1d97 refactor: Rework encrypted backup UI and logic
- Centralizes backup content view logic into a single BackupContentFrame.
- Removes the separate, now obsolete EncryptedBackupContentFrame.
- Adds a toggle button within the BackupContentFrame to switch between viewing normal and encrypted backups.
- Centralizes the Restore, Delete, and Edit Comment buttons into a single button bar in BackupContentFrame.
- Corrects the path resolution logic to find backups and encrypted containers within the /pybackup subdirectory.
- Fixes UI bugs where action buttons would disappear when switching tabs.
2025-09-04 23:22:12 +02:00
0b9c58410f feat: Rework backup list and space calculation
- Improves the backup list display with chronological sorting, colored grouping for full/incremental backups, and dedicated time column.
- Changes backup folder naming to a consistent dd-mm-yyyy_HH:MM:SS format.
- Fixes bug where backup size was not displayed.
- Adds detection for encrypted backup containers, showing them correctly in the list.
- Hardens destination space check:
  - Considers extra space needed for compressed backups.
  - Disables start button if projected usage is > 95% or exceeds total disk space.
2025-09-04 14:20:57 +02:00
76a27e12b2 ebcrypted backup part 3 2025-09-04 13:43:37 +02:00
3f5bac2d7e encrypt backups part zwo 2025-09-04 02:02:06 +02:00
adf78124a4 encrypt backups part one 2025-09-04 01:49:56 +02:00
158bc6ec97 encrypted backups part one 2025-09-04 01:49:24 +02:00
9a7470f017 feat: Verbesserung der Backup-Größenberechnung und des UI-Feedbacks
- Refactor '_execute_rsync', um die 'Gesamtgröße' aus der rsync-Ausgabe zu parsen und zurückzugeben, was eine genauere Größe für vollständige Backups liefert.
- Verbessertes Logging im Backup-Manager, um die Ausführung von rsync und die Logik zur Größenberechnung besser zu verfolgen.
- Implementierung eines live aktualisierenden Dauer-Timers auf der Haupt-UI, der die verstrichene Zeit während eines Backup-Vorgangs anzeigt.
- Die Zusammenfassung am Ende des Backups verwendet nun die genaueren Größeninformationen.
2025-09-03 17:45:31 +02:00
c35c5c52a4 fix checkbox enabele fullbackup works a Fullbackup 2025-09-02 17:31:22 +02:00
988b0e8d1d fix(app): Behebt das Hängenbleiben der UI und die falsche Grössenberechnung
Mehrere grundlegende Probleme in der Anwendungslogik wurden behoben:

- **UI-Verarbeitungsschleife:** Die Verarbeitung von Nachrichten aus Hintergrund-Threads wurde komplett überarbeitet. Zuvor führten zwei konkurrierende Schleifen zu einer Race Condition, bei der Nachrichten verloren gingen. Jetzt gibt es eine einzige, zentrale Verarbeitungsschleife, die Nachrichten in Stapeln verarbeitet. Dies behebt das Problem, dass die Benutzeroberfläche nach dem Löschen oder dem Abschluss eines Backups im "in Arbeit"-Zustand hängen blieb.

- **Backup-Grössenberechnung:** Die Ermittlung der Grösse von inkrementellen Backups wurde robuster gestaltet.
    - Die rsync-Ausgabe wird nun zuverlässig auf Englisch erzwungen, um Parsing-Fehler in anderen System-Locales zu vermeiden.
    - Die Grösse wird nun aus der `sent... received...` Zusammenfassungszeile von rsync ausgelesen, was auch bei Backups ohne Datenänderungen einen Wert ungleich Null liefert.
    - Es wird nun korrekt zwischen Voll-Backups (Anzeige der Gesamtgrösse) und inkrementellen Backups (Anzeige der Übertragungsgrösse) unterschieden.

- **Sonstige Korrekturen:**
    - Eine fehlende Übersetzung für die manuelle Ausschlussliste wurde hinzugefügt.
    - Ein überflüssiger Aufruf zum Starten der Verarbeitungsschleife wurde entfernt.
2025-09-02 13:59:06 +02:00
05500f0303 feat(ui): Refactor backup and advanced settings navigation
- Update button styles in Backup Content and Advanced Settings to match the main application navigation.
- Implement a progress bar indicator for the active tab.
- Realign buttons in Advanced Settings to the left.
- Add a dynamic informational label for the "Manual Excludes" section.
2025-09-01 20:36:24 +02:00
16b8a92a24 fix: Improve backup detection and UI updates
- Ensure backup content view updates after backup completion or deletion.
- Fix "Please wait" animation not stopping after backup deletion.
- Refactor backup type selection logic for more reliable UI updates.
- Correct backup detection after resetting settings.
- Ensure correct size is written to info file for all backup types.
2025-09-01 19:10:15 +02:00
058dc1e951 feat: Add manual exclude list functionality
- Create a separate file for manual excludes (`rsync-manual-excludes.conf`) that is not cleared on reset.
- Add a button to the settings frame to add files/folders to the manual exclude list.
- Update the backup and calculation logic to use the manual exclude list.
- Ensure the UI reflects the combined exclude lists.
2025-09-01 16:16:55 +02:00
fbfc6a7224 Refactor: Update various modules and add deletion functionality
This commit includes updates across several modules, including:
- backup_manager.py: Enhancements related to backup deletion and regex for backup naming.
- core/data_processing.py: Adjustments to UI state handling.
- pbp_app_config.py: Addition of new UI messages.
- pyimage_ui/actions.py: Refinements in UI actions.
- pyimage_ui/system_backup_content_frame.py: Integration of new deletion logic.
- pyimage_ui/user_backup_content_frame.py: Minor adjustments.

These changes collectively improve backup management, UI responsiveness, and prepare for new deletion features.
2025-09-01 02:02:15 +02:00
7c765019ff Fix: BackupContentFrame layout and style access
Corrected the parenting of BackupContentFrame in main_app.py to ensure it's a child of content_frame, aligning its layout behavior with SettingsFrame.

Resolved AttributeError in BackupContentFrame by updating style lookup to use the top-level window's style object, ensuring correct background color retrieval.
2025-09-01 02:00:13 +02:00
b6b05633a7 feat: Implement compressed backups and restore
Implements a new feature for creating compressed full backups and restoring from them.

- Backups can now be created as compressed .tar.gz archives.
- This option is only available for full backups to maintain the efficiency of incremental backups.
- The UI now forces a full backup when compression is selected.
- The backup list correctly identifies and labels compressed backups.
- The restore process can handle both compressed and uncompressed backups.

fix: Improve backup process feedback and reliability

- Fixes a critical bug where backups could be overwritten if created on the same day. Backup names now include a timestamp to ensure uniqueness.
- Improves UI feedback during compressed backups by showing distinct stages (transfer, compress) and using an indeterminate progress bar during the compression phase.
- Disables the cancel button during the non-cancellable compression stage.
- Fixes a bug where the incremental backup size was written to the info file for full backups. The correct total size is now used.
2025-08-31 23:57:00 +02:00
f69e77cdd2 feat: Implement backup deletion and improve exclusion list
This commit introduces two main improvements:

1.  **Backup Deletion:** The user can now delete system and user backups from the "Backup Content" view.
2.  **Improved Exclusion List:** The `.cache` directory is now excluded from backups by default, which should prevent "file has vanished" warnings from rsync.
2025-08-31 19:54:14 +02:00
ed9700aca1 fix change restore to Backup content 2025-08-31 17:43:50 +02:00
974c8295f1 feat: Verbesserung der Backup-Typ-Auswahl und Korrektur der Füllstandsanzeige
2
   3 Dieses Commit enthält zwei wesentliche Verbesserungen:
   4
   5 1.  **Flexible Auswahl des Backup-Typs:** Der Benutzer kann jetzt manuell die
     Erstellung eines vollständigen Backups auswählen, auch wenn bereits ein früheres
     vollständiges Backup vorhanden ist. Die Anwendung wechselt in diesem Fall nicht mehr
     automatisch zu einem inkrementellen Backup.
   6
   7 2.  **Korrektur der Füllstandsanzeige:** Die Füllstandsanzeige zeigt jetzt die
     voraussichtliche Backup-Größe sowohl für vollständige als auch für inkrementelle
     Backups korrekt an. Dies wurde erreicht, indem sichergestellt wurde, dass die
     Quellgröße in allen Fällen korrekt berechnet und an die Benutzeroberfläche übergeben
     wird.
2025-08-31 17:37:05 +02:00
f65e7feb67 add new feature to edit comments on backup fix on correct backupzize on info-txt and dreate info text in parent backup dir 2025-08-31 02:33:59 +02:00
9e88ac8bb5 refactor: Metadaten-Speicherung zur Behebung von Berechtigungsproblemen
- Ändert die Logik zum Erstellen und Auflisten von Backups, um Metadaten-Dateien (z.B. 'backup_name.txt') im übergeordneten Verzeichnis des Backups statt darin zu speichern.
- Dies behebt den 'Permission denied'-Fehler beim Schreiben von Metadaten für System-Backups, die root gehören, da das übergeordnete Verzeichnis für den Benutzer beschreibbar ist.
- Ermöglicht vollständig unbeaufsichtigte/automatisierte Backups ohne eine zweite Passwortabfrage.
2025-08-31 01:12:10 +02:00
8132c5cef9 feat: Zeitanzeige & Fix für unbeaufsichtigte Backups
- Behebt das Problem, bei dem für die Metadaten-Datei eine zweite pkexec-Passwortabfrage nach einem langen Backup-Lauf erforderlich war. Dies ermöglicht nun unbeaufsichtigte/automatisierte Backups.
- Fügt eine neue UI-Anzeige für Startzeit, Endzeit und Dauer des Backups hinzu.
- Das Info-Label zeigt nun den prozentualen Fortschritt während des Backups an.
2025-08-30 22:32:52 +02:00
269da49a1a rename appconfig and mv configmanager to shared_libs 2025-08-30 19:08:56 +02:00
5f5cd78ee0 user dirs works final 2025-08-30 17:47:43 +02:00
e1ed313a7d user folder founds fix part one add german namefolder on app_config for works calculate size 2025-08-30 14:19:20 +02:00
4c4b8bf0cd disable checkboxes on running backup 2025-08-30 11:50:49 +02:00
eae09b8694 refactor(backup): Improve cancellation and UI state management
This commit refactors the backup cancellation process and hardens the UI state
management to resolve several race conditions and bugs.

Key changes:

Atomic Privileged Operations:
Introduced a helper method (`_execute_as_root`) to run shell commands via a
temporary script with a single `pkexec` invocation.
The backup cancellation for system backups now uses this method to atomically
terminate the rsync process and delete the partial backup directory, requiring only
one password authentication instead of two.
A general-purpose `delete_privileged_path` method is now available for other UI
actions, like deleting from the backup content view.
Robust State Handling:
Replaced unreliable state tracking based on UI widget text with a dedicated
`self.app.backup_is_running` boolean flag.
This flag is set immediately when a backup starts, preventing a race condition
that allowed a second backup to be initiated, which previously led to a
segmentation fault.
The `toggle_start_cancel` logic is now driven entirely by this reliable in
memory flag.
UI Hardening & Bug Fixes:
The `_set_ui_state` method now also disables clicks on the destination canvas
during a backup.
The `toggle_mode` method (for switching views) now checks the
`backup_is_running` flag to prevent resetting UI elements like projection canvases
when navigating away and back during a backup.
Fixed a bug where an invalid date format string (`% -d`) created incorrect
directory names, causing the deletion on cancel to fail.
Resolved a race condition where the backup process object was cleared
prematurely, leading to an `AttributeError` in the backup thread upon cancellation.
2025-08-30 11:35:26 +02:00
7ab227626b commit pkexec part one for remove cancel backup dir 2025-08-30 01:57:21 +02:00
8f0150c293 add user backup content 2025-08-29 20:37:54 +02:00
841bc82915 Textlabel works over progressbar 2025-08-29 15:05:55 +02:00
94530fd626 commit part one Systembackup create folders and metadata 2025-08-29 14:03:57 +02:00
6af66d5211 recover mode works add source on excludelist 2025-08-28 18:20:10 +02:00
bf3eaaf451 reformat and remove unused imports 2025-08-28 15:06:46 +02:00
313f3b9654 commit part 3 canvas edit on default settings 2025-08-28 01:59:15 +02:00
fd06c29a18 commit part 2 canvas edit left on default settings 2025-08-28 00:57:40 +02:00
6d55a476fd commit part 1 canvas edit right left on default settings 2025-08-27 23:43:32 +02:00
1b4fcc8a1c add colors on settings treeview, fix update view after default settings on hide files 2025-08-27 11:31:30 +02:00
bd947bd80e fix treeview anchor center 2025-08-27 08:53:57 +02:00
3a295ce70a edit 2 readme 2025-08-27 01:29:03 +02:00
a879e7130d edit readme 2025-08-27 01:27:21 +02:00
5be938420c add readme, chanchelog and license file 2025-08-27 01:21:46 +02:00
8522168ec5 fix(ui, calculation, state-management): Improve disk usage display and fix race
conditions

This commit addresses several issues related to the disk usage display in both
backup and restore modes, and resolves race conditions during mode switches.

**Corrected restore mode projection calculation:**
Introduced dedicated state variables (`restore_destination_folder_size_bytes`,
`restore_source_size_bytes`) to accurately calculate and display projected disk
usage and size differences in restore mode, preventing state pollution from other
modes.

**Ensured correct disk display on mode switch:**
Implemented logic to re-evaluate and set `destination_total_bytes` and
`destination_used_bytes` based on the currently active mode's selected path. This
prevents stale disk information from one mode being displayed in another.

**Fixed race conditions during background calculations:**
Implemented a robust cancellation mechanism for all background folder size
calculations. Threads now pass their originating mode, and results are discarded if
the application's mode has changed, preventing UI state corruption. This includes
managing both left and right canvas calculation threads.

**feat(ui): Added explicit UI reset on action:**
Introduced a `reset_projection_canvases` function to clear all projection
displays and reset relevant data variables immediately when a new action (e.g.,
folder selection, mode switch) is initiated. This provides a cleaner user
experience by preventing stale data from being shown while new calculations are in
progress.

**Resolved missing imports:**
Added necessary `import os` and `import shutil` statements to
`pyimage_ui/navigation.py` to resolve runtime errors.
2025-08-27 00:57:59 +02:00
2f7992777d reset buttom canvas on klick any button 2025-08-27 00:36:23 +02:00
e908a2150e fix hide restore canvases when switching views ensure that the restore-specific disk usage canvases are hidden when navigating to the scheduler or settings views from the restore view 2025-08-26 23:06:48 +02:00