3v4lu8

joined 1 year ago
[–] 3v4lu8@lemmy.world 1 points 1 year ago

Hi,

I'm trying to setup a lemmy instance with docker and traefik in a machine that serve other apps, so traefik is already setup with letsencript and http to https redirect. I host also a nostr server.

The problem is that on certain operations, like a password change I get an error regarding wss.

ERROR HTTP request{http.method=GET http.scheme="wss" http.host=lemmy.x.org  http.target=/api/v3/ws ...

that is my docker-compose.xml. Can you spot where I'm wrong? Thank you for any help

version: "3.7"

services:
  lemmy-server:
    image: dessalines/lemmy:0.17.4
    restart: always
    environment:
      - RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy
_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=
info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
      - RUST_BACKTRACE=full
    volumes:
      - ./lemmy.hjson:/config/config.hjson
    depends_on:
      - db
    networks:
      - lemmy-net
      - proxy
    labels:
      - traefik.enable=true
      - traefik.http.routers.leddit-api.rule=Host(`lemmy.x.org`) && (PathPrefix(`/api`, `/pictrs`, `/feeds`, `/nodeinfo`, `/.well-known`) || Method(`POST`) || HeadersRegexp(`Accept`, `^[Aa]pplication/.*`))
      - traefik.http.routers.leddit-api.entrypoints=websecure
      - traefik.http.services.leddit-api.loadbalancer.server.port=8536
      - traefik.http.routers.leddit-api.tls=true
      - traefik.http.routers.leddit-api.tls.certresolver=lets-encrypt
      - traefik.http.routers.leddit-api.tls.domains[0].main=lemmy.x.org
      - traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https
      - traefik.http.middlewares.leddit-api.headers.customrequestheaders.Sec-WebSocket-Protocol=true

  lemmy-ui:
    image: dessalines/lemmy-ui:0.17.4
    environment:
      - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-server:8536
      - LEMMY_UI_LEMMY_EXTERNAL_HOST=lemmy.x.org
      - LEMMY_HTTPS=true
    depends_on:
      - lemmy-server
    restart: always
    networks:
      - lemmy-net
      - proxy
    labels:
      - traefik.enable=true
      - traefik.http.routers.lemmy.rule=Host(`lemmy.x.org`)
      - traefik.http.services.lemmy.loadbalancer.server.port=1234
      - traefik.http.routers.lemmy.entrypoints=websecure
      - traefik.http.routers.lemmy.tls.certresolver=lets-encrypt
      - traefik.http.routers.lemmy.tls.domains[0].main=lemmy.x.org
      - traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https
      - traefik.http.middlewares.lemmy.headers.customrequestheaders.Sec-WebSocket-Protocol=true

  db:
    image: postgres:15-alpine
    hostname: db
    environment:
      - POSTGRES_USER=lemmy
      - POSTGRES_PASSWORD=password
    volumes:
      - db:/var/lib/postgresql/data
    restart: always
    networks:
      - lemmy-net

networks:
  proxy:
    external: true
  lemmy-net:

volumes:
  db: