Skip to content

Commit

Permalink
ADD: S3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Leutenegger committed Dec 17, 2019
1 parent a70b578 commit 8b0c016
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased
### Added
* S3 Support

## 0.1.5
### Changed
* Path generation for `forget` task now checks if `src` is actually filled and not only defined.
Expand Down Expand Up @@ -34,4 +38,3 @@ and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).
## 0.1.0
### Added
* initial release

12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ official [documentation](https://restic.readthedocs.io/en/stable/030_preparing_a
Available variables:

| Name | Required | Description |
| ---------- |:--------:| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `location` | yes | The location of the Backend. Currently, [Local](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#local) and [SFTP](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp) are supported |
| `password` | yes | The password used to secure this repository |
| `init` | no | Describes if the repository should be initialized or not. Use `false` if you are backuping to an already existing repo. |
| Name | Required | Description |
| ----------------------- |:--------:| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `location` | yes | The location of the Backend. Currently, [Local](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#local), [SFTP](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp and [S3](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#amazon-s3) are supported |
| `password` | yes | The password used to secure this repository |
| `init` | no | Describes if the repository should be initialized or not. Use `false` if you are backuping to an already existing repo. |
| `aws_access_key` | no | The access key for the S3 backend |
| `aws_secret_access_key` | no | The secret access key for the S3 backend |

Example:
```yaml
Expand Down
6 changes: 6 additions & 0 deletions templates/restic_access_Linux.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }}
export RESTIC_PASSWORD={{ restic_repos[item.repo].password }}
{% if restic_repos[item.repo].aws_access_key is defined %}
AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }}
{% endif %}
{% if restic_repos[item.repo].aws_secret_access_key is defined %}
AWS_SECRET_ACCESS_KEY={{ restic_repos[item.repo].aws_secret_access_key }}
{% endif %}
BACKUP_NAME={{ item.name }}
{% if item.src is defined %}
BACKUP_SOURCE={{ item.src }}
Expand Down
6 changes: 6 additions & 0 deletions templates/restic_script_Linux.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }}
export RESTIC_PASSWORD={{ restic_repos[item.repo].password }}
BACKUP_NAME={{ item.name }}
{% if restic_repos[item.repo].aws_access_key is defined %}
AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }}
{% endif %}
{% if restic_repos[item.repo].aws_secret_access_key is defined %}
AWS_SECRET_ACCESS_KEY={{ restic_repos[item.repo].aws_secret_access_key }}
{% endif %}
{% if item.src is defined %}
BACKUP_SOURCE={{ item.src }}
{% endif %}
Expand Down

0 comments on commit 8b0c016

Please sign in to comment.