Skip to content

Site updates: Regenerate domain certificate when the domain is changed - #1116

Merged
youknowriad merged 2 commits into
trunkfrom
update/fix-site-certificate-updates
Mar 25, 2025
Merged

Site updates: Regenerate domain certificate when the domain is changed#1116
youknowriad merged 2 commits into
trunkfrom
update/fix-site-certificate-updates

Conversation

@youknowriad

@youknowriad youknowriad commented Mar 24, 2025

Copy link
Copy Markdown
Contributor

Related STU-19-linear-issue

Proposed Changes

This PR fixes a couple small bugs and makes a small related refactoring:

  • Bug 1: When changing the custom domain name for a given site with HTTPs enabled, the certificate is regenerated properly for that site.
  • Bug 2: Avoid lingering certificates when sites are removed.
  • Refactoring: The logic to updates hosts file and certificates was sometimes implemented in ipc-handlers and sometimes in the server class, this moves all the logic to the server class.

Testing Instructions

  • Create a site
  • Run the server
  • Change custom domain
  • Enable/disable HTTPs
  • Rename the custom domain

On each step, the site should function properly (assuming the root certificate is trusted)

  • Also removing the site, removes the certificate from the file system.
@youknowriad
youknowriad requested review from a team and mcsf March 24, 2025 10:01
@youknowriad youknowriad self-assigned this Mar 24, 2025

@ivan-ottinger ivan-ottinger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The proposed changes look good and work as expected. 👌🏼

  • changing and renaming domain works correctly
  • disabling HTTPS or removing a site removes the related certificate from the file system
  • I did not observe any regressions
@youknowriad
youknowriad merged commit cb51e85 into trunk Mar 25, 2025
@youknowriad
youknowriad deleted the update/fix-site-certificate-updates branch March 25, 2025 11:51
@sentry

sentry Bot commented Mar 28, 2025

Copy link
Copy Markdown

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: Cannot read properties of undefined (reading 'options') T.<anonymous>(main/studio/./src/site-server) View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants