Skip to content

Commit

Permalink
feat: traefik v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Morriz committed Apr 3, 2024
1 parent d7a9746 commit 70754a1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion db.yml.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
versions:
traefik: v2.11
traefik: v3
crowdsec: v1.6.0

plugins:
Expand Down
2 changes: 1 addition & 1 deletion proxy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro

traefik:
image: v2.11
image: traefik:v3.0
container_name: traefik
networks:
- default
Expand Down
1 change: 1 addition & 0 deletions proxy/tpl/routers-http.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ http:
entryPoints:
- web{% if i.port != 80 %}-secure{% endif %}
rule: 'Host(`{{ i.domain }}`){% if i.path_prefix %} && PathPrefix(`{{ i.path_prefix }}`){% endif %}'
rulesyntax: v2
{%- if i.port != 80 %}
tls:
certResolver: letsencrypt
Expand Down
1 change: 1 addition & 0 deletions proxy/tpl/routers-tcp.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ tcp:
{%- else %}
rule: 'HostSNI(`*`)'
{%- endif %}
rulesyntax: v2
{%- if i.passthrough %}
tls:
passthrough: true
Expand Down
5 changes: 2 additions & 3 deletions proxy/tpl/traefik.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ entryPoints:
{%- endfor %}
{%- endfor %}

experimental:
http3: true
{%- if has_plugins %}
experimental:
plugins:
{%- if plugin_registry.crowdsec.enabled %}
{%- set p = plugin_registry.crowdsec %}
Expand All @@ -92,7 +91,7 @@ global:
sendAnonymousUsage: true

log:
level: INFO
level: DEBUG

providers:
docker:
Expand Down
7 changes: 5 additions & 2 deletions tpl/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- {{ project.name }}-{{ dep }}
{%- endfor %}
{%- endif %}
{%- if s.env %}
{%- if s.env.model_dump() | length > 0 %}
environment:
{%- for k, v in s.env %}
- '{{ k }}={{ (v ~ '').replace("'", "''") }}'
Expand All @@ -44,7 +44,10 @@ services:
- traefik.{{ router }}.routers.{{ name }}.entrypoints={% if i.hostport %}{{ Protocol(i.protocol).value }}-{{ i.hostport }}{% else %}web-secure{% endif %}
{%- if i.router != Router.udp %}
- traefik.{{ router }}.routers.{{ name }}.rule=Host{% if i.router == Router.tcp %}SNI{% endif %}(`{{ i.domain }}`){%- if i.path_prefix %} && PathPrefix(`{{ i.path_prefix }}`){%- endif %}
- traefik.{{ router }}.routers.{{ name }}.tls.certresolver=letsencrypt
- traefik.{{ router }}.routers.{{ name }}.rulesyntax=v2
{%- if i.router == Router.tcp %}
- traefik.tcp.routers.{{ name }}.tls.certresolver=letsencrypt
{%- endif %}
{%- endif %}
- traefik.{{ router }}.routers.{{ name }}.service={{ name }}
{%- if i.path_prefix and i.path_remove %}
Expand Down

0 comments on commit 70754a1

Please sign in to comment.