Skip to content
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

feat: persist and reuse generated https certificates #136

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Mastercuber
Copy link
Contributor

πŸ”— Linked issue

closes #132

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

In this PR a new flag (--https.reuse) is introduced to be able to reuse previosly autogenerated certificates, instead of generating them every time listhen is restarted.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

codecov bot commented Nov 5, 2023

Codecov Report

Attention: Patch coverage is 52.54237% with 28 lines in your changes are missing coverage. Please review.

Project coverage is 50.48%. Comparing base (d115045) to head (55cc0fd).
Report is 14 commits behind head on main.

Files Patch % Lines
src/_cert.ts 57.69% 22 Missing ⚠️
src/cli.ts 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
+ Coverage   49.42%   50.48%   +1.06%     
==========================================
  Files          17       17              
  Lines        1819     1844      +25     
  Branches      147      148       +1     
==========================================
+ Hits          899      931      +32     
+ Misses        915      908       -7     
  Partials        5        5              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

src/_cert.ts Outdated
const key = await fs.readFile(certificateDirectory + "cert-key.pem");
return {
cert: cert.toString("utf8"),
key: key.toString("utf8"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could perform both keys in a single JSON file. Mainly to simplify fs but also having possibility to for example have multiple generated keys cached in one read/write + having more meta

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit introduces these change

@Mastercuber Mastercuber force-pushed the persist-https-certs branch 2 times, most recently from 536868b to 73dc5be Compare November 6, 2023 18:12
@gkkirilov
Copy link

@pi0 Is there something else needed for this to get merged?

@Mastercuber Mastercuber force-pushed the persist-https-certs branch from 73dc5be to 55cc0fd Compare March 22, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: persist generated https certificates
3 participants