Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Common
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Charts
Common
Commits
a1dbf2b6
Commit
a1dbf2b6
authored
1 month ago
by
Andri Joos
Browse files
Options
Downloads
Patches
Plain Diff
add traefik redirectscheme middleware template
parent
5661eb93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/templates/_helpers.tpl
+24
-0
24 additions, 0 deletions
common/templates/_helpers.tpl
common/templates/traefik/middlewares/_redirectscheme.tpl
+5
-0
5 additions, 0 deletions
common/templates/traefik/middlewares/_redirectscheme.tpl
with
29 additions
and
0 deletions
common/templates/_helpers.tpl
+
24
−
0
View file @
a1dbf2b6
...
@@ -112,3 +112,27 @@ TLSStore
...
@@ -112,3 +112,27 @@ TLSStore
- secretName: {{ $secretName }}
- secretName: {{ $secretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{
{
/*
Middlewares
*/
}
}
{
{
/*
RedirectScheme
*/
}
}
{{- define "common.traefik.middlewares.redirectscheme.variables.spec" -}}
{{- $redirectScheme := dict }}
{{- $scheme := "https" }}
{{- $permanent := true }}
{{- if .Values.scheme }}
{{- $scheme = .Values.scheme }}
{{- end }}
{{- if hasKey .Values "permanent" }}
{{- $permanent = .Values.permanent }}
{{- end }}
{{- $redirectScheme := merge $redirectScheme (dict "scheme" $scheme) }}
{{- $redirectScheme := merge $redirectScheme (dict "permanent" $permanent) }}
{{- $spec := dict "redirectScheme" $redirectScheme }}
{{- toYaml $spec }}
{{- end }}
This diff is collapsed.
Click to expand it.
common/templates/traefik/middlewares/_redirectscheme.tpl
0 → 100644
+
5
−
0
View file @
a1dbf2b6
# https://doc.traefik.io/traefik/middlewares/overview/
{{- define "common.traefik.middlewares.redirectscheme" }}
{{ include "common.traefik.middleware" (merge $ (dict "spec" (include "common.traefik.middlewares.redirectscheme.variables.spec" . | fromYaml))) }}
---
{{- end }}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment