new:jitsi (jitsi meet, jitsi conference focus, jitsi videobridhe2)

This commit is contained in:
Jörg Deckert 2020-04-11 12:27:31 +02:00
parent b38725937f
commit de024930eb
15 changed files with 3291 additions and 0 deletions

3
IDs.md
View File

@ -6,5 +6,8 @@
603 olefy 603 olefy
604 radius 604 radius
605 privacyidea 605 privacyidea
606 jitsi
607 jicofo
608 jvb
2000 admin 2000 admin

43
jitsi/Makefile Normal file
View File

@ -0,0 +1,43 @@
preinstall:
# hardcoded users and groups
$(inroot) useradd --system --comment="created from appliance building - jitsi user" --home-dir="/var/lib/zabbix/home" --shell="/sbin/nologin" --no-create-home --uid 606 --user-group jitsi
$(inroot) useradd --system --comment="created from appliance building - jitsi jicofo user" --home-dir="/usr/share/jicofo" --shell="/bin/bash" --no-create-home --uid 607 --gid 606 jicofo
$(inroot) useradd --system --comment="created from appliance building - jitsi videobridge user" --home-dir="/usr/share/jitsi-videobridge" --shell="/bin/bash" --no-create-home --uid 608 --gid 606 jvb
# switch to hardened, build hardened toolchain, rebuild everything
mkdir -p $(CHROOT)/etc/portage/profile
echo "-hardened" >> $(CHROOT)/etc/portage/profile/use.mask
$(inroot) $(EMERGE) $(USEPKG) --oneshot gcc
$(inroot) $(EMERGE) $(USEPKG) --oneshot binutils virtual/libc
-$(gcc_config)
$(inroot) $(EMERGE) $(USEPKG) --emptytree @world
$(inroot) bash -c 'yes YES | etc-update --automode -9'
postinstall: base/timesyncd.conf base/firstboot.start
# Konfigurationen anpassen
cp base/timesyncd.conf $(CHROOT)/etc/systemd/timesyncd.conf
mkdir -p $(CHROOT)/etc/local.d
cp base/firstboot.start $(CHROOT)/etc/local.d/firstboot.start
touch $(CHROOT)/firstboot
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' $(CHROOT)/etc/sudoers
sed -i 's#^auth.*$$#auth [success=2 default=ignore] pam_ssh_agent_auth.so file=~/.ssh/authorized_keys\nauth include system-auth#' $(CHROOT)/etc/pam.d/sudo
echo "Defaults env_keep += SSH_AUTH_SOCK" > $(CHROOT)/etc/sudoers.d/ssh_auth_sock
$(inroot) useradd -m -G users,wheel -s /bin/bash --comment="virtual appliance admin" --uid 2000 admin
$(inroot) passwd -d admin; $(inroot) passwd -e admin
$(inroot) systemctl enable tmux@root.service
cp base/tmux.conf $(CHROOT)/root/.tmux.conf
# Beispiel feste IP-Adresse
cp base/00-eth0.network $(CHROOT)/00-eth0.network.example
# Nginx-Konfiguration
mkdir $(CHROOT)/etc/nginx/conf.d
cp nginx/conf.d/meet.example.com.conf $(CHROOT)/etc/nginx/conf.d/meet.example.com.conf
mv $(CHROOT)/etc/nginx/nginx.conf $(CHROOT)/etc/nginx/nginx.conf.orig
cp nginx/nginx.conf $(CHROOT)/etc/nginx/nginx.conf
## # Start services
## $(inroot) systemctl enable nginx
## $(inroot) systemctl enable jicofo
## $(inroot) systemctl enable jitsi-videobridge
clean:

7
jitsi/README.md Normal file
View File

@ -0,0 +1,7 @@
Erstkonfiguration
=================
- für variable Daten (Datenbanken, Konfiguration) muß eine mit ext4 formatierte Datenpartition mit dem Label "DATA" vorhanden sein. Diese wird nach /DATA gemountet.
- feste IP-Adresse und /etc/hosts konfigurieren
- evtl. Nginx-Zertifikat neu erzeugen
- unter VMware evtl. open-vm-tools aktivieren

View File

@ -0,0 +1,22 @@
# Beispiel für feste IP-Adreß-Konfiguration:
# Anpassen und als 00-eth0.network nach /etc/systemd/network verschieben
# (s. "man systemd.network", "man systemd-resolved")
#
# NICHT VERGESSEN: entsprechende Einträge in /etc/hosts hinzufügen
# <IPv4> <FQDN> <Hostname>
# <IPv6> <FQDN> <Hostname>
[Match]
Name=eth0
[Network]
Description=1. Netzwerk-Port
Address=192.168.1.2/24
Address=fdb5:78b:64cc:0:f8c0::2/64
Gateway=192.168.1.1
Gateway=fdb5:78b:64cc:0:f8c0::1
DNS=192.168.1.3
DNS=fdb5:78b:64cc:0:f8c0::3
NTP=192.168.1.4
NTP=fdb5:78b:64cc:0:f8c0::4
Domains=privacyidea.de

36
jitsi/base/firstboot.start Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
# base settings
set -e
[ -e /firstboot ] || exit 0
echo 'Setting defaults...'
localectl --no-convert set-keymap de-latin1-nodeadkeys
echo 'Activate services...'
timedatectl set-ntp true
# variables
LABEL="DATA"
# Data partition
echo 'Mount data partition...'
mkdir -p /$LABEL
if [ ! -L "/dev/disk/by-label/$LABEL" ]; then
echo 'ERROR: Data partition not found!'
echo "Please create a data partition with ext4 filesystem and label \"$LABEL\":"
echo "# cfdisk /dev/<disk> (use GPT label, create linux partition)"
echo "# mkfs.ext4 -L $LABEL /dev/<partition>"
exit 1
fi
if ! grep -Fq "LABEL=$LABEL" /etc/fstab; then
echo "LABEL=$LABEL /$LABEL ext4 noatime 0 1" >> /etc/fstab
fi
mount -a
if ! mount | grep /$LABEL > /dev/null; then
echo "ERROR: Could not mount data partition!"
exit 1
fi
rm /firstboot

12
jitsi/base/timesyncd.conf Normal file
View File

@ -0,0 +1,12 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# See timesyncd.conf(5) for details.
[Time]
NTP=0.de.pool.ntp.org 1.de.pool.ntp.org 2.de.pool.ntp.org 3.de.pool.ntp.org
FallbackNTP=0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org

3
jitsi/base/tmux.conf Normal file
View File

@ -0,0 +1,3 @@
set -g mouse on
set-option -g set-titles on
set-option -g set-titles-string "#S / #T"

20
jitsi/jitsi.cfg Normal file
View File

@ -0,0 +1,20 @@
##HOSTNAME = $(APPLIANCE)
##TIMEZONE = UTC
DISK_SIZE = 8.0G
##SWAP_SIZE = 30
##SWAP_FILE = $(CHROOT)/.swap
##ARCH = amd64-hardened
##MAKEOPTS = -j10 -l10
##PRUNE_CRITICAL = NO
##CHANGE_PASSWORD = YES
##HEADLESS = NO
##SOFTWARE = 1
##PKGLIST = 0
##RSYNC_MIRROR = rsync://rsync15.de.gentoo.org/gentoo/
##KERNEL_PKG = gentoo-sources
KERNEL_CONFIG = appliances/$(APPLIANCE)/kernel.config
ENABLE_SSHD = YES
TIMEZONE=Europe/Berlin
LOCALE=de_DE.utf8
REPO_NAMES = unitas
REPO_URI_unitas = https://dev.unitas-network.de/r/Gentoo/Unitas.git

2984
jitsi/kernel.config Normal file

File diff suppressed because it is too large Load Diff

7
jitsi/make.conf Normal file
View File

@ -0,0 +1,7 @@
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"
USE="hardened justify pie ssp urandom xattr -fortran -pch -pic -prelink -profile -tcc"
MAKEOPTS="-j5"
PYTHON_TARGETS="python3_6"
PYTHON_SINGLE_TARGET="python3_6"
VIDEO_CARDS="vmware"

View File

@ -0,0 +1,62 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name meet.example.com;
access_log /var/log/nginx/meet.example.com.access_log main;
error_log /var/log/nginx/meet.example.com.error_log info;
root /var/www/meet.example.com/htdocs;
if ($host = meet.example.com) {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
server_name meet.example.com;
ssl_certificate /etc/ssl/nginx/nginx.pem;
ssl_certificate_key /etc/ssl/nginx/nginx.key;
access_log /var/log/nginx/meet.example.com.ssl_access_log main;
error_log /var/log/nginx/meet.example.com.ssl_error_log info;
root /usr/share/jitsi-meet;
ssi on;
index index.html index.htm;
error_page 404 /static/404.html;
location = /config.js {
alias /etc/jitsi/meet/meet.example.com-config.js;
}
location = /external_api.js {
alias /usr/share/jitsi-meet/libs/external_api.min.js;
}
#ensure all static content can always be found first
location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
{
add_header 'Access-Control-Allow-Origin' '*';
alias /usr/share/jitsi-meet/$1/$2;
}
# BOSH
location = /bosh {
proxy_pass https://talk.example.com:5443/bosh;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
add_header Access-Control-Allow-Origin "*";
}
location ~ ^/([^/?&:'"]+)$ {
try_files $uri @root_path;
}
location @root_path {
rewrite ^/(.*)$ / break;
}
}

46
jitsi/nginx/nginx.conf Normal file
View File

@ -0,0 +1,46 @@
user nginx nginx;
worker_processes 1;
error_log /var/log/nginx/error_log info;
events {
worker_connections 1024;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main
'$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
client_header_timeout 10m;
client_body_timeout 10m;
send_timeout 10m;
connection_pool_size 256;
client_header_buffer_size 1k;
large_client_header_buffers 4 2k;
request_pool_size 4k;
gzip off;
output_buffers 1 32k;
postpone_output 1460;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 75 20;
ignore_invalid_headers on;
index index.html;
include /etc/nginx/conf.d/*.conf;
}

3
jitsi/package.keywords Normal file
View File

@ -0,0 +1,3 @@
# Grundsystem
app-emulation/open-vm-tools ~amd64 ~x86
sys-auth/pam_ssh_agent_auth ~amd64 ~x86

27
jitsi/package.use Normal file
View File

@ -0,0 +1,27 @@
# base
app-admin/sudo -sendmail
app-editors/nano ncurses
app-emulation/open-vm-tools pic -modules
app-misc/mc -slang
dev-lang/python ssl threads xml
dev-libs/libpcre cxx jit
dev-libs/libpcre2 jit
dev-util/pkgconfig internal-glib
dev-vcs/git -python
net-misc/openssh ssl
net-misc/wget ssl
sys-apps/hwids udev
sys-apps/kmod tools
sys-apps/net-tools hostname
sys-apps/portage ipc
sys-auth/pambase nullok sha512
sys-devel/gcc cxx nptl
sys-kernel/gentoo-sources symlink
# Monitoring
net-analyzer/zabbix agent
# Jitsi Meet
app-text/poppler -introspection -jpeg -jpeg2k
net-print/cups-filters -foomatic -postscript
dev-java/openjdk-jre-bin headless-awt

16
jitsi/world Normal file
View File

@ -0,0 +1,16 @@
app-admin/logrotate
app-admin/sudo
app-emulation/open-vm-tools
app-emulation/qemu-guest-agent
app-misc/mc
app-misc/tmuxservice
net-analyzer/zabbix
sys-auth/pam_ssh_agent_auth
sys-fs/mdadm
sys-power/acpid
app-crypt/certbot-nginx
dev-java/openjdk-jre-bin
net-misc/jicofo-bin
net-misc/jitsi-meet-web-bin
net-misc/jitsi-videobridge-bin
www-servers/nginx