Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3079587e0b | ||
|
|
dfe372bbbd | ||
|
|
d04dc75c81 | ||
|
|
42dc05c473 | ||
|
|
658ed34b64 | ||
|
|
900d772398 | ||
|
|
ea120dd613 | ||
|
|
7d59d4ee36 | ||
|
|
4ddf27d340 | ||
|
|
6a75d5d509 | ||
|
|
31f737bb09 | ||
|
|
d8c4d28fb0 | ||
|
|
5c59f5adc1 | ||
|
|
c212d68183 | ||
|
|
3f5db87844 | ||
|
|
9e13103e04 | ||
|
|
1896d0d3a4 | ||
|
|
b9349d3ae1 | ||
|
|
e702e01092 | ||
|
|
84ef0a54f6 | ||
|
|
5820f74282 |
9
.github/workflows/tagged-release.yml
vendored
9
.github/workflows/tagged-release.yml
vendored
@@ -5,7 +5,7 @@ name: "tagged-release"
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
tagged-release:
|
||||
@@ -13,7 +13,8 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: "marvinpinto/action-automatic-releases@v1.2.1"
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2.2.1
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
prerelease: false
|
||||
generate_release_notes: true
|
||||
make_latest: "true"
|
||||
|
||||
@@ -1 +1 @@
|
||||
FROM mysql:9.0.0
|
||||
FROM mysql:9.3.0
|
||||
|
||||
32
README.md
32
README.md
@@ -1,6 +1,6 @@
|
||||
# dokku mysql [](https://github.com/dokku/dokku-mysql/actions/workflows/ci.yml?query=branch%3Amaster) [](https://webchat.libera.chat/?channels=dokku)
|
||||
|
||||
Official mysql plugin for dokku. Currently defaults to installing [mysql 9.0.0](https://hub.docker.com/_/mysql/).
|
||||
Official mysql plugin for dokku. Currently defaults to installing [mysql 9.3.0](https://hub.docker.com/_/mysql/).
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -11,7 +11,7 @@ Official mysql plugin for dokku. Currently defaults to installing [mysql 9.0.0](
|
||||
|
||||
```shell
|
||||
# on 0.19.x+
|
||||
sudo dokku plugin:install https://github.com/dokku/dokku-mysql.git mysql
|
||||
sudo dokku plugin:install https://github.com/dokku/dokku-mysql.git --name mysql
|
||||
```
|
||||
|
||||
## Commands
|
||||
@@ -24,8 +24,10 @@ mysql:backup-deauth <service> # remove backup authenticatio
|
||||
mysql:backup-schedule <service> <schedule> <bucket-name> [--use-iam] # schedule a backup of the mysql service
|
||||
mysql:backup-schedule-cat <service> # cat the contents of the configured backup cronfile for the service
|
||||
mysql:backup-set-encryption <service> <passphrase> # set encryption for all future backups of mysql service
|
||||
mysql:backup-set-public-key-encryption <service> <public-key-id> # set GPG Public Key encryption for all future backups of mysql service
|
||||
mysql:backup-unschedule <service> # unschedule the backup of the mysql service
|
||||
mysql:backup-unset-encryption <service> # unset encryption for future backups of the mysql service
|
||||
mysql:backup-unset-public-key-encryption <service> # unset GPG Public Key encryption for future backups of the mysql service
|
||||
mysql:clone <service> <new-service> [--clone-flags...] # create container <new-name> then copy data from <name> into <new-name>
|
||||
mysql:connect <service> # connect to the service via the mysql connection tool
|
||||
mysql:create <service> [--create-flags...] # create a mysql service
|
||||
@@ -675,6 +677,19 @@ Set the GPG-compatible passphrase for encrypting backups for backups:
|
||||
dokku mysql:backup-set-encryption lollipop
|
||||
```
|
||||
|
||||
### set GPG Public Key encryption for all future backups of mysql service
|
||||
|
||||
```shell
|
||||
# usage
|
||||
dokku mysql:backup-set-public-key-encryption <service> <public-key-id>
|
||||
```
|
||||
|
||||
Set the `GPG` Public Key for encrypting backups:
|
||||
|
||||
```shell
|
||||
dokku mysql:backup-set-public-key-encryption lollipop
|
||||
```
|
||||
|
||||
### unset encryption for future backups of the mysql service
|
||||
|
||||
```shell
|
||||
@@ -688,6 +703,19 @@ Unset the `GPG` encryption passphrase for backups:
|
||||
dokku mysql:backup-unset-encryption lollipop
|
||||
```
|
||||
|
||||
### unset GPG Public Key encryption for future backups of the mysql service
|
||||
|
||||
```shell
|
||||
# usage
|
||||
dokku mysql:backup-unset-public-key-encryption <service>
|
||||
```
|
||||
|
||||
Unset the `GPG` Public Key encryption for backups:
|
||||
|
||||
```shell
|
||||
dokku mysql:backup-unset-public-key-encryption lollipop
|
||||
```
|
||||
|
||||
### schedule a backup of the mysql service
|
||||
|
||||
```shell
|
||||
|
||||
@@ -110,7 +110,7 @@ def installation_section(service, dokku_version):
|
||||
"",
|
||||
"```shell",
|
||||
f"# on {dokku_version}",
|
||||
f"sudo dokku plugin:install https://github.com/dokku/dokku-{service}.git {service}",
|
||||
f"sudo dokku plugin:install https://github.com/dokku/dokku-{service}.git --name {service}",
|
||||
"```",
|
||||
]
|
||||
)
|
||||
@@ -290,7 +290,9 @@ def usage_backup(
|
||||
"backup-deauth",
|
||||
"backup",
|
||||
"backup-set-encryption",
|
||||
"backup-set-public-key-encryption",
|
||||
"backup-unset-encryption",
|
||||
"backup-unset-public-key-encryption",
|
||||
"backup-schedule",
|
||||
"backup-schedule-cat",
|
||||
"backup-unschedule",
|
||||
|
||||
@@ -308,6 +308,10 @@ service_backup() {
|
||||
BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e ENCRYPTION_KEY=$(cat "$BACKUP_ENCRYPTION_CONFIG_ROOT/ENCRYPTION_KEY")"
|
||||
fi
|
||||
|
||||
if [[ -f "$BACKUP_ENCRYPTION_CONFIG_ROOT/ENCRYPT_WITH_PUBLIC_KEY_ID" ]]; then
|
||||
BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e ENCRYPT_WITH_PUBLIC_KEY_ID=$(cat "$BACKUP_ENCRYPTION_CONFIG_ROOT/ENCRYPT_WITH_PUBLIC_KEY_ID")"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
"$DOCKER_BIN" container run --rm $BACKUP_PARAMETERS "$PLUGIN_S3BACKUP_IMAGE"
|
||||
}
|
||||
@@ -433,6 +437,16 @@ service_backup_set_encryption() {
|
||||
echo "$ENCRYPTION_KEY" >"${SERVICE_BACKUP_ENCRYPTION_ROOT}/ENCRYPTION_KEY"
|
||||
}
|
||||
|
||||
service_backup_set_public_key_encryption() {
|
||||
declare desc="set up backup GPG Public Key encryption"
|
||||
declare SERVICE="$1" ENCRYPT_WITH_PUBLIC_KEY_ID="$2"
|
||||
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
|
||||
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/"
|
||||
|
||||
mkdir "$SERVICE_BACKUP_ENCRYPTION_ROOT"
|
||||
echo "$ENCRYPT_WITH_PUBLIC_KEY_ID" >"${SERVICE_BACKUP_ENCRYPTION_ROOT}/ENCRYPT_WITH_PUBLIC_KEY_ID"
|
||||
}
|
||||
|
||||
service_backup_unschedule() {
|
||||
declare desc="unschedule the backup of the service"
|
||||
declare SERVICE="$1"
|
||||
@@ -450,6 +464,15 @@ service_backup_unset_encryption() {
|
||||
rm -rf "$SERVICE_BACKUP_ENCRYPTION_ROOT"
|
||||
}
|
||||
|
||||
service_backup_unset_encryption() {
|
||||
declare desc="remove backup encryption"
|
||||
declare SERVICE="$1"
|
||||
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
|
||||
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/"
|
||||
|
||||
rm -rf "$SERVICE_BACKUP_ENCRYPTION_ROOT"
|
||||
}
|
||||
|
||||
service_container_rm() {
|
||||
declare desc="stop a service and remove the running container"
|
||||
declare SERVICE="$1"
|
||||
|
||||
8
config
8
config
@@ -28,9 +28,9 @@ if [[ -n $DOKKU_API_VERSION ]]; then
|
||||
export PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
|
||||
fi
|
||||
|
||||
export PLUGIN_BUSYBOX_IMAGE="busybox:1.34.1-uclibc"
|
||||
export PLUGIN_AMBASSADOR_IMAGE="dokku/ambassador:0.5.0"
|
||||
export PLUGIN_S3BACKUP_IMAGE="dokku/s3backup:0.14.0"
|
||||
export PLUGIN_WAIT_IMAGE="dokku/wait:0.6.0"
|
||||
export PLUGIN_BUSYBOX_IMAGE=${PLUGIN_BUSYBOX_IMAGE:=busybox:1.37.0-uclibc}
|
||||
export PLUGIN_AMBASSADOR_IMAGE=${PLUGIN_AMBASSADOR_IMAGE:=dokku/ambassador:0.8.2}
|
||||
export PLUGIN_S3BACKUP_IMAGE=${PLUGIN_S3BACKUP_IMAGE:=dokku/s3backup:0.18.0}
|
||||
export PLUGIN_WAIT_IMAGE=${PLUGIN_WAIT_IMAGE:=dokku/wait:0.9.3}
|
||||
|
||||
export MYSQL_CONFIG_OPTIONS=${MYSQL_CONFIG_OPTIONS:=""}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku mysql service plugin"
|
||||
version = "1.40.0"
|
||||
version = "1.42.0"
|
||||
[plugin.config]
|
||||
|
||||
25
subcommands/backup-set-public-key-encryption
Executable file
25
subcommands/backup-set-public-key-encryption
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
|
||||
|
||||
service-backup-set-public-key-encryption-cmd() {
|
||||
#E set the GPG Public Key for encrypting backups
|
||||
#E dokku $PLUGIN_COMMAND_PREFIX:backup-set-public-key-encryption lollipop
|
||||
#A service, service to run command against
|
||||
#A public-key-id, a GPG Public Key ID (or fingerprint) to use for encryption. Must be uploaded to the GPG keyserver beforehand.
|
||||
declare desc="set GPG Public Key encryption for all future backups of $PLUGIN_SERVICE service"
|
||||
local cmd="$PLUGIN_COMMAND_PREFIX:backup-set-public-key-encryption" argv=("$@")
|
||||
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||
declare SERVICE="$1" PUBLIC_KEY_ID="$2"
|
||||
is_implemented_command "$cmd" || dokku_log_fail "Not yet implemented"
|
||||
|
||||
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service"
|
||||
[[ -z "$PUBLIC_KEY_ID" ]] && dokku_log_fail "Please specify a valid GPG Public Key ID (or fingerprint)"
|
||||
verify_service_name "$SERVICE"
|
||||
service_backup_set_public_key_encryption "$SERVICE" "$PUBLIC_KEY_ID"
|
||||
}
|
||||
|
||||
service-backup-set-public-key-encryption-cmd "$@"
|
||||
23
subcommands/backup-unset-public-key-encryption
Executable file
23
subcommands/backup-unset-public-key-encryption
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
|
||||
|
||||
service-backup-unset-public-key-encryption-cmd() {
|
||||
#E unset the GPG Public Key encryption for backups
|
||||
#E dokku $PLUGIN_COMMAND_PREFIX:backup-unset-public-key-encryption lollipop
|
||||
#A service, service to run command against
|
||||
declare desc="unset GPG Public Key encryption for future backups of the $PLUGIN_SERVICE service"
|
||||
local cmd="$PLUGIN_COMMAND_PREFIX:backup-unset-public-key-encryption" argv=("$@")
|
||||
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||
declare SERVICE="$1"
|
||||
is_implemented_command "$cmd" || dokku_log_fail "Not yet implemented" # TODO: [22.03.2024 by Mykola]
|
||||
|
||||
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service"
|
||||
verify_service_name "$SERVICE"
|
||||
service_backup_unset_public_key_encryption "$SERVICE" # TODO: [22.03.2024 by Mykola]
|
||||
}
|
||||
|
||||
service-backup-unset-encryption-cmd "$@"
|
||||
Reference in New Issue
Block a user