-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from dokku/use-gpg-public-key-encryption
feat: implement GPG Public Key encryption support
- Loading branch information
Showing
5 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "$@" |