encryptBackup.tsx 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 `self-hosted` install when you execute it.'
  29. )}
  30. </p>
  31. <RelocationCodeBlock
  32. dark
  33. language="bash"
  34. filename="TERMINAL"
  35. icon={<IconTerminal />}
  36. hideCopyButton={false}
  37. >
  38. {code}
  39. </RelocationCodeBlock>
  40. <p className="encrypt-help">
  41. <b>{t('Understanding the command:')}</b>
  42. </p>
  43. <p>
  44. <mark>{'SENTRY_DOCKER_IO_DIR=/path/to/key'}</mark>
  45. {t('Map local directory to ')}
  46. <mark>{'/sentry-admin'}</mark>
  47. {t('in your Docker container.')}
  48. </p>
  49. <p>
  50. <mark>{'./sentry-admin.sh'}</mark>
  51. {t(
  52. 'This is a script present in your self-hosted installation containing admin tools.'
  53. )}
  54. </p>
  55. <p>
  56. <mark>{'export global'}</mark>
  57. {t('Perform a global export of your entire self-hosted instance.')}
  58. </p>
  59. <p>
  60. <mark>{'--encrypt-with /sentry-admin/key.pub'}</mark>
  61. {t('Encrypts the export with the public key created in the last step.')}
  62. </p>
  63. <p>
  64. <mark>{'/sentry-admin/file.tar'}</mark>
  65. {t(
  66. 'Writes the export file into the same directory where the public key file is located.'
  67. )}
  68. </p>
  69. <p className="encrypt-note">
  70. <i>
  71. {t('Note: Depending on your configuration, you may need to use ')}
  72. <mark>sudo</mark>
  73. {t('for this command.')}
  74. </i>
  75. </p>
  76. <ContinueButton priority="primary" onClick={() => props.onComplete()} />
  77. </motion.div>
  78. </Wrapper>
  79. );
  80. }
  81. export default EncryptBackup;