Skip to content

fix(ssl): Regenerate vhost after certificate request#113

Merged
nfebe merged 1 commit intomainfrom
fix/ssl-vhost-regeneration
Mar 28, 2026
Merged

fix(ssl): Regenerate vhost after certificate request#113
nfebe merged 1 commit intomainfrom
fix/ssl-vhost-regeneration

Conversation

@nfebe
Copy link
Copy Markdown
Contributor

@nfebe nfebe commented Mar 27, 2026

When requesting a certificate via POST /certificates, the vhost was not regenerated with SSL configuration. This required manually toggling SSL off/on to trigger vhost update. Now the handler enables SSL on the domain config and regenerates the vhost automatically after a successful certificate request.

@sourceant
Copy link
Copy Markdown

sourceant bot commented Mar 27, 2026

Code Review Summary

This PR fixes an issue where SSL certificates were requested but not immediately applied to the Nginx virtual host configuration. It adds an optional deployment field to the request body to facilitate automatic vhost updates.

🚀 Key Improvements

  • Automates the SSL enablement process after certificate acquisition.
  • Introduces enableSSLForDeployment for cleaner logic separation in internal/api/server.go.

💡 Minor Suggestions

  • Refactor range loop to use pointers for cleaner struct updates.

Copy link
Copy Markdown

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

When requesting a certificate via POST /certificates, the vhost was
not regenerated with SSL configuration. This required manually toggling
SSL off/on to trigger vhost update. Now accepts an optional deployment
field and directly looks up the deployment to enable SSL and regenerate
the vhost after a successful certificate request.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
@nfebe nfebe force-pushed the fix/ssl-vhost-regeneration branch from 3b490c0 to 0e6684f Compare March 28, 2026 00:04
Copy link
Copy Markdown

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

@nfebe nfebe merged commit 50f1ffb into main Mar 28, 2026
5 checks passed
@nfebe nfebe deleted the fix/ssl-vhost-regeneration branch March 28, 2026 08:05
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.

1 participant