services/templates/traefik/dynamic_config.yaml.gotmpl

87 lines
2.2 KiB
Go Template
Raw Permalink Normal View History

{{- define "tlsSetup" -}}
{{- if .Traefik.GenerateAcmeCertificates }}
tls:
certResolver: resolver
{{- else }}
tls: {}
{{- end }}
{{- end -}}
---
http:
routers:
forgejo:
entryPoints:
- "https"
rule: "Host(`{{ .Forgejo.Subdomain }}.{{ .RootDomain }}`)"
service: "forgejo"
{{- template "tlsSetup" }}
gotosocial:
entryPoints:
- "https"
rule: "Host(`{{ .GoToSocial.Subdomain }}.{{ .RootDomain }}`)"
service: "gotosocial"
{{- template "tlsSetup" }}
landing:
entryPoints:
- "https"
rule: "Host(`{{ .RootDomain }}`)"
service: "landing"
{{- template "tlsSetup" }}
woodpecker:
entryPoints:
- "https"
rule: "Host(`{{ .Woodpecker.Subdomain }}.{{ .RootDomain }}`)"
service: "woodpecker"
{{- template "tlsSetup" }}
woodpecker-grpc:
entryPoints:
- "https"
rule: "Host(`{{ .Woodpecker.GrpcSubdomain }}.{{ .RootDomain }}`)"
service: "woodpecker-grpc"
{{- template "tlsSetup" }}
services:
forgejo:
loadBalancer:
servers:
- url: "http://{{ .Forgejo.ContainerIpv4Address }}:{{ .Forgejo.HttpPort }}/"
gotosocial:
loadBalancer:
servers:
- url: "http://{{ .GoToSocial.ContainerIpv4Address }}:{{ .GoToSocial.Port }}/"
landing:
loadBalancer:
servers:
- url: "http://{{ .Landing.ContainerIpv4Address }}:{{ .Landing.Port }}/"
woodpecker:
loadBalancer:
servers:
- url: "http://{{ .Woodpecker.ContainerIpv4Address }}:{{ .Woodpecker.HttpPort }}/"
woodpecker-grpc:
loadBalancer:
servers:
- url: "h2c://{{ .Woodpecker.ContainerIpv4Address }}:{{ .Woodpecker.GrpcPort }}/"
tcp:
routers:
gitSSH:
entryPoints:
- "gitSSH"
rule: "HostSNI(`*`)"
service: "gitSSH"
services:
gitSSH:
loadBalancer:
servers:
- address: "{{ .Forgejo.ContainerIpv4Address }}:{{ .Forgejo.SshPort }}"
{{- if not .Traefik.GenerateAcmeCertificates }}
tls:
stores:
default:
defaultCertificate:
certFile: {{ .Traefik.TlsContainerDirectory }}/traefik.crt
keyFile: {{ .Traefik.TlsContainerDirectory }}/traefik.key
{{- end }}