ikatson / rqbit

A bittorrent client in Rust
Other
867 stars 83 forks source link

How to set listen_addr of DHT in rqbit #276

Open shirok1 opened 2 weeks ago

shirok1 commented 2 weeks ago

I want to use port mapping to expose DHT in Docker

shirok1 commented 2 weeks ago

My current workaround is to run it in host network mode, and change the listen addr so that only my Traefik reverse proxy in container can access.

services:
  rqbit:
    image: ikatson/rqbit
    network_mode: host
    # ports:
    #   - 3030:3030 # HTTP API port
    #   - 4240:4240 # TCP BitTorrent port
    environment:
      # Replace this with your LAN hostname or IP, resolvable from other devices in your LAN
      # RQBIT_UPNP_SERVER_ENABLE: "true"
      # RQBIT_UPNP_SERVER_FRIENDLY_NAME: rqbit-docker

      # Replace this if you want to change the HTTP/Web UI port
      RQBIT_HTTP_API_LISTEN_ADDR: 172.17.0.1:3030
    volumes:
      - db:/home/rqbit/db
      - cache:/home/rqbit/cache
      # Replace /tmp/scratch with your downloads folder
      - /xxx:/home/rqbit/downloads
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.rqbit.rule=Host(`rqbit.xxx`)"
      - "traefik.http.routers.rqbit.tls=true"
      - "traefik.http.services.rqbit.loadbalancer.server.port=3030"
      - "traefik.docker.network=traefik"
#     networks:
#       - traefik
# networks:
#   traefik:
#     external: true
volumes:
  db: {}
  cache: {}
ikatson commented 1 week ago

You can't at the moment, but it's an easy PR away - to set "dht_config.listen_addr" here