-
Notifications
You must be signed in to change notification settings - Fork 45
fix(dashmate): letsencrypt renewal and dashmate doctor fixes #3018
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
base: master
Are you sure you want to change the base?
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 📝 WalkthroughWalkthroughAdds Let's Encrypt support across certificate analysis, sample collection, and obtain/renew tasks: provider-specific error mappings, a LetsEncrypt validation path in sample collection, and initialization plus rsa2048 key handling in the obtain/renew task. Changes
Sequence Diagram(s)sequenceDiagram
participant Collector as CollectSamplesTask
participant Validator as validateLetsEncryptCertificate
participant Lego as LegoCertificate
participant Store as ctx.samples.setServiceInfo
Collector->>Validator: validateLetsEncryptCertificate(config, EXPIRATION_LIMIT_DAYS)
Validator-->>Collector: { error, data }
Collector->>Lego: obfuscate string fields in data (using Lego rules)
Collector->>Store: setServiceInfo('gateway','ssl',{ error, data })
sequenceDiagram
participant Task as obtainLetsEncryptCertificateTask
participant FS as Filesystem (dirs)
participant LegoCmd as lego CLI
participant Cert as certificate files
Task->>FS: load config (email, external IP, dirs), validate required fields
Task->>FS: create lego directories if missing
Task->>LegoCmd: run lego with args (include --key-type rsa2048)
LegoCmd-->>Cert: write certificate and key files
Task->>Task: check certificate validity / set flags (certificateValid,isRenewal)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
🤖 Fix all issues with AI agents
In `@packages/dashmate/src/doctor/analyse/analyseConfigFactory.js`:
- Around line 131-159: The two description strings for the LETSENCRYPT_ERRORS
entries use double quotes instead of single quotes; update the description
values for LETSENCRYPT_ERRORS.EMAIL_IS_NOT_SET and
LETSENCRYPT_ERRORS.CERTIFICATE_NOT_FOUND to use single-quoted plain strings
(keep all chalk`` template usages unchanged), so the LETSENCRYPT_ERRORS mapping
matches the project's single-quote style and ESLint rules.
In
`@packages/dashmate/src/listr/tasks/ssl/letsencrypt/obtainLetsEncryptCertificateTaskFactory.js`:
- Around line 79-80: The current merge using Object.assign(ctx, data) in
obtainLetsEncryptCertificateTaskFactory will overwrite pre-set ctx fields (e.g.,
ctx.email, ctx.externalIp, path fields); change the merge logic to only set
fields that are missing on ctx (e.g., for each key in data, if ctx[key] ===
undefined or null then set ctx[key] = data[key]) so existing values are
preserved, or update the comment to reflect that overwrites are intended; target
the Object.assign usage and the ctx/data merge in
obtainLetsEncryptCertificateTaskFactory.
packages/dashmate/src/listr/tasks/ssl/letsencrypt/obtainLetsEncryptCertificateTaskFactory.js
Outdated
Show resolved
Hide resolved
b29ad46 to
8009d72
Compare
Issue being fixed or feature implemented
Fixes several issues discovered during testing of the Let's Encrypt SSL provider (#3000):
What was done?
How Has This Been Tested?
Breaking Changes
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.