All Projects → arnaudjuracek → kirby-backup-widget

arnaudjuracek / kirby-backup-widget

Licence: MIT license
Kirby panel widget to easily backup your site content.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to kirby-backup-widget

kirby-copy-files
Clone page dashboard widget for Kirby panel
Stars: ✭ 12 (-52%)
Mutual labels:  kirby, kirby-widget, kirby-panel
Laravel Backup
A package to backup your Laravel app
Stars: ✭ 4,752 (+18908%)
Mutual labels:  backup, zip
Cartkit
Cartkit - The [quick] starter kit!
Stars: ✭ 39 (+56%)
Mutual labels:  kirby, kirby-widget
Libarchive
Multi-format archive and compression library
Stars: ✭ 1,625 (+6400%)
Mutual labels:  backup, zip
Flametree
🔥 Python file and zip operations made easy
Stars: ✭ 148 (+492%)
Mutual labels:  zip, archive
kirby-boiler-field
Boilerplate for Kirby form fields
Stars: ✭ 15 (-40%)
Mutual labels:  kirby, kirby-panel
laravel-backup-shield
🔒Password protection (and encryption) for your laravel backups.
Stars: ✭ 32 (+28%)
Mutual labels:  backup, zip
laravel-mail-export
A simple mailable trait and interface to export mails to a storage disk once being sent.
Stars: ✭ 82 (+228%)
Mutual labels:  backup, archive
kirby-git
Kirby plugin for updating content in the panel via Git
Stars: ✭ 75 (+200%)
Mutual labels:  kirby, kirby-panel
Dmarchiver
A tool to archive the direct messages, images and videos from your private conversations on Twitter
Stars: ✭ 204 (+716%)
Mutual labels:  backup, archive
Libarchivejs
Archive library for browsers
Stars: ✭ 145 (+480%)
Mutual labels:  zip, archive
blockyarchive
Blocky archive - multithreaded archiver offering bit rot protection and sector level recoverability
Stars: ✭ 88 (+252%)
Mutual labels:  backup, archive
Apkdiffpatch
a C++ library and command-line tools for Zip(Jar,Apk) file Diff & Patch; create minimal delta/differential; support Jar sign(apk v1 sign) & apk v2,v3 sign .
Stars: ✭ 121 (+384%)
Mutual labels:  zip, archive
kirbyup
🆙 Zero-config bundler for Kirby Panel plugins
Stars: ✭ 33 (+32%)
Mutual labels:  kirby, kirby-panel
Mzip Android
An Android compress and extract library support popular compression format such as rar, zip
Stars: ✭ 95 (+280%)
Mutual labels:  zip, archive
Dareblopy
Data Reading Blocks for Python
Stars: ✭ 82 (+228%)
Mutual labels:  zip, archive
Zipper
🗳A library to create, read and modify ZIP archive files, written in Swift.
Stars: ✭ 38 (+52%)
Mutual labels:  zip, archive
Archivemounter
Mounts archives like disk images (macOS)
Stars: ✭ 77 (+208%)
Mutual labels:  zip, archive
Kirby Autogit
⬢ Saves every change made via Kirby Panel to a Git repository
Stars: ✭ 147 (+488%)
Mutual labels:  backup, kirby
Ob3vil1on
Another archive cracker created in python | cracking [zip/7z/rar] by bruteforcing [ NOT MAINTAINED ]
Stars: ✭ 17 (-32%)
Mutual labels:  zip, archive

Kirby Backup Widget

Kirby panel widget to easily backup your site content.

version kirby_version license

license

Installation

Use one of the alternatives below.

1. Using kirby-webpack

Simply use the built-in Kirby Package Manager by running:

$ npm run kirby:add
$ [?] Git URL: https://github.com/arnaudjuracek/kirby-backup-widget
$ [?] Module name: kirby-backup-widget
$ [?] Category: widgets

2. Kirby CLI

If you are using the Kirby CLI you can install this plugin by running the following commands in your shell:

$ cd path/to/kirby
$ kirby plugin:install arnaudjuracek/kirby-backup-widget

3. Clone or download

  1. Clone or download this repository.
  2. Unzip the archive if needed and rename the folder to kirby-backup-widget.

Make sure that the plugin folder structure looks like this:

site/widgets/kirby-backup-widget/

4. Git Submodule

If you know your way around Git, you can download this plugin as a submodule:

$ cd path/to/kirby
$ git submodule add https://github.com/arnaudjuracek/kirby-backup-widget site/widgets/kirby-backup-widget

Options

The following options can be set in your /site/config/config.php file:


widget.backup.include

c::set('widget.backup.include', ['projects', 'blog']);
  • description: array of folders to include from the backup. Note that if you use widget.backup.exclude, all folders will be included no matter what you set in widget.backup.include.
  • default: by default, all folders inside content/ are included

widget.backup.exclude

c::set('widget.backup.exclude', ['error']);
  • description: array of folders to exclude from the backup. Note that if used, widget.backup.include will be ignored.
  • default: []

widget.backup.include_site

c::set('widget.backup.include_site', false);
  • description: whether to include root files and site options. Set this to true if you want to backup your site.LANG.txt etc.
  • default: false

widget.backup.destination

c::set('widget.backup.destination', 'backups');
  • description: set the destination directory for the backup files. Accept subdirectory by using 'dir' . DS . 'subdir'. Note that the directory will be placed in content/ no matter what. This is mainly used to avoid collisions if you already have a directory called backups in content/. If the directory does not exist, it will be automatically created with CHMOD 0777. Finally, note that this backup directory will always be exluded, to avoid recursion.
  • default: backups

widget.backup.overwrite

c::set('widget.backup.overwrite', true);
  • description: set it to false if you don't want to allow backups overwrite. If set to false and a backup file with the same name already exists, the widget will show an alert error message.
  • default: true

widget.backup.date_format

c::set('widget.backup.date_format', 'Y-m-d');
  • description: set the date format used to name the backup file. See function.date.php for available formats.
  • default: Y-m-d

Security

It is recommended to limit access to your backup files by placing them behing a firewall.

Here is a quick way to prevent unauthorised user to download your backups :

config.php
c::set('routes', [
  [
    'pattern' => 'content/backups/(:any)',
    'action' => function ($file) {
      if (site()->user()) {
        // only logged users have access to content/backups files
        page('backups')->files()->find($file)->download();
      } else {
        header::forbidden();
        die('Unauthorized access');
      }
    }
  ]
]);
.htaccess
# block backups from being accessed directly
RewriteRule ^content/backups/(.*)$ index.php [L]

If you want more detail about it, see how to build an asset firewall.

Todo

  • change basic url ?action= parameters for a more robust widget routing solution
  • add confirmation modal before deleting
  • swtich to .gitignore like exclude / include path patterns

Requirements

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].