Repository navigation
Control cluster-admin HTTP route with API - #82
Merged
Merged
Conversation
Redirect to path with trailing slash. This new behavior is required by /cluster-admin and /rspamd paths.
Override the automatic priority assignment rule with a custom value. Required for cluster-admin/ route.
gsanchietti
approved these changes
Feb 20, 2025
gsanchietti
left a comment
Member
There was a problem hiding this comment.
It seems good, but needs real testing to see if something is really missing
Amygos
approved these changes
Feb 20, 2025
Tbaile
approved these changes
Feb 21, 2025
Member
Author
|
Thank you for you reviews, I'm squashing the fixup commits. |
- Treat a 404 status code as still worth a retry. When Traefik is started the API endpoint is not immediately accessible. - Wait Traefik full startup with the write-hosts helper.
Implement cluster-admin/ HTTP route with set-route action as other routes.
Generate and store API_PATH near _api.yml creation.
DavidePrincipi
force-pushed
the
feat-7312
branch
from
February 21, 2025 09:46
3c3b2be to
e7d731e
Compare
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.
Manage cluster-admin/ with
set-routeaction, like routes created by modules. With this approach, cluster-admin becomes as configurable as any other HTTP route through the standard API.This PR adds to set-route (and get-route) two new (optional) attributes:
priority, required by cluster-admin to override any other ruleslash_redirect, required by cluster-admin to fix the URL path if the trailing slash is missing. E.g.http://myns8.example.org/cluster-adminis redirected to/cluster-admin/. This new feature would be useful also to other web applications (e.g. Rspamd web UI).It also fixes
write-hostshelper to wait for complete Traefik startup, retrying if the API response is 404, which is a transitory condition during Traefik startup.Refs NethServer/dev#7312
Note: I tried to call the
set-routeaction from the Traefik instance itself during create-module, but at that time roles and permissions are still unconfigured and I got a 403.