Johni0702 / mumble-web

An HTML5 Mumble client
682 stars 151 forks source link

Build problem and mumbleweb access through external Nginx reverse proxie #147

Closed r4dh4l closed 3 years ago

r4dh4l commented 3 years ago

Hi,

I installed mumble-web (git version) and mumble-web-proxy following https://github.com/johni0702/mumble-web and https://github.com/johni0702/mumble-web-proxy.

To build and run mumble-web and mumble-web-proxy I've cerated an unprivileged user mumble-web with home directory /home/mumble-web/.

The systemd service starts but already reports some files not found:

root@vm-mumble:~# systemctl status mumble-web.service 
● mumble-web.service - Mumble web interface
   Loaded: loaded (/etc/systemd/system/mumble-web.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2021-02-16 00:27:50 CET; 1h 41min ago
     Docs: https://github.com/johni0702/mumble-web
 Main PID: 23445 (websockify)
    Tasks: 1 (limit: 529)
   Memory: 20.1M
   CGroup: /system.slice/mumble-web.service
           └─23445 /usr/bin/python2.7 /usr/bin/websockify --web=/home/mumble-web/mumble-web/dist --ssl-target localhost:64737 localhost:64738

Feb 16 00:27:50 vm-mumble websockify[23445]: WebSocket server settings:
Feb 16 00:27:50 vm-mumble websockify[23445]:   - Listen on localhost:64737
Feb 16 00:27:50 vm-mumble websockify[23445]:   - Flash security policy server
Feb 16 00:27:50 vm-mumble websockify[23445]:   - Web server. Web root: /home/mumble-web/mumble-web/dist
Feb 16 00:27:50 vm-mumble websockify[23445]:   - No SSL/TLS support (no cert file)
Feb 16 00:27:50 vm-mumble websockify[23445]:   - proxying from localhost:64737 to localhost:64738 (using SSL)
Feb 16 01:14:47 vm-mumble websockify[23445]: localhost - - [16/Feb/2021 01:14:47] code 404, message File not found
Feb 16 01:14:54 vm-mumble websockify[23445]: localhost - - [16/Feb/2021 01:14:54] code 404, message File not found
Feb 16 01:24:15 vm-mumble websockify[23445]: localhost - - [16/Feb/2021 01:24:15] code 404, message File not found
Feb 16 01:24:37 vm-mumble websockify[23445]: localhost - - [16/Feb/2021 01:24:37] code 404, message File not found
root@vm-mumble:~# 

When I try to access mumble-web via w3m http://localhost/ I get a 403 forbidded. /var/log/nginx/error.log reports:

root@vm-mumble:~# cat /var/log/nginx/error.log
2021/02/16 02:13:36 [error] 25886#25886: *1 directory index of "/home/mumble-web/mumble-web/dist/" is forbidden, client: 127.0.0.1, server: vm-mumble, request: "GET / HTTP/1.0", host: "localhost"
root@vm-mumble:~# 

The directories have the following access rights:

mumble-web@vm-mumble:~$ ls -la
total 40
drwxr-xr-x 7 mumble-web mumble-web 4096 Feb 14 21:48 .
drwxr-xr-x 5 root       root       4096 Feb 14 17:39 ..
-rw-r--r-- 1 mumble-web mumble-web  220 May 15  2017 .bash_logout
-rw-r--r-- 1 mumble-web mumble-web 3552 Feb 14 21:42 .bashrc
drwxr-xr-x 5 mumble-web mumble-web 4096 Feb 14 23:06 .cargo
drwxr-xr-x 9 mumble-web mumble-web 4096 Feb 14 17:50 mumble-web
drwxr-xr-x 5 mumble-web mumble-web 4096 Feb 14 23:06 mumble-web-proxy
drwxr-xr-x 5 mumble-web mumble-web 4096 Feb 14 17:47 .npm
-rw-r--r-- 1 mumble-web mumble-web  833 Feb 14 21:42 .profile
drwxr-xr-x 6 mumble-web mumble-web 4096 Feb 14 21:42 .rustup
mumble-web@vm-mumble:~$ ls -la mumble-web/
total 408
drwxr-xr-x   9 mumble-web mumble-web   4096 Feb 14 17:50 .
drwxr-xr-x   7 mumble-web mumble-web   4096 Feb 14 21:48 ..
drwxr-xr-x   3 mumble-web mumble-web   4096 Feb 14 17:39 app
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 16 01:17 dist
-rw-r--r--   1 mumble-web mumble-web    797 Feb 14 17:39 Dockerfile
drwxr-xr-x   8 mumble-web mumble-web   4096 Feb 14 17:39 .git
-rw-r--r--   1 mumble-web mumble-web    765 Feb 14 17:39 .gitignore
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 14 17:39 loc
drwxr-xr-x 655 mumble-web mumble-web  20480 Feb 14 17:47 node_modules
-rw-r--r--   1 mumble-web mumble-web   2073 Feb 14 17:39 package.json
-rw-r--r--   1 mumble-web mumble-web 333074 Feb 14 17:50 package-lock.json
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 14 17:39 patches
-rw-r--r--   1 mumble-web mumble-web   9145 Feb 14 17:39 README.md
drwxr-xr-x   4 mumble-web mumble-web   4096 Feb 14 17:39 themes
-rw-r--r--   1 mumble-web mumble-web   2287 Feb 14 17:39 webpack.config.js
mumble-web@vm-mumble:~$ ls -la mumble-web/dist/
total 12
drwxr-xr-x 2 mumble-web mumble-web 4096 Feb 16 01:17 .
drwxr-xr-x 9 mumble-web mumble-web 4096 Feb 14 17:50 ..
-rw-r--r-- 1 mumble-web mumble-web    0 Feb 14 17:49 3e7ea0f3c897c0d2044f.worker.js
-rw-r--r-- 1 mumble-web mumble-web    0 Feb 14 17:49 3e7ea0f3c897c0d2044f.worker.js.map
-rw-r--r-- 1 mumble-web mumble-web    0 Feb 14 17:49 4f1383918d1df79896d8.worker.js
-rw-r--r-- 1 mumble-web mumble-web    0 Feb 14 17:49 4f1383918d1df79896d8.worker.js.map
-rw-r--r-- 1 mumble-web mumble-web  426 Feb 14 17:49 config.local.js
mumble-web@vm-mumble:~$ 

Can I run mumble-web this way or did I miss something here?

Johni0702 commented 3 years ago
  1. You do not need websockify if you use mumble-web-proxy. It already does what websockify used to do (and more). The example systemd service file in the README is outdated and should use mumble-web-proxy instead: ExecStart=/path/to/mumble-web-proxy --listen-ws 64737 --server localhost:64738
  2. There should be a lot more files is the dist folder (and they shouldn't be empty), among others an index.html, which the reason nginx errors. Are you sure it built successfully?
  3. If it is not 2, then please share your nginx configuration.
r4dh4l commented 3 years ago

Thx @Johni0702 for your help. I'm somehow an "after work admin" so sorry if my replies to your answers seem a little bit uneducated:

  1. You do not need websockify if you use mumble-web-proxy. It already does what websockify used to do (and more). The example systemd service file in the README is outdated and should use mumble-web-proxy instead:

Oh, okay. I thought about an outdated README creating the systemd unit because systemd reported missing websockify but I thought installing websockify was a missing point unter preliminaries and both, preliminaries and mumble-web-proxy is needed. So okay, no websockify needed. Thank you as well for providing the updated systemd unit config which works fine:

root@vm-mumble:~# systemctl status mumble-web
● mumble-web.service - Mumble web interface
   Loaded: loaded (/etc/systemd/system/mumble-web.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2021-02-16 17:37:38 CET; 2min 29s ago
     Docs: https://github.com/johni0702/mumble-web
 Main PID: 3740 (mumble-web-prox)
    Tasks: 2 (limit: 529)
   Memory: 2.0M
   CGroup: /system.slice/mumble-web.service
           └─3740 /home/mumble-web/mumble-web-proxy/target/release/mumble-web-proxy --listen-ws 64737 --server localhost:64738

Feb 16 17:37:38 vm-mumble systemd[1]: Started Mumble web interface.
Feb 16 17:37:39 vm-mumble mumble-web-proxy[3740]: Resolving upstream address ("localhost", 64738)
Feb 16 17:37:39 vm-mumble mumble-web-proxy[3740]: Resolved upstream address: [::1]:64738
Feb 16 17:37:39 vm-mumble mumble-web-proxy[3740]: Binding to port 64737
Feb 16 17:37:39 vm-mumble mumble-web-proxy[3740]: Waiting for client connections..
root@vm-mumble:~# 

Acutally I'm writing a step by step tutorial for myself including example outputs. If you want I can provide it in the end. Maybe it is more helpful for beginners.

  1. There should be a lot more files is the dist folder (and they shouldn't be empty), among others an index.html, which the reason nginx errors. Are you sure it built successfully?

Somehow yes. Here is what I logged in my personal documentation:

useradd -m -d /home/mumble-web -s /bin/false mumble-web

su - mumble-web -s /bin/bash

git clone https://github.com/johni0702/mumble-web

cd mumble-web

mumble-web@vm-mumble:~/mumble-web$ npm install
npm WARN npm npm does not support Node.js v10.23.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
[            ......] | extract:core-js: sill extract core-js@2.6.11 extracted to /home/mumble-web/mumble-web/node_modules/.staging/core-js-affd3849 (54050[   
> node-sass@4.14.1 install /home/mumble-web/mumble-web/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-64_binding.node
Download complete  ] - :
Binary saved to /home/mumble-web/mumble-web/node_modules/node-sass/vendor/linux-x64-64/binding.node
Caching binary to /home/mumble-web/.npm/node-sass/4.14.1/linux-x64-64_binding.node

> core-js@2.6.11 postinstall /home/mumble-web/mumble-web/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> node-sass@4.14.1 postinstall /home/mumble-web/mumble-web/node_modules/node-sass
> node scripts/build.js

Binary found at /home/mumble-web/mumble-web/node_modules/node-sass/vendor/linux-x64-64/binding.node
Testing binary
Binary is fine

> mumble-web@0.5.1 postinstall /home/mumble-web/mumble-web
> patch-package

patch-package 6.2.2
Applying patches...
mumble-client-codecs-browser@1.2.0 ✔

> mumble-web@0.5.1 prepare /home/mumble-web/mumble-web
> rm -rf dist && npm run build

npm WARN npm npm does not support Node.js v10.23.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/

> mumble-web@0.5.1 build /home/mumble-web/mumble-web
> webpack && [ -f dist/config.local.js ] || cp app/config.local.js dist/

Killed
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 940 packages from 413 contributors in 580.361s
mumble-web@vm-mumble:~/mumble-web$

And here again the directory content:

mumble-web@vm-mumble:~$ ls -la
total 40
drwxr-xr-x 7 mumble-web mumble-web 4096 Feb 14 21:48 .
drwxr-xr-x 5 root       root       4096 Feb 14 17:39 ..
-rw-r--r-- 1 mumble-web mumble-web  220 May 15  2017 .bash_logout
-rw-r--r-- 1 mumble-web mumble-web 3552 Feb 14 21:42 .bashrc
drwxr-xr-x 5 mumble-web mumble-web 4096 Feb 14 23:06 .cargo
drwxr-xr-x 9 mumble-web mumble-web 4096 Feb 14 17:50 mumble-web
drwxr-xr-x 5 mumble-web mumble-web 4096 Feb 14 23:06 mumble-web-proxy
drwxr-xr-x 5 mumble-web mumble-web 4096 Feb 14 17:47 .npm
-rw-r--r-- 1 mumble-web mumble-web  833 Feb 14 21:42 .profile
drwxr-xr-x 6 mumble-web mumble-web 4096 Feb 14 21:42 .rustup
mumble-web@vm-mumble:~$ ls -la mumble-web/
total 408
drwxr-xr-x   9 mumble-web mumble-web   4096 Feb 14 17:50 .
drwxr-xr-x   7 mumble-web mumble-web   4096 Feb 14 21:48 ..
drwxr-xr-x   3 mumble-web mumble-web   4096 Feb 14 17:39 app
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 16 01:17 dist
-rw-r--r--   1 mumble-web mumble-web    797 Feb 14 17:39 Dockerfile
drwxr-xr-x   8 mumble-web mumble-web   4096 Feb 14 17:39 .git
-rw-r--r--   1 mumble-web mumble-web    765 Feb 14 17:39 .gitignore
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 14 17:39 loc
drwxr-xr-x 655 mumble-web mumble-web  20480 Feb 14 17:47 node_modules
-rw-r--r--   1 mumble-web mumble-web   2073 Feb 14 17:39 package.json
-rw-r--r--   1 mumble-web mumble-web 333074 Feb 14 17:50 package-lock.json
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 14 17:39 patches
-rw-r--r--   1 mumble-web mumble-web   9145 Feb 14 17:39 README.md
drwxr-xr-x   4 mumble-web mumble-web   4096 Feb 14 17:39 themes
-rw-r--r--   1 mumble-web mumble-web   2287 Feb 14 17:39 webpack.config.js
mumble-web@vm-mumble:~$ ls -la dist/
ls: cannot access 'dist/': No such file or directory
mumble-web@vm-mumble:~$ ls -la mumble-web/dist/
total 12
drwxr-xr-x 2 mumble-web mumble-web 4096 Feb 16 01:17 .
drwxr-xr-x 9 mumble-web mumble-web 4096 Feb 14 17:50 ..
-rw-r--r-- 1 mumble-web mumble-web    0 Feb 14 17:49 3e7ea0f3c897c0d2044f.worker.js
-rw-r--r-- 1 mumble-web mumble-web    0 Feb 14 17:49 3e7ea0f3c897c0d2044f.worker.js.map
-rw-r--r-- 1 mumble-web mumble-web    0 Feb 14 17:49 4f1383918d1df79896d8.worker.js
-rw-r--r-- 1 mumble-web mumble-web    0 Feb 14 17:49 4f1383918d1df79896d8.worker.js.map
-rw-r--r-- 1 mumble-web mumble-web  426 Feb 14 17:49 config.local.js
mumble-web@vm-mumble:~$

Is there something I misinterpreted in https://github.com/johni0702/mumble-web ?

  1. If it is not 2, then please share your nginx configuration.

(The nginx config will be another problem because my server is a home server running behind a dynamic IP addressed via a dynamic DNS address and serving several services on different virtual machines. My current way is to use a single virtual machine with Nginx as Reverse Proxy forwarding all service requests (like forwarding https://my.ddns.net/seafile/ to a virtual machine hosting the data cloud service seafile etc). But I think this is a separated problem which comes later.)

Johni0702 commented 3 years ago

Ah, no, looks like it didn't actually fully build. Notice the following lines in the log:

> webpack && [ -f dist/config.local.js ] || cp app/config.local.js dist/

Killed

I'm guessing that's webpack getting killed mid-build, presumably because you ran out of RAM or something.

r4dh4l commented 3 years ago

Oh, thx, didn't notice that. The used VM has just 512MB (because it was always enough for running mumble) so I provide more RAM for the build process.

How should I proceed? Can I just execute npm install again or should I load a snapshot I've created before starting with mumble-web?

Johni0702 commented 3 years ago

Oh, thx, didn't notice that. The used VM has just 512MB (because it was always enough for running mumble) so I provide more RAM for the build process.

Yeah, that should probably be fine for running, it's likely just the compilation process which needs more.

How should I proceed? Can I just execute npm install again or should I load a snapshot I've created before starting with mumble-web?

It should be sufficient to just do npm install again, probably even just npm run build would be enough. For your documentation it's probably better to restart though.

r4dh4l commented 3 years ago

Yeah, that should probably be fine for running, it's likely just the compilation process which needs more.

2GB worked (but I didn't something between 512MB and 2GB).

It should be sufficient to just do npm install again, probably even just npm run build would be enough. For your documentation it's probably better to restart though.

Okay, I made a startover and the compulation result is:

mumble-web@vm-mumble:~/mumble-web$ ls -la
total 412
drwxr-xr-x   9 mumble-web mumble-web   4096 Feb 17 18:44 .
drwxr-xr-x   7 mumble-web mumble-web   4096 Feb 17 18:38 ..
drwxr-xr-x   3 mumble-web mumble-web   4096 Feb 17 18:37 app
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 17 18:44 dist
-rw-r--r--   1 mumble-web mumble-web    797 Feb 17 18:37 Dockerfile
drwxr-xr-x   8 mumble-web mumble-web   4096 Feb 17 18:37 .git
-rw-r--r--   1 mumble-web mumble-web    765 Feb 17 18:37 .gitignore
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 17 18:37 loc
drwxr-xr-x 655 mumble-web mumble-web  20480 Feb 17 18:43 node_modules
-rw-r--r--   1 mumble-web mumble-web   2073 Feb 17 18:37 package.json
-rw-r--r--   1 mumble-web mumble-web 333074 Feb 17 18:44 package-lock.json
drwxr-xr-x   2 mumble-web mumble-web   4096 Feb 17 18:37 patches
-rw-r--r--   1 mumble-web mumble-web   9145 Feb 17 18:37 README.md
drwxr-xr-x   4 mumble-web mumble-web   4096 Feb 17 18:37 themes
-rw-r--r--   1 mumble-web mumble-web   2287 Feb 17 18:37 webpack.config.js

mumble-web@vm-mumble:~/mumble-web$ ls -la dist/
total 28292
drwxr-xr-x 2 mumble-web mumble-web    4096 Feb 17 18:44 .
drwxr-xr-x 9 mumble-web mumble-web    4096 Feb 17 18:44 ..
-rw-r--r-- 1 mumble-web mumble-web    1463 Feb 17 18:44 00fd86fe12871b707998bf7214820fdd.svg
-rw-r--r-- 1 mumble-web mumble-web     988 Feb 17 18:44 077f1c5bd335be073c48c340b01f58bc.svg
-rw-r--r-- 1 mumble-web mumble-web 8362176 Feb 17 18:44 0ad307aafedd7fe4951f.worker.js
-rw-r--r-- 1 mumble-web mumble-web 8707358 Feb 17 18:44 0ad307aafedd7fe4951f.worker.js.map
-rw-r--r-- 1 mumble-web mumble-web    1539 Feb 17 18:44 0ce7650c4d5a52a5323868f75588e1c7.svg
-rw-r--r-- 1 mumble-web mumble-web    3018 Feb 17 18:44 14de2daf58adaa3eb1ee.js
-rw-r--r-- 1 mumble-web mumble-web     103 Feb 17 18:44 14de2daf58adaa3eb1ee.js.map
-rw-r--r-- 1 mumble-web mumble-web    2771 Feb 17 18:44 18e00168e2eeff800227594e26818681.svg
-rw-r--r-- 1 mumble-web mumble-web    1870 Feb 17 18:44 195ad531e2d729dbb80bb4524be18d78.png
-rw-r--r-- 1 mumble-web mumble-web    2273 Feb 17 18:44 22ecf0ecde1ae2a6281265174b7fa355.svg
-rw-r--r-- 1 mumble-web mumble-web     619 Feb 17 18:44 22f60ac9b9d2e752cb1a.js
-rw-r--r-- 1 mumble-web mumble-web     103 Feb 17 18:44 22f60ac9b9d2e752cb1a.js.map
-rw-r--r-- 1 mumble-web mumble-web    1295 Feb 17 18:44 296b612d2847da52749549f73d0c3664.svg
-rw-r--r-- 1 mumble-web mumble-web    1260 Feb 17 18:44 32785c1d21b0050be9168487542b8c3d.svg
-rw-r--r-- 1 mumble-web mumble-web 1350306 Feb 17 18:44 3e7ea0f3c897c0d2044f.worker.js
-rw-r--r-- 1 mumble-web mumble-web 1380639 Feb 17 18:44 3e7ea0f3c897c0d2044f.worker.js.map
-rw-r--r-- 1 mumble-web mumble-web 1352467 Feb 17 18:44 4f1383918d1df79896d8.worker.js
-rw-r--r-- 1 mumble-web mumble-web 1382964 Feb 17 18:44 4f1383918d1df79896d8.worker.js.map
-rw-r--r-- 1 mumble-web mumble-web    2403 Feb 17 18:44 50dddae19e7bf601b168f46a1303674b.svg
-rw-r--r-- 1 mumble-web mumble-web     595 Feb 17 18:44 590b7640425a352bfe75.js
-rw-r--r-- 1 mumble-web mumble-web     103 Feb 17 18:44 590b7640425a352bfe75.js.map
-rw-r--r-- 1 mumble-web mumble-web   14901 Feb 17 18:44 5b70c2cbbd6e9258a632c70b03381627.png
-rw-r--r-- 1 mumble-web mumble-web    2886 Feb 17 18:44 66d88f09352531bde81c.js
-rw-r--r-- 1 mumble-web mumble-web     103 Feb 17 18:44 66d88f09352531bde81c.js.map
-rw-r--r-- 1 mumble-web mumble-web     603 Feb 17 18:44 6d73bb785aa06bf0c436ad6f7cc6262a.svg
-rw-r--r-- 1 mumble-web mumble-web    1025 Feb 17 18:44 71edeaefdc2f5a19dc84298669af6962.svg
-rw-r--r-- 1 mumble-web mumble-web    1093 Feb 17 18:44 7b86c879d50808c66816ed3338f26557.svg
-rw-r--r-- 1 mumble-web mumble-web     533 Feb 17 18:44 7dd33815bcb23cf9a0cd851c2145e169.css
-rw-r--r-- 1 mumble-web mumble-web   15086 Feb 17 18:44 7e20ba1e3b8980a164c5f557a0470919.ico
-rw-r--r-- 1 mumble-web mumble-web   42054 Feb 17 18:44 80250154041d2e9f6d50a91181409f21.png
-rw-r--r-- 1 mumble-web mumble-web    1020 Feb 17 18:44 82747b4bbd0cfe92292f74cd27f2763e.svg
-rw-r--r-- 1 mumble-web mumble-web    1397 Feb 17 18:44 86d4f1d7547270ff26f08a9271e7edcb.svg
-rw-r--r-- 1 mumble-web mumble-web    1407 Feb 17 18:44 8f75583a16890ab851fc3f121fc63f89.svg
-rw-r--r-- 1 mumble-web mumble-web    1467 Feb 17 18:44 9171288d67adc4805412883901d2f180.svg
-rw-r--r-- 1 mumble-web mumble-web     525 Feb 17 18:44 972a0ac8cf8526580a216210a364cc60.svg
-rw-r--r-- 1 mumble-web mumble-web     800 Feb 17 18:44 9ae3dac014f51d714254cf522602cec0.svg
-rw-r--r-- 1 mumble-web mumble-web     530 Feb 17 18:44 9cda20ca6e5077b6999771c9a8a3cec5.css
-rw-r--r-- 1 mumble-web mumble-web    1263 Feb 17 18:44 a65db861eecb8dcc62ad70fec489da3f.svg
-rw-r--r-- 1 mumble-web mumble-web     415 Feb 17 18:44 b78ed441778f2e4ce1201a75af76594e.svg
-rw-r--r-- 1 mumble-web mumble-web    3137 Feb 17 18:44 cae715f31f2b11394cad.js
-rw-r--r-- 1 mumble-web mumble-web     103 Feb 17 18:44 cae715f31f2b11394cad.js.map
-rw-r--r-- 1 mumble-web mumble-web    1047 Feb 17 18:44 cf02aba975e911ef9823610d908b32f5.png
-rw-r--r-- 1 mumble-web mumble-web    5627 Feb 17 18:44 config.js
-rw-r--r-- 1 mumble-web mumble-web    5666 Feb 17 18:44 config.js.map
-rw-r--r-- 1 mumble-web mumble-web     426 Feb 17 18:44 config.local.js
-rw-r--r-- 1 mumble-web mumble-web     536 Feb 17 18:44 d57d3d2918d0b72f0c24e9dc162c6c4a.svg
-rw-r--r-- 1 mumble-web mumble-web    1266 Feb 17 18:44 d5ba30b381ebc262ba3871eaed9d7102.svg
-rw-r--r-- 1 mumble-web mumble-web    1174 Feb 17 18:44 dbd9efebc73f884c5039cc3192a65dd8.svg
-rw-r--r-- 1 mumble-web mumble-web    1165 Feb 17 18:44 e0c171776518ab302b54ccc71e59a582.svg
-rw-r--r-- 1 mumble-web mumble-web     302 Feb 17 18:44 e72996a6d1ed5d1d7962c27c10c08fa6.json
-rw-r--r-- 1 mumble-web mumble-web    9919 Feb 17 18:44 e809fc9b5b9b89f1069def2574cea41d.css
-rw-r--r-- 1 mumble-web mumble-web    1132 Feb 17 18:44 ec4d8b884ac39ef8494fb4aca6c6069f.svg
-rw-r--r-- 1 mumble-web mumble-web   14250 Feb 17 18:44 ee7a19054eb87597c4b8e4664823ebfd.png
-rw-r--r-- 1 mumble-web mumble-web    9964 Feb 17 18:44 f04d8b0d6164403444eae8f080f0d70b.css
-rw-r--r-- 1 mumble-web mumble-web     800 Feb 17 18:44 f2fc230fc7d9a9b8f6f03d342f6e94b2.svg
-rw-r--r-- 1 mumble-web mumble-web    1499 Feb 17 18:44 f54b0be1d559b03ad8d945e988ec8ed4.svg
-rw-r--r-- 1 mumble-web mumble-web   31341 Feb 17 18:44 index.html
-rw-r--r-- 1 mumble-web mumble-web 2808713 Feb 17 18:44 index.js
-rw-r--r-- 1 mumble-web mumble-web 3110023 Feb 17 18:44 index.js.map
-rw-r--r-- 1 mumble-web mumble-web    8494 Feb 17 18:44 matrix.js
-rw-r--r-- 1 mumble-web mumble-web    7455 Feb 17 18:44 matrix.js.map
-rw-r--r-- 1 mumble-web mumble-web   59398 Feb 17 18:44 theme.js
-rw-r--r-- 1 mumble-web mumble-web   63653 Feb 17 18:44 theme.js.map
mumble-web@vm-mumble:~/mumble-web$

Now w3m http://localhost/ shows something I expected, but a first teast with Firefox within my LAN via http://vm-mumble/ ended up in

Failed to initialize user media Refresh page to retry. TypeError: window.navigator.mediaDevices is undefined

/var/log/nginx/error.log says:

root@vm-mumble:~# tail /var/log/nginx/error.log
2021/02/21 02:25:43 [error] 7196#7196: *1 "/home/mumble-web/mumble-web/dist/mumble-web/index.html" is not found (2: No such file or directory), client: 192.168.1.126, server: vm-mumble, request: "GET /mumble-web/ HTTP/1.0", host: "vm-mumble"

The mumble-web before index.html is too much, isn't it? But where is it defined?

As Nginx config I used:

server {
        listen 80;
        server_name vm-mumble;

        location / {
                root /home/mumble-web/mumble-web/dist;
        }
        location /demo {
                proxy_pass http://localhost:64737;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
        }
}

map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
}

And btw: Why the second location is called /demo?

(Just to explai why I use port 80 here: I have a spearated Nginx reverse proxy for SSL but this would be the last step in my "chain".)

Johni0702 commented 3 years ago

Failed to initialize user media Refresh page to retry. TypeError: window.navigator.mediaDevices is undefined

That's expected if you access it via http://vm-mumble/. Microphone access in browsers is restricted to https or localhost sites.

And btw: Why the second location is called /demo?

First location just serves the website itself, second location forwards websocket connections to mumble-web-proxy. That's the same demo as in the port field when connecting: https://voice.johni0702.de/?address=voice.johni0702.de&port=443/demo (cause the address and port internally get combined to wss://voice.johni0702.de:443/demo, hence hitting the /demo location; note that this requires https as well).

The mumble-web before index.html is too much, isn't it? But where is it defined?

No clue. Might want to check your browser to see which URLs it wants to access and for what reason. Though if you get to the above Failed to initialize user media error, your browser shouldn't be missing any html files, so could also just ignore it unless another issue pops up.

r4dh4l commented 3 years ago

Thanks for your help understanding what I'm doing.

First location just serves the website itself, second location forwards websocket connections to mumble-web-proxy. That's the same demo as in the port field when connecting: https://voice.johni0702.de/?address=voice.johni0702.de&port=443/demo (cause the address and port internally get combined to wss://voice.johni0702.de:443/demo, hence hitting the /demo location; note that this requires https as well).

Got it (I think), but is there a certain reason why it is called "demo"? Does it have to be called "demo" for some reason or could I name it mumblewebproxy (/mwp) as well?

That's expected if you access it via http://vm-mumble/ . Microphone access in browsers is restricted to https or localhost sites.

TLDR: The following part is just a documentation of what I did today because it maybe will help others not falling into similar pitfalls (if using dynamic DNS setups with multiple services) - it contains no request.

Okay. Here it comes to the problem I've mentioned at the end of https://github.com/Johni0702/mumble-web/issues/147#issuecomment-779982774: Because I have just one external (dynamic) IP I have to serve all the services (running on my home server on separated VMs) via my.ddns.net/servicename/. So my infrastructure looks like this:

So my current setup works like this:

[internet]
⇅ (via `my.ddns.net`)
[router]
⇅
[Hypervisor
    [VM-ReverseProxy (nginx)]↔[LetsEncrypt]
    ⇅ (unencrypted)
    [VM-Mumble
        [nginx]
        ⇅
        [MumbleWebProxy]
        ⇅
        [MumbleWeb]
        ⇅
        [Mumble]
    ]
]

To link the VM-ReverseProxy to VM-Mumble I tried this:

location /mumble-web {
        proxy_pass http://vm-mumble;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
        }

Opening https://my.ddns.net/mumble-web/ ends up in

404 Not Found nginx/1.14.2

Vm-ReverseProxy says (first point in the mentioned "nginx chain"):

root@vm-revproxy~:~# cat /var/log/nginx/access.log | grep mumble-web
192.168.1.1 - - [22/Feb/2021:23:36:34 +0100] "GET /mumble-web/ HTTP/2.0" 404 132 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
root@vm-revproxy:~# cat /var/log/nginx/error.log | grep mumble-web
root@vm-revproxy:~# 

Vm-ReverseProxy says:

root@vm-mumble:~# cat /var/log/nginx/access.log | grep mumble-web
192.168.1.126 - - [22/Feb/2021:23:36:33 +0100] "GET /mumble-web/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
root@vm-mumble:~# cat /var/log/nginx/error.log | grep mumble-web
2021/02/22 23:36:33 [error] 794#794: *1 "/home/mumble-web/mumble-web/dist/mumble-web/index.html" is not found (2: No such file or directory), client: 192.168.1.126, server: vm-mumble, request: "GET /mumble-web/ HTTP/1.1", host: "vm-mumble"
root@vm-mumble:~#

So this seems related to your last answer:

No clue. Might want to check your browser to see which URLs it wants to access and for what reason. Though if you get to the above Failed to initialize user media error, your browser shouldn't be missing any html files, so could also just ignore it unless another issue pops up.

The only plausible reason for the additional mumble-web in the URL seemed to be the location block on VM-ReverseProxy:

location /mumble-web {
        proxy_pass http://vm-mumble;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
        }

To test this I've changed location /mumble-web to location /mw. Now the Nginx log reports:

root@vm-mumble:~# cat /var/log/nginx/error.log | grep mumbleweb
2021/02/22 23:56:03 [error] 13990#13990: *1 "/home/mumble-web/mumble-web/dist/mw/index.html" is not found (2: No such file or directory), client: 192.168.1.126, server: vm-mumble, request: "GET /mumbleweb/ HTTP/1.1", host: "vm-mumble"
root@vm-mumble:~# 

So this confirms that the last mumble-web in /home/mumble-web/mumble-web/dist/mumble-web/index.html of the error log is the one in the location block of VM-ReverseProxy. The problem: I can not use location / to address the VM serving Mumble because location / already points to an nginx serving my www page.

To solve this I've created a symlink redirecting the request to the right path:

root@vm-mumble:~# ln -s /home/mumble-web/mumble-web/dist/ /home/mumble-web/mumble-web/dist/mumbleweb
chown -h mumble-web:mumble-web /home/mumble-web/mumble-web/dist/mumbleweb

And now https://my.ddns.net/mumbleweb/ loads:

Screenshot_2021-02-23_00-29-41

Unfortunately after login MumbleWeb reports:

[12:29:52 AM] Connecting to server my.ddns.net
[12:29:52 AM] Connection error: [object Event]

From what I understand in the issues related to to "object Event" the problem is that the connection between my VM-ReverseProxy and my VM-Mumble is unencrypted. So I think I have to learn https://docs.nginx.com/nginx/admin-guide/security-controls/securing-http-traffic-upstream/ to secure the connection between my VM-ReverseProxy and my VM-Mumble with self-signed certificates.

Johni0702 commented 3 years ago

is there a certain reason why it is called "demo"?

Cause that's the mumble-web-proxy pointing at my demonstration server. I run other servers as well using different names. The name doesn't matter, it just has to match with the info you type into the Connect to Server dialog (or set as defaults in the config for it).

To link the VM-ReverseProxy to VM-Mumble I tried this:

For nginx there is a huge difference between proxy_pass http://vm-mumble; (i.e. without a path) and proxy_pass http://vm-mumble/; (i.e. with a path, in this case the shortest possible path /; this could also be a full path like /some/sub/dir/). In the former case, as you observed, it'll just pass the exact URI path on to the downstream server, hence why the /mumble-web is still present on the VM-Mumble nginx. In the latter case it appends only the part of the URI which is left after the location /mumble-web to the path specified in proxy_pass. So if you change your config to the latter, a request to https://my.ddns.net/mumble-web/ should end up at http://vm-mumble/ (technically it will go to http://vm-mumble//, the double slash is because your location is /mumble-web rather than /mumble-web/ but it should automatically be normalized). Or another example https://my.ddns.net/mumble-web/demo will go to http://vm-mumble/demo

From what I understand in the issues related to to "object Event"

Nah, this is just bad logging. The error could be anything, have a look into the browser console to find the real one. It only cares about whether the initial connection is encrypted, the others don't matter and are in fact not even visible to the browser. E.g. it might be because the path (or port, it's ugly, I really hate that I didn't add an extra path field, or just combined host, port and path into one URL field) you connect to is incorrect. It should probably be 443/mumble-web/demo for you, so the URL it connects to will be wss://my.ddns.net:443/mumble-web/demo.

r4dh4l commented 3 years ago

Cause that's the mumble-web-proxy pointing at my demonstration server. I run other servers as well using different names. > > The name doesn't matter, it just has to match with the info you type into the Connect to Server dialog (or set as defaults in the config for it).

Great, got it, thank you. I'Ve just renamed it to location /proxy and it works.

In the latter case it appends only the part of the URI which is left after the location /mumble-web to the path specified in proxy_pass. So if you change your config to the latter, a request to https://my.ddns.net/mumble-web/ should end up at http://vm-mumble/ (technically it will go to http://vm-mumble//, the double slash is because your location is /mumble-web rather than /mumble-web/ but it should automatically be normalized). Or another example https://my.ddns.net/mumble-web/demo will go to http://vm-mumble/demo

I'm still trying to understand the details but you are right: I've changed proxy_pass to http://vm-mumble/; (instead of http://vm-mumble;) and now it works without the symlink workaround. Thank you!

Nah, this is just bad logging. The error could be anything, have a look into the browser console to find the real one.

Okay, there I get (on the most upper output layer):

-- loading localization data for language "en" ... loc.js:144
-- loading localization data for language "en-US" ... loc.js:144
Connecting to server my.ddns.net index.js:1367
Firefox can’t establish a connection to the server at wss://my.ddns.net/. stream.js:43
Connection error: 
error
​
bubbles: false
​cancelBubble: false
​cancelable: false
​composed: false
​currentTarget: null
​defaultPrevented: false
​eventPhase: 0
​explicitOriginalTarget: WebSocket { url: "wss://my.ddns.net/", readyState: 3, bufferedAmount: 0, … }
​isTrusted: true
​originalTarget: WebSocket { url: "wss://my.ddns.net/", readyState: 3, bufferedAmount: 0, … }
​returnValue: true
​srcElement: WebSocket { url: "wss://my.ddns.net/", readyState: 3, bufferedAmount: 0, … }
​target: WebSocket { url: "wss://my.ddns.net/", readyState: 3, bufferedAmount: 0, … }
​timeStamp: 56746
​type: "error"
​<get isTrusted()>: function isTrusted()
​<prototype>: EventPrototype { composedPath: composedPath(), stopPropagation: stopPropagation(), stopImmediatePropagation: stopImmediatePropagation(), … }
index.js:1367

So a WebSocket problem?

It only cares about whether the initial connection is encrypted, the others don't matter and are in fact not even visible to the browser.

Okay, thank you.

E.g. it might be because the path (or port, it's ugly, I really hate that I didn't add an extra path field, or just combined host, port and path into one URL field) you connect to is incorrect.

I was a little bit confused what I should paste into the Address field but the web console was helpful to determine that...

It should probably be 443/mumble-web/demo for you, so the URL it connects to will be wss://my.ddns.net:443/mumble-web/demo.

...means I have to provide my.ddns.net/mumbleweb/proxy (if I use /mumbleweb in the "outer" Reverse Proxy and /proxy in the "inner" one) instead of just my.ddns.net, right?

Screenshot_2021-02-23_18-07-49

If so the connection attempt keeps just trying to connet:

[6:08:14 PM] Connecting to server my.ddns.net/mumbleweb/proxy

Web console says:

-- loading localization data for language "en" ... loc.js:144
-- loading localization data for language "en-US" ... loc.js:144
Connecting to server my.ddns.net/mumbleweb/proxy

Did I misunderstood something in your last explanation? Because some mumble web interfaces using your projects just list mumble.example.com without any paths in the login mask so users only have to provide a username.

Johni0702 commented 3 years ago

Try my.ddns.net as the address and 443/mumbleweb/proxy for the port (yeah, it's stupid, they're combined as wss://$address:$port).

Because some mumble web interfaces using your projects just list mumble.example.com without any paths in the login mask so users only have to provide a username.

One can probably configure nginx to forward websocket connections to a different destination than normal http connections, I've never done that though. If your web interface is only meant to connect to a single server, then the way I'd recommend doing it is to just hide the address and port field (there's a config option for that) and then set their values either via the URL (like I do for the demo server) or also in the config.

the connection attempt keeps just trying to connet

Does it get to the outer nginx? The inner nginx? Mumble-web-proxy? Murmur? Check their logs to figure out where it gets stuck.

r4dh4l commented 3 years ago

Try my.ddns.net as the address and 443/mumbleweb/proxy for the port (yeah, it's stupid, they're combined as wss://$address:$port).

Ah, now I got it - I wouldn't call it "stupid", it's okay as long as I know where to put which path.

If your web interface is only meant to connect to a single server, then the way I'd recommend doing it is to just hide the address and port field (there's a config option for that) and then set their values either via the URL (like I do for the demo server) or also in the config.

Good to know, thank you. This would have been another question because this is exactly what I want (later).

Does it get to the outer nginx? The inner nginx? Mumble-web-proxy? Murmur? Check their logs to figure out where it gets stuck.

Okay, step by step:

  1. I opened https://my.ddns.net/mumbleweb/ and provide 443/mumbleweb/proxy for Port.

  2. The webinterface stucks at [10:11:24 PM] Connecting to server my.ddns.net.

  3. I checked the logs on the "outer" ReverseProxy and get:

root@vm-revproxy:~# cat /var/log/nginx/access.log | grep mumble
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/ HTTP/2.0" 200 7502 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/9ae3dac014f51d714254cf522602cec0.svg HTTP/2.0" 200 800 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/82747b4bbd0cfe92292f74cd27f2763e.svg HTTP/2.0" 200 1020 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/f54b0be1d559b03ad8d945e988ec8ed4.svg HTTP/2.0" 200 1499 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/f2fc230fc7d9a9b8f6f03d342f6e94b2.svg HTTP/2.0" 200 800 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/0ce7650c4d5a52a5323868f75588e1c7.svg HTTP/2.0" 200 1539 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/d5ba30b381ebc262ba3871eaed9d7102.svg HTTP/2.0" 200 1266 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/7b86c879d50808c66816ed3338f26557.svg HTTP/2.0" 200 1093 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/077f1c5bd335be073c48c340b01f58bc.svg HTTP/2.0" 200 988 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/50dddae19e7bf601b168f46a1303674b.svg HTTP/2.0" 200 2403 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/71edeaefdc2f5a19dc84298669af6962.svg HTTP/2.0" 200 1025 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/config.local.js HTTP/2.0" 499 0 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/22ecf0ecde1ae2a6281265174b7fa355.svg HTTP/2.0" 200 2273 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:14 +0100] "GET /mumbleweb/8f75583a16890ab851fc3f121fc63f89.svg HTTP/2.0" 200 1407 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:15 +0100] "GET /mumbleweb/9cda20ca6e5077b6999771c9a8a3cec5.css HTTP/2.0" 200 530 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:15 +0100] "GET /mumbleweb/e809fc9b5b9b89f1069def2574cea41d.css HTTP/2.0" 200 9919 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:15 +0100] "GET /mumbleweb/cf02aba975e911ef9823610d908b32f5.png HTTP/2.0" 200 1047 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:55:15 +0100] "GET /mumbleweb/ee7a19054eb87597c4b8e4664823ebfd.png HTTP/2.0" 200 14250 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.1 - - [24/Feb/2021:21:56:09 +0100] "GET /mumbleweb/proxy HTTP/1.1" 101 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
root@vm-revproxy:~# cat /var/log/nginx/error.log | grep mumble
2021/02/24 21:55:14 [error] 1719#1719: *92 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.1, server: my.ddns.net, request: "GET /mumbleweb/f2fc230fc7d9a9b8f6f03d342f6e94b2.svg HTTP/2.0", upstream: "http://[fdb8:4dea:e5eb::451]:80//f2fc230fc7d9a9b8f6f03d342f6e94b2.svg", host: "my.ddns.net", referrer: "https://my.ddns.net/mumbleweb/"
2021/02/24 21:55:14 [error] 1719#1719: *92 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.1, server: my.ddns.net, request: "GET /mumbleweb/22ecf0ecde1ae2a6281265174b7fa355.svg HTTP/2.0", upstream: "http://[fdb8:4dea:e5eb::451]:80//22ecf0ecde1ae2a6281265174b7fa355.svg", host: "my.ddns.net", referrer: "https://my.ddns.net/mumbleweb/"
2021/02/24 21:55:14 [error] 1719#1719: *92 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.1, server: my.ddns.net, request: "GET /mumbleweb/8f75583a16890ab851fc3f121fc63f89.svg HTTP/2.0", upstream: "http://[fdb8:4dea:e5eb::451]:80//8f75583a16890ab851fc3f121fc63f89.svg", host: "my.ddns.net", referrer: "https://my.ddns.net/mumbleweb/"
2021/02/24 21:56:09 [error] 1719#1719: *169 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.1, server: my.ddns.net, request: "GET /mumbleweb/proxy HTTP/1.1", upstream: "http://[fdb8:4dea:e5eb::451]:80//proxy", host: "my.ddns.net"
root@vm-revproxy:~#
  1. I checked the logs on the "inner" ReverseProxy and get:
root@vm-mumble:~# cat /var/log/nginx/access.log | grep mumble
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //9ae3dac014f51d714254cf522602cec0.svg HTTP/1.1" 200 800 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //82747b4bbd0cfe92292f74cd27f2763e.svg HTTP/1.1" 200 1020 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //f54b0be1d559b03ad8d945e988ec8ed4.svg HTTP/1.1" 200 1499 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //f2fc230fc7d9a9b8f6f03d342f6e94b2.svg HTTP/1.1" 200 800 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //0ce7650c4d5a52a5323868f75588e1c7.svg HTTP/1.1" 200 1539 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //d5ba30b381ebc262ba3871eaed9d7102.svg HTTP/1.1" 200 1266 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //7b86c879d50808c66816ed3338f26557.svg HTTP/1.1" 200 1093 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //077f1c5bd335be073c48c340b01f58bc.svg HTTP/1.1" 200 988 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //50dddae19e7bf601b168f46a1303674b.svg HTTP/1.1" 200 2403 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //71edeaefdc2f5a19dc84298669af6962.svg HTTP/1.1" 200 1025 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //22ecf0ecde1ae2a6281265174b7fa355.svg HTTP/1.1" 200 2273 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:14 +0100] "GET //8f75583a16890ab851fc3f121fc63f89.svg HTTP/1.1" 200 1407 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:15 +0100] "GET //9cda20ca6e5077b6999771c9a8a3cec5.css HTTP/1.1" 200 530 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.126 - - [24/Feb/2021:21:55:15 +0100] "GET //e809fc9b5b9b89f1069def2574cea41d.css HTTP/1.1" 200 9919 "https://my.ddns.net/mumbleweb/" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
root@vm-mumble:~# cat /var/log/nginx/error.log | grep mumble
root@vm-mumble:~#

So it seems there is a problem bewteen the outer and the inner Reverse Proxy.

Just to confirm my Nginx configs:

Outer ReverseProxy:

location /mumbleweb {
        proxy_pass http://vm-mumble/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
        }

Inner ReverseProxy:

server {
        listen 80;
        server_name vm-mumble;

        location / {
                root /home/mumble-web/mumble-web/dist;
        }

        location /proxy {
                proxy_pass http://localhost:64737;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
        }
}

map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
}

For the case an 111: Connection refused is caused by some missing ports here is my firewall configuration on the inner ReverseProxy:

root@vm-mumble:~# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
?????                      ALLOW IN    Anywhere                   # SSH
64738                      ALLOW IN    Anywhere                   # Mumble-Server
5666                       ALLOW IN    Anywhere                   # NRPE (Nagios Remote Plugin Executor) port
80                         ALLOW IN    Anywhere                   # mumble-web-proxy via nginx
????? (v6)                 ALLOW IN    Anywhere (v6)              # SSH
64738 (v6)                 ALLOW IN    Anywhere (v6)              # Mumble-Server
5666 (v6)                  ALLOW IN    Anywhere (v6)              # NRPE (Nagios Remote Plugin Executor) port
80 (v6)                    ALLOW IN    Anywhere (v6)              # mumble-web-proxy via nginx

root@vm-mumble:~#

Did I forget something here?

r4dh4l commented 3 years ago

@Johni0702 Sorry a last question before I give up:

To get as close as possible to the default use case (direct access to the mumble-web server without a a second/"external" Reverse Proxy) I tried "snakeoil" certificates to enable https access to my mumble(-web) VM which has no regular certificates.

So my Nginx config on the mumble(-web) server is now:

server {
        listen 443 ssl;
        server_name vm-mumble;
        ssl on;
        ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
        ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;

        location / {
            root /home/mumble-web/mumble-web/dist;
        }

        location /proxy {
            proxy_pass http://localhost:64737;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
        }
}

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
    }

The good thing: Except the regular security warning for opening a website with self-signed certificates I can open (in m case) https://vm-mumble within my LAN, select the microphone and get the login mask with:

Following your exaplanation in https://github.com/Johni0702/mumble-web/issues/147#issuecomment-785020275 I've adjusted the port field to

and hit Connect.

Now I get Connection error: [object Event] again. As you adviced in https://github.com/Johni0702/mumble-web/issues/147#issuecomment-784053684 ("The error could be anything, have a look into the browser console to find the real one.") I opened the Firefox Console and got the following output with an 404 Not Found error and can’t establish a connection to the server at wss://vm-mumble/mumbleweb/proxy. error :

> GET https://vm-mumble/ [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/config.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/config.local.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/theme.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/matrix.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/index.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/ee7a19054eb87597c4b8e4664823ebfd.png [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/cf02aba975e911ef9823610d908b32f5.png [HTTP/1.1 200 OK 0ms]
-- loading localization data for language "en" ... loc.js:144
> GET https://vm-mumble/cae715f31f2b11394cad.js
[HTTP/1.1 200 OK 0ms]
-- loading localization data for language "en-US" ... loc.js:144
Connecting to server vm-mumble index.js:1367
> GET wss://vm-mumble/mumbleweb/proxy [HTTP/1.1 404 Not Found 14ms]
Firefox can’t establish a connection to the server at wss://vm-mumble/mumbleweb/proxy. stream.js:43
Connection error: 
    error
​        bubbles: false
​        cancelBubble: false
​​        cancelable: false
​​        composed: false
​​        currentTarget: null
​​        defaultPrevented: false
​​        eventPhase: 0
​​        > explicitOriginalTarget: WebSocket { url: "wss://vm-mumble/mumbleweb/proxy", readyState: 3, bufferedAmount: 0, … }
​​        isTrusted: true
​​        > originalTarget: WebSocket { url: "wss://vm-mumble/mumbleweb/proxy", readyState: 3, bufferedAmount: 0, … }
​​        returnValue: true
​​        > srcElement: WebSocket { url: "wss://vm-mumble/mumbleweb/proxy", readyState: 3, bufferedAmount: 0, … }
​​        > target: WebSocket { url: "wss://vm-mumble/mumbleweb/proxy", readyState: 3, bufferedAmount: 0, … }
​​        timeStamp: 148793
​​        type: "error"
​​        > <get isTrusted()>: function isTrusted()
​​        > <prototype>: EventPrototype { composedPath: composedPath(), stopPropagation: stopPropagation(), stopImmediatePropagation: stopImmediatePropagation(), … }

The good thing: connection to the server at wss://vm-mumble/mumbleweb/proxy means that the combination of Address and Port field in the login mask is combined in the right way, isn't it?

The bad thing: GET wss://vm-mumble/mumbleweb/proxy [HTTP/1.1 404 Not Found 14ms] seems to be the error for missing web content. But if the browser can not find the web files why I can see the login mask in the first place?

Johni0702 commented 3 years ago

Following your exaplanation in #147 (comment) I've adjusted the port field to

* Address: `vm-mumble`

* Port: `443/mumbleweb/proxy`

* Userame: `tinatest`

If you're removing the outer proxy from everything and thereby removing the mumbleweb/ prefix from everything, you also gotta remove it from the port field.

r4dh4l commented 3 years ago

If you're removing the outer proxy from everything and thereby removing the mumbleweb/ prefix from everything, you also gotta remove it from the port field.

Oh, thank you. :facepalm:

So I've tested again, got the request for microphone and the login mask where I provided port: 443/proxy this time. The webinterface stucked again with

[12:59:38 AM] Connecting to server vm-mumble

The output of the Firefox Web Console was:

> GET https://vm-mumble/f2fc230fc7d9a9b8f6f03d342f6e94b2.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/9ae3dac014f51d714254cf522602cec0.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/22ecf0ecde1ae2a6281265174b7fa355.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/82747b4bbd0cfe92292f74cd27f2763e.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/8f75583a16890ab851fc3f121fc63f89.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/f54b0be1d559b03ad8d945e988ec8ed4.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/0ce7650c4d5a52a5323868f75588e1c7.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/d5ba30b381ebc262ba3871eaed9d7102.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/7b86c879d50808c66816ed3338f26557.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/077f1c5bd335be073c48c340b01f58bc.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/50dddae19e7bf601b168f46a1303674b.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/71edeaefdc2f5a19dc84298669af6962.svg [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/config.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/config.local.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/theme.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/matrix.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/index.js [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/ee7a19054eb87597c4b8e4664823ebfd.png [HTTP/1.1 200 OK 0ms]
> GET https://vm-mumble/cf02aba975e911ef9823610d908b32f5.png [HTTP/1.1 200 OK 0ms]
-- loading localization data for language "en" ... loc.js:144
> GET https://vm-mumble/cae715f31f2b11394cad.js [HTTP/1.1 200 OK 0ms]
-- loading localization data for language "en-US" ... loc.js:144
Connecting to server vm-mumble index.js:1367
> GET wss://vm-mumble/proxy [HTTP/1.1 101 Switching Protocols 19ms]

(so no errors as far as I see)

The nginx logs were not very helpful:

root@vm-mumble:~# cat /var/log/nginx/access.log
192.168.1.199 - - [18/Mar/2021:01:00:07 +0100] "> GET  /index.js.map HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
192.168.1.199 - - [18/Mar/2021:01:00:17 +0100] "> GET  /proxy HTTP/1.1" 101 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"
root@vm-mumble:~# cat /var/log/nginx/error.log

But I remembered to ask journalctl which provided an interesting output:

root@vm-mumble:~# journalctl -xe | grep mumble
...
Mar 18 01:00:17 vm-mumble mumble-web-proxy[1416]: New connection from [::ffff:127.0.0.1]:39212
Mar 18 01:00:17 vm-mumble mumble-web-proxy[1416]: Error on connection [::ffff:127.0.0.1]:39212: ServerTls(Ssl(Error { code: ErrorCode(1), cause: Some(Ssl(ErrorStack([Error { code: 337047686, library: "SSL routines", function: "tls_process_server_certificate", reason: "certificate verify failed", file: "../ssl/statem/statem_clnt.c", line: 1915 }]))) }, X509VerifyResult { code: 62, error: "Hostname mismatch" }))
root@vm-mumble:~# 

Is certificate verify failed a problem in this context?

Johni0702 commented 3 years ago

Yes, your mumble server needs to provide a valid certificate for the address which mumble-web-proxy is connecting to. If the connection between mumble-web-proxy and the mumble server does not need to be secured (e.g. because it's local-only anyway), you can also pass --accept-invalid-certificate to mumble-web-proxy to ignore that check.

r4dh4l commented 3 years ago

So in /etc/systemd/system/mumble-web.service I changed

ExecStart=/home/mumble-web/mumble-web-proxy/target/release/mumble-web-proxy --listen-ws 64737 --server localhost:64738

to

ExecStart=/home/mumble-web/mumble-web-proxy/target/release/mumble-web-proxy --listen-ws 64737 --server localhost:64738 --accept-invalid-certificate

and:

[2:42:43 AM] Connecting to server my.ddns.net [2:42:44 AM] Connected! [2:42:44 AM] Welcome message:

Thank you so much @Johni0702 ! :smile:

A last question to understand the concept:

Why do I have to provide 443/... as port and not 80/...? As far as I understood when I open https://my.ddns.net/mumbleweb/ my outer Reverse Proxy directs to the mumble web server encrypted, but what comes after is unencrypted, isn't it?

        location /proxy {
            proxy_pass http://localhost:64737;

Or do I mix the order of mumble-web and mumble-web-proxy in my comprehension?

However: To support your great project a little bit I could provide you my tutorial for the whole setup. The main difference is that I describe the setup of mumble-web-proxy as preliminary for the mumble-web setup and provide more examples. Let me know if you are interested.