Skip to content

Commit 9ecdf45

Browse files
Merge pull request #27 from itiden/chore/improve-readme
Chore/improve readme
2 parents 49c3996 + 89bebca commit 9ecdf45

File tree

3 files changed

+110
-89
lines changed

3 files changed

+110
-89
lines changed

README.md

Lines changed: 42 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,84 @@
11
# Backup
22

3-
Welcome to the Backup Addon! This addon supercharges your Statamic experience by providing powerful backup management capabilities. Say goodbye to data loss worries and hello to peace of mind!
3+
Backup is an extensible and powerful backup tool for statamic sites, it enables you to create, manage and schedule backups of your site with ease in the control panel.
44

55
## Table of Contents
66

77
- [Features](#features)
88
- [Installation](#installation)
99
- [Configuration](#configuration)
1010
- [Usage](#usage)
11-
- [Contributing](#contributing)
11+
- [Scheduling](#scheduling)
12+
- [Documentation](#documentation)
1213
- [License](#license)
1314

1415
## Features
1516

16-
- 📂 **Customizable Storage**: Choose where your backups are stored, whether it's on your local disk or a different storage provider.
17-
- 🔄 **Backup Rotation**: Automatically manage your backups by setting a maximum number to keep. Old backups are deleted to make room for new ones.
18-
- 🔒 **Password Protection**: Keep your backups secure with an optional password. No unauthorized access allowed!
19-
-**Scheduled Backups**: Set it and forget it! Schedule backups to run automatically at your preferred frequency.
17+
Why use our backup addon?
2018

21-
## Installation
22-
23-
To install this addon, follow these simple steps:
19+
- Control panel page where you can manage backups
20+
- Chunked uploads - upload huge backups from other servers without the need to change your `php.ini`.
21+
- Permissions - choose exactly which users can manage your backups with [permissions](https://statamic.dev/users#permissions).
22+
- Choose exactly what you want to backup by configuring the backup [pipeline](docs/pipeline.md).
23+
- Easy to extend and customize, [just create a new pipes](docs/pipeline.md#creating-a-new-backup-pipe)!
24+
- Uses laravels [storage system](https://laravel.com/docs/11.x/filesystem) and thus supports external storage out of the box.
25+
- Tested, we have over 140 assertions in this addon.
2426

25-
1. **Composer Installation**:
27+
## Installation
2628

27-
Run the following composer command in your Statamic project:
29+
1. To install this addon, require it using composer.
2830

2931
```bash
3032
composer require itiden/statamic-backup
3133
```
3234

33-
2. **Configuration**:
34-
35-
Publish the configuration file:
36-
37-
```sh
35+
2. Set the `content_path` config value to the path of your content, start with publishing the config:
36+
```bash
3837
php artisan vendor:publish --tag="backup-config"
3938
```
39+
default is `storage_path('content')`
4040

41-
Next, configure the addon by editing the `config/backup.php` file. Customize settings such as content path, backup destination, and more.
42-
43-
Read the full configuration documentation [here](docs/configuration.md)!
44-
45-
3. **Usage**:
46-
47-
You're all set! Start using the addon to handle your backups effortlessly.
48-
49-
## Commands
50-
51-
Backup your site:
52-
53-
```sh
54-
php artisan statamic:backup
55-
```
41+
## Configuration
5642

57-
Restore your site from an absolute path
43+
You can configure the backup settings in the `config/backup.php` file, first publish the configuration file using the following command:
5844

59-
```sh
60-
php artisan statamic:backup:restore {path}
45+
```bash
46+
php artisan vendor:publish --tag="backup-config"
6147
```
6248

63-
Clear the temp file directory
64-
65-
```sh
66-
php artisan statamic:backup:clear
67-
```
49+
Then you can configure:
6850

69-
## Configuration
51+
- Backup path
52+
- Backup disk
53+
- Backup filename
54+
- Backup schedule
55+
- Temporary files path
56+
- Max amount of backups to keep
57+
- Backup password
58+
- The Backup pipeline
7059

71-
Read the configuration [docs](docs/configuration.md)!
60+
Read more about the configuration [here](docs/configuration.md)!
7261

73-
## Notifications/Events
62+
## Usage
7463

75-
You can send notifications when a backup is created. Read the notifications [docs](docs/notifications.md)!
64+
To create a backup, navigate to the Backup section in the control panel and click the "Create Backup" button. There you can also see a list of all your backups and download or restore them if needed.
7665

77-
## Usage
66+
Or if you prefer to use the command line, you can use the following command:
7867

79-
Using the Statamic Backup Addon is a breeze:
68+
```bash
69+
php artisan statamic:backup:create
70+
```
8071

81-
1. Configure your backup settings in `config/backup.php` to match your needs [[docs]](docs/configuration.md).
72+
### Scheduling
8273

83-
2. Run the backup command manually or let scheduled backups take care of it automatically.
74+
Configure the backup schedule in the configuration file, read more about it [here](docs/scheduling.md).
8475

85-
3. Enjoy the peace of mind knowing your data is backed up, secure, and accessible when you need it.
76+
To use the scheduling you need to run the laravel scheduler. Read more about that here: [Running the scheduler](https://laravel.com/docs/10.x/scheduling#running-the-scheduler).
8677

87-
## Contributing
78+
## Documentation
8879

89-
We welcome contributions from the Statamic community! Whether it's bug fixes, new features, or improvements, please feel free to contribute.
80+
In the docs directory you can read more about the pipeline, scheduling and notification configurations.
9081

9182
## License
9283

93-
This addon is open-source and available under the [MIT License](LICENSE).
84+
Backup is open-sourced software licensed under the [MIT license](LICENSE.md).

config/backup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*
4141
* set to null to disable automatic backups
4242
* frequency can be any of the laravel schedule frequencies
43-
* time should be what the frequency expects
43+
* time should be parameters the frequency expects
4444
*
4545
* see https://laravel.com/docs/10.x/scheduling#schedule-frequency-options
4646
*/

docs/configuration.md

Lines changed: 67 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,72 @@ php artisan vendor:publish --tag="backup-config"
1010

1111
## Configuration Options
1212

13-
Now, let's dive into the exciting world of configuration. Here's an overview of each option:
14-
15-
- **`content_path`**:
16-
17-
- _Description_: Specifies the path to your content directory, used by the default content backup driver.
18-
- _Default_: `storage_path('content')`
19-
20-
- **`destination`**:
21-
22-
- _Description_: Defines the backup destination disk and path.
23-
- _Default_: statamic-backups on the local disk.
24-
25-
- **`temp_path`**:
26-
27-
- _Description_: Specifies the path to the temporary directory used for backup operations.
28-
- _Defualt_: `storage_path('framework/statamic-backup')`
29-
30-
- **`max_backups`**:
31-
32-
- _Description_: Determines the maximum number of backups to keep. When this limit is exceeded, the oldest backup will be automatically deleted.
33-
- _Default_: 10
34-
35-
- **`password`**:
36-
37-
- _Description_: Sets a backup password. If set to null, password protection is disabled.
38-
- _Default_: `env('BACKUP_PASSWORD')`
39-
40-
- **`schedule`**:
41-
42-
- _Description_: Configure the backup schedule options. Specify the frequency and time for automatic backups.
43-
- _Configuration_: Check out our scheduling docs [here](scheduling.md).
44-
- _Default_: Daily at midnight
45-
46-
- **`pipeline`**:
47-
- _Description_: Specifies the backup pipeline. These "pipes" determine what parts of your site will be backed up.
48-
- _Configuration_: Check out our backup pipes docs [here](pipes.md).
49-
- _Default_: Content, Assets, and Users.
13+
This is the default contents of the configuration:
14+
15+
```php
16+
return [
17+
/**
18+
* The path to the content directory
19+
*
20+
* This is used by the default content backup driver
21+
*/
22+
'content_path' => storage_path('content'),
23+
24+
/**
25+
* The backup destination options
26+
*/
27+
'destination' => [
28+
'disk' => 'local',
29+
'path' => 'statamic-backups',
30+
],
31+
32+
/**
33+
* The path to the temp directory
34+
*/
35+
'temp_path' => storage_path('framework/statamic-backup'),
36+
37+
/**
38+
* The maximum number of backups to keep
39+
*
40+
* when exceeded the oldest backup will be deleted
41+
*/
42+
'max_backups' => 10,
43+
44+
/**
45+
* The backup password
46+
*
47+
* set to null to disable password protection
48+
*/
49+
'password' => env('BACKUP_PASSWORD', null),
50+
51+
/**
52+
* The backup schedule options
53+
*
54+
* set to null to disable automatic backups
55+
* frequency can be any of the laravel schedule frequencies
56+
* time should be parameters the frequency expects
57+
*
58+
* see https://laravel.com/docs/10.x/scheduling#schedule-frequency-options
59+
*/
60+
'schedule' => [
61+
'frequency' => 'daily',
62+
// 'time' => '03:00',
63+
],
64+
65+
/**
66+
* The backup steps to use
67+
*
68+
* These are the steps/pipes that will be used to backup your site
69+
* You can add your own here
70+
*
71+
* All pipes are expected to be instances of Itiden\Backup\Abtracts\BackupPipe
72+
*/
73+
'pipeline' => [
74+
Itiden\Backup\Pipes\Content::class,
75+
Itiden\Backup\Pipes\Assets::class,
76+
Itiden\Backup\Pipes\Users::class,
77+
],
78+
];
79+
```
5080

5181
There you have it! With these options, you can fine-tune your backup setup to suit your needs and keep your data safe and sound. Happy configuring! 😄🚀

0 commit comments

Comments
 (0)