diff --git a/dockerbox.yml b/dockerbox.yml index dffbca5..fe5658f 100644 --- a/dockerbox.yml +++ b/dockerbox.yml @@ -20,7 +20,6 @@ - docker - traefik - nextcloud - - gitea - jenkins - prometheus - nginx diff --git a/roles/traefik/defaults/main.yml b/roles/traefik/defaults/main.yml index a545163..3be86b5 100644 --- a/roles/traefik/defaults/main.yml +++ b/roles/traefik/defaults/main.yml @@ -3,8 +3,10 @@ traefik_dashboard: false traefik_root: "/opt/{{ traefik_name }}" traefik_localonly: "10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8" traefik_production: false +traefik_hsts_enable: false traefik_hsts_preload: false traefik_hsts_seconds: 0 +traefik_http_redirect: false traefik_ports: - "80:80" - "443:443" diff --git a/roles/traefik/templates/security.yml.j2 b/roles/traefik/templates/security.yml.j2 index 5f6e983..35f2aa1 100644 --- a/roles/traefik/templates/security.yml.j2 +++ b/roles/traefik/templates/security.yml.j2 @@ -11,6 +11,8 @@ http: sslRedirect: true browserXssFilter: true contentTypeNosniff: true +{% if traefik_hsts_enable is defined and traefik_hsts_enable %} stsPreload: {{ traefik_hsts_preload }} stsSeconds: {{ traefik_hsts_seconds }} +{% endif %} customFrameOptionsValue: SAMEORIGIN diff --git a/roles/traefik/templates/traefik.yml.j2 b/roles/traefik/templates/traefik.yml.j2 index 4a34c0b..17f726d 100644 --- a/roles/traefik/templates/traefik.yml.j2 +++ b/roles/traefik/templates/traefik.yml.j2 @@ -10,12 +10,14 @@ providers: entrypoints: web: address: ':80' +{% if traefik_http_redirect is defined and traefik_http_redirect %} http: redirections: entrypoint: to: websecure scheme: https permanent: true +{% endif %} websecure: address: ':443' http: