services/templates/traefik/dynamic_config.yaml.gotmpl
Dan Anglin dd339eb3d6
fix: template updates and code fixes
This commit comes after provisioning the development environment.

Changes:

- templates: template the container name.
- mage: update the deploy target to deploy to specific environments.
- compose: fix network ref.
- traefik: merge all dynamic templates into one file.
- woodpecker(dockerfile): remove commands to copy entrypoint to the
  docker container since the entrypoint has been removed.
- traefik: add support for using existing TLS certificates.
2023-08-28 04:04:40 +01:00

86 lines
2.2 KiB
Go Template

{{- 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 }}