-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix(dashmate): zero ssl verification passes without being verified #2365
fix(dashmate): zero ssl verification passes without being verified #2365
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes in this pull request involve modifications to the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
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.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (2)
packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js (2)
172-181
: Consider making the server response wait time configurableThe current implementation waits up to 10 seconds (
MAX_WAIT_TIME = 10000
) for the verification server to respond before throwing an error. In some environments with slower startup times or resource constraints, the server might take longer to become responsive. Consider making the maximum wait time configurable or increasing it to enhance reliability across different environments.
205-230
: Enhance error message with actionable troubleshooting stepsWhen prompting the user to retry the domain verification, providing specific troubleshooting steps can improve the user experience. Including guidance on checking DNS settings, ensuring the external IP is correctly configured, and verifying that the verification file is accessible can help users resolve issues more efficiently.
Apply this diff to enhance the error message:
retry = await task.prompt({ type: 'toggle', header: chalk` An error occurred during verification: {red ${errorMessage}} Please ensure that: - Port 80 on your public IP address ${ctx.externalIp} is open for incoming HTTP connections. - Your firewall allows traffic on port 80. - Port forwarding for port 80 is enabled if you're using Network Address Translation (NAT). + - The verification file is accessible at ${ctx.certificate.validation.other_methods[ctx.externalIp].file_validation_url_http}. + - Your DNS records correctly point to your external IP address. `, message: 'Try again?', enabled: 'Yes', disabled: 'No', initial: true, });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
packages/dashmate/src/listr/tasks/ssl/VerificationServer.js
(3 hunks)packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js
(2 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js (3)
Learnt from: shumkov
PR: dashpay/platform#2297
File: packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js:148-150
Timestamp: 2024-11-12T14:56:12.334Z
Learning: In the `obtainZeroSSLCertificateTaskFactory` function in `packages/dashmate/src/listr/tasks/ssl/zerossl/obtainZeroSSLCertificateTaskFactory.js`, the application already fails appropriately if `configFileRepository.write(configFile)` fails, so additional error handling around this operation is unnecessary.
Learnt from: shumkov
PR: dashpay/platform#2298
File: packages/dashmate/src/listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js:74-74
Timestamp: 2024-11-12T14:56:12.334Z
Learning: In the `cleanupZeroSSLCertificatesTask` function located in `packages/dashmate/src/listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js`, the team prefers to include a small fixed delay between all requests to avoid overloading ZeroSSL, rather than implementing exponential backoff.
Learnt from: shumkov
PR: dashpay/platform#2298
File: packages/dashmate/src/listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js:27-48
Timestamp: 2024-11-12T14:56:12.334Z
Learning: In `cleanupZeroSSLCertificatesTask` located in `packages/dashmate/src/listr/tasks/ssl/zerossl/cleanupZeroSSLCertificatesTaskFactory.js`, if the certificate listing API call fails, we prefer the entire command to fail without additional error handling.
🔇 Additional comments (1)
packages/dashmate/src/listr/tasks/ssl/VerificationServer.js (1)
174-174
: Previously addressed concern about fetch timeouts
The fetch timeout (FETCH_TIMEOUT
) and interval (INTERVAL
) values have been previously discussed. Given that the verification server runs locally in a Docker container, the current values are appropriate for prompt detection of issues.
Issue being fixed or feature implemented
ZeroSSL certificate verification passes without actually verifying the certificate.
What was done?
How Has This Been Tested?
Obtain certificates on with open and close 80 port
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Bug Fixes
Documentation