[Feat] Server SSLs (phase 1)#1056
Open
RichardAnderson wants to merge 6 commits intovitodeploy:4.xfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces server-level SSL certificate management (CSR generation, custom cert install, and LetsEncrypt wildcard issuance) backed by queued SSH jobs, plus new web/API endpoints and UI to manage these certificates.
Changes:
- Added server SSL create/activate/deactivate/delete flows with new action classes, jobs, and websocket broadcasting.
- Extended the SSL domain model (server/domain associations, CSR metadata, wildcard/CSR flags) and updated Horizon queues/config.
- Added a new server SSL UI (Inertia/React) and OpenAPI documentation, plus new feature/unit test coverage.
Reviewed changes
Copilot reviewed 61 out of 62 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/SSH/Services/Database/GetUsersTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/SSH/Services/Database/GetDatabasesTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/SSH/Services/Database/GetCharsetsTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/Plugins/PluginTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/Plugins/LegacyPluginsTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/NotificationChannels/TelegramTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/NotificationChannels/SlackTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/NotificationChannels/EmailTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/NotificationChannels/DiscordTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/Helpers/AgentTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/DNSProviders/CloudflareTest.php | Adds RefreshDatabase for isolation. |
| tests/Unit/Actions/SSL/ParseDomainsTest.php | Adds unit coverage for CSR domain parsing helper. |
| tests/Feature/ServerSslTest.php | Adds end-to-end coverage for server SSL UI flows (CSR/custom/activate/delete/download). |
| resources/views/ssh/ssl/wildcard-prepare.blade.php | Adds certbot workspace preparation script. |
| resources/views/ssh/ssl/wildcard-cleanup-hook.blade.php | Adds certbot manual cleanup hook script. |
| resources/views/ssh/ssl/wildcard-cleanup-artifacts.blade.php | Adds cleanup for hook artifacts and certbot state files. |
| resources/views/ssh/ssl/wildcard-auth-hook.blade.php | Adds certbot manual auth hook script. |
| resources/views/ssh/ssl/delete-ssl.blade.php | Adds server-side SSL deletion script (incl. wildcard certbot delete). |
| resources/views/ssh/ssl/deactivate-ssl.blade.php | Adds server-side “deactivate” script (re-encrypt key and remove cert files). |
| resources/views/ssh/ssl/csr-config.blade.php | Adds OpenSSL config template for CSR generation. |
| resources/views/ssh/ssl/create-wildcard-ssl.blade.php | Adds certbot command template for wildcard issuance. |
| resources/views/ssh/ssl/create-csr.blade.php | Adds OpenSSL CSR generation command template. |
| resources/views/ssh/ssl/activate-ssl.blade.php | Adds activation command template (optional key decryption). |
| resources/js/types/ssl.d.ts | Extends frontend SSL type for server-level fields (CSR/wildcard/domains). |
| resources/js/pages/server-ssls/index.tsx | Adds server SSL listing page. |
| resources/js/pages/server-ssls/components/create-server-ssl.tsx | Adds sheet form to create CSR/custom/wildcard SSLs. |
| resources/js/pages/server-ssls/components/columns.tsx | Adds data table columns and actions (activate/deactivate/delete/log view). |
| resources/js/pages/server-ssls/components/activate-server-ssl.tsx | Adds activation UI for CSR (certificate/CA bundle input). |
| resources/js/layouts/server/layout.tsx | Adds “SSL” nav item in server layout. |
| public/api-docs/openapi/server-ssl.yaml | Adds OpenAPI paths for server SSL endpoints. |
| public/api-docs/openapi/schemas/SSL.yaml | Extends SSL schema for CSR data and server-level fields. |
| database/migrations/2026_03_19_195030_add_has_csr_to_ssls_table.php | Adds has_csr flag to ssls table. |
| database/migrations/2026_03_19_155628_add_is_wildcard_to_ssls_table.php | Adds is_wildcard flag to ssls table. |
| database/migrations/2026_03_19_151925_add_domain_id_to_ssls_table.php | Adds nullable domain_id foreign key to ssls table. |
| database/migrations/2026_03_19_095004_update_ssls_table_add_server_id_and_csr_data.php | Adds nullable server_id, CSR metadata columns, and relaxes nullability on legacy columns. |
| database/factories/SslFactory.php | Adds serverLevel() factory state for server SSLs. |
| config/horizon.php | Adds ssh-certbot queue/supervisor configuration. |
| config/core.php | Adds core.server_ssl_types configuration list. |
| app/Traits/BroadcastsSslEvents.php | Adds shared websocket broadcast + failure handling for SSL jobs. |
| app/Policies/SslPolicy.php | Adds server-level SSL policy methods (view/create/delete/activate). |
| app/Models/Ssl.php | Extends SSL model with server/domain relations, CSR fields, flags, casts, fillables. |
| app/Models/Server.php | Adds ssls() relationship. |
| app/Jobs/SSL/InstallCustomServerSslJob.php | Implements SSH-side installation for custom server SSL. |
| app/Jobs/SSL/DeleteServerSslJob.php | Implements SSH-side deletion for server SSLs (incl wildcard certbot delete). |
| app/Jobs/SSL/DeactivateServerSslJob.php | Implements SSH-side deactivation/revert-to-CSR behavior. |
| app/Jobs/SSL/CreateServerCsrJob.php | Implements SSH-side CSR generation and CSR path storage. |
| app/Jobs/SSL/CreateLetsEncryptWildcardSslJob.php | Implements certbot-based wildcard issuance with DNS record automation. |
| app/Jobs/SSL/ActivateServerSslJob.php | Implements SSH-side activation for CSR-based SSLs. |
| app/Http/Resources/SslResource.php | Extends SSL API resource to include server-level fields + limited CSR data. |
| app/Http/Controllers/ServerSslController.php | Adds web endpoints for listing/creating/activating/downloading/deleting server SSLs. |
| app/Http/Controllers/SSLController.php | Updates to renamed DeleteSsl action. |
| app/Http/Controllers/API/ServerSSLController.php | Adds API endpoints for server SSL management. |
| app/Http/Controllers/API/SSLController.php | Updates to renamed DeleteSsl action. |
| app/Enums/SslType.php | Adds CSR type and updates color mapping. |
| app/Actions/SSL/InstallCustomServerSsl.php | Adds action to validate/parse/install custom server SSLs. |
| app/Actions/SSL/DeleteSsl.php | Refactors delete action and adds server-level deletion job dispatch. |
| app/Actions/SSL/DeactivateServerSsl.php | Adds server SSL deactivation action. |
| app/Actions/SSL/CreateServerSsl.php | Adds server SSL “router” action to delegate to specific creators. |
| app/Actions/SSL/CreateServerCsr.php | Adds server CSR creation action + domain parsing helper. |
| app/Actions/SSL/CreateLetsEncryptWildcardSsl.php | Adds action to request wildcard SSL issuance and enqueue certbot job. |
| app/Actions/SSL/CertificateParser.php | Adds PEM parsing utility (domains + expiry extraction). |
| app/Actions/SSL/ActivateServerSsl.php | Adds CSR activation action with parsing/validation and job dispatch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
saeedvaziry
reviewed
Mar 19, 2026
saeedvaziry
reviewed
Mar 19, 2026
saeedvaziry
reviewed
Mar 19, 2026
database/migrations/2026_03_19_095004_update_ssls_table_add_server_id_and_csr_data.php
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive refactor and expansion of SSL certificate management from the server. It adds new action classes for creating, activating, deactivating, and deleting SSLs directly on servers, and introduces a new
ServerSSLControllerfor API endpoints. The changes also improve certificate parsing and validation, and update naming conventions for consistency. Below are the most important changes grouped by theme.Server-level SSL Management
CreateServerSsl,CreateServerCsr,InstallCustomServerSsl,CreateLetsEncryptWildcardSsl,ActivateServerSsl, andDeactivateServerSsl, enabling creation, installation, activation, and deactivation of SSLs directly on servers. [1] [2] [3] [4] [5] [6]ServerSSLControllerwith endpoints for listing, creating, activating, downloading, and deleting server SSLs via the API.Certificate Handling and Validation
CertificateParserclass for robust parsing of PEM certificates, extracting expiry dates and domains from SANs, with improved validation and error handling.CSR Generation
Wildcard LetsEncrypt Certificates
Deletion Logic and Naming Consistency
DeleteSSLtoDeleteSsl, and updated all references for naming consistency. Added logic for deleting server-level SSLs, including job dispatching and logging. [1] [2] [3] [4] [5] [6]Enums and Domain Modeling
CSRtype to theSslTypeenum and updated color mapping logic.Job Dispatching and Logging
ssh,ssh-certbot). [1] [2] [3] [4] [5]These changes provide a robust foundation for managing SSL certificates at the server level, with improved validation, API support, and job-based processing.