-
Notifications
You must be signed in to change notification settings - Fork 69
fix: Make encryption step optional #1123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| infrastructure/environments/setup-environment.ts | 3/5 | Makes disk encryption optional but breaks mandatory variable check in Ansible playbook (encrypted_disk_size always required) |
1 file reviewed, 3 comments
| if (!encryption_key_defined) { | ||
| const answers_enable_encryption = await prompts( | ||
| [ | ||
| { | ||
| name: 'enableEncryption', | ||
| type: 'confirm' as const, | ||
| message: 'Do you want to enable disk encryption?', | ||
| scope: 'ENVIRONMENT' as const, | ||
| initial: Boolean(process.env.ENABLE_ENCRYPTION) | ||
| } | ||
| ].map(questionToPrompt) | ||
| ) | ||
| enableEncryption = answers_enable_encryption.enableEncryption |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: If ENCRYPTION_KEY already exists, enableEncryption stays true but the user is never asked about disk space. This means encryption mode is inferred from the existence of ENCRYPTION_KEY rather than being explicitly controlled. Consider checking for both ENCRYPTION_KEY and DISK_SPACE to determine if encryption was previously enabled, or prompt the user for clarity.
81347cb to
4702a05
Compare
4702a05 to
5615479
Compare
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Note
Currently, we do not run e2e tests as a check on
opencrvs-countryconfig-repo PRs. Please ensure your PR doesn't break any e2e tests.One method for doing this is to open a PR with these changes to
opencrvs-farajalandas well, and see if the PR check passes there.Description
Goal of this PR is to allow users choose if they wish to go with Encrypted file system or not
Testing
Answer no choosen
Disk size question was not asked:

Encryption key was not stored into Github:

Disk size was not stored into GitHub:

Answer yes choosen
Disk size question was asked:

Variable was created:

Re-run script when both encryption key and disk size are setup
Encryption key passed from Environment variables
Checklist