File tree Expand file tree Collapse file tree 4 files changed +27
-5
lines changed
share/github-backup-utils Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ backup-secret() {
76
76
77
77
backup-secret " management console password" " manage-password" " secrets.manage"
78
78
backup-secret " password pepper" " password-pepper" " secrets.github.user-password-secrets"
79
+ backup-secret " Kredz credz HMAC key" " kredz-credz-hmac" " secrets.kredz.credz-hmac-secret"
79
80
80
81
# Backup external MySQL password if running external MySQL DB.
81
82
if is_service_external ' mysql' ; then
@@ -113,8 +114,6 @@ if ghe-ssh "$host" -- ghe-config --true app.actions.enabled; then
113
114
backup-secret " Actions Launch action runner secret" " actions-launch-action-runner-secret" " secrets.launch.action-runner-secret"
114
115
backup-secret " Actions Launch service cert" " actions-launch-azp-app-cert" " secrets.launch.azp-app-cert"
115
116
backup-secret " Actions Launch service private key" " actions-launch-app-app-private-key" " secrets.launch.azp-app-private-key"
116
-
117
- backup-secret " Kredz credz HMAC key" " kredz-credz-hmac" " secrets.kredz.credz-hmac-secret"
118
117
fi
119
118
120
119
if ghe-ssh " $host " -- " test -f $GHE_REMOTE_DATA_USER_DIR /common/idp.crt" ; then
Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ restore-secret "Actions Launch service private key" "actions-launch-app-app-priv
85
85
restore-secret " Actions Launch token oauth key" " actions-oauth-s2s-signing-key" " secrets.launch.token-oauth-key"
86
86
restore-secret " Actions Launch token oauth cert" " actions-oauth-s2s-signing-cert" " secrets.launch.token-oauth-cert"
87
87
88
- restore-secret " Kredz credz HMAC key" " kredz-credz-hmac" " secrets.kredz.credz-hmac-secret"
89
88
90
89
# Setup the database logins.
91
90
ghe_verbose " * Restoring database logins and users to $host ..."
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ restore-secret "external MySQL password" "external-mysql-password" "secrets.exte
40
40
41
41
# Restore management console password hash if present.
42
42
restore-secret " management console password" " manage-password" " secrets.manage"
43
+ restore-secret " Kredz credz HMAC key" " kredz-credz-hmac" " secrets.kredz.credz-hmac-secret"
43
44
44
45
# Restore SAML keys if present.
45
46
if [ -f " $GHE_RESTORE_SNAPSHOT_PATH /saml-keys.tar" ]; then
Original file line number Diff line number Diff line change @@ -470,6 +470,31 @@ begin_test "ghe-backup upgrades transaction backup to full if LSN chain break"
470
470
)
471
471
end_test
472
472
473
+ begin_test " ghe-backup takes backup of Kredz settings"
474
+ (
475
+ set -e
476
+
477
+ required_secrets=(
478
+ " secrets.kredz.credz-hmac-secret"
479
+ )
480
+
481
+ for secret in " ${required_secrets[@]} " ; do
482
+ ghe-ssh " $GHE_HOSTNAME " -- ghe-config " $secret " " foo"
483
+ done
484
+
485
+ ghe-backup
486
+
487
+ required_files=(
488
+ " kredz-credz-hmac"
489
+ )
490
+
491
+ for file in " ${required_files[@]} " ; do
492
+ [ " $( cat " $GHE_DATA_DIR /current/$file " ) " = " foo" ]
493
+ done
494
+
495
+ )
496
+ end_test
497
+
473
498
begin_test " ghe-backup takes backup of Actions settings"
474
499
(
475
500
set -e
@@ -507,7 +532,6 @@ begin_test "ghe-backup takes backup of Actions settings"
507
532
" secrets.launch.azp-app-cert"
508
533
" secrets.launch.azp-app-private-key"
509
534
510
- " secrets.kredz.credz-hmac-secret"
511
535
)
512
536
513
537
# these 5 were removed in later versions, so we extract them as best effort
@@ -551,7 +575,6 @@ begin_test "ghe-backup takes backup of Actions settings"
551
575
" actions-launch-azp-app-cert"
552
576
" actions-launch-app-app-private-key"
553
577
554
- " kredz-credz-hmac"
555
578
)
556
579
557
580
# Add the one optional file we included tests for
You can’t perform that action at this time.
0 commit comments