From 565ad35bf44ac01ca78a5f01ac6d0e19c487e07b Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 02:28:04 +0200 Subject: [PATCH 01/14] :sparkles: Allow for specifying the S3 Storage Class Requires that https://github.com/dokku/docker-s3backup/pull/12 be merged --- common-functions | 22 +++++++++++++++++++++- subcommands/backup-s3class | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100755 subcommands/backup-s3class diff --git a/common-functions b/common-functions index c0b316c..9c396f2 100755 --- a/common-functions +++ b/common-functions @@ -176,6 +176,7 @@ service_backup() { local BACKUP_ENCRYPTION_CONFIG_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup-encryption" local AWS_ACCESS_KEY_ID_FILE="$SERVICE_BACKUP_ROOT/AWS_ACCESS_KEY_ID" local AWS_SECRET_ACCESS_KEY_FILE="$SERVICE_BACKUP_ROOT/AWS_SECRET_ACCESS_KEY" + local S3_STORAGE_CLASS_FILE="$SERVICE_BACKUP_ROOT/S3_STORAGE_CLASS" local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" local ID="$(cat "$SERVICE_ROOT/ID")" local BACKUP_PARAMETERS="" @@ -188,6 +189,10 @@ service_backup() { dokku_log_fail "Provide AWS credentials or use the --use-iam flag" fi + if [[ -f "S3_STORAGE_CLASS_FILE" ]]; then + BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e S3_STORAGE_CLASS=$(cat "$S3_STORAGE_CLASS_FILE")" + fi + TMPDIR=$(mktemp -d --tmpdir) trap 'rm -rf "$TMPDIR" > /dev/null' RETURN INT TERM EXIT @@ -249,7 +254,22 @@ service_backup_deauth() { local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}" local SERVICE_BACKUP_ROOT="${SERVICE_ROOT}/backup/" - rm -rf "$SERVICE_BACKUP_ROOT" + rm -f "$SERVICE_BACKUP_ROOT/AWS_ACCESS_KEY_ID" + rm -f "$SERVICE_BACKUP_ROOT/AWS_SECRET_ACCESS_KEY" + rm -f "$SERVICE_BACKUP_ROOT/AWS_DEFAULT_REGION" + rm -f "$SERVICE_BACKUP_ROOT/AWS_SIGNATURE_VERSION" + rm -f "$SERVICE_BACKUP_ROOT/ENDPOINT_URL" + +} + +service_backup_s3class() { + declare desc="Sets the S3 storage class to be used for the backup" + declare SERVICE="$1" S3_STORAGE_CLASS="$2" + local SERVICE_BACKUP_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup" + + mkdir "$SERVICE_BACKUP_ROOT" + echo "$S3_STORAGE_CLASS" >"$SERVICE_BACKUP_ROOT/S3_STORAGE_CLASS" + } service_backup_schedule() { diff --git a/subcommands/backup-s3class b/subcommands/backup-s3class new file mode 100755 index 0000000..7596909 --- /dev/null +++ b/subcommands/backup-s3class @@ -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_BASE_PATH/common/functions" +source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions" + +service-backup-s3class-cmd() { + #E set the s3 storage class to Standard Infrequent Access + #E dokku $PLUGIN_COMMAND_PREFIX:backup-s3class lolipop STANDARD_IA + #A service, service to run command against + #A storage-class, an aws S3 storage class + declare desc="sets the S3 storage class to be used for backups on the $PLUGIN_SERVICE service" + local cmd="$PLUGIN_COMMAND_PREFIX:backup-s3class" argv=("$@") + [[ ${argv[0]} == "$cmd" ]] && shift 1 + declare SERVICE="$1" S3_STORAGE_CLASS="$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 "$S3_STORAGE_CLASS" ]] && dokku_log_fail "Please specify an aws S3 storage class" + [[ "$S3_STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$S3_STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." + service_backup_s3class "$SERVICE" "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "$AWS_DEFAULT_REGION" "$AWS_SIGNATURE_VERSION" "$ENDPOINT_URL" +} + +service-backup-s3class-cmd "$@" From 05da386388b97a280e08809068a08afb2e6ff505 Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 13:41:09 +0200 Subject: [PATCH 02/14] :pencil: --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e5c5302..f9df209 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ postgres:app-links # list all postgres service l postgres:backup [--use-iam] # creates a backup of the postgres service to an existing s3 bucket postgres:backup-auth # sets up authentication for backups on the postgres service postgres:backup-deauth # removes backup authentication for the postgres service +postgres:backup-s3class <-storage-class> # sets the S3 storage class to be used for backups on the postgres service postgres:backup-schedule [--use-iam] # schedules a backup of the postgres service postgres:backup-schedule-cat # cat the contents of the configured backup cronfile for the service postgres:backup-set-encryption # sets encryption for all future backups of postgres service From 347195cae8fc066ecb8eb8703470d8e472599e3c Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 17:12:31 +0200 Subject: [PATCH 03/14] :bug: --- common-functions | 4 ++-- subcommands/backup-s3class | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common-functions b/common-functions index 9c396f2..3068546 100755 --- a/common-functions +++ b/common-functions @@ -265,9 +265,9 @@ service_backup_deauth() { service_backup_s3class() { declare desc="Sets the S3 storage class to be used for the backup" declare SERVICE="$1" S3_STORAGE_CLASS="$2" - local SERVICE_BACKUP_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup" + local SERVICE_BACKUP_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup/" - mkdir "$SERVICE_BACKUP_ROOT" + mkdir -p "$SERVICE_BACKUP_ROOT" echo "$S3_STORAGE_CLASS" >"$SERVICE_BACKUP_ROOT/S3_STORAGE_CLASS" } diff --git a/subcommands/backup-s3class b/subcommands/backup-s3class index 7596909..9e3abdb 100755 --- a/subcommands/backup-s3class +++ b/subcommands/backup-s3class @@ -18,7 +18,7 @@ service-backup-s3class-cmd() { [[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service" [[ -z "$S3_STORAGE_CLASS" ]] && dokku_log_fail "Please specify an aws S3 storage class" - [[ "$S3_STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$S3_STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." + [[ ! "$S3_STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$S3_STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." service_backup_s3class "$SERVICE" "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "$AWS_DEFAULT_REGION" "$AWS_SIGNATURE_VERSION" "$ENDPOINT_URL" } From 6c09e3dbcf6506cdb24d8f23455c4111497de9ff Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 17:14:05 +0200 Subject: [PATCH 04/14] :bug: --- subcommands/backup-s3class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subcommands/backup-s3class b/subcommands/backup-s3class index 9e3abdb..3c072df 100755 --- a/subcommands/backup-s3class +++ b/subcommands/backup-s3class @@ -19,7 +19,7 @@ service-backup-s3class-cmd() { [[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service" [[ -z "$S3_STORAGE_CLASS" ]] && dokku_log_fail "Please specify an aws S3 storage class" [[ ! "$S3_STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$S3_STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." - service_backup_s3class "$SERVICE" "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "$AWS_DEFAULT_REGION" "$AWS_SIGNATURE_VERSION" "$ENDPOINT_URL" + service_backup_s3class "$SERVICE" "$S3_STORAGE_CLASS" } service-backup-s3class-cmd "$@" From 812619d08e1a63afc577a1a91db73b03403bbb25 Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 17:18:24 +0200 Subject: [PATCH 05/14] :bug: Create /backup only if it doesn't exist --- common-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-functions b/common-functions index 3068546..10020fa 100755 --- a/common-functions +++ b/common-functions @@ -231,7 +231,7 @@ service_backup_auth() { declare SERVICE="$1" AWS_ACCESS_KEY_ID="$2" AWS_SECRET_ACCESS_KEY="$3" AWS_DEFAULT_REGION="$4" AWS_SIGNATURE_VERSION="$5" ENDPOINT_URL="$6" local SERVICE_BACKUP_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup" - mkdir "$SERVICE_BACKUP_ROOT" + mkdir -p "$SERVICE_BACKUP_ROOT" echo "$AWS_ACCESS_KEY_ID" >"$SERVICE_BACKUP_ROOT/AWS_ACCESS_KEY_ID" echo "$AWS_SECRET_ACCESS_KEY" >"$SERVICE_BACKUP_ROOT/AWS_SECRET_ACCESS_KEY" From 001dff3b98c4e3b74792970ea406bf194adb40a2 Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 17:36:00 +0200 Subject: [PATCH 06/14] :arrow_up: Upgrade s3backup dependency to 11.0 --- common-functions | 2 +- config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common-functions b/common-functions index 10020fa..05f54a9 100755 --- a/common-functions +++ b/common-functions @@ -189,7 +189,7 @@ service_backup() { dokku_log_fail "Provide AWS credentials or use the --use-iam flag" fi - if [[ -f "S3_STORAGE_CLASS_FILE" ]]; then + if [[ ! -f "S3_STORAGE_CLASS_FILE" ]]; then BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e S3_STORAGE_CLASS=$(cat "$S3_STORAGE_CLASS_FILE")" fi diff --git a/config b/config index 1a2312f..719b0d9 100644 --- a/config +++ b/config @@ -28,5 +28,5 @@ fi export PLUGIN_BUSYBOX_IMAGE="busybox:1.31.1-uclibc" export PLUGIN_AMBASSADOR_IMAGE="dokku/ambassador:0.3.3" -export PLUGIN_S3BACKUP_IMAGE="dokku/s3backup:0.10.3" +export PLUGIN_S3BACKUP_IMAGE="dokku/s3backup:0.11.0" export PLUGIN_WAIT_IMAGE="dokku/wait:0.4.3" From 6b96fdd5ae2100d7c2242a27f7636ea5e9a17b43 Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 19:15:16 +0200 Subject: [PATCH 07/14] :arrow_up: Upgrade s3backup dependency to 11.1 --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index 719b0d9..9f8ce0c 100644 --- a/config +++ b/config @@ -28,5 +28,5 @@ fi export PLUGIN_BUSYBOX_IMAGE="busybox:1.31.1-uclibc" export PLUGIN_AMBASSADOR_IMAGE="dokku/ambassador:0.3.3" -export PLUGIN_S3BACKUP_IMAGE="dokku/s3backup:0.11.0" +export PLUGIN_S3BACKUP_IMAGE="dokku/s3backup:0.11.1" export PLUGIN_WAIT_IMAGE="dokku/wait:0.4.3" From 114593b884c0b715241cfcede6e90b6436b9c3b3 Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 19:20:58 +0200 Subject: [PATCH 08/14] :bug: wrong case --- common-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-functions b/common-functions index 05f54a9..10020fa 100755 --- a/common-functions +++ b/common-functions @@ -189,7 +189,7 @@ service_backup() { dokku_log_fail "Provide AWS credentials or use the --use-iam flag" fi - if [[ ! -f "S3_STORAGE_CLASS_FILE" ]]; then + if [[ -f "S3_STORAGE_CLASS_FILE" ]]; then BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e S3_STORAGE_CLASS=$(cat "$S3_STORAGE_CLASS_FILE")" fi From 3e78949e5b444453e64756411874b4235af8e07a Mon Sep 17 00:00:00 2001 From: schlepptop Date: Tue, 14 Jul 2020 19:31:13 +0200 Subject: [PATCH 09/14] :bug: Missing $ --- common-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-functions b/common-functions index 10020fa..6359da5 100755 --- a/common-functions +++ b/common-functions @@ -189,7 +189,7 @@ service_backup() { dokku_log_fail "Provide AWS credentials or use the --use-iam flag" fi - if [[ -f "S3_STORAGE_CLASS_FILE" ]]; then + if [[ -f "$S3_STORAGE_CLASS_FILE" ]]; then BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e S3_STORAGE_CLASS=$(cat "$S3_STORAGE_CLASS_FILE")" fi From a212e19306f8d40c44ab3b8d7e743fdc9a69f3ad Mon Sep 17 00:00:00 2001 From: schlepptop Date: Wed, 15 Jul 2020 02:03:57 +0200 Subject: [PATCH 10/14] :pencil: Allow for correctly generating the README.md --- README.md | 2 +- subcommands/backup-s3class | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f9df209..d76d30d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ postgres:app-links # list all postgres service l postgres:backup [--use-iam] # creates a backup of the postgres service to an existing s3 bucket postgres:backup-auth # sets up authentication for backups on the postgres service postgres:backup-deauth # removes backup authentication for the postgres service -postgres:backup-s3class <-storage-class> # sets the S3 storage class to be used for backups on the postgres service +postgres:backup-s3class # sets the S3 storage class to be used for backups on the postgres service postgres:backup-schedule [--use-iam] # schedules a backup of the postgres service postgres:backup-schedule-cat # cat the contents of the configured backup cronfile for the service postgres:backup-set-encryption # sets encryption for all future backups of postgres service diff --git a/subcommands/backup-s3class b/subcommands/backup-s3class index 3c072df..2ff56da 100755 --- a/subcommands/backup-s3class +++ b/subcommands/backup-s3class @@ -13,13 +13,13 @@ service-backup-s3class-cmd() { declare desc="sets the S3 storage class to be used for backups on the $PLUGIN_SERVICE service" local cmd="$PLUGIN_COMMAND_PREFIX:backup-s3class" argv=("$@") [[ ${argv[0]} == "$cmd" ]] && shift 1 - declare SERVICE="$1" S3_STORAGE_CLASS="$2" + declare SERVICE="$1" STORAGE_CLASS="$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 "$S3_STORAGE_CLASS" ]] && dokku_log_fail "Please specify an aws S3 storage class" - [[ ! "$S3_STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$S3_STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." - service_backup_s3class "$SERVICE" "$S3_STORAGE_CLASS" + [[ -z "$STORAGE_CLASS" ]] && dokku_log_fail "Please specify an aws S3 storage class" + [[ ! "$S3_STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." + service_backup_s3class "$SERVICE" "$STORAGE_CLASS" } service-backup-s3class-cmd "$@" From b6325b4953317d6fdce25d3314f723d48cb0d103 Mon Sep 17 00:00:00 2001 From: schlepptop Date: Wed, 15 Jul 2020 12:06:58 +0200 Subject: [PATCH 11/14] Confirm change --- subcommands/backup-s3class | 1 + 1 file changed, 1 insertion(+) diff --git a/subcommands/backup-s3class b/subcommands/backup-s3class index 2ff56da..c24cae1 100755 --- a/subcommands/backup-s3class +++ b/subcommands/backup-s3class @@ -20,6 +20,7 @@ service-backup-s3class-cmd() { [[ -z "$STORAGE_CLASS" ]] && dokku_log_fail "Please specify an aws S3 storage class" [[ ! "$S3_STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." service_backup_s3class "$SERVICE" "$STORAGE_CLASS" + echo "Set the storage class to $STORAGE_CLASS" } service-backup-s3class-cmd "$@" From 5e2662e89ced2ec9480cfc1eaa9eedd88181063f Mon Sep 17 00:00:00 2001 From: schlepptop Date: Wed, 15 Jul 2020 12:28:32 +0200 Subject: [PATCH 12/14] :recycle: Use properties system instead of /backup directory --- common-functions | 12 ++++-------- install | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/common-functions b/common-functions index 6359da5..f2a9d16 100755 --- a/common-functions +++ b/common-functions @@ -3,6 +3,7 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_AVAILABLE_PATH/config/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" docker_ports_options() { declare desc="Exports a list of exposed ports" @@ -176,7 +177,6 @@ service_backup() { local BACKUP_ENCRYPTION_CONFIG_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup-encryption" local AWS_ACCESS_KEY_ID_FILE="$SERVICE_BACKUP_ROOT/AWS_ACCESS_KEY_ID" local AWS_SECRET_ACCESS_KEY_FILE="$SERVICE_BACKUP_ROOT/AWS_SECRET_ACCESS_KEY" - local S3_STORAGE_CLASS_FILE="$SERVICE_BACKUP_ROOT/S3_STORAGE_CLASS" local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" local ID="$(cat "$SERVICE_ROOT/ID")" local BACKUP_PARAMETERS="" @@ -189,8 +189,8 @@ service_backup() { dokku_log_fail "Provide AWS credentials or use the --use-iam flag" fi - if [[ -f "$S3_STORAGE_CLASS_FILE" ]]; then - BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e S3_STORAGE_CLASS=$(cat "$S3_STORAGE_CLASS_FILE")" + if fn-plugin-property-exists "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "S3_STORAGE_CLASS"; then + BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e S3_STORAGE_CLASS=$(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "S3_STORAGE_CLASS")" fi TMPDIR=$(mktemp -d --tmpdir) @@ -265,11 +265,7 @@ service_backup_deauth() { service_backup_s3class() { declare desc="Sets the S3 storage class to be used for the backup" declare SERVICE="$1" S3_STORAGE_CLASS="$2" - local SERVICE_BACKUP_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup/" - - mkdir -p "$SERVICE_BACKUP_ROOT" - echo "$S3_STORAGE_CLASS" >"$SERVICE_BACKUP_ROOT/S3_STORAGE_CLASS" - + fn-plugin-property-write "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "S3_STORAGE_CLASS" "$S3_STORAGE_CLASS" } service_backup_schedule() { diff --git a/install b/install index 6521cc3..e0cab4a 100755 --- a/install +++ b/install @@ -25,6 +25,7 @@ plugin-install() { mkdir -p "$PLUGIN_DATA_ROOT" || echo "Failed to create $PLUGIN_SERVICE data directory" chown dokku:dokku "$PLUGIN_DATA_ROOT" + fn-plugin-property-setup "$PLUGIN_COMMAND_PREFIX" mkdir -p "$PLUGIN_CONFIG_ROOT" || echo "Failed to create $PLUGIN_SERVICE config directory" chown dokku:dokku "$PLUGIN_CONFIG_ROOT" From 1d027ba420d61748ef55503b3e448ff19d6620d5 Mon Sep 17 00:00:00 2001 From: schlepptop Date: Wed, 15 Jul 2020 12:31:54 +0200 Subject: [PATCH 13/14] :bug: --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index e0cab4a..d8238d2 100755 --- a/install +++ b/install @@ -1,5 +1,7 @@ #!/usr/bin/env bash source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" + set -eo pipefail [[ $DOKKU_TRACE ]] && set -x From b8203226357a48495e028497539cafe861f45b23 Mon Sep 17 00:00:00 2001 From: schlepptop Date: Wed, 15 Jul 2020 12:45:24 +0200 Subject: [PATCH 14/14] :bug: --- subcommands/backup-s3class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subcommands/backup-s3class b/subcommands/backup-s3class index c24cae1..780f7a1 100755 --- a/subcommands/backup-s3class +++ b/subcommands/backup-s3class @@ -18,7 +18,7 @@ service-backup-s3class-cmd() { [[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service" [[ -z "$STORAGE_CLASS" ]] && dokku_log_fail "Please specify an aws S3 storage class" - [[ ! "$S3_STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." + [[ ! "$STORAGE_CLASS" =~ ^(STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA|INTELLIGENT_TIERING|GLACIER|DEEP_ARCHIVE)$ ]] && dokku_log_fail "$STORAGE_CLASS is not a valid S3 storage class. Read https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html for more information." service_backup_s3class "$SERVICE" "$STORAGE_CLASS" echo "Set the storage class to $STORAGE_CLASS" }