diff --git a/templates/compose.yaml b/templates/compose.yaml index aafe356..d2fc9df 100644 --- a/templates/compose.yaml +++ b/templates/compose.yaml @@ -30,7 +30,7 @@ services: volumes: - './config/prod:/var/www/app/config/packages/prod:ro' - './var:/var/www/app/var:rw' - - '/var/logs/chill:/var/www/app/logs' + - '/var/logs/chill:/var/www/app/var/logs' - '{{ doc_storage_dir }}/{{ item['chill_environment'] }}:/var/storage' links: - redis diff --git a/templates/config/prod/framework.yaml b/templates/config/prod/framework.yaml index 2c8855e..4827806 100644 --- a/templates/config/prod/framework.yaml +++ b/templates/config/prod/framework.yaml @@ -1,3 +1,7 @@ framework: - trusted_proxies: '172.0.0.0/8' - trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port'] \ No newline at end of file + trusted_proxies: '127.0.0.1,REMOTE_ADDR{% for ip in traefik_trusted_ips|default([]) %},{{ ip }}{% endfor %}' + trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port'] + +parameters: + router.request_context.scheme: 'https' + asset.request_context.secure: true \ No newline at end of file diff --git a/templates/traefik-compose.yaml b/templates/traefik-compose.yaml index e896468..4f603c3 100644 --- a/templates/traefik-compose.yaml +++ b/templates/traefik-compose.yaml @@ -13,7 +13,11 @@ services: - "--providers.docker=true" - "--providers.docker.exposedByDefault=false" - "--entryPoints.web.address=:80" + - "--entryPoints.web.http.redirections.entrypoint.scheme=https" - "--entryPoints.websecure.address=:443" + {%+ for ip in traefik_trusted_ips|default([]) +%} + - "--entryPoints.websecure.forwardedHeaders.trustedIPs={{ ip }}" + {%+ endfor +%} {%+ for c in chills +%} {%+ if c.expose_port is not false +%} - "--entryPoints.chill{{ c.chill_environment }}.address=:{{ c.expose_port }}" @@ -35,7 +39,6 @@ services: volumes: # So that Traefik can listen to the Docker events - /var/run/docker.sock:/var/run/docker.sock - - /var/traefik/certs:/var/traefik/certs networks: - traefik