mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-06 13:39:41 +01:00
docs: update backup encryption example
This commit is contained in:
@@ -1,29 +1,39 @@
|
|||||||
---
|
---
|
||||||
title: Encrypt backups using GPG
|
title: Encrypt backups
|
||||||
layout: default
|
layout: default
|
||||||
parent: How Tos
|
parent: How Tos
|
||||||
nav_order: 8
|
nav_order: 8
|
||||||
---
|
---
|
||||||
# Encrypt backup
|
# Encrypt backup
|
||||||
|
|
||||||
The image supports encrypting backups using GPG out of the box. In case a `GPG_PASSPHRASE` environment variable is set, the backup archive will be encrypted using the given key and saved as a sql.gpg file instead or sql.gz.gpg.
|
The image supports encrypting backups using one of two available methods: GPG with passphrase or GPG with a public key
|
||||||
|
|
||||||
|
## Using GPG passphrase
|
||||||
|
|
||||||
|
The image supports encrypting backups using GPG out of the box. In case a `GPG_PASSPHRASE` or `GPG_PUBLIC_KEY` environment variable is set, the backup archive will be encrypted using the given key and saved as a sql.gpg file instead or sql.gz.gpg.
|
||||||
|
|
||||||
{: .warning }
|
{: .warning }
|
||||||
To restore an encrypted backup, you need to provide the same GPG passphrase or key used during backup process.
|
To restore an encrypted backup, you need to provide the same GPG passphrase used during backup process.
|
||||||
|
|
||||||
- GPG home directory `/config/gnupg`
|
- GPG home directory `/config/gnupg`
|
||||||
- Cipher algorithm `aes256`
|
- Cipher algorithm `aes256`
|
||||||
-
|
|
||||||
To decrypt manually, you need to install `gnupg`
|
|
||||||
|
|
||||||
### Decrypt backup
|
{: .note }
|
||||||
|
The backup encrypted using `GPG passphrase` method can be restored automatically, no need to decrypt it before restoration.
|
||||||
|
|
||||||
|
|
||||||
|
To decrypt manually, you need to install `gnupg`
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
gpg --batch --passphrase "my-passphrase" \
|
gpg --batch --passphrase "my-passphrase" \
|
||||||
--output database_20240730_044201.sql.gz \
|
--output database_20240730_044201.sql.gz \
|
||||||
--decrypt database_20240730_044201.sql.gz.gpg
|
--decrypt database_20240730_044201.sql.gz.gpg
|
||||||
```
|
```
|
||||||
|
Using your private key
|
||||||
|
|
||||||
|
```shell
|
||||||
|
gpg --output database_20240730_044201.sql.gz --decrypt database_20240730_044201.sql.gz.gpg
|
||||||
|
```
|
||||||
### Backup
|
### Backup
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
|
|||||||
Reference in New Issue
Block a user