Skip to content

Commit 9fe2348

Browse files
committed
initial commit
0 parents  commit 9fe2348

File tree

13 files changed

+17013
-0
lines changed

13 files changed

+17013
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Build & Deploy Documentation'
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 'Checkout'
13+
uses: actions/checkout@v1
14+
- name: 'Setup NodeJs'
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: '12.x'
18+
- name: 'Install dependencies'
19+
run: npm install
20+
- name: 'Build documentation'
21+
run: npm run docs:build
22+
- name: 'Deploy to GitHub-Pages'
23+
uses: JamesIves/github-pages-deploy-action@releases/v3
24+
with:
25+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
26+
BRANCH: gh-pages
27+
FOLDER: Documentation/.vuepress/dist

Documentation/.vuepress/config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
title: 'Neos Backups',
3+
themeConfig: {
4+
nav: [
5+
{text: 'Github', link: 'https://github.com/breadlesscode/neos-backups'}
6+
],
7+
sidebar: [
8+
'/installation',
9+
'/filesystems',
10+
'/steps',
11+
'/custom-behaviours'
12+
],
13+
theme: '@vuepress/theme-default',
14+
smoothScroll: true,
15+
docsRepo: 'breadlesscode/neos-backups',
16+
docsDir: 'Documentation',
17+
docsBranch: 'master',
18+
editLinks: true,
19+
editLinkText: 'Help me improve this page!',
20+
lastUpdated: 'Last Updated',
21+
}
22+
};
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
$sidebar-link-padding = .5rem
2+
3+
.sidebar
4+
border: 0
5+
padding: 0 1rem
6+
7+
.sidebar-link
8+
box-sizing: border-box
9+
padding: 0 1rem
10+
11+
.sidebar-links > li .sidebar-link
12+
&.active
13+
border: 0
14+
background-color: #D4ECFC
15+
border-radius: 4px
16+
17+
18+
.sidebar ul.sidebar-sub-headers
19+
padding-top: $sidebar-link-padding
20+
21+
.sidebar-sub-headers .sidebar-sub-header a.sidebar-link
22+
padding-top: $sidebar-link-padding
23+
padding-bottom $sidebar-link-padding
24+
background: transparent
25+
26+
.links
27+
display: flex
28+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$accentColor = lighten(#26224C, 20%)
2+
$textColor = #2c3e50
3+
$borderColor = #eaecef
4+
$codeBgColor = #282c34
5+
$badgeTipColor = #42b983
6+
$badgeWarningColor = darken(#ffe564, 35%)
7+
$badgeErrorColor = #DA5961

Documentation/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
home: true
3+
editLink: false
4+
heroImage: /neos-backups.svg
5+
heroText: Neos Backups
6+
tagline: Easy backup and restore your Neos CMS in different filesystems
7+
actionText: Get Started →
8+
actionLink: /installation
9+
features:
10+
- title: Easy customizable
11+
details: You can easily add your own backup steps or add your own filesystem adapter.
12+
- title: Free
13+
details: Its free, why not use it? Its always better to have backups.
14+
- title: Open Source
15+
details: You discovered a bug? No problem, go to the Github page and report it.
16+
footer: MIT Licensed | Copyright © 2020 by Marvin Kuhn
17+
---

Documentation/custom-behaviours.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Custom behaviours
2+
3+
You have the possibility to create your own step, name generator and compressor.
4+
5+
- [Custom step](#custom-step)
6+
- [Custom name generator](#custom-name-generator)
7+
- [Custom compressor](#custom-compressor)
8+
9+
## Custom step
10+
11+
```php
12+
<?php
13+
namespace My\Vendor\Step;
14+
15+
use Breadlesscode\Backups\Step\StepAbstract;
16+
17+
class MyCustomExportStep extends StepAbstract
18+
{
19+
/**
20+
* Folder name in backup file
21+
*
22+
* @var string
23+
*/
24+
protected $name = 'MySqlExport';
25+
26+
/**
27+
* your restore warning markdown string
28+
* if a this property is not sufficient,
29+
* you can override the getRestoreWarning() method
30+
*
31+
* @var string
32+
*/
33+
protected $restoreWarning = 'My custom warning';
34+
35+
/**
36+
* @inheritDoc
37+
*/
38+
public function backup(): bool
39+
{
40+
// your backup code here
41+
return true;
42+
}
43+
44+
/**
45+
* @inheritDoc
46+
*/
47+
public function restore(): bool
48+
{
49+
// your restore code here
50+
return true;
51+
}
52+
}
53+
```
54+
55+
Settings.yaml
56+
```yaml
57+
Breadlesscode:
58+
Backups:
59+
steps:
60+
'My\Vendor\Step\MyCustomExportStep':
61+
my: config
62+
```
63+
64+
## Custom name generator
65+
BackupNameGenerator.php
66+
```php
67+
<?php
68+
namespace My\Vendor\Generators;
69+
70+
class BackupNameGenerator implements BackupNameGeneratorInterface
71+
{
72+
public function generate(): string
73+
{
74+
return (new \DateTime())->format('Y-m-d_H:i:s');
75+
}
76+
}
77+
```
78+
79+
Objects.yaml
80+
```yaml
81+
Breadlesscode\Backups\Generators\BackupNameGeneratorInterface:
82+
className: 'My\Vendor\BackupNameGenerator'
83+
```
84+
85+
## Custom compressor
86+
87+
```php
88+
<?php
89+
namespace My\Vendor\Compressor;
90+
91+
class MyCompressor extends AbstractCompressor
92+
{
93+
public function compress(string $source, string $targetFolder): ?string
94+
{
95+
// do your backup compressing
96+
return $archivePath;
97+
}
98+
99+
public function decompress(string $source, string $targetFolder): ?string
100+
{
101+
// do your backup decompressing
102+
return $targetFolder;
103+
}
104+
105+
public function generateFilename($name): string
106+
{
107+
return $name.'.tar.xyz';
108+
}
109+
}
110+
```

Documentation/filesystems.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Filesystems
2+
3+
This package provides the following filesystem adapter by default:
4+
5+
* [Local](#local)
6+
* [SFTP](#sftp)
7+
* [AWS-S3](#aws-s3)
8+
* [Azure Blob](#azure-blob)
9+
* [Dropbox](#dropbox)
10+
* [Google Storage](#google-storage)
11+
12+
::: tip
13+
This plugin uses the `league/flysystem` package under the hood.
14+
:::
15+
16+
## Local
17+
18+
Example configuration:
19+
```yaml
20+
Breadlesscode:
21+
Backups:
22+
filesystem:
23+
type: 'local'
24+
path: '%FLOW_PATH_DATA%Persistent/Backups'
25+
```
26+
27+
## SFTP
28+
29+
Example configuration:
30+
```yaml
31+
Breadlesscode:
32+
Backups:
33+
filesystem:
34+
type: 'sftp'
35+
host: 'example.com',
36+
port: 22,
37+
username: 'username',
38+
password: 'password',
39+
privateKey: 'path/to/or/contents/of/privatekey',
40+
passphrase: 'passphrase-for-privateKey',
41+
root: '/path/to/root',
42+
timeout: 10,
43+
directoryPerm: 0755
44+
```
45+
## AWS-S3
46+
47+
Example configuration:
48+
```yaml
49+
Breadlesscode:
50+
Backups:
51+
filesystem:
52+
type: 'aws-s3'
53+
region: ''
54+
bucketName: ''
55+
credentials:
56+
key: ''
57+
secret: ''
58+
```
59+
## Azure Blob
60+
61+
Example configuration:
62+
```yaml
63+
Breadlesscode:
64+
Backups:
65+
filesystem:
66+
type: 'azure'
67+
containerName: ''
68+
account:
69+
key: ''
70+
name: ''
71+
```
72+
## Dropbox
73+
74+
Example configuration:
75+
```yaml
76+
Breadlesscode:
77+
Backups:
78+
filesystem:
79+
type: 'dropbox'
80+
authorizationToken: ''
81+
```
82+
## Google Storage
83+
84+
Example configuration:
85+
```yaml
86+
Breadlesscode:
87+
Backups:
88+
filesystem:
89+
type: 'google-storage'
90+
projectId: ''
91+
bucketName: ''
92+
```

Documentation/installation.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Installation
2+
3+
You can easly add this package via composer.
4+
5+
```bash
6+
composer require breadlesscode/neos-backups
7+
```
8+
9+
## Setup configuration
10+
11+
First you have to choose a [filesystem](./filesystems.md) where you want to store the backups.
12+
Than you have to configure all backup steps you want to use.
13+
14+
Example Configuration:
15+
```yaml
16+
Breadlesscode:
17+
Backups:
18+
filesystem:
19+
type: 'local'
20+
path: '%FLOW_PATH_DATA%Persistent/Backups'
21+
steps: #{}
22+
'Breadlesscode\Backups\Step\SiteExportStep': []
23+
'Breadlesscode\Backups\Step\FileExportStep':
24+
paths:
25+
logs: '%FLOW_PATH_DATA%Logs'
26+
'Breadlesscode\Backups\Step\MysqlTableExportStep':
27+
tables:
28+
- neos_flow_security_account
29+
```

Documentation/steps.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Backup Steps
2+
3+
* [File/Directory copy step](#file-directory-copy-step)
4+
* [Site export step](#site-export-step)
5+
* [MySql-Table export step](#mysql-table-export-step)
6+
7+
8+
## File export step
9+
This is a easy step to copy files and directories into the backup.
10+
11+
Example configuration:
12+
```yaml
13+
Breadlesscode:
14+
Backups:
15+
steps:
16+
'Breadlesscode\Backups\Step\CopyStep':
17+
paths:
18+
logs: '%FLOW_PATH_DATA%Logs'
19+
```
20+
21+
## Site export step
22+
This step uses the Neos CMS site export functionality to export sites and his resources
23+
into a XML-File.
24+
25+
Example configuration:
26+
```yaml
27+
Breadlesscode:
28+
Backups:
29+
steps:
30+
'Breadlesscode\Backups\Step\SiteExportStep': []
31+
```
32+
33+
## MySql-Table export step
34+
35+
This step exports MySql-Tables via the `mysqldump`-Binary.
36+
37+
Example configuration:
38+
```yaml
39+
Breadlesscode:
40+
Backups:
41+
steps:
42+
'Breadlesscode\Backups\Step\MysqlTableExportStep':
43+
mysqlDumpBinPath: 'mysqldump'
44+
mysqlBinPath: 'mysql'
45+
tables:
46+
- neos_flow_security_account
47+
```

0 commit comments

Comments
 (0)