Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS with traefik not working #47

Closed
mrvalterhugo opened this issue Jan 7, 2023 · 6 comments
Closed

TLS with traefik not working #47

mrvalterhugo opened this issue Jan 7, 2023 · 6 comments
Labels
question Further information is requested

Comments

@mrvalterhugo
Copy link

First of all, thanks for this awesome tool.

I have been playing with it, and so far, it has been great.

Non TLS mode works like a charm.

I was able to make the TLS mode work with the onconnect mode and static cert and key files.

I tried the traefik approach but I couldn't make it work.
I am able to stabilish connection on port 465 on traefik, but it does not seem to redirect to mailrise.

I am wondering if there is anything I am missing on the config file.

This is what I have used:

configs:
telegram:
urls:
- tgram://123333:3333/-33444

smtp:
auth:
basic:
user: pass

Could you please let me know if I am missing something here?

Thank You!

@YoRyan YoRyan added the question Further information is requested label Jan 7, 2023
@YoRyan
Copy link
Owner

YoRyan commented Jan 7, 2023

Could I also see your Traefik configuration? I caution that I'm not a Traefik expert, but I'll try to help.

@mrvalterhugo
Copy link
Author

This is my docker compose

version: "3.5"
services:
  mailrise:
    image: yoryan/mailrise
    container_name: mailrise
    restart: unless-stopped
    volumes:
      - ./mailrise.conf:/etc/mailrise.conf:ro
#    ports:
#      - 8025:8025
    labels:
      traefik.tcp.routers.mailrise.rule: "HostSNI(`*`)"
      traefik.tcp.routers.mailrise.tls: "true"
      traefik.tcp.routers.mailrise.tls.certresolver: "cloudflare"
      traefik.tcp.routers.mailrise.tls.domains[0].main: "mailrise.mydomain.com"
      traefik.tcp.routers.mailrise.tls.domains[0].sans: ""
      traefik.tcp.routers.mailrise.entrypoints: "mailsecure"
    networks:
      - main-network

networks:
  main-network:
    external: true
    name: main-network

@mrvalterhugo
Copy link
Author

Traefik config:

entryPoints:
  mailsecure:
    address: ":465"

@YoRyan
Copy link
Owner

YoRyan commented Jan 7, 2023

Hmm, that's pretty much what I have in the Readme sample. I used to run with this configuration, and it did work, but I no longer use it, so I'm just taking shots in the dark.

You could try accessing the Traefik dashboard to see whether your routes are set up correctly.

@mrvalterhugo
Copy link
Author

Right, I have checked the traefik dashboard and could't see the TCP service.
It seems to work after I added this label:

traefik.enable: true

It's missing from your example config. I think it might be worth adding to your example.

Appreciate your help.

@YoRyan
Copy link
Owner

YoRyan commented Jan 9, 2023

Glad to hear you worked it out!

(It's my understanding that you don't usually need that label unless you also have exposedByDefault set to false.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants