-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed the backup-unset-public-key-encryption command. #336
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -433,7 +433,7 @@ service_backup_set_encryption() { | |
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}" | ||
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/" | ||
|
||
mkdir "$SERVICE_BACKUP_ENCRYPTION_ROOT" | ||
mkdir -p "$SERVICE_BACKUP_ENCRYPTION_ROOT" | ||
echo "$ENCRYPTION_KEY" >"${SERVICE_BACKUP_ENCRYPTION_ROOT}/ENCRYPTION_KEY" | ||
} | ||
|
||
|
@@ -443,7 +443,7 @@ service_backup_set_public_key_encryption() { | |
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}" | ||
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/" | ||
|
||
mkdir "$SERVICE_BACKUP_ENCRYPTION_ROOT" | ||
mkdir -p "$SERVICE_BACKUP_ENCRYPTION_ROOT" | ||
echo "$ENCRYPT_WITH_PUBLIC_KEY_ID" >"${SERVICE_BACKUP_ENCRYPTION_ROOT}/ENCRYPT_WITH_PUBLIC_KEY_ID" | ||
} | ||
|
||
|
@@ -461,16 +461,16 @@ service_backup_unset_encryption() { | |
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}" | ||
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/" | ||
|
||
rm -rf "$SERVICE_BACKUP_ENCRYPTION_ROOT" | ||
rm "$SERVICE_BACKUP_ENCRYPTION_ROOT/ENCRYPTION_KEY" | ||
} | ||
|
||
service_backup_unset_encryption() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was a duplicate of the above function prior to this change. |
||
declare desc="remove backup encryption" | ||
service_backup_unset_public_key_encryption() { | ||
declare desc="remove backup GPG Public Key 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" | ||
rm "$SERVICE_BACKUP_ENCRYPTION_ROOT/ENCRYPT_WITH_PUBLIC_KEY_ID" | ||
} | ||
|
||
service_container_rm() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,11 @@ service-backup-unset-public-key-encryption-cmd() { | |
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] | ||
is_implemented_command "$cmd" || dokku_log_fail "Not yet implemented" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleaned up todos |
||
|
||
[[ -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_public_key_encryption "$SERVICE" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This wasn't pointing to an actual function and would blow up at this point prior to the above change in common-functions. |
||
} | ||
|
||
service-backup-unset-encryption-cmd "$@" | ||
service-backup-unset-public-key-encryption-cmd "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added '-p' flag to prevent this command from failing if the encryption directory already exists. This will occur after an encryption type was set and then removed.