encryptBackup.tsx 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import {motion} from 'framer-motion';
  2. import {IconTerminal} from 'sentry/icons';
  3. import {t} from 'sentry/locale';
  4. import testableTransition from 'sentry/utils/testableTransition';
  5. import ContinueButton from 'sentry/views/relocation/components/continueButton';
  6. import RelocationCodeBlock from 'sentry/views/relocation/components/relocationCodeBlock';
  7. import StepHeading from 'sentry/views/relocation/components/stepHeading';
  8. import Wrapper from 'sentry/views/relocation/components/wrapper';
  9. import type {StepProps} from './types';
  10. export function EncryptBackup(props: StepProps) {
  11. const code =
  12. 'SENTRY_DOCKER_IO_DIR=/path/to/key ./sentry-admin.sh \\\nexport global --encrypt-with /sentry-admin/key.pub /sentry-admin/export.tar';
  13. return (
  14. <Wrapper data-test-id="encrypt-backup">
  15. <StepHeading step={3}>
  16. {t('Create an encrypted backup of your current self-hosted instance')}
  17. </StepHeading>
  18. <motion.div
  19. transition={testableTransition()}
  20. variants={{
  21. initial: {y: 30, opacity: 0},
  22. animate: {y: 0, opacity: 1},
  23. exit: {opacity: 0},
  24. }}
  25. >
  26. <p>
  27. {t(
  28. 'You’ll need to have the public key saved in the previous step accessible when you run the following command in your terminal. Make sure your current working directory is the root of your '
  29. )}
  30. <mark>self-hosted</mark>
  31. {t('install when you execute it.')}
  32. </p>
  33. <RelocationCodeBlock
  34. dark
  35. language="bash"
  36. filename="TERMINAL"
  37. icon={<IconTerminal />}
  38. hideCopyButton={false}
  39. >
  40. {code}
  41. </RelocationCodeBlock>
  42. <p className="encrypt-help">
  43. <b>{t('Understanding the command:')}</b>
  44. </p>
  45. <p>
  46. {t('The ')}
  47. <mark>{'SENTRY_DOCKER_IO_DIR=/path/to/key/dir'}</mark>
  48. {t(
  49. 'environment variable maps the local directory where you saved your public key in the previous step to a '
  50. )}
  51. <mark>{'/sentry-admin'}</mark>
  52. {t('volume in your Docker container. ')}
  53. <mark>{'./sentry-admin.sh'}</mark>
  54. {t('is a script included by default with your ')}
  55. <mark>{'self-hosted'}</mark>
  56. {t(
  57. 'installation which contains a number of administrative tools. One of these is the'
  58. )}
  59. <mark>{'export global'}</mark>
  60. {t('command for backing up all Sentry data. ')}
  61. <mark>{'--encrypt-with /sentry-admin/key.pub'}</mark>
  62. {t('encrypts the data using our public key, and ')}
  63. <mark>{'/sentry-admin/export.tar'}</mark>
  64. {t(
  65. "is the name of the output tarball. This is what you'll upload in the next step."
  66. )}
  67. </p>
  68. <p className="encrypt-note">
  69. <i>
  70. {t('Note: Depending on your system configuration, you may need to use ')}
  71. <mark>sudo -E</mark>
  72. {t('for this command.')}
  73. </i>
  74. </p>
  75. <ContinueButton priority="primary" onClick={() => props.onComplete()} />
  76. </motion.div>
  77. </Wrapper>
  78. );
  79. }
  80. export default EncryptBackup;