holtwick / briefing

🔮 Secure direct video group chat
https://brie.fi/ng
GNU Affero General Public License v3.0
1.42k stars 236 forks source link

Port 24678 #141

Closed itsallinyourhead closed 1 year ago

itsallinyourhead commented 1 year ago

Grüß Gott.

After adding

    server {
        listen                          [::]:443 http2 ssl;
        listen                          443 http2 ssl;
        server_name                     briefing.example.com;

        ssl_certificate                 ../certs/chained.pem;
        ssl_certificate_key             ../certs/private.pem;
        ssl_stapling_file               ../certs/stapling.pem;

        access_log                      logs/briefing.example.com https;

        location / {
            proxy_http_version          1.1;
            proxy_pass                  http://SERVER_IP_ADDRESS:8080;
            proxy_set_header            Host $http_host;
        }
    }

to nginx configuration file and running

git clone https://github.com/holtwick/briefing.git
cd briefing
npm install
npm start
> briefing@3.1.2 start
> cross-env DEBUG=1 ZEED=* LEVEL=a zerva src/zerva/index.ts

Zerva: Building from "/usr/local/briefing/src/zerva/index.ts"
Zerva: Starting app
D|                              config |  setup +39.00ms
I|.                             config |  Dynamic config for the frontend:

window.briefingConfig = {} +175.00ms (src/zerva/config.ts:20:7)
D|                                room |  setup +227.00ms (src/zerva/room.ts:24:3)
D|                                stun |  setup {
  "udp4": true,
  "udp6": true,
  "port": 3478,
  "log": null,
  "sw": true
} +270.00ms (src/zerva/stun.ts:19:3)
I|.                         zerva:vite |  use vite undefined +313.00ms
Zerva: Vite serving from /usr/local/briefing
Zerva: Open page at http://localhost:8080

briefing.example.com is reachable with a browser and looks similar to https://brie.fi/ng. But briefing.example.com generates more than 70 requests without user interaction while https://brie.fi/ng only generates 8 requests. Also briefing.example.com repeatedly tries to to reach briefing.example.com:24678 (which permamently fails) while https://brie.fi/ng does not try reach port 24678.

lsof -i -P -n | grep LISTEN
node     2714741     root   23u  IPv6 35621359      0t0  TCP *:24678 (LISTEN)

Port 24678 is listening only for IPv6, not IPv4.

What have I done wrong?

holtwick commented 1 year ago

Moin Moin.

Please get started here https://github.com/holtwick/briefing/blob/master/docs/installation/README.md

There are some services like STUN and the signaling via Websocket, that might need special configurations. You may also use those of Briefing in the beginning and start using your own step by step then.

UPD sounds like the actual WebRTC connection. Taht should usually not go to the server, except for TURN. See docs for details.

itsallinyourhead commented 1 year ago

It works correctly with nginx now. Looks similar to your domain. If anyone is interested:

server {
    listen                          [::]:443 http2 ssl;
    listen                          443 http2 ssl;
    server_name                     briefing.example.com;

    ssl_certificate                 ../certs/chained.pem;
    ssl_certificate_key             ../certs/private.pem;
    ssl_stapling_file               ../certs/stapling.pem;

    location ~^/(favicon\.ico|robots\.txt|serviceWorker\.js)$ {
            try_files               /$uri =444;
    }
    location ~^/(css|js|pics)/ {
            try_files               /$uri =444;
    }
    location ~^/([a-z]+\-[a-z]+\-[0-9]+|)$ {
            access_log              logs/briefing.example.com https;
            error_log               logs/error;
            expires                 0;
            try_files               /$uri /index.html =444;
    }
    location /zerva-websocket {
        proxy_http_version          1.1;
        proxy_pass                  http://LOCAL_IP_ADDRESS:8080;
        proxy_set_header            Connection "upgrade";
        proxy_set_header            Host $http_host;
        proxy_set_header            Upgrade $http_upgrade;
        proxy_set_header            X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    root                            /usr/local/briefing/www;
}
git clone https://github.com/holtwick/briefing.git
cd briefing
npm install
npm run build
npm start