ITSquad/Mumble: Difference between revisions

From Pirate Party Belgium
Jump to navigation Jump to search
(Created page with "{{ProjectSidebar | title = Mumble | start = 2020/03/22 | status = doing | workgroup = ITSquad | contact = it [at] pirateparty (point) be }} == Description == Mumble is a ser...")
 
m (fix links)
Line 13: Line 13:
Since March 2020, the PPBe is hosting a Mumble server together with a web client on https://talk.parley.be.
Since March 2020, the PPBe is hosting a Mumble server together with a web client on https://talk.parley.be.


It is also possible to connect through [another Mumble client](https://www.mumble.com/mumble-download.php) at <code>mumble.parley.be</code> with port <code>64738</code>.
It is also possible to connect through [https://www.mumble.com/mumble-download.php another Mumble client] at <code>mumble.parley.be</code> with port <code>64738</code>.


To connect you can give the username you wish. No password is needed, although we could decide to setup a password if we see that there are too much spam.
To connect you can give the username you wish. No password is needed, although we could decide to setup a password if we see that there are too much spam.


As we are using [umurmur](https://umurmur.net/), a lightweight Mumble server, there are some limitations. For instance, the number of rooms is fixed on server startup, and we cannot grant permissions for certain users. There is only one admin password, which gives the right to silent people.
As we are using [https://umurmur.net/ umurmur], a lightweight Mumble server, there are some limitations. For instance, the number of rooms is fixed on server startup, and we cannot grant permissions for certain users. There is only one admin password, which gives the right to silent people.


== Install ==
== Install ==
Line 36: Line 36:
  git clone https://github.com/umurmur/umurmur.git .
  git clone https://github.com/umurmur/umurmur.git .


Checkout to the latest version (see the [releases list](https://github.com/umurmur/umurmur/releases)):
Checkout to the latest version (see the [https://github.com/umurmur/umurmur/releases releases list]):


  git checkout 0.2.17
  git checkout 0.2.17
Line 230: Line 230:
EOF</nowiki>
EOF</nowiki>


Install certbot for managing the certificates ([check on their website](https://certbot.eff.org) if you need to install the certbot repository):
Install certbot for managing the certificates ([https://certbot.eff.org check on their website] if you need to install the certbot repository):


  apt install certbot python-certbot-nginx
  apt install certbot python-certbot-nginx

Revision as of 15:11, 22 March 2020

Mumble Toicon-icon-avocado-build.svg
Workgroup ITSquad
Start date Sun 22 March 2020
Contact it [at] pirateparty (point) be
Status In progress

Description

Mumble is a server for holding audio conferences.

Since March 2020, the PPBe is hosting a Mumble server together with a web client on https://talk.parley.be.

It is also possible to connect through another Mumble client at mumble.parley.be with port 64738.

To connect you can give the username you wish. No password is needed, although we could decide to setup a password if we see that there are too much spam.

As we are using umurmur, a lightweight Mumble server, there are some limitations. For instance, the number of rooms is fixed on server startup, and we cannot grant permissions for certain users. There is only one admin password, which gives the right to silent people.

Install

Server

Install dependencies:

sudo apt install git build-essential cmake libconfig-dev libprotobuf-c-dev libmbedtls-dev ssl-certs

Create the directory for the server sources:

mkdir /opt/umurmur
cd /opt/umurmur

Clone the umurmur git repository:

git clone https://github.com/umurmur/umurmur.git .

Checkout to the latest version (see the releases list):

git checkout 0.2.17

Create the build directory:

mkdir ./build
cd ./build

Build the sources:

cmake .. -DSSL=libmbedtls
make

Install the umurmur binary on the system:

make install

You can now edit the configuration file at /usr/local/etc/umurmur.conf. Check the doc for an example. We will define the certificates later on. You can setup a password if you wish.

Generate a random password for the admin:

pwgen -s 42 1

And copy/paste this password to the umurmur config file.

Create the systemd service unit:

cat > /etc/systemd/system/umurmur.service << EOF
[Unit]
Description=Minimalistic Mumble server
After=network.target

[Service]
Type=simple
User=nobody
Group=ssl-cert
Restart=on-failure
RestartSec=3
PIDFile=/run/umurmurd.pid
ExecStartPre=/usr/local/bin/umurmurd -t -c /usr/local/etc/umurmur.conf
ExecStart=/usr/local/bin/umurmurd -d -r -c /usr/local/etc/umurmur.conf
ExecReload=/bin/kill -HUP $MAINPID
PrivateDevices=yes
PrivateTmp=yes
ProtectSystem=strict
ReadWriteDirectories=/usr/local/etc/
ProtectHome=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
LockPersonality=yes
NoNewPrivileges=yes
LimitRTPRIO=1

[Install]
WantedBy=multi-user.target
EOF

Reload the systemd service unit config:

systemctl daemon-reload

Web client

Install nodejs repository (LTS is v0.12.x):

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

Install nodejs and websockify:

apt install nodejs websockify

Create the directory for mumble-web:

mkdir /var/www/mumble-web
cd /var/www/mumble-web

Clone the mumble-web git repository:

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

Build the sources:

npm install
npm audit fix

Edit the configuration file at ./app/config.js. Change the following options in connectDialog section:

'address': false
'port': false
'token': false

It will tell the client to only ask for an username and password. If you didn't setup a password, you can also set it to false.

Change address in the defaults section:

'address': "talk.parley.be/mumble"

Build the assets and config:

npm run build

Create the systemd service unit (just copy past this):

cat > /etc/systemd/system/mumble-web.service << EOF
[Unit]
Description=Mumble web client using websockets
After=network.target

[Service]
Type=simple
User=nobody
Group=nogroup
Restart=on-failure
RestartSec=3
PIDFile=/run/mumble-web.pid
ExecStart=/usr/bin/websockify --ssl-target 64737 localhost:64738
ExecReload=/bin/kill -HUP $MAINPID
PrivateDevices=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
LockPersonality=yes
NoNewPrivileges=yes
LimitRTPRIO=1

[Install]
WantedBy=multi-user.target
EOF

Reload the systemd service unit config:

systemctl daemon-reload

Nginx

Install nginx:

apt install nginx

Create the config for your web client (just copy/paste this):

cat > /etc/nginx/sites-available/mumble.conf << EOF
server {
  listen 80;
  listen [::]:80;
  server_name talk.parley.be mumble.parley.be;
  
  # Useful for Let's Encrypt
  location /.well-known/acme-challenge/ {
    allow all;
  }
  
  location / {
    return 301 https://$host$request_uri;
  }
}

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;

  server_name talk.parley.be;

  ssl_certificate /etc/letsencrypt/live/talk.parley.be/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/talk.parley.be/privkey.pem;

  include /etc/letsencrypt/options-ssl-nginx.conf;

  location / {
    root /var/www/mumble-web/dist/;
  }

  location /mumble {
    proxy_pass http://127.0.0.1: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;
}
EOF

Install certbot for managing the certificates (check on their website if you need to install the certbot repository):

apt install certbot python-certbot-nginx

Add the following hook in /etc/letsencrypt/cli.ini:

post-hook = chmod 0640 /etc/letsencrypt/archive/*/privkey*.pem && chmod g+rx /etc/letsencrypt/live /etc/letsencrypt/archive && chown -R root:ssl-cert /etc/letsencrypt/live /etc/letsencrypt/archive

This will give the read permissions for the group ssl-certs. It is required for the umurmur server which will be run as member of that group.

Generate two certificates, one for the client and one for the server:

certbot certonly --nginx -d talk.parley.be
certbot certonly --nginx -d mumble.parley.be

Enable the nginx configuration:

ln -s /etc/nginx/sites-available/mumble.conf /etc/nginx/sites-enabled/

Check that everything is fine:

nginx -t

Reload the nginx server:

systemctl reload nginx

Change the certificates for umurmur in the config file /usr/local/etc/umurmur.conf. The paths should be something like:

certificate = "/etc/letsencrypt/live/mumble.parley.be/fullchain.pem";
private_key = "/etc/letsencrypt/live/mumble.parley.be/privkey.pem";

You can finally start the client and server:

systemctl start umurmur
systemctl start mumble-web

Don't forget to open the port 64738 of your firewall if you want to allow people connecting from the desktop Mumble client!

When everything looks good, enable the services:

systemctl enable umurmur mumble-web

Enjoy!