|
|
(180 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) |
Zeile 1: |
Zeile 1: |
| = Komponenten des HighPerformanceBackends =
| | Nextcloud Talk '''H'''igh '''P'''erformance '''B'''ackend |
| '''TODO: ''' Grafische Darstellung der Kooperation der verwendeten Dienste | |
|
| |
|
| == Janus WebRTC gateway == | | = Beschreibung = |
| '''TODO: ''' Aufgabe des Dienstes beschreiben
| | ; Komponenten |
| | {| class="wikitable sortable" |
| | |- |
| | ! Komponente !! Aufgabe !! Link !! Beschreibung |
| | |- |
| | | Janus || WebRTC Gateway || [[Nextcloud/Talk:HPB:Janus]] || |
| | |- |
| | | NATS || Messaging Server || [[Nextcloud/Talk:HPB:NATS]] || |
| | |- |
| | | Signaling-Servern || Signaling-Servern || [[Nextcloud/Talk:HPB:Signaling-Server]] || |
| | |- |
| | | Webserver Frontend || Webserver Frontend || [[Nextcloud/Talk:HPB:Apache]] || |
| | |} |
|
| |
|
| === Weitere Informationen === | | = Installation = |
| # https://github.com/meetecho/janus-gateway Janus
| | == Server-Daten == |
|
| |
|
| == NATS messaging server == | | {| class="wikitable sortable" |
| '''TODO: ''' Aufgabe des Dienstes beschreiben
| | |- |
| | ! Server !! URL |
| | |- |
| | | Nextcloud-Server || cloud.foxtom.de |
| | |- |
| | | TURN-Server || turn.foxtom.de:5349 |
| | |- |
| | | Signaling Server || signaling.foxtom.de |
| | |} |
|
| |
|
| === Weitere Informationen === | | = Konfiguration = |
| # https://nats.io/
| | == Schlüssel (keys) erstellen == |
| | {| class="wikitable sortable" |
| | |- |
| | ! Aufgabe !! Befehl |
| | |- |
| | | Api-Key für Janus || openssl rand -base64 16 |
| | |- |
| | | Hash-Key || openssl rand -hex 16 |
| | |- |
| | | Block-Key || openssl rand -hex 16 |
| | |- |
| | | Secret Key für die Nextcloud || openssl rand -hex 16 |
| | |} |
|
| |
|
| == Nextcloud Talk signaling server ==
| | ;siehe auch '''[[Openssl]]''' |
| '''TODO ''' | |
|
| |
|
| === Weitere Informationen === | | == Einbinden in Nextcloud Talk == |
| # https://github.com/strukturag/nextcloud-spreed-signaling
| | siehe '''[[Nextcloud/Talk:HPB:Einbinden in Nextcloud Talk]]''' |
| | |
| == Apache Webserver ==
| |
| '''TODO: ''' Aufgabe des Dienstes beschreiben | |
| | |
| === Weitere Informationen ===
| |
| '''TODO'''
| |
| | |
| = Vorbereitung der Installation =
| |
| Für die jeweiligen Komponenten werden Schlüssel (keys) benötigt, die im Vorfeld wie folgt erzeugt werden können:
| |
| | |
| == <api-Key> für Janus ==
| |
| openssl rand -base64 16
| |
| | |
| == Hash-Key ==
| |
| openssl rand -hex 16
| |
| | |
| == Block-Key ==
| |
| openssl rand -hex 16
| |
|
| |
|
| == Secret Key für die Nextcloud == | | == Firewall konfigurieren == |
| openssl rand -hex 16
| | # apt install ufw |
|
| |
|
| == Schlüssel für den TURN-Server ==
| | # ufw allow http |
| * Talk-Einstellungen der Nextcloud
| | # ufw allow https |
| '''TODO:''' Beschreibung des Klickwegs als Text | | # ufw allow ssh |
| '''TODO:''' Screenshot hinzufügen | | # ufw allow 5349/tcp |
| | # ufw allow 5349/udp |
|
| |
|
| == Server-Adressen ==
| | # ufw enable |
| '''Nextcloud-Server:''' cloud.itw-berlin.net | |
| '''TURN-Server:''' cloud.itw-berlin.net:5349
| |
| '''Signaling Server:''' signaling.foxtom.de
| |
|
| |
|
| = Janus =
| | # ufw status |
| == Installation ==
| | Status: active |
| apt install janus | |
| | |
| == Konfiguration ==
| |
| === /etc/janus/janus.jcfg ===
| |
| ...
| |
| stun_server = "cloud.itw-berlin.net"
| |
| stun_port = 5349
| |
| ...
| |
| full_trickle = true
| |
| ...
| |
| turn_server = "cloud.itw-berlin.net"
| |
| turn_port = 5349
| |
| ...
| |
| turn_rest_api_key = "<api-Key>" | |
| ...
| |
| | |
| === /etc/janus/janus.transport.http.jcfg ===
| |
| Janus-Server soll nur das lokale Interface abhören
| |
| ...
| |
| interface = "lo"
| |
| ...
| |
| | |
| === /etc/janus/janus.transport.websockets.jcfg ===
| |
| Janus-Server soll nur das lokale Interface abhören
| |
| ...
| |
| ws_interface = "lo"
| |
| ...
| |
| | |
| == Dienst starten ==
| |
| sudo systemctl start janus
| |
| | |
| == Status prüfen ==
| |
| '''TODO: ''' Was bedeutet diese Ausgabe?
| |
| | |
| sudo systemctl status janus
| |
| | | |
| ● janus.service - Janus WebRTC gateway | | To Action From |
| Loaded: loaded (/lib/systemd/system/janus.service; enabled; vendor preset: enabled)
| | -- ------ ---- |
| Active: active (running) since Wed 2021-01-06 23:53:56 CET; 12s ago
| | 80/tcp ALLOW Anywhere |
| Docs: https://janus.conf.meetecho.com/docs/index.html | | 443/tcp ALLOW Anywhere |
| Main PID: 10220 (janus)
| | 22/tcp ALLOW Anywhere |
| Tasks: 24 (limit: 2296)
| | 5349/tcp ALLOW Anywhere |
| Memory: 11.1M
| | 5349/udp ALLOW Anywhere |
| CGroup: /system.slice/janus.service
| | 80/tcp (v6) ALLOW Anywhere (v6) |
| └─10220 /usr/bin/janus -o | | 443/tcp (v6) ALLOW Anywhere (v6) |
| | | 22/tcp (v6) ALLOW Anywhere (v6) |
| Jan 06 23:53:57 signaling janus[10220]: '''[ERR] [config.c:janus_config_parse:191] -- Error reading configuration file 'janus.transport.rabbitmq.cfg'... error 2 (No such file or directory)''' | | 5349/tcp (v6) ALLOW Anywhere (v6) |
| Jan 06 23:53:57 signaling janus[10220]: RabbitMQ SSL support disabled | | 5349/udp (v6) ALLOW Anywhere (v6) |
| Jan 06 23:53:57 signaling janus[10220]: '''[WARN] RabbitMQ support disabled (Janus API)'''
| |
| Jan 06 23:53:57 signaling janus[10220]: '''[WARN] RabbitMQ support disabled (Admin API)'''
| |
| Jan 06 23:53:57 signaling janus[10220]: '''[WARN] RabbitMQ support disabled for both Janus and Admin API, giving up'''
| |
| Jan 06 23:53:57 signaling janus[10220]: '''[WARN] The 'janus.transport.rabbitmq' plugin could not be initialized'''
| |
| Jan 06 23:53:57 signaling janus[10220]: '''[WARN] libnice version outdated: 0.1.14 installed, at least 0.1.15 recommended'''
| |
| Jan 06 23:53:57 signaling janus[10220]: HTTP transport timer started
| |
| Jan 06 23:54:09 signaling janus[10220]: Creating new session: 7609464843575521; 0x7f1b4c001db0
| |
| Jan 06 23:54:09 signaling janus[10220]: Creating new handle in session 7609464843575521: 3636178337595333; 0x7f1b4c001db0 0x7f1b4c0031a0
| |
|
| |
|
| == Debugging == | | == Dateien == |
| === Log prüfen ===
| |
| === Debug-/Loglevel einstellen ===
| |
|
| |
|
| = NATS = | | = Anwendung = |
| == Installation ==
| |
| === Repository hinzufügen ===
| |
| # curl -sL -o /etc/apt/trusted.gpg.d/morph027-nats-server.asc https://packaging.gitlab.io/nats-server/gpg.key
| |
| # echo "deb https://packaging.gitlab.io/nats-server nats main" | tee /etc/apt/sources.list.d/morph027-nats-server.list
| |
| === Installation durchführen ===
| |
| # apt update
| |
| # apt install nats-server
| |
|
| |
|
| == Konfiguration == | | = Sicherheit = |
| Die Konfigurationsdatei '''nats.conf''' wird im Verzeichnis '''/etc/nats''' angelegt und enthält nur die Zeile "listen: 127.0.0.1:4222":
| | = Dokumentation = |
| sudo install -d -o nats -g nats /etc/nats
| | == Projekt == |
| sudo -u nats echo "listen: 127.0.0.1:4222" > /etc/nats/nats.conf
| | # https://github.com/strukturag/nextcloud-spreed-signaling |
| | |
| == Dienst starten ==
| |
| sudo systemctl start nats-server
| |
| sudo systemctl status nats-server
| |
|
| |
| ● nats-server.service - NATS messaging server
| |
| Loaded: loaded (/lib/systemd/system/nats-server.service; enabled; vendor preset: enabled)
| |
| Active: active (running) since Thu 2021-01-07 00:00:02 CET; 9s ago
| |
| Docs: https://docs.nats.io/nats-server/
| |
| Main PID: 10269 (nats-server)
| |
| Tasks: 6 (limit: 2296)
| |
| Memory: 6.5M
| |
| CGroup: /system.slice/nats-server.service
| |
| └─10269 /usr/bin/nats-server --config /etc/nats/nats.conf
| |
|
| |
| Jan 07 00:00:02 signaling systemd[1]: Started NATS messaging server.
| |
| Jan 07 00:00:02 signaling nats-server[10269]: [10269] 2021/01/07 00:00:02.815032 [INF] Starting nats-server version 2.1.9
| |
| Jan 07 00:00:02 signaling nats-server[10269]: [10269] 2021/01/07 00:00:02.815675 [INF] Git commit [7c76626]
| |
| Jan 07 00:00:02 signaling nats-server[10269]: [10269] 2021/01/07 00:00:02.816182 [INF] Listening for client connections on localhost:4222
| |
| Jan 07 00:00:02 signaling nats-server[10269]: [10269] 2021/01/07 00:00:02.816342 [INF] Server id is NDBF27HOCXESCE4M7QWO6T3ZWCRQPRSXLJWWJDCTXFGD36LOFCTZJAYR
| |
| Jan 07 00:00:02 signaling nats-server[10269]: [10269] 2021/01/07 00:00:02.816475 [INF] Server is ready
| |
| | |
| = Signaling Server = | |
| Zur Installation des Servers wird das Paket '''golang-go''' benötigt, welches über die Paketverwaltung installiert werden kann:
| |
| apt install golang-go
| |
| | |
| == Installation ==
| |
| Die benötigten Quellpakete werden über GitHub bezogen und hier im Verzeichnis /usr/src abgelegt:
| |
| cd /usr/src
| |
| git clone https://github.com/strukturag/nextcloud-spreed-signaling.git
| |
| cd /usr/src/nextcloud-spreed-signaling
| |
| | |
| Der anschließende Befehl '''make build''' erstellt das Programm '''bin/signaling'''
| |
| make build
| |
| | |
| == Konfiguration ==
| |
| Beispielkonfiguration
| |
| /usr/src/nextcloud-spreed-signaling/server.conf.in
| |
| | |
| Diese Datei wird nach /etc/signaling/server.conf kopiert:
| |
| mkdir -p /etc/signaling
| |
| cd /usr/src/nextcloud-spreed-signaling
| |
| cp server.conf.in /etc/signaling/server.conf
| |
| | |
| Um den Signaling-Server als Systemdienst installieren zu können, wird ein Benutzer und eine Gruppe angelegt:
| |
| groupadd signaling
| |
| useradd --system --gid signaling --shell /usr/sbin/nologin --comment "Standalone signaling server for Nextcloud Talk." signaling
| |
| | |
| und die Berechtigungen angepasst:
| |
| chmod 600 /etc/signaling/server.conf
| |
| chown signaling: /etc/signaling/server.conf
| |
| | |
| Entsprechend den lokalen Begebenheiten wir diese Datei wie folgt editiert:
| |
| listen = 127.0.0.1:8080
| |
| ...
| |
| [sessions]
| |
| hashkey = <Hash-Key>
| |
| ...
| |
| blockkey = <Block-Key>
| |
| ...
| |
| [backend]
| |
| backends = backend1
| |
|
| |
| [backend1]
| |
| url = https://cloud.itw-berlin.net
| |
| ...
| |
| secret = <Nextcloud Secret Key>
| |
| ...
| |
| [nats]
| |
| url = nats://localhost:4222
| |
| ...
| |
| [mcu]
| |
| type = janus
| |
| ...
| |
| url = ws://127.0.0.1:8188
| |
| ...
| |
| [turn]
| |
| apikey = <api-key>
| |
| secret = <TURN-Server-Key>
| |
| servers = turn:cloud.itw-berlin.net:5349?transport=udp,turn:cloud.itw-berlin.net:5349?transport=tcp
| |
| ...
| |
| | |
| Zum automatischen Starten des Signaling-Servers als Systemdienst werden die folgenden Befehle ausgeführt:
| |
| cp dist/init/systemd/signaling.service /etc/systemd/system/signaling.service
| |
| systemctl enable signaling.service
| |
| systemctl start signaling.service
| |
| | |
| == Starten des Signaling-Servers ==
| |
| Ist Janus-Server bereits gestartet, kann der Signaling-Server für einen Test direkt aufgerufen werden:
| |
| sudo /usr/src/nextcloud-spreed-signaling/bin/signaling --config /etc/signaling/server.conf
| |
|
| |
| 2021-01-06 15:11:51.109402 I | main.go:130: Starting up version 64cccab641874b3e688c1eb9029b5bb9215741e5/go1.11.6 as pid 9913
| |
| 2021-01-06 15:11:51.109824 I | main.go:139: Using a maximum of 1 CPUs
| |
| 2021-01-06 15:11:51.111647 I | natsclient.go:116: Connection established to nats://localhost:4222 (ND2IPCPXAOZMW5QPQ3R476UVGKI42RUNGIQ7YOHLNHK3QLTS7HXIVIWH)
| |
| 2021-01-06 15:11:51.111713 I | backend_configuration.go:77: Backend backend1 added for https://cloud.itw-berlin.net/
| |
| 2021-01-06 15:11:51.111723 I | hub.go:177: Using a maximum of 8 concurrent backend connections per host
| |
| 2021-01-06 15:11:51.111739 I | hub.go:184: Using a timeout of 10s for backend connections
| |
| 2021-01-06 15:11:51.111759 I | hub.go:270: Not using GeoIP database
| |
| 2021-01-06 15:11:51.113242 I | mcu_janus.go:289: Connected to Janus WebRTC Server 0.9.2 by Meetecho s.r.l.
| |
| 2021-01-06 15:11:51.113260 I | mcu_janus.go:293: Found JANUS VideoRoom plugin 0.0.9 by Meetecho s.r.l.
| |
| 2021-01-06 15:11:51.113269 I | mcu_janus.go:299: Data channels are supported
| |
| 2021-01-06 15:11:51.113274 I | mcu_janus.go:305: Full-Trickle is enabled
| |
| 2021-01-06 15:11:51.113280 I | mcu_janus.go:308: Maximum bandwidth 1048576 bits/sec per publishing stream
| |
| 2021-01-06 15:11:51.113285 I | mcu_janus.go:309: Maximum bandwidth 2097152 bits/sec per screensharing stream
| |
| 2021-01-06 15:11:51.114259 I | mcu_janus.go:315: Created Janus session 6900302758812903
| |
| 2021-01-06 15:11:51.114951 I | mcu_janus.go:322: Created Janus handle 7778710372665701
| |
| 2021-01-06 15:11:51.115064 I | main.go:226: Using janus MCU
| |
| 2021-01-06 15:11:51.115132 I | hub.go:357: Using a timeout of 10s for MCU requests
| |
| 2021-01-06 15:11:51.115192 I | backend_server.go:94: Using configured TURN API key
| |
| 2021-01-06 15:11:51.115250 I | backend_server.go:95: Using configured shared TURN secret
| |
| 2021-01-06 15:11:51.115315 I | backend_server.go:97: Adding "turn:cloud.itw-berlin.net:5349?transport=udp" as TURN server
| |
| 2021-01-06 15:11:51.115372 I | backend_server.go:97: Adding "turn:cloud.itw-berlin.net:5349?transport=tcp" as TURN server
| |
| 2021-01-06 15:11:51.115420 I | backend_server.go:104: No IPs configured for the stats endpoint, only allowing access from 127.0.0.1
| |
| 2021-01-06 15:11:51.115613 I | main.go:302: Listening on 127.0.0.1:8080
| |
| | |
| | |
| == Debugging ==
| |
| === Log prüfen ===
| |
| === Debug-/Loglevel einstellen ===
| |
| | |
| = Frontend-Webserver (Apache) =
| |
| * Normalerweise wird der Signalisierungsserver hinter einem Webserver ausgeführt, der das SSL-Protokoll ausführt oder als Load Balancer für mehrere Signalisierungsserver fungiert.
| |
| | |
| == Installation ==
| |
| | |
| == Konfuguration ==
| |
| * Um den Apache-Webservice als Frontend für den Signalisierungsserver zu konfigurieren, müssen die Module mod_proxy_http und mod_proxy_wstunnel aktiviert sein, damit WebSocket- und API-Backend-Anforderungen weitergeleitet werden können:
| |
| sudo a2enmod proxy
| |
| sudo a2enmod proxy_http
| |
| sudo a2enmod proxy_wstunnel
| |
| | |
| == Virtual-Host einrichten ==
| |
| Jetzt kann die Virtual-Host-Konfiguration von Apache erweitert werden, um Anfragen an den Signalisierungsserver weiterzuleiten (vorausgesetzt, der Server wird auf der lokalen Schnittstelle an Port 8080 ausgeführt). Für signaling.foxtom.de sollte die Datei /etc/apache2/sites-available/signaling.foxtom.de.conf wie folgt editiert werden:
| |
| | |
| <IfModule mod_ssl.c>
| |
| <VirtualHost *:443>
| |
|
| |
| ServerAdmin webmaster@localhost
| |
| DocumentRoot /var/www/html
| |
|
| |
| ErrorLog ${APACHE_LOG_DIR}/error.log
| |
| CustomLog ${APACHE_LOG_DIR}/access.log combined
| |
|
| |
| ServerName signaling.foxtom.de
| |
| SSLCertificateFile /etc/letsencrypt/live/signaling.foxtom.de/fullchain.pem
| |
| SSLCertificateKeyFile /etc/letsencrypt/live/signaling.foxtom.de/privkey.pem
| |
| Include /etc/letsencrypt/options-ssl-apache.conf
| |
|
| |
| ProxyErrorOverride On
| |
| DocumentRoot "/var/www/html"
| |
| ProxyPass /error/ !
| |
| ErrorDocument 404 /error/404_proxy.html
| |
| ProxyPass / "http://127.0.0.1:8080/"
| |
| RewriteEngine on
| |
| RewriteCond %{HTTP:Upgrade} websocket [NC]
| |
| RewriteCond %{HTTP:Connection} upgrade [NC]
| |
| RewriteRule ^/?(.*) "ws://127.0.0.1:8080/$1" [P,L]
| |
|
| |
| </VirtualHost>
| |
| </IfModule>
| |
| | |
| == Debugging ==
| |
| === Log prüfen ===
| |
| === Debug-/Loglevel einstellen ===
| |
| | |
| = Einbinden in Nextcloud Talk =
| |
| * Dies geschieht unter ''Einstellungen'' > ''Talk''.
| |
| * Ganz unten wird nun ein Signaling Server mit dem Plus-Zeichen hinzugefügt.
| |
| * Die Domain lautet hierfür ''https://signaling.meinedomain.de/standalone-signaling''.
| |
| * Unter ''Gemeinsames Geheimnis'' wird nun der Nextcloud Secret Key hinterlegt, den wir ganz am Anfang erzeugt haben:
| |
| | |
| Hinterlegen des Signaling Servers in der Nextcloud Talk Konfiguration
| |
| | |
| Die Option'' SSL Zertifikat überprüfen'' sollte hier aktiviert werden, wenn der Signaling Server über ein valides Zertifikat verfügt (zum Beispiel Let’s Encrypt).
| |
| | |
| | |
| Quelle: https://nichteinschalten.de/signalisierungsserver-fuer-nextcloud-aufsetzen-how-to/
| |
| | |
| netstat -tulpen | grep 8080
| |
| | |
| [http://nats.io/documentation/tutorials/gnatsd-install/ http://nats.io/documentation/tutorials/gnatsd-install/]
| |
| | |
| | |
| [https://github.com/meetecho/janus-gateway https://github.com/meetecho/janus-gateway]) can be used to act as a WebRTC gateway. See the documentation of Janus on how to configure and run the server. At least the <tt>VideoRoom</tt> plugin and the websocket transport of Janus must be enabled.
| |
| | |
| The signaling server uses the <tt>VideoRoom</tt> plugin of Janus to manage sessions. All gateway details are hidden from the clients, all messages are sent through the signaling server. Only WebRTC media is exchanged directly between the gateway and the clients.
| |
| | |
| Edit the <tt>server.conf</tt> and enter the URL to the websocket endpoint of Janus in the section <tt>[mcu]</tt> and key <tt>url</tt>. During startup, the signaling server will connect to Janus and log information of the gateway.
| |
| | |
| The maximum bandwidth per publishing stream can also be configured in the section <tt>[mcu]</tt>, see properties <tt>maxstreambitrate</tt> and <tt>maxscreenbitrate</tt>.
| |
| | |
| = Test und Benchmarking =
| |
| == Benchmark client ==
| |
| === Installation ===
| |
| === Konfiguration ===
| |
| === Anwendung ===
| |
| === Bewertung der Ergebinisse ===
| |
|
| |
|
| = Links = | | = Links = |
| == Intern == | | == Siehe auch == |
| '''TODO''' Links zu relevanten internen Artikeln hinzufügen
| | # https://de.wikipedia.org/wiki/WebRTC |
|
| |
|
| == Extern == | | == Weblinks == |
| # https://github.com/strukturag/nextcloud-spreed-signaling
| |
| # https://de.wikipedia.org/wiki/WebRTC
| |
| # https://decatec.de/home-server/nextcloud-talk-mit-eigenem-signaling-server-high-performance-backend/ | | # https://decatec.de/home-server/nextcloud-talk-mit-eigenem-signaling-server-high-performance-backend/ |
| # https://decatec.de/home-server/nextcloud-auf-ubuntu-server-20-04-lts-mit-nginx-mariadb-php-lets-encrypt-redis-und-fail2ban/ | | # https://decatec.de/home-server/nextcloud-auf-ubuntu-server-20-04-lts-mit-nginx-mariadb-php-lets-encrypt-redis-und-fail2ban/ |
Zeile 340: |
Zeile 99: |
| # https://decatec.de/home-server/docker-auf-ubuntu-server/ | | # https://decatec.de/home-server/docker-auf-ubuntu-server/ |
|
| |
|
| [[Kategorie:Entwurf]]
| | |
| [[Kategorie:Nextcloud]] | | |
| | |
| | |
| | [[Kategorie:Nextcloud/Talk]] |