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

Self hosted foundry guide is wrong, outdated or incomplete #44

Open
Andyvec opened this issue Mar 10, 2023 · 5 comments
Open

Self hosted foundry guide is wrong, outdated or incomplete #44

Andyvec opened this issue Mar 10, 2023 · 5 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@Andyvec
Copy link

Andyvec commented Mar 10, 2023

Hi,

I'm following this guide line by line:
https://github.com/bekriebel/fvtt-module-avclient-livekit/wiki/Installing-LiveKit-on-an-Existing-Self-Hosted-Foundry-Server
But there is an issue with it.

The assumption is that you have installed foundry using the official guide, that means that your 443 port is already in use by the reverse proxy you configured there.
So when you follow this livekit on existing self-hosted foundry server guide, and you are activating the server in the last step, you get this error tcp :443: bind: address already in use. livekit-caddy-1 exited with code 1 on every start or reboot of the service.

Here you can see all process trying to listen on 443:
sudo lsof -i:443

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 961 root 14u IPv6 25349 0t0 TCP *:https (LISTEN)
nginx 961 root 15u IPv4 25350 0t0 TCP *:https (LISTEN)
nginx 962 nginx 14u IPv6 25349 0t0 TCP *:https (LISTEN)
nginx 962 nginx 15u IPv4 25350 0t0 TCP *:https (LISTEN)
nginx 963 nginx 14u IPv6 25349 0t0 TCP *:https (LISTEN)
nginx 963 nginx 15u IPv4 25350 0t0 TCP *:https (LISTEN)
nginx 964 nginx 14u IPv6 25349 0t0 TCP *:https (LISTEN)
nginx 964 nginx 15u IPv4 25350 0t0 TCP *:https (LISTEN)
nginx 965 nginx 14u IPv6 25349 0t0 TCP *:https (LISTEN)
nginx 965 nginx 15u IPv4 25350 0t0 TCP *:https (LISTEN)
livekit-s 4293 root 19u IPv4 38008 0t0 UDP *:https`

The guide should be updated.
Still, I was trying to change livekit server ports to solve it, but then I discover that the livekit Foundry plugins doesn't accept that.
Is there any way I can have both on the server, and the VTT listening the 443?

Thanks in advance for the help!

@bekriebel
Copy link
Owner

The guide in the wiki was originally developed by another use and contributed. I'm not actually sure what the best fix is, as I've never followed the guide myself.

My guess is that it's part of the TURN configuration for LiveKit that is trying to listen on 443. You could try disabling TURN in the livekit config, as it is typically not needed. The main livekit sever websocket should already be listening on a different port and be forwarded by the nginx config in the guide.

If I get the chance, I'll try to run through the steps at some point. However, if you or another user find a solution, the wiki can be updated by anyone to provide the updated information.

@bekriebel bekriebel added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Mar 10, 2023
@Andyvec
Copy link
Author

Andyvec commented Mar 13, 2023

Update: Audio and video is still working after the error message. So probably that was an unnecessary service failure, maybe the turn server

@zoidable
Copy link

zoidable commented Jul 8, 2023

Is it possible you didn't outcomment the caddy part in the docker-compose.yaml? The init script creates another one in /opt/livekit that's used by the systemd service.

@Andyvec
Copy link
Author

Andyvec commented Jul 21, 2023

Hi @zoidable, please excuse the long delay in my answer... I have turned off that server for some time.

The caddy part it is there, this is my docker-compose file:

# LiveKit requires host networking, which is only available on Linux
# This compose will not function correctly on Mac or Windows
version: "3.9"
services:
  caddy:
    image: livekit/caddyl4
    command: run --config /etc/caddy.yaml --adapter yaml
    restart: unless-stopped
    network_mode: "host"
    volumes:
      - ./caddy.yaml:/etc/caddy.yaml
      - ./caddy_data:/data
  livekit:
    image: livekit/livekit-server:latest
    command: --config /etc/livekit.yaml
    restart: unless-stopped
    network_mode: "host"
    volumes:
      - ./livekit.yaml:/etc/livekit.yaml
  redis:
    image: redis:6-alpine
    command: redis-server /etc/redis.conf
    network_mode: "host"
    volumes:
      - ./redis.conf:/etc/redis.conf

@zoidable
Copy link

For me just deleting/commenting the caddy part helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants