feat: add sharing between profiles

This commit is contained in:
d34dscene
2025-04-09 12:01:41 +02:00
parent 40939f3daa
commit 899d2d3638
88 changed files with 686 additions and 464 deletions
+6 -1
View File
@@ -84,6 +84,11 @@ func UpsertMiddleware(a *config.App) http.HandlerFunc {
// Ensure name has no @
params.Name = strings.Split(params.Name, "@")[0]
if params.Middleware == nil {
http.Error(w, "Missing middleware configuration", http.StatusBadRequest)
return
}
// Update configuration based on type
switch params.Protocol {
case "http":
@@ -100,7 +105,7 @@ func UpsertMiddleware(a *config.App) http.HandlerFunc {
}
err = q.UpsertTraefikConfig(r.Context(), db.UpsertTraefikConfigParams{
ProfileID: profileID,
ProfileID: existingConfig.ProfileID,
Source: source.Local,
Config: existingConfig.Config,
})