Merge pull request #101 from usmanatron/azureblob

Add support for Azure Blob Storage
This commit is contained in:
L3D 2023-08-23 23:04:30 +02:00 committed by GitHub
commit ce731567bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 2 deletions

View file

@ -102,7 +102,7 @@ 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), [SFTP](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp), [S3](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#amazon-s3) and [B2](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#backblaze-b2) are supported |
| `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), [S3](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#amazon-s3), [Azure Blob](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#microsoft-azure-blob-storage) and [B2](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#backblaze-b2) 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. |
@ -113,10 +113,33 @@ restic_repos:
location: /srv/restic-repo
password: securepassword1
init: true
remote:
sftp:
location: sftp:user@host:/srv/restic-repo
password: securepassword2
init: true
aws:
location: s3:s3.amazonaws.com/bucket_name
password: securepassword3
init: true
aws_access_key: accesskey
aws_secret_access_key: secretaccesskey
aws_default_region: eu-west-1
azure:
location: azure:container:/
password: securepassword4
init: true
azure_account_name: storageaccountname
# Only one of the following are required
azure_account_key: somekey
azure_account_sas: sasurl
# Optional
azure_endpoint_suffix: core.windows.net
b2:
location: b2:bucketname:path/to/repo
password: securepassword5
init: true
b2_account_id: accountid
b2_account_key: accountkey
```
### Backups

View file

@ -7,6 +7,10 @@
AWS_ACCESS_KEY_ID: '{{ item.value.aws_access_key | default("") }}'
AWS_SECRET_ACCESS_KEY: '{{ item.value.aws_secret_access_key | default("") }}'
AWS_DEFAULT_REGION: '{{ item.value.aws_default_region | default("") }}'
AZURE_ACCOUNT_NAME: '{{ item.value.azure_account_name | default("") }}'
AZURE_ACCOUNT_KEY: '{{ item.value.azure_account_key | default("") }}'
AZURE_ACCOUNT_SAS: '{{ item.value.azure_account_sas | default("") }}'
AZURE_ENDPOINT_SUFFIX: '{{ item.value.azure_endpoint_suffix | default("") }}'
B2_ACCOUNT_ID: '{{ item.value.b2_account_id | default("") }}'
B2_ACCOUNT_KEY: '{{ item.value.b2_account_key | default("") }}'
no_log: "{{ restic_no_log }}"

View file

@ -14,6 +14,18 @@ export AWS_SECRET_ACCESS_KEY='{{ restic_repos[item.repo].aws_secret_access_key |
{% if restic_repos[item.repo].aws_default_region is defined %}
export AWS_DEFAULT_REGION={{ restic_repos[item.repo].aws_default_region }}
{% endif %}
{% if restic_repos[item.repo].azure_account_name is defined %}
export AZURE_ACCOUNT_NAME={{ restic_repos[item.repo].azure_account_name }}
{% endif %}
{% if restic_repos[item.repo].azure_account_key is defined %}
export AZURE_ACCOUNT_KEY={{ restic_repos[item.repo].azure_account_key }}
{% endif %}
{% if restic_repos[item.repo].azure_account_sas is defined %}
export AZURE_ACCOUNT_SAS={{ restic_repos[item.repo].azure_account_sas }}
{% endif %}
{% if restic_repos[item.repo].azure_endpoint_suffix is defined %}
export AZURE_ENDPOINT_SUFFIX={{ restic_repos[item.repo].azure_endpoint_suffix }}
{% endif %}
{% if restic_repos[item.repo].b2_account_id is defined %}
export B2_ACCOUNT_ID={{ restic_repos[item.repo].b2_account_id }}
{% endif %}

View file

@ -57,6 +57,18 @@ export AWS_SECRET_ACCESS_KEY='{{ restic_repos[item.repo].aws_secret_access_key |
{% if restic_repos[item.repo].aws_default_region is defined %}
export AWS_DEFAULT_REGION={{ restic_repos[item.repo].aws_default_region }}
{% endif %}
{% if restic_repos[item.repo].azure_account_name is defined %}
export AZURE_ACCOUNT_NAME={{ restic_repos[item.repo].azure_account_name }}
{% endif %}
{% if restic_repos[item.repo].azure_account_key is defined %}
export AZURE_ACCOUNT_KEY={{ restic_repos[item.repo].azure_account_key }}
{% endif %}
{% if restic_repos[item.repo].azure_account_sas is defined %}
export AZURE_ACCOUNT_SAS={{ restic_repos[item.repo].azure_account_sas }}
{% endif %}
{% if restic_repos[item.repo].azure_endpoint_suffix is defined %}
export AZURE_ENDPOINT_SUFFIX={{ restic_repos[item.repo].azure_endpoint_suffix }}
{% endif %}
{% if restic_repos[item.repo].b2_account_id is defined %}
export B2_ACCOUNT_ID={{ restic_repos[item.repo].b2_account_id }}
{% endif %}