Commit graph

57 commits

Author SHA1 Message Date
zaphod-black
df8789d0b8 Add estimated backup size calculations to native Linux installer
FEATURE: Display estimated file and block device sizes before backup configuration

NEW FUNCTIONS:
- calculate_file_backup_size() - Calculates total size of files to backup
  * Uses du with exclude patterns
  * Handles multiple paths
  * Returns human-readable format (KB/MB/GB)

- get_block_device_size() - Gets block device total size
  * Uses blockdev or lsblk
  * Returns size in GB

DISPLAY LOCATIONS:
1. During initial setup:
   - Shows estimated file size after entering backup paths
   - Shows block device size after selecting device
   - Includes helpful notes about compression/deduplication

2. When editing existing configuration:
   - Same size displays during reconfiguration

3. In configuration summaries:
   - Final installation summary
   - Settings update summary

USER EXPERIENCE:
✓ Estimated file backup size: 45.3 GB
✓ Block device size: 256.0 GB
⚠ Note: Actual size may be smaller due to PBS deduplication and compression
⚠ Note: Block device backups can take 20-30+ minutes depending on size

This helps users:
- Understand backup size before committing
- Plan storage requirements on PBS server
- Set realistic time expectations for backups

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 00:30:43 -06:00
zaphod-black
435d05b678 Add .gitignore to prevent credential exposure
SECURITY: Protect sensitive files from accidental commits

Added comprehensive .gitignore to prevent committing:
- Encryption keys (*.key, *.pem, encryption-key*.json)
- Configuration files (pbs-client.conf, /config/)
- Credentials and secrets (.env, credentials*, secrets*)
- Logs that might contain sensitive data (*.log, /logs/)
- Temporary files (*.tmp, *.swp, *~)
- IDE and build artifacts

This ensures no sensitive data is accidentally committed to the repo.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:49:19 -06:00
zaphod-black
583a289523 Update README with Docker quick start and development warning
DOCUMENTATION UPDATE:

Added comprehensive Docker instructions to README:

CHANGES:
- Added "🚧 IN DEVELOPMENT" warning to Docker section
- Emphasized native Linux installer as stable production version
- Added step-by-step Quick Start instructions:
  1. Build the image
  2. Run container with volume mounts
  3. Configure via web UI
- Included examples for different backup paths
- Added "Configuration UI" to features list
- Clarified Settings page workflow

ORGANIZATION:
- Docker section appears AFTER all native Linux sections
- Clear warning that Docker is for testing/cross-platform use
- Native Linux positioned as primary, stable solution

This makes it clear to users:
- Native Linux = Production ready 
- Docker = Development/Testing 🚧

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:41:37 -06:00
zaphod-black
efba1948f6 Add web-based configuration interface to Docker dashboard
FEATURE: Settings page for configuring PBS backups via web UI

PROBLEM:
- Users had no way to configure PBS settings from the web dashboard
- Required manually setting environment variables or restarting containers
- Blank stats because no configuration existed

SOLUTION:
Added complete configuration management system:

API ENDPOINTS:
- GET /config - Retrieve current configuration
- POST /config - Save new configuration to /config/settings.json

DASHBOARD ENHANCEMENTS:
- New "⚙ Settings" button in Actions section
- Modal form with all configuration options:
  * PBS Repository (user@pam!token@host:port:datastore)
  * PBS Password/Token Secret
  * Backup Hostname
  * Backup Paths
  * Exclude Patterns (multi-line textarea)
  * Backup Schedule (cron expression)
  * Timezone
- Form validation and user-friendly placeholders
- Persistent storage to /config/settings.json
- Auto-refresh status after saving

DESIGN:
- Retro terminal aesthetic matching dashboard theme
- Blue/purple neon modal with dark background overlay
- Smooth fade-in animation
- Mobile-responsive form layout

TECHNICAL:
- Configuration persists across container restarts
- Environment variables can be overridden by config file
- JavaScript fetch API for async save/load
- Proper error handling and user feedback

Now users can configure everything from the web UI!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:34:36 -06:00
zaphod-black
0746428435 Fix Docker web dashboard with Python HTTP server + blue/purple neon theme
PROBLEM SOLVED:
The netcat-based HTTP server had a fundamental bidirectional pipe issue:
- `( read method path ) | nc -l` only connects stdout→stdin in one direction
- The `read` command couldn't receive HTTP request data from nc
- All requests returned "Not found" despite correct routing logic

SOLUTION:
- Created api-server.py: Proper Python HTTP server using http.server
- Handles dashboard (GET /), status, health, logs, and backup trigger (POST)
- Full request/response handling with proper HTTP headers
- Replaces broken netcat approach with robust solution

DASHBOARD ENHANCEMENTS:
- Changed from green terminal theme to blue/purple neon aesthetic
  - Primary: #00d4ff (cyan blue)
  - Accent: #aa00ff (purple)
  - Background: #0a0a14 (dark blue-black)
- Increased all font sizes 2-4px for better readability
- Enhanced button padding and spacing
- More visible, high-contrast interface

TECHNICAL DETAILS:
- Dockerfile: Replaced netcat-openbsd with python3 dependency
- api-server.sh: Now simple wrapper that exec's Python script
- api-server.py: Full-featured HTTP server with JSON/HTML responses
- dashboard.html: Updated color scheme and typography

TESTING:
 Dashboard loads at http://localhost:8080/
 /status endpoint returns JSON
 /health endpoint working
 /logs endpoint working
 Real-time backup monitoring ready

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:25:10 -06:00
zaphod-black
ab1bc800af Add retro ASCII web dashboard (WIP - routing issue)
New Features:
- Beautiful retro terminal-style web dashboard
- Dark mode with green-on-black terminal aesthetics
- ASCII art header and box-drawing characters
- Real-time status monitoring
- Manual backup trigger button
- Log viewer with syntax highlighting
- Backup history display
- Responsive design with scanline effects
- Auto-refresh every 30 seconds

Files Added:
- docker/scripts/dashboard.html - Complete retro web UI
- docker/test-dashboard.sh - Testing script

Files Modified:
- docker/Dockerfile - Added netcat-openbsd and dashboard.html
- docker/scripts/api-server.sh - Added dashboard serving (has routing bug)

Known Issue:
The nc-based HTTP server has a path routing bug where all requests
hit the default case. The dashboard HTML is complete and beautiful,
but needs either:
1. Fix to the nc-based routing logic, OR
2. Replace with Python HTTP server for more reliable routing

Dashboard features work when routing is fixed:
- GET / - Serves retro dashboard
- GET /status - Backup status JSON
- GET /health - Health check JSON
- POST /backup - Trigger manual backup
- GET /logs - Recent backup logs

The HTML/CSS/JS is production-ready, just needs working HTTP routing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:10:29 -06:00
zaphod-black
fbe81d28ae Add Docker-based cross-platform solution (v1.2.0)
Major addition: Full Docker implementation for Windows, macOS, and Linux support

New Features:
- Docker container with PBS client in Debian environment
- Platform-specific docker-compose files (linux/windows/macos)
- Daemon mode with internal cron scheduler
- One-shot backup mode for manual execution
- Optional REST API server for remote management
- Health monitoring and status endpoints
- Automatic encryption key generation and management

Docker Structure:
- docker/Dockerfile - Container build definition
- docker/scripts/ - Entrypoint, backup, healthcheck, and API scripts
- docker/build.sh - Build script for Docker image
- docker/deploy.sh - Interactive deployment script
- docker/docker-compose-*.yml - Platform-specific configurations

Documentation:
- docker/README-DOCKER.md - Complete Docker documentation
- docker/QUICKSTART-DOCKER.md - Quick start guide
- docker/DOCKER-SOLUTION-SUMMARY.md - Architecture overview
- BACKUP-TYPES-GUIDE.md - File vs block device backup guide

Updated:
- README.md - Added cross-platform support section and platform matrix
- CHANGELOG.md - Documented all Docker features

This enables PBSClientTool to backup Windows and Mac systems via Docker,
while maintaining native Linux performance for full disk images.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 22:36:41 -06:00
zaphod-black
e5a4b7abf4 Update title bar from "Installer" to "Tool"
- Changed header from "Proxmox Backup Client Installer" to "Proxmox PBSClient Tool"
- Better reflects the multi-purpose nature of the tool (not just installation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 21:47:43 -06:00
zaphod-black
19cee4c6ce
Update README.md 2025-11-02 19:02:52 -06:00
zaphod-black
718b4bd7f0 Fix syntax error in header - add missing closing quotes
- Added missing closing quotes on header lines 2124 and 2125
- Resolves "syntax error near unexpected token ')'" error

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:39:43 -06:00
zaphod-black
c31306881c Fix ASCII header alignment
- Simplified main header box by removing right-side borders
- Fixed spacing in backup progress header
- Ensures consistent display across all terminals

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 12:06:20 -06:00
zaphod-black
15fda585d1 UX: Smart menu adapts based on installation status
Menu now automatically detects if PBSClientTool is installed as a
system command and hides the install option when already installed.

DETECTION:
- Checks if /usr/local/bin/PBSClientTool exists at startup
- Stores result in SCRIPT_INSTALLED variable (true/false)
- No verbose messages - detection is silent

MENU BEHAVIOR:

When NOT installed:
  1) List all backup targets
  2) Add new backup target
  3) Edit existing target
  4) Delete target
  5) Run backup now (select target)
  6) Reinstall PBS client
  7) Install as system command  ← Shows option
  8) Exit
Select option [1-8] [8]:

When INSTALLED:
  1) List all backup targets
  2) Add new backup target
  3) Edit existing target
  4) Delete target
  5) Run backup now (select target)
  6) Reinstall PBS client
  7) Exit  ← Option 7 is now Exit
Select option [1-7] [7]:

SMART CASE HANDLING:
- Option 7 handler checks SCRIPT_INSTALLED status
  - If false: Runs install_script()
  - If true: Exits program
- Option 8 handler checks SCRIPT_INSTALLED status
  - If false: Exits program
  - If true: Shows "Invalid option" error
- After installing from menu, SCRIPT_INSTALLED updates to true
  - Menu immediately reflects change on next iteration

BENEFITS:
- Cleaner UX - no redundant options
- Self-documenting - absence of option indicates already installed
- Automatic adaptation - no manual refresh needed
- Prevents confusion - users won't try to install twice
- Professional behavior - menus adapt to system state

EDGE CASE HANDLING:
- If user installs from menu option 7, status updates immediately
- Next menu loop shows 7 options instead of 8
- Install option doesn't reappear until uninstalled

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 01:37:19 -05:00
zaphod-black
8335eba18c UX: Add system install to menu + prompt after initial setup
Made system-wide installation more discoverable and automatic.

CHANGES:

1. Main Menu Option 7 Added:
   - New option: "Install as system command"
   - Renumbered Exit from 7 to 8
   - Updated prompt from [1-7] to [1-8]
   - Calls install_script() directly from menu

2. Post-Installation Prompt:
   - After initial target configuration completes, asks:
     "Would you like to install PBSClientTool as a system command?"
   - Shows benefit: "This will allow you to run 'sudo PBSClientTool' from anywhere."
   - Default: yes (recommended)
   - Only prompts if not already installed (checks $INSTALL_PATH)
   - Applied to both setup paths:
     - PBS client already installed (first target setup)
     - PBS client not installed (fresh install)

3. Installation Detection:
   - Checks if /usr/local/bin/PBSClientTool already exists
   - Skips prompt if already installed
   - Prevents redundant installation offers

USER EXPERIENCE:

Before:
- Users had to know about --install flag
- Manual installation required navigating to script directory
- No guidance after setup

After:
- Automatic prompt after initial setup (smart default)
- Menu option for installation anytime
- Clear explanation of benefits
- One-time setup, use anywhere

Example flow:
1. User runs: sudo ./pbs-client-installer.sh
2. Completes initial configuration wizard
3. Script shows: "First target 'default' created successfully!"
4. Script asks: "Install as system command? (yes/no) [yes]:"
5. User presses Enter (accepts default)
6. Installed to /usr/local/bin/PBSClientTool
7. User can now run: sudo PBSClientTool (from any directory)

This makes system installation the default path for new users,
improving discoverability and ease of use.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 01:25:56 -05:00
zaphod-black
0186349d99 Docs: Major README simplification + dedicated troubleshooting guide
Reorganized documentation for better usability and maintenance.

CHANGES:

1. README.md simplified (750 → 243 lines):
   - Focused on quick start and essential usage
   - Removed redundant step-by-step sections
   - Removed duplicate explanations
   - Clearer structure with better hierarchy
   - Link to dedicated troubleshooting guide

2. New TROUBLESHOOTING.md (comprehensive guide):
   - Connection Issues:
     - Connection test script usage
     - 3-step failure diagnosis
     - SSL certificate handling
   - Permission Errors:
     - Missing Datastore.Backup permission
     - PBS web interface and CLI solutions
     - Required permissions explained
   - Installation Issues:
     - Ubuntu 22.04 libssl1.1 missing
     - Arch Linux libfuse3 errors
     - yay AUR helper installation
   - Backup Issues:
     - Backups not running diagnostics
     - "Skip mount point" explanation
     - No space left solutions
     - Encryption key problems
   - Multi-Target Issues:
     - Target connection test failures
     - Missing services
   - Configuration Issues:
     - Whitespace in configuration
     - Incomplete configuration warning
   - Advanced Troubleshooting:
     - Verbose logging
     - Manual testing
     - PBS server logs
     - Network timeout solutions
   - Common Misconfigurations:
     - Token format examples
     - Datastore name case-sensitivity
     - Repository string format
     - Permission path format

BENEFITS:
- Faster onboarding (README focused on getting started)
- Easier problem-solving (dedicated troubleshooting guide)
- Better maintainability (separate concerns)
- Improved searchability (detailed error solutions)
- Professional documentation structure

README now covers:
- Features and quick start
- Prerequisites (simplified)
- Basic usage
- Multi-target management
- Backup types explained
- Encryption key best practices
- Updating and uninstallation

TROUBLESHOOTING covers:
- All error messages and solutions
- Step-by-step diagnostic procedures
- Advanced configuration options
- Common pitfalls and how to avoid them

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 00:58:38 -05:00
zaphod-black
1e930c2775 Feature: System-wide installation with PBSClientTool command
Added ability to install the script system-wide, making it available
as a command from anywhere on the system. No more need to navigate
to the script directory or remember the path.

NEW FEATURES:

1. Command-line argument support:
   - --install     : Install to /usr/local/bin/PBSClientTool
   - --uninstall   : Remove from system (keeps configs)
   - --help, -h    : Show comprehensive help message
   - --version, -v : Show version information
   - (no args)     : Run interactive menu (default)

2. Installation function (install_script):
   - Detects if already installed
   - Asks for confirmation before overwriting
   - Copies script to /usr/local/bin/PBSClientTool
   - Sets executable permissions
   - Shows usage examples after installation

3. Uninstallation function (uninstall_script):
   - Removes /usr/local/bin/PBSClientTool
   - Preserves backup targets and configurations
   - Warns about difference vs complete removal (uninstaller.sh)
   - Requires confirmation before proceeding

4. Help system:
   - Comprehensive --help message with examples
   - Documents all command-line options
   - Shows features and documentation link
   - Formatted for easy reading

IMPLEMENTATION:
- Added SCRIPT_NAME and INSTALL_PATH constants (lines 13-14)
- Added install_script() function (lines 1995-2032)
- Added uninstall_script() function (lines 2035-2067)
- Added show_help() function (lines 2070-2113)
- Added show_version() function (lines 2116-2118)
- Added argument parsing before main() (lines 2325-2348)
- Updated README with installation instructions
- Updated CHANGELOG with new features

USAGE EXAMPLES:

Install to system:
  cd PBSClientTool
  sudo ./pbs-client-installer.sh --install

Run from anywhere:
  sudo PBSClientTool

Show help:
  sudo PBSClientTool --help

Uninstall:
  sudo PBSClientTool --uninstall

Update after git pull:
  git pull
  sudo ./pbs-client-installer.sh --install  # Overwrites old version

BENEFITS:
- More convenient access from any directory
- Follows standard Unix tool conventions
- Easy to update (git pull + reinstall)
- Safer workflow (don't need to cd into dev directory as root)
- Professional user experience

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 00:41:23 -05:00
zaphod-black
6829facb00 UX: Add confirmation prompt before PBS client installation
Improved the installation flow to be more explicit and user-friendly
when PBS client is not installed on the system.

BEFORE:
- Script immediately started installing
- No clear indication of what would happen
- User couldn't cancel

AFTER:
- Clear message: "Proxmox Backup Client is not installed"
- Shows 3-step plan:
  1. Install Proxmox Backup Client
  2. Configure your first backup target
  3. Set up automated backups
- Asks for confirmation: "Do you want to proceed?"
- User can cancel by entering anything other than "yes"
- Clear progress messages after each step

FLOW:
1. Detect PBS not installed
2. Show what will happen
3. Ask for confirmation
4. Install (if confirmed)
5. Configure first target
6. Exit

The script already correctly skips the multi-target menu when PBS
is not installed - this change just makes the flow more explicit
and gives users control over whether to proceed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 23:16:30 -05:00
zaphod-black
95e937b964 Feature: Automatic authentication test for all targets at startup
Added automatic connection testing when the script starts up. All
configured backup targets are now tested immediately, giving users
instant feedback about which targets are accessible.

NEW FUNCTIONS:
- quick_test_target() (lines 127-145)
  - Lightweight auth test for a single target
  - 5 second timeout for quick feedback
  - Runs in subshell to avoid polluting environment
  - Returns 0 on success, 1 on failure

- test_all_targets() (lines 148-176)
  - Tests all configured targets
  - Displays formatted status for each:
    - "✓ Connected" - Authentication successful
    - "✗ Failed" - Cannot authenticate
  - Shows warning if any targets fail
  - Suggests using "Edit target" option to fix issues

INTEGRATION:
- Called automatically after show_targets_list() at startup
- Only runs if targets exist
- Minimal performance impact (5s max per target)
- Non-blocking - script continues regardless of results

USER EXPERIENCE:
Before: User had to manually test each target or discover issues when backups fail
After: Immediate visual feedback on all target statuses at startup

Example output:
════════════════════════════════════════
  Testing Backup Target Connections
════════════════════════════════════════

  default:             ✗ Failed
  offsite:             ✓ Connected

[WARN] Some targets failed connection test
[INFO] Use option 3 (Edit target) to fix connection issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 23:10:03 -05:00
zaphod-black
10534da9a6 Fix: Trim all user input to prevent whitespace breaking config
Added defensive whitespace trimming (| xargs) to ALL prompted variables,
not just PBS_PASSWORD. This prevents trailing/leading spaces or newlines
from breaking the PBS_REPOSITORY string and causing authentication failures.

ISSUE:
User reported permission error despite having correct PBS permissions.
Root cause: Input variables contained trailing whitespace, causing the
repository string to be malformed:
  Expected: root@pam!backupAutomations@192.168.1.181:8007:backups
  Actual:   root@pam !backupAutomations@192.168.1.181:8007:backups
                    ^ extra space breaks authentication

SOLUTION:
Added `| xargs` to trim whitespace from all inputs:
- PBS_SERVER, PBS_PORT, PBS_DATASTORE
- PBS_USERNAME, PBS_REALM
- PBS_TOKEN_NAME, PBS_TOKEN_SECRET/PBS_PASSWORD

Applied to both functions:
- interactive_config_for_target() (lines 1006-1027)
- reconfigure_connection_for_target() (lines 613-634)

The `xargs` command without arguments reads stdin and outputs it with
leading/trailing whitespace removed - a common shell trimming idiom.

This complements the existing PBS_PASSWORD_CLEAN newline stripping
and provides comprehensive input sanitization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 22:49:48 -05:00
zaphod-black
157265e3f9 UX: Move "View target details" to sub-menu under List targets
Improved menu flow by moving target details viewing into a natural
workflow after listing targets.

BEFORE:
Main menu had 8 options including separate "View target details" option.
User flow: Main → List targets → Main → View details → Select target

AFTER:
Main menu has 7 options. "View target details" is a sub-menu.
User flow: Main → List targets → View details (optional) → Main

CHANGES:
- Option 1 (List all backup targets) now shows a sub-menu:
  1) View target details
  2) Back to main menu
- Removed old option 6 (View target details) from main menu
- Renumbered options: 7 → 6 (Reinstall), 8 → 7 (Exit)
- Main menu prompt changed from [1-8] to [1-7]
- Sub-menu uses same resolve_target_input() for number/name selection

BENEFITS:
- More intuitive workflow (view list, then optionally drill down)
- Cleaner main menu (7 options instead of 8)
- Reduces redundant listing of targets
- Users can quickly return to main menu without viewing details

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 22:44:39 -05:00
zaphod-black
2bfe067231 UX: Accept both numbers and names for target selection
Added resolve_target_input() helper function that allows users to select
targets by either:
- Number from the displayed list (e.g., "1")
- Full target name (e.g., "default")

CHANGES:
- New resolve_target_input() function (lines 107-124)
  - Detects if input is numeric with regex ^[0-9]+$
  - Uses sed to extract Nth line from list_targets output
  - Falls back to treating input as literal target name

- Updated all target selection points:
  - edit_target() - option 3
  - delete_target() - option 4
  - Menu option 5 (run backup)
  - Menu option 6 (view details)

- Changed prompts to clarify:
  - "Enter target number or name" (was "Enter target name")
  - Better error messages for invalid numbers

USER EXPERIENCE:
Before: User had to remember and type exact target name
After: User can simply type "1" from the numbered list

This addresses the user confusion where they entered "1" expecting
it to work like a numbered menu, but got "Target '1' does not exist"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 22:41:32 -05:00
zaphod-black
8ca8ae2fdc Fix: Detect "unknown" string as incomplete configuration
Extended incomplete configuration check to handle configs that have
literal "unknown" string values (not just empty strings).

This handles cases where config migration or incomplete setup left
placeholder "unknown" values in PBS_SERVER or PBS_DATASTORE fields.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 22:26:14 -05:00
zaphod-black
72ea543458 Fix: Menu loop and incomplete target configuration display
This commit addresses two user-reported issues:

ISSUE 1: Menu exits after every action instead of looping
- Removed all `exit 0` calls from menu options (except Exit option)
- Wrapped menu in `while true` loop for continuous operation
- Changed error exits to `continue` to return to menu
- Users can now perform multiple actions without restarting script

ISSUE 2: Target list shows "unknown" values for server/datastore
- Root cause: Empty variables in config file (incomplete migration/setup)
- Improved show_targets_list() with better error handling:
  - Uses process substitution `< <(list_targets)` instead of pipe
  - Clears all variables before sourcing each config
  - Detects incomplete configs (missing PBS_SERVER/PBS_DATASTORE)
  - Shows warning: "⚠ Incomplete configuration"
  - Suggests: "Use option 3 (Edit target) to reconfigure"
- Only displays server/datastore when config is complete

USER EXPERIENCE:
Before:
- Script exits after listing targets (requires restart)
- Shows "unknown:8007" and confusing empty values

After:
- Menu loops continuously until user selects Exit
- Shows clear warning for incomplete configs with action steps
- Prevents variable carryover between target iterations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 22:23:00 -05:00
zaphod-black
c51b5b03ee Add flexible scheduling and manual backup selection for hybrid mode
This enhancement adds two major improvements to hybrid backup mode:

1. SEPARATE SCHEDULE CONFIGURATION:
   - Block device backups now have independent scheduling from file backups
   - Options: weekly, biweekly, monthly, custom day of week/month
   - File backups run on main schedule, block device on separate schedule
   - Stored in BLOCK_DEVICE_FREQUENCY and BLOCK_DEVICE_DAY config variables
   - Backup script checks date/week to determine if block backup should run

2. MANUAL BACKUP SELECTION:
   - Interactive menu when running backup in hybrid mode
   - Three options: files only, block only, or both
   - Files only: fast (~2-3 min) for quick daily archives
   - Block only: slow (~20-30 min) for VM conversion capability
   - Both: complete backup of everything
   - Backup script accepts "files", "block", or "yes" as FORCE_FULL parameter

These features provide fine-grained control over backup execution while
maintaining the convenience of hybrid mode. Users can now optimize
backup frequency based on their needs (frequent file backups, less
frequent disk images) and selectively run specific backup types manually.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 22:15:45 -05:00
zaphod-black
d26ede3702 Complete multi-target backup support (Part 3 of 3) - 100% DONE!
This commit completes the multi-target backup system implementation.
Full management system with menu integration and first-time setup.

COMPLETED IN THIS COMMIT:

1. Main menu integration:
   - Replaced legacy single-target menu with multi-target menu
   - 8 menu options:
     1) List all backup targets
     2) Add new backup target
     3) Edit existing target
     4) Delete target
     5) Run backup now (select target)
     6) View target details
     7) Reinstall PBS client
     8) Exit
   - All menu options fully implemented and tested for syntax

2. First-time setup flow:
   - New installation prompts for first target name
   - PBS installed but no targets: prompts for first target
   - Defaults to "default" target name
   - Validates target names (alphanumeric, dash, underscore only)
   - Creates first target with full configuration wizard

3. Code cleanup:
   - Removed leftover run_backup_now() and show_summary() calls
   - All code paths now exit explicitly
   - Added safety check for unexpected code paths
   - Clean separation of concerns

FEATURES SUMMARY:

Multi-Target Management:
 Multiple backup destinations (different PBS servers)
 Named targets (e.g., "offsite", "local", "backup1")
 Independent systemd services per target
 Target CRUD operations (Create, Read, Update, Delete)
 Live backup progress monitoring per target
 Automatic migration from legacy single-target config

Target Operations:
 List targets with server/datastore/status
 Add new targets interactively
 Edit targets (connection, settings, or full reconfig)
 Delete targets with confirmation
 Run backups per target with live progress
 View detailed target configuration

Infrastructure:
 Per-target systemd services and timers
 Per-target backup scripts
 Per-target configuration files
 Target name validation
 Backward compatibility via migration

TESTING STATUS:
 Syntax validated (no errors)
 Needs functional testing
 Needs migration testing
 Needs multi-server testing

CHANGELOG UPDATED:
- Marked as "COMPLETE"
- Documented all completed components
- Listed testing requirements

Next steps for user:
1. Test with existing setup (migration)
2. Test adding second backup target
3. Test running backups for each target
4. Update README with multi-target examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 20:43:50 -05:00
zaphod-black
fc78ff9ddb WIP: Multi-target backup support (Part 2 of 3) - 90% Complete
This commit completes the core infrastructure for multi-target backups.
Only main menu integration remains.

COMPLETED IN THIS COMMIT:

1. Per-target wrapper functions:
   - interactive_config_for_target(name) - Full configuration wizard
   - reconfigure_connection_for_target(name) - Connection-only updates
   - reconfigure_backup_settings_for_target(name) - Settings-only updates
   - run_backup_for_target(name) - Execute backup with live progress

2. Systemd service creation for named targets:
   - create_systemd_service_for_target(name) - Complete service generation
   - Generates pbs-backup-TARGET.service (scheduled backups)
   - Generates pbs-backup-TARGET-manual.service (manual full backups)
   - Generates pbs-backup-TARGET.timer (scheduler)
   - Creates target-specific backup scripts with embedded target name
   - All configs stored in /etc/proxmox-backup-client/targets/TARGET.conf

3. Main menu partially updated:
   - Added migrate_legacy_config() call at startup
   - Started new multi-target menu structure
   - Menu shows: List, Add, Edit, Delete, Run, View, Reinstall, Exit

FEATURES:
- Each target = independent systemd services
- Target-specific backup scripts include target name in logs
- Live progress monitoring per target
- Complete isolation between targets
- Backward compatible via automatic migration

TESTING STATUS:
- Syntax validated (no errors)
- Not yet functionally tested
- Migration logic not tested
- Menu integration incomplete

REMAINING WORK (Part 3):
- Complete main menu case statement updates
- Add first-time setup flow for new installations
- Add "Run all targets" bulk backup option
- Test legacy→multi-target migration
- Full integration testing
- Update README with multi-target examples

CHANGELOG UPDATED:
- Detailed breakdown of completed components
- Clear TODO list for remaining work
- Marked as "90% Complete"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 20:41:44 -05:00
zaphod-black
d9a4e5a308 WIP: Multi-target backup support (Part 1 of 2)
This commit introduces the foundation for multiple backup targets,
allowing users to backup to multiple PBS servers for redundancy.

ADDED:
- Multi-target configuration structure
  - TARGETS_DIR: /etc/proxmox-backup-client/targets/
  - Each target stored as TARGET.conf
  - Independent systemd services per target (pbs-backup-TARGET.service)

- Target management functions:
  - list_targets() - List all configured target names
  - validate_target_name() - Validate target naming rules
  - target_exists() - Check if target is configured
  - get_target_config_path() - Get path to target config file
  - show_targets_list() - Display all targets with server/status
  - show_target_detail() - Show detailed target configuration

- Target CRUD operations:
  - add_target() - Interactive target creation
  - edit_target() - Edit connection, settings, or full reconfig
  - delete_target() - Remove target with confirmation

- Migration system:
  - migrate_legacy_config() - Auto-migrate single-target to "default" target
  - Renames old services: pbs-backup.service -> pbs-backup-default.service
  - Preserves existing backups and schedules

CHANGED:
- Script version: 1.0.0 -> 1.1.0
- Updated CHANGELOG with multi-target progress and recent fixes

WORK IN PROGRESS (Part 2 needed):
- Update create_systemd_service() to accept target name parameter
- Create wrapper functions for per-target configuration
- Update main menu with multi-target options
- Add schedule coordination (all-at-once, alternating, individual)
- Add "Run backup now" with target selection

TESTING STATUS: Not yet tested, foundation only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 20:37:31 -05:00
zaphod-black
e333839c8b Fix: Remove stderr suppression from journalctl to show logs
PROBLEM:
- User running "sudo journalctl -u pbs-backup-manual.service -f" sees perfect verbose output
- But installer script shows blank screen during backup
- Progress updates like "processed 65.6 GiB in 18m" should be visible

ROOT CAUSE:
- journalctl command had "2>/dev/null" which suppressed all stderr
- This was hiding any errors or blocking journalctl from displaying properly
- The -n 100 flag was unnecessary complexity

SOLUTION:
- Removed "2>/dev/null" - allow journalctl to show its output normally
- Removed "-n 100" flag - not needed with --since
- Reduced --since from "5 seconds ago" to "2 seconds ago" for tighter window
- Kept "|| true" so Ctrl+C doesn't fail the script

Now the backup progress should display exactly like:
  processed 65.6 GiB in 18m, uploaded 64.4 GiB
  processed 69.3 GiB in 19m, uploaded 68.0 GiB
  (updates every minute during block device backup)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 19:58:43 -05:00
zaphod-black
f542fe2730 Fix: Show backup logs from service start, not just new entries
PROBLEM:
- journalctl -fu only shows NEW log entries after you start following
- By the time journalctl started, backup had already begun
- User missed all initial output and saw blank screen

ROOT CAUSE:
- We started the service, then started journalctl
- The -f flag only follows future entries
- All the backup progress was already written to journal before follow began

SOLUTION:
1. Start systemctl in background with &
2. Reduced sleep from 1s to 0.5s
3. Use --since "5 seconds ago" to capture logs from service start
4. Use -n 100 to show last 100 lines of context
5. Moved progress box display before starting service

CHANGES:
- journalctl -fu SERVICE -> journalctl -u SERVICE -f --since "5 seconds ago" -n 100
- systemctl start SERVICE -> systemctl start SERVICE & (background)
- sleep 1 -> sleep 0.5
- Applied to both manual backup locations

Now user sees full verbose backup output including:
- File backup progress bars
- Block device backup transfer rates
- Chunk upload progress
- All PBS client output

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 19:51:36 -05:00
zaphod-black
9486eb6a8c Fix: Follow correct service logs during manual backup
PROBLEM:
- Manual backup starts pbs-backup-manual.service
- But journalctl was following pbs-backup.service logs
- User saw no output during backup execution

FIX:
- Changed journalctl to follow pbs-backup-manual.service
- Applied to both manual backup locations:
  - Menu option 4 handler
  - run_backup_now() function

Now verbose backup progress displays correctly during manual runs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 19:36:34 -05:00
zaphod-black
f88cba76bb Fix hybrid backups to run full backup when triggered manually
PROBLEM:
- User configured hybrid backup mode (files + block device)
- Manual "Run backup now" only did file backup, not block device
- Block device backups only ran on Sunday (day 7)
- User couldn't test full backup without waiting until Sunday

SOLUTION:
- Modified backup.sh to accept optional "yes" argument to force full backup
- Created new systemd service: pbs-backup-manual.service
  - Calls backup.sh with "yes" argument
  - Forces both file AND block device backup regardless of day
- Updated backup script logic:
  - If FORCE_FULL="yes" -> always do block device backup
  - Else if Sunday -> do block device backup
  - Else -> skip block device backup
- Updated both manual backup triggers:
  - Post-install "Run backup now" prompt
  - Menu option 4 "Run backup now"
  - Both now use pbs-backup-manual.service

BEHAVIOR:
- Scheduled backups (via timer): Files daily, block device weekly on Sunday
- Manual backups (via menu): Files + block device ALWAYS (full backup)

FILES CHANGED:
- Added FORCE_FULL parameter to backup.sh
- Modified "both" case to check FORCE_FULL first
- Created pbs-backup-manual.service systemd unit
- Updated run_backup_now() to use manual service
- Updated menu option 4 handler to use manual service

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 19:13:08 -05:00
zaphod-black
801b8649ba Rename project from PBSClientInstaller to PBSClientTool
- Updated README.md title
- Updated git clone URL in installation instructions
- Updated directory name in installation commands
- Reflects GitHub repository rename to PBSClientTool

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 19:08:09 -05:00
zaphod-black
fea2c7a226 Add menu option to modify backup schedule/type
- Added new menu option 5: "Modify backup schedule/type"
- Moved "Exit" option to option 6
- Created `reconfigure_backup_settings()` function that:
  - Preserves connection details (server, credentials)
  - Re-prompts for backup type, paths, schedule, and retention
  - Regenerates systemd service with new settings
  - Restarts backup timer
  - Shows service status and next scheduled backup time
- Allows changing from file-level to block device backups (or vice versa) without reinstalling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 18:53:43 -05:00
zaphod-black
afd1587837 Fix logs not closing after backup completion
- Changed process management in backup monitoring
- Monitor process now runs in background and kills journalctl when service completes
- journalctl runs in foreground (easier to kill properly)
- Fixes issue where logs would stay open showing blank screen
- Applied to both "Run backup now" menu option and post-install backup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 18:43:01 -05:00
zaphod-black
93debf1e21 Update README and CHANGELOG with live progress monitoring documentation
Documentation improvements to showcase the new live backup progress
monitoring feature and make it easier for users to understand how
to run and monitor backups.

README.md Updates:

Step 13 - Optional Immediate Backup:
- Added example output showing live progress monitoring
- Shows the progress box, real-time stats, and completion
- Example includes file counts, transfer speeds, and timing
- Explains what users will see during backup
- Notes ability to exit with Ctrl+C

Reconfiguration Section:
- Updated to numbered list format for clarity
- Added option 4: "Run backup now" with description
- Explains what "Run backup now" provides:
  * Immediate backup testing
  * Live progress monitoring with real-time statistics
  * File counts, transfer speeds, compression ratios
  * Automatic completion detection
  * Option to exit early (backup continues)

Post-Installation → Manual Backup:
- Added "Easy way (with live progress)" section
- Shows how to use installer option 4 for backups
- Lists benefits: live monitoring, auto-completion, clear status
- Kept "Direct command" section for advanced users
- Makes it clear which method provides better UX

CHANGELOG.md Updates:
- Documented README changes in "Changed" section
- Listed all three sections that were updated
- Notes recommendation of easy method via installer

Impact:
Users now have clear documentation showing:
1. What live progress looks like during backups
2. How to access it (option 4 in main menu)
3. Why it's better than manual systemctl commands
4. What information they'll see in real-time

This makes the feature discoverable and encourages users to
use the built-in progress monitoring instead of manual log following.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 18:40:20 -05:00
zaphod-black
a828f7eb1f Add live backup progress monitoring with automatic completion detection
User Experience Enhancement: Show real-time backup progress instead
of just asking if user wants to follow logs.

Changes to Backup Progress Display:

1. Automatic Progress Monitoring:
   - No longer prompts to follow logs
   - Automatically starts showing journalctl output
   - Displays PBS client's built-in progress bars and stats
   - Runs in background with PID tracking

2. Visual Progress Box:
   ╔════════════════════════════════════════════════════════╗
   ║  Backup Progress (Live)                                ║
   ║  Press Ctrl+C to exit (backup continues in background) ║
   ╚════════════════════════════════════════════════════════╝

3. Automatic Completion Detection:
   - Monitors systemd service with `systemctl is-active`
   - Polls every 2 seconds until service completes
   - Kills journal follow process when done
   - Shows final status (success or failure)

4. Helpful Post-Backup Information:
   - On success: Shows how to list snapshots
   - On failure: Shows how to check full logs
   - Includes repository info for easy copy/paste

Applied to Two Functions:
- run_backup_now() - Called after initial installation
- Main menu option 4 - "Run backup now"

Technical Implementation:
- Uses `timeout 3600` to prevent runaway journal process
- Background journal follow with PID capture
- Clean process termination with kill + wait
- Proper error handling for failed backups

CHANGELOG.md Updates:
- Added new "Live backup progress monitoring" feature
- Listed all capabilities and use cases

This provides immediate visual feedback and shows the user
exactly what's happening during the backup process, including
file counts, transfer speeds, and compression stats from PBS client.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 18:31:12 -05:00
zaphod-black
dae89fca31 Add defensive newline filtering when writing passwords to config
CRITICAL FIX: Added robust newline stripping as a defensive measure
when writing passwords to the config file.

The Problem:
Even though prompt_password() was fixed to output to stderr, the
newline was still somehow getting into the PBS_PASSWORD variable
in some cases, causing the config file to be malformed.

The Solution (Defense in Depth):
Before writing PBS_PASSWORD to config file, explicitly strip all
newline and carriage return characters:

PBS_PASSWORD_CLEAN=$(echo -n "$PBS_PASSWORD" | tr -d '\n\r')

This ensures the password is always clean, regardless of how it
was captured or what's in the original variable.

Changes:
- pbs-client-installer.sh:
  - Line 298: Added newline filter in reconfigure_connection()
  - Line 593: Added newline filter in create_systemd_service()
  - Both use: tr -d '\n\r' to remove \n and \r characters

CHANGELOG.md:
- Updated to document defensive filtering approach
- Lists both functions that apply the filter

This is a belt-and-suspenders approach: we fix the source
(prompt_password) AND filter at write time for maximum safety.

Impact:
Config file will now ALWAYS have single-line passwords, even if
something goes wrong with password capture. This prevents the
"authentication failed - invalid credentials" error in the
backup service.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 18:27:20 -05:00
zaphod-black
8f3bd49a51 Improve defaults and add run backup now option
User Experience Improvements:

1. Changed Default Realm from "pbs" to "pam"
   - "pam" is the standard realm for root authentication
   - More intuitive for most users
   - Matches common Proxmox setup patterns

2. Changed Default Encryption from "yes" to "no"
   - Removes friction for quick testing and setup
   - Users can easily opt-in during configuration
   - Reduces complexity for basic backup scenarios
   - Advanced users still have the option available

3. Added "Run backup now" to Main Menu
   - New option 4 in the existing configuration menu
   - Allows immediate backup testing without reconfiguration
   - Starts backup service and offers to follow logs
   - Provides helpful commands if backup fails
   - Makes it easy to test backups after setup

Changes:
- pbs-client-installer.sh:
  - Line 265, 349: PBS_REALM default changed to "pam"
  - Line 462: ENABLE_ENCRYPTION default changed to "no"
  - Lines 895-939: Added option 4 "Run backup now" with log following
  - Shifted "Exit" from option 4 to option 5

CHANGELOG.md:
- Documented all three changes in "Changed" section
- Highlighted default changes in bold

This makes the installer more user-friendly for the common case
(root@pam authentication, no encryption for testing) while still
supporting advanced configurations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 18:15:13 -05:00
zaphod-black
748e735e5d Fix critical password newline bug causing backup authentication failure
CRITICAL BUG FIX: The prompt_password() function was capturing a newline
character along with the password/token, causing the config file to have
malformed multi-line password values.

The Problem:
- prompt_password() used `echo` to print a newline after password input
- This echo was captured by command substitution: PBS_PASSWORD=$(prompt_password ...)
- Config file ended up with:
  PBS_PASSWORD="
  actual-token-here"
- PBS client couldn't authenticate with the malformed password
- Error: "authentication failed - invalid credentials"

The Fix:
- Changed `echo` to `echo >&2` (output to stderr)
- Stderr is not captured by command substitution
- Only the actual password is captured and stored
- Config file now correctly has: PBS_PASSWORD="actual-token-here"

File Changed: pbs-client-installer.sh
- Line 54: echo >&2  # Output newline to stderr so it doesn't get captured

CHANGELOG.md Updated:
- Documented as CRITICAL fix
- Explains the authentication failure in backup service
- Notes config file formatting fix

Impact:
- Connection test passed but backup service failed with auth error
- This affected both password and API token authentication
- Backups would fail silently on scheduled runs
- Now fixed: backups will authenticate correctly

Testing:
User should run installer again and the backup service will now work.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 18:08:18 -05:00
zaphod-black
ac2480bc24 Add comprehensive installation walkthrough to README
DOCUMENTATION UPDATE: Added detailed step-by-step guide covering the
entire installation process from PBS server setup to completion.

README.md Changes:

Prerequisites Section (Expanded):
- How to create API tokens in PBS web interface
- How to configure datastore permissions
- Common permission error and how to fix it
- Information gathering checklist before running installer

New: Step-by-Step Walkthrough (14 Steps):
1. Running the installer
2. PBS server configuration (IP, port, datastore)
3. Authentication method selection (why API tokens)
4. Entering API token details
5. Backup type selection (files/block/hybrid)
6. File backup paths configuration
7. Block device selection and auto-detection
8. Backup schedule configuration
9. Retention policy settings
10. Encryption setup and key management
11. 3-step connection test process
12. Systemd service creation
13. Optional immediate backup
14. Completion summary

Each step includes:
- Example prompts and responses
- Explanation of options
- Recommendations and best practices
- Common device types and their paths
- Troubleshooting tips

CHANGELOG.md Updates:
- Documented new comprehensive walkthrough
- Listed PBS server setup documentation
- Added permission error troubleshooting to Added section

This addresses the most common user questions and provides a
complete reference for first-time users. Users can now follow
the guide step-by-step to successfully configure PBS backups.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 18:04:49 -05:00
zaphod-black
2dbbf2a683 Fix SSL fingerprint prompt causing authentication timeout
CRITICAL FIX: The PBS client was waiting for interactive SSL
certificate fingerprint confirmation, causing the installer to
timeout during authentication testing.

Changes to pbs-client-installer.sh:
- Authentication test now pipes 'y' to auto-accept SSL fingerprints
- Displays accepted fingerprint in logs for transparency
- Added SSL certificate issues to error troubleshooting
- References new test-connection.sh script in error messages

New file: test-connection.sh
- Parameterized diagnostic script for testing PBS connections
- No hardcoded credentials (security best practice)
- Handles SSL fingerprint acceptance interactively
- Tests all 3 steps: reachability, auth, datastore access
- Provides detailed error messages and guidance
- Usage examples for both password and API token auth

Updated CHANGELOG.md:
- Documented SSL fingerprint auto-acceptance as critical fix
- Listed all improvements since v1.0.0
- Highlighted test-connection.sh script addition

Updated README.md:
- Added comprehensive troubleshooting section
- Documented test-connection.sh usage with examples
- Explained 3-step connection verification process
- Added SSL fingerprint handling instructions
- Clarified timeout values for each step

This resolves the "authentication hanging" issue where the login
command was waiting indefinitely for user input on SSL fingerprint
confirmation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 17:21:10 -05:00
zaphod-black
8dab3d023f Update CHANGELOG with authentication fix
Document the fix for using correct PBS client commands
(login instead of non-existent status command)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:58:46 -05:00
zaphod-black
fd5c876d7d Fix authentication test to use correct PBS client commands
The issue was using 'proxmox-backup-client status' which doesn't exist.

Changes:
- Use 'proxmox-backup-client login' for authentication testing
  (This is the proper command to test credentials)
- Use 'proxmox-backup-client list' instead of 'snapshot list'
  (Simpler command to verify datastore access)
- Reduced timeouts from 30s to 15s (these commands are faster)
- Added debug output showing the repository string being used
- Improved error message display from PBS client

This should resolve authentication timeouts and actually show
real error messages when credentials are invalid.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:58:30 -05:00
zaphod-black
8f8cd12a67 Update CHANGELOG with block device and connection test fixes
Documented the latest improvements:
- 3-step connection verification process
- Block device detection fixes for btrfs subvolumes
- Enhanced error messages and diagnostics
- Progress indicators during connection testing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:43:38 -05:00
zaphod-black
6cebec45ff Fix block device detection and improve connection test
Block Device Detection:
- Strip btrfs subvolume notation [/@] from detected device path
- Validate detected device before showing it as default
- Show available block devices when invalid device is entered
- Better error messages for device detection issues

Connection Test Improvements:
- 3-step verification process for better diagnostics:
  1. Server reachability test (5s timeout with curl)
  2. Authentication test with 'status' command (30s timeout)
  3. Datastore access verification (optional)
- Step-by-step feedback shows exactly where the failure occurs
- More specific error messages based on failure point
- Shows actual PBS client errors when authentication fails
- Succeeds if authentication works, even if snapshot list fails
  (normal when no backups exist yet)

This resolves:
- Invalid device paths like /dev/mapper/root[/@]
- Connection timeouts that were actually authentication issues
- Better user experience with clear progress indicators

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:43:14 -05:00
zaphod-black
71f7519353 Add CHANGELOG and update README with new features
Added:
- CHANGELOG.md following Keep a Changelog format
- Documented all changes from v1.0.0 to current unreleased version
- README section explaining reconfiguration options
- Enhanced troubleshooting section with connection test details

The CHANGELOG documents:
- Reconfiguration feature for existing installations
- Connection test timeout and improved error messages
- Installation method change from wget to git clone

The README now clearly explains:
- How to reconfigure existing installations
- Connection-only vs full reconfiguration options
- Use cases for quick connection updates
- Connection test timeout behavior and error types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:40:53 -05:00
zaphod-black
fde5a9edf2 Add timeout and better error messages to connection test
The connection test now:
- Has a 30-second timeout to prevent indefinite hanging
- Shows "This may take up to 30 seconds..." message
- Differentiates between timeout (unreachable) and auth errors
- Provides specific troubleshooting steps based on error type
- Displays helpful commands for diagnosing connection issues

This fixes the issue where the script would hang indefinitely
when the PBS server was unreachable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:37:11 -05:00
zaphod-black
8e958159d1 Add reconfiguration options for existing PBS installations
When PBS client is already installed, the script now offers:
- Reconfigure connection only (server/credentials) - quick option
- Full reconfiguration (all settings)
- Reinstall PBS client and reconfigure
- Exit without changes

The connection-only reconfiguration preserves all backup settings
(paths, schedules, retention) and only updates PBS server details
and credentials. This is useful when switching backup servers or
updating authentication tokens.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:28:38 -05:00
zaphod-black
934d6172cf Update installation instructions to use git clone
Replace wget command with git clone for better version control
and easier updates. The previous wget URL was also malformed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:21:10 -05:00
zaphod-black
fe3e62a8d4
Update README.md 2025-11-01 16:17:01 -05:00
zaphod-black
baa92c80d2
Fix issue link formatting in quickstart.md 2025-11-01 16:14:40 -05:00