Skip to content

feat: release NovaBackuper v1.4.0 with encryption, multi-destination backups and security improvements#88

Open
power0matin wants to merge 34 commits into
erfjab:masterfrom
power0matin:master
Open

feat: release NovaBackuper v1.4.0 with encryption, multi-destination backups and security improvements#88
power0matin wants to merge 34 commits into
erfjab:masterfrom
power0matin:master

Conversation

@power0matin

Copy link
Copy Markdown

Overview

This pull request delivers the NovaBackuper v1.4.0 release, bringing major improvements to functionality, security, reliability, and documentation.

🚀 New Features

  • Add encrypted backup support
  • Add support for multiple backup destinations
  • Add profile editor
  • Add CLI mode
  • Add configurable timezone support for Telegram reports
  • Improve interactive menu with edit and update options

🔒 Security Improvements

  • Prevent sensitive credentials from being exposed during backup execution
  • Harden generated backup scripts
  • Improve update process reliability
  • Safer shell variable substitution and script generation

🛠 Bug Fixes

  • Fix ZIP backup creation when SQLite WAL/SHM files are missing
  • Fix generated script escaping issues
  • Improve Telegram upload reliability
  • Fix updater when installed via curl | bash
  • Restore valid control flow after generator changes
  • Ensure first scheduled backup always runs
  • Improve scheduled backup exit-code handling
  • Fix caption formatting and shell syntax issues
  • Resolve merge conflicts while preserving v1.4.0 functionality

📖 Documentation

  • Rewrite and expand the English README
  • Improve Persian README formatting and readability
  • Update installation instructions
  • Document supported backup destinations
  • Add timezone configuration examples
  • Improve project documentation and usage guides

Backward Compatibility

Existing installations remain compatible. Users can simply update to take advantage of the new features and security improvements.


This PR represents the complete v1.4.0 release of NovaBackuper.

Initial release of NovaBackuper installer
- Replace Backuper branding and sponsor text with NovaBackuper identity
- Focus description and features on x-ui + Telegram backup workflow
- Update installation command to use nova-backuper.sh from this repository
- Add maintainer / contact links for power0matin and credit original Backuper project
- Replace inline zip call with a dynamic db_files list
- Only include existing x-ui database files (db, wal, shm) in the archive
- Add logging for included files before compression
- Prevent backup failures when optional WAL/SHM files are not present
- Rewrite English and Persian READMEs to use NovaBackuper branding and wording
- Update installation commands to download nova-backuper.sh from this repository
- Fix/adjust maintainer, GitHub and stargazer links to use power0matin URLs
- Update Telegram inline keyboard reply_markup to point to the correct GitHub repo and developer profile
- Extend Telegram configuration wizard to ask for an IANA timezone
- Validate the provided timezone and fall back to the system timezone if empty
- Inject the selected timezone into the generated backup script
- Update caption generation to format date and time using the user’s timezone instead of server default
- Condense Telegram caption into a shorter, more professional format
- Keep timezone-aware date/time in a single compact line
- Show host, IP, backup ID, and x-ui scope without redundant text
- Extend main menu with an option to edit existing backup scripts
- Implement edit flow that lists existing scripts, removes the old script and cron entry, and reruns the wizard for the same remark
- Add self-update option to fetch the latest nova-backuper.sh from GitHub
- Safely detect when running via curl|bash and avoid overwriting system bash, guiding the user to rerun the install command instead
- Change update_novabackuper to always download the latest script to /root/nova-backuper.sh
- Automatically exec the freshly downloaded script so users see the new version immediately
- Fix generated backup script syntax error by escaping nested command substitution
  in the CAPTION heredoc inside generate_script
- Keep existing per-remark backup scripts intact while updating the installer logic
- Document common IANA timezone values for widely used countries
- Add a collapsible <details>/<summary> section under the Telegram report feature
- Mirror the same structure in the Persian README to help users pick the correct timezone
- Add a collapsible timezone section to the English README using a markdown table
- Mirror the same timezone table and structure in the Persian README
- Help users pick the correct IANA timezone when configuring NovaBackuper
Added contact information for Matin Shahabadi.
Updated error handling and improved dependency installation logic. Enhanced cron job setup and backup script generation.
Generated backup scripts were written with escaped dollar signs (e.g. \$(...) and \${VAR}),
which can trigger syntax errors and break runtime expansions.

This change removes the extra escaping in the template, quotes SPLIT_SIZE for zip, and
uses a nullglob-based part discovery instead of ls to improve robustness.
Telegram uploads failed because curl line continuations could break, causing -F flags
to be executed as standalone commands.

Refactor sendDocument calls to build curl arguments in an array and execute curl once
per file part, eliminating fragile backslash continuations. Also fix backup_name
logging to expand correctly.
…unner

Escape replacement values used in sed placeholder substitutions to avoid breakage
with special characters in tokens/paths.

Also allow "Run all backup scripts" to continue on individual failures and report
a summary instead of aborting the whole program.
…status

Ensure the installer triggers an immediate first backup by running generated scripts
with FORCE_RUN=1 to bypass the interval gate.

Introduce FORCE_RUN support in generated scripts and return exit code 75 when a run
is skipped due to interval timing, allowing accurate reporting by the installer.
The generator's post-create flow was left with a dangling else/fi after adding the
FORCE_RUN first-run behavior, causing a syntax error during execution.

Restructure generate_script() to run the first backup with FORCE_RUN=1, then set up
cron, and exit cleanly with no orphaned conditionals.
- Add FORCE_RUN to bypass interval gate on first run
- Return exit code 75 when backup is not due yet
- Escape sed placeholder replacements safely
- Ensure cron setup runs after successful first execution
… scripts

Handle the interval-gate exit code (75) as a non-error skip in option 5,
and print an accurate summary of succeeded/skipped/failed runs.
- Add optional AES-256 backup encryption (7z preferred, zip -e fallback)
- Add multi-destination support: Telegram, Local Folder, or both
- Replace destructive edit mode with a real in-place profile editor
- Add full silent/CLI mode (--install, --edit, --remove, --run, --update, --help)
- Add input_secret() helper for password input without echo
- Add detect_encrypt_tool() and require_encrypt_tool() helpers
- Add _read_script_value() and _set_script_value() for safe in-place script editing
- Update cron automatically when interval or remark changes via editor
- Update both README (EN + FA) to reflect all new features and changelog
- Restrict generated backup scripts with secure file permissions
- Install dependencies only when required
- Verify update integrity before executing new releases
- Synchronize version information across the project
- Improve overall security, reliability, and maintainability
Updated the README to include a quick install section, improved formatting, and added details about supported platforms and features.
Updated the README file for NovaBackuper with new sections, improved formatting, and added English version link. Enhanced installation instructions and clarified backup features.
Updated installation instructions and supported platforms section.
…chive logs

Fix a regression from the previous security hardening pass: generated
backup scripts were chmod'd to 600, which strips the execute bit.
`bash script.sh` (used for the one-off first run) only needs read
access, so that worked — but crontab invokes the script path directly
and needs +x, so every scheduled run after install silently failed.

- Change generated profile scripts from chmod 600 to 700 (owner-only
  read/write/execute). Keeps the embedded Telegram token and
  encryption password unreadable to other local users while restoring
  cron's ability to execute the file directly.
- Apply the same 700 permission to self-updated copies of the main
  script (previously chmod +x, now also owner-only).
- Fix exit-code bug in the generated script's interval gate: `rc=$?`
  after `if ! should_run_now; then` was capturing the negated status
  of `!` (always 0/1), never the real 75 "not due yet" code. Now
  captured directly from should_run_now before any negation.
- Fix misleading log output: the archive-creation log line always
  printed the unencrypted filename even when encryption was enabled,
  making logs look inconsistent with what was actually sent. Each
  branch (plain zip / encrypted zip / encrypted 7z) now logs its own
  real filename.
- Add persistent logging to /var/log/novabackuper/<remark>.log inside
  each generated script. Cron output was previously discarded, so a
  script correctly skipping (interval not yet due) was indistinguishable
  from one silently failing. Every run's outcome is now on disk.
- Only run install_dependencies once per host (guarded by
  /var/lib/novabackuper/.deps_installed) instead of on every menu load,
  so a transient network issue doesn't block access to the menu.
- Add checksum verification (nova-backuper.sh.sha256) to --update
  before exec'ing the downloaded script as root; warns if no checksum
  is published rather than failing silently.
- Fix VERSION constant (v1.4.0) to match the v2.0.0 header comment.

Migration note: existing profiles created before this fix are still
chmod 600 and need a manual `chmod 700 /root/_*_backuper_script.sh`
to resume running under cron.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant