@@ -22,11 +22,14 @@ GHE_HOSTNAME="$1"
22
22
# us run this script directly.
23
23
: ${GHE_RESTORE_SNAPSHOT:= current}
24
24
25
+ # Path to snapshot dir we're restoring from
26
+ GHE_RESTORE_SNAPSHOT_PATH=" $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT "
27
+
25
28
port=$( ssh_port_part " $GHE_HOSTNAME " )
26
29
host=$( ssh_host_part " $GHE_HOSTNAME " )
27
30
28
31
# No need to restore anything, early exit
29
- if [ ! -d " $GHE_DATA_DIR / $GHE_RESTORE_SNAPSHOT /actions" ]; then
32
+ if [ ! -d " $GHE_RESTORE_SNAPSHOT_PATH /actions" ]; then
30
33
echo " Warning: Actions backup missing. Skipping ..."
31
34
exit 0
32
35
fi
35
38
ghe_remote_version_required " $host "
36
39
37
40
# Transfer all Actions data from the snapshot to the user data directory using rsync.
38
- ghe_verbose " * Transferring actions files to $host ..."
41
+ ghe_verbose " * Transferring Actions files to $host ..."
39
42
40
43
ghe-ssh -p " $port " " $host " -- sudo mkdir -p " $GHE_REMOTE_DATA_USER_DIR /actions"
41
44
ghe-ssh -p " $port " " $host " -- sudo chown -R actions:actions " $GHE_REMOTE_DATA_USER_DIR /actions"
42
45
43
46
ghe-rsync -arvHR --delete \
44
47
-e " ghe-ssh -p $port " \
45
48
--rsync-path=' sudo -u actions rsync' \
46
- " $GHE_DATA_DIR / $GHE_RESTORE_SNAPSHOT /actions/./" \
49
+ " $GHE_RESTORE_SNAPSHOT_PATH /actions/./" \
47
50
" $host :$GHE_REMOTE_DATA_USER_DIR /actions/" 1>&3
48
51
52
+ # Restore Actions settings.
53
+ ghe_verbose " * Restoring Actions settings to $host ..."
54
+
55
+ restore-secret " Actions configuration database login" " actions-config-db-login" " secrets.actions.ConfigurationDatabaseSqlLogin"
56
+ restore-secret " Actions configuration database password" " actions-config-db-password" " secrets.actions.ConfigurationDatabaseSqlPassword"
57
+ restore-secret " Actions framework access token key secret" " actions-framework-access-token" " secrets.actions.FrameworkAccessTokenKeySecret"
58
+ restore-secret " Actions Url signing HMAC key primary" " actions-url-signing-hmac-key-primary" " secrets.actions.UrlSigningHmacKeyPrimary"
59
+ restore-secret " Actions Url signing HMAC key secondary" " actions-url-signing-hmac-key-secondary" " secrets.actions.UrlSigningHmacKeySecondary"
60
+ restore-secret " Actions OAuth S2S signing cert" " actions-oauth-s2s-signing-cert" " secrets.actions.OAuthS2SSigningCert"
61
+ restore-secret " Actions OAuth S2S signing key" " actions-oauth-s2s-signing-key" " secrets.actions.OAuthS2SSigningKey"
62
+ restore-secret " Actions OAuth S2S signing cert thumbprint" " actions-oauth-s2s-signing-cert-thumbprint" " secrets.actions.OAuthS2SSigningCertThumbprint"
63
+ restore-secret " Actions primary encryption cert thumbprint" " actions-primary-encryption-cert-thumbprint" " secrets.actions.PrimaryEncryptionCertificateThumbprint"
64
+ restore-secret " Actions AAD cert thumbprint" " actions-aad-cert-thumbprint" " secrets.actions.AADCertThumbprint"
65
+ restore-secret " Actions delegated auth cert thumbprint" " actions-delegated-auth-cert-thumbprint" " secrets.actions.DelegatedAuthCertThumbprint"
66
+ restore-secret " Actions runtime service principal cert" " actions-runtime-service-principal-cert" " secrets.actions.RuntimeServicePrincipalCertificate"
67
+ restore-secret " Actions S2S encryption cert" " actions-s2s-encryption-cert" " secrets.actions.S2SEncryptionCertificate"
68
+ restore-secret " Actions secondary encryption cert thumbprint" " actions-secondary-encryption-cert-thumbprint" " secrets.actions.SecondaryEncryptionCertificateThumbprint"
69
+ restore-secret " Actions service principal cert" " actions-service-principal-cert" " secrets.actions.ServicePrincipalCertificate"
70
+ restore-secret " Actions SPS validation cert thumbprint" " actions-sps-validation-cert-thumbprint" " secrets.actions.SpsValidationCertThumbprint"
71
+
49
72
bm_end " $( basename $0 ) "
0 commit comments