Repository navigation
Automatic TLS certificates with set-certificate - #115
Merged
Merged
Conversation
This action is no longer used by UI. It is designed for applications only. Checking if the certificate name overlaps with HTTP routes is a required by UI only.
Change the behavior of set-certificate to obtain a TLS certificate for the specified FQDN using a Traefik router configuration, instead of modifying the default certificate configuration. The resulting certificate is now of type Automatic rather than Requested.
Since a Traefik router is defined also by set-certificate we have different types of routers to manage. - Renamed helper function read_host_names_of_traefik_routers() - Renamed variables for consistency - Added only_http_routes=True argument to set-default-certificate validator
The "lets_encrypt" boolean attribute tells if at least one of the matching certificates was obtained from Let's Encrypt.
- New set-certificate behavior - set-route parameters are optional - Fixed formatting
gsanchietti
reviewed
Oct 15, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the set-certificate action from modifying the default Traefik certificate to configuring individual Traefik routers for single-name automatic certificates. This enables obtaining Let's Encrypt certificates that are marked as "Automatic" like HTTP routes, while preserving backward compatibility.
Key changes:
- Replace default certificate modification with dedicated Traefik router configuration in
set-certificate - Add
lets_encryptflag toget-certificateresponse to indicate if a Let's Encrypt certificate exists - Update function names and logic to handle both HTTP routes and certificate routers consistently
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
imageroot/actions/set-certificate/20writeconfig |
Replaces certificate request logic with router configuration approach |
imageroot/pypkg/cert_helpers.py |
Renames function to handle both HTTP routes and certificate routers |
imageroot/actions/get-certificate/20readconfig |
Adds lets_encrypt flag to response |
imageroot/actions/set-certificate/validate-input.json |
Updates input schema to use lets_encrypt instead of check_routes |
imageroot/actions/set-certificate/validate-output.json |
Simplifies output schema for backward compatibility |
imageroot/actions/set-certificate/05check_routes |
Converts validation step to placeholder |
tests/20_traefik_certificates_api.robot |
Updates test expectations for new error handling |
imageroot/actions/list-certificates/50list_certificates |
Updates function call to renamed helper |
imageroot/actions/set-default-certificate/50set_default_certificate |
Updates function call with new parameter |
README.md |
Updates documentation to reflect new behavior and API changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Amygos
approved these changes
Oct 15, 2025
gsanchietti
approved these changes
Oct 15, 2025
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 PR propose the following changes:
set-certificatebehavior no longer alters the default Traefik certificate. It now configures a Traefik router, like HTTP routes do. This strategy allows to obtain a single-name certificate of type Automatic, like theminio1.dp.nethserver.netentry of the screenshot.get-certificatereturns alets_encryptattribute, similar toget-route. The UI can use this boolean to know if a Let's Encrypt certificate for the given FQDN exists. Useful for the toggle widget.Refs NethServer/dev#7669