Hello, I’ve also having problems with Passbolt Traefik and Cloudflare. I’ve also seen the tutorial of Techno Tim and Christian Lempa but I can’t reach the passbolt login screen and I’m getting Bad Gateway error.
Here is my passbolt docker-compose.yaml:
version: '3'
services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
environment:
- CF_API_EMAIL=cloudflare-email
- CF_DNS_API_TOKEN=cloudflare-api-token
# - CF_API_KEY=YOUR_API_KEY
# be sure to use the correct one depending on if you are using a token or key
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/ubuntu/traefik/data/traefik.yaml:/traefik.yaml:ro
- /home/ubuntu/traefik/data/acme.json:/acme.json
- /home/ubuntu/traefik/data/config.yml:/config.yml:ro
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.traefik.entrypoints=web'
- 'traefik.http.routers.traefik.rule=Host(`traefik-dashboard-internal.home.example.com`)'
- 'traefik.http.middlewares.traefik-auth.basicauth.users=ubuntu:test'
- 'traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https'
- 'traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https'
- 'traefik.http.routers.traefik.middlewares=traefik-https-redirect'
- 'traefik.http.routers.traefik-secure.entrypoints=websecure'
- 'traefik.http.routers.traefik-secure.rule=Host(`traefik-dashboard-internal.home.example.com`)'
- 'traefik.http.routers.traefik-secure.middlewares=traefik-auth'
- 'traefik.http.routers.traefik-secure.tls=true'
- 'traefik.http.routers.traefik-secure.tls.certresolver=cloudflare'
- 'traefik.http.routers.traefik-secure.tls.domains[0].main=home.example.com'
- 'traefik.http.routers.traefik-secure.tls.domains[0].sans=*.home.example.com'
- 'traefik.http.routers.traefik-secure.service=api@internal'
networks:
proxy:
external: true
I’m using the following traefik configurations:
traefik.yaml
api:
dashboard: true
debug: true
entryPoints:
web:
address: ':80'
http:
redirections:
entryPoint:
to: websecure
scheme: https
permanent: true
websecure:
address: ':443'
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: 'unix:///var/run/docker.sock'
exposedByDefault: false
file:
filename: /config.yml
certificatesResolvers:
cloudflare:
acme:
email: mail@example.com
storage: acme.json
dnsChallenge:
provider: cloudflare
#disablePropagationCheck: true # uncomment this if you have issues pulling certificates through cloudflare, By setting this flag to true disables the need to wait for the propagation of the TXT record to all authoritative name servers.
resolvers:
- '1.1.1.1:53'
- '1.0.0.1:53'
And here my traefik configuration file with the SslHeaders from passbolt and other services:
config.yml
http:
#region routers
routers:
esxi1:
entryPoints:
- 'websecure'
rule: 'Host(`esxi1.home.example.com`)'
middlewares:
- default-headers
- https-redirectscheme
tls: {}
service: esxi1
vcenter:
entryPoints:
- 'websecure'
rule: 'Host(`vcenter.home.example.com`)'
middlewares:
- default-headers
- https-redirectscheme
tls: {}
service: vcenter
synology:
entryPoints:
- 'websecure'
rule: 'Host(`synology.home.example.com`)'
middlewares:
- default-headers
- https-redirectscheme
tls: {}
service: synology
plex:
entryPoints:
- 'websecure'
rule: 'Host(`plex.home.example.com`)'
middlewares:
- default-headers
- https-redirectscheme
tls: {}
service: plex
minio:
entryPoints:
- 'websecure'
rule: 'Host(`minio.home.example.com`)'
middlewares:
- default-headers
- https-redirectscheme
tls: {}
service: minio
# idrac:
# entryPoints:
# - 'websecure'
# rule: 'Host(`idrac.home.example.com`)'
# middlewares:
# - idrac
# - https-redirectscheme
# tls: {}
# service: idrac
# idrac-console:
# entryPoints:
# - 'idrac' # REQUIRED for iDRAC virtual console: Create a new TCP entry point in traefik on port 5900
# rule: 'Host(`idrac.home.example.com`)'
# middlewares:
# - idrac
# - https-redirectscheme
# tls: {}
# service: idrac-console
#endregion
#region services
services:
esxi1:
loadBalancer:
servers:
- url: 'https://10.1.10.16'
passHostHeader: true
vcenter:
loadBalancer:
servers:
- url: 'https://10.1.10.21'
synology:
loadBalancer:
servers:
- url: 'https://10.1.10.12'
passHostHeader: true
plex:
loadBalancer:
servers:
- url: 'https://10.1.10.105:32400'
passHostHeader: true
minio:
loadBalancer:
servers:
- url: 'https://10.1.10.12:9000'
passHostHeader: true
# idrac:
# loadBalancer:
# servers:
# - url: 'https://10.1.10.14'
# passHostHeader: true
# idrac-console:
# loadBalancer:
# servers:
# - url: 'https://10.1.10.14:5900'
# passHostHeader: true
#endregion
middlewares:
https-redirectscheme:
redirectScheme:
scheme: https
permanent: true
default-headers:
headers:
frameDeny: true
browserXssFilter: true
contentTypeNosniff: true
forceSTSHeader: true
stsIncludeSubdomains: true
stsPreload: true
stsSeconds: 15552000
customFrameOptionsValue: SAMEORIGIN
customRequestHeaders:
X-Forwarded-Proto: https
idrac:
headers:
frameDeny: true
browserXssFilter: true
forceSTSHeader: true
stsIncludeSubdomains: true
stsSeconds: 15552000
customFrameOptionsValue: SAMEORIGIN
customRequestHeaders:
X-Forwarded-Proto: https
SslHeader:
headers:
FrameDeny: true
AccessControlAllowMethods: 'GET,OPTIONS,PUT'
AccessControlAllowOriginList:
- origin-list-or-null
AccessControlMaxAge: 100
AddVaryHeader: true
BrowserXssFilter: true
ContentTypeNosniff: true
ForceSTSHeader: true
STSIncludeSubdomains: true
STSPreload: true
ContentSecurityPolicy: default-src 'self' 'unsafe-inline'
CustomFrameOptionsValue: SAMEORIGIN
ReferrerPolicy: same-origin
PermissionsPolicy: vibrate 'self'
STSSeconds: 315360000
# default-whitelist:
# ipWhiteList:
# sourceRange:
# - "10.0.0.0/8"
# - "10.1.10.0/16"
# - "172.16.0.0/12"
secured:
chain:
middlewares:
# - default-whitelist
- default-headers
I hope we can solve the issue together… but I don’t know how I can add this tls.yaml from passbolt docs:
tls.yaml
tls:
options:
default:
minVersion: VersionTLS12
sniStrict: true
curvePreferences:
- CurveP521
- CurveP384
cipherSuites:
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
can I add them to the portainer labels?
I hope somebody can help us out to close issue.
thanks
Best regards
Jonathan