73aac2a00f4152e453c397971c9dbfa2aad51715
[buildscripts] / bbb
1 #!/bin/bash
2
3 # misc interesting:
4 # https://github.com/sergeyksv/tingodb
5
6
7 #### begin bbb-docker-dev setup
8 mkc /a/opt/bbb-docker-dev-setup/
9 ln -s $PWD ~
10
11
12 ### begin vm setup, a/v didnt work, probably a nat issue
13
14 s virsh dumpxml ubuntu20.04-clone-bbb | gr mac
15 # use mac
16 virsh net-update default add ip-dhcp-host "<host mac='52:54:00:8e:c3:55' name='i.b8.nz' ip='192.168.122.17' />" --live --config
17
18 virsh start ubuntu20.04-clone-bbb
19
20 iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 16384:32768 -j DNAT --to 192.168.122.17:16384-32768
21 iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j DNAT --to 192.168.122.17:80
22 iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 443 -j DNAT --to 192.168.122.17:443
23 # based on https://serverfault.com/a/1083813
24 iptables -I LIBVIRT_FWI -o virbr0 -d 192.168.122.17 -m conntrack --ctstate DNAT,RELATED,ESTABLISHED -j ACCEPT
25 # alternate would be to have matching rule like this:
26 #iptables -D LIBVIRT_FWI -o virbr0 -p tcp -d 192.168.122.17 --dport 443 -j ACCEPT
27 # the accept rule here doesnt work without -i, and it is in the wrong chain.
28 # https://wiki.libvirt.org/page/Networking#Forwarding_Incoming_Connections
29
30
31 # on router, forward 80, 443 and these:
32
33 cat <<'EOF'
34 config redirect
35 option name bbbudp
36 option src wan
37 option src_dport 16384:32768
38 option dest lan
39 option dest_ip $l.7
40 option proto udp
41 config rule
42 option src wan
43 option target ACCEPT
44 option dest_port 16384:32768
45 option proto udp
46 EOF
47
48
49 wget -qO- https://ubuntu.bigbluebutton.org/bbb-install-2.5.sh | bash -sxe -- -v focal-250 -s i.b8.nz -e letsencrypt@b8.nz -a -g
50
51
52
53
54 ### failed systemd-nspawn steps (docker doesnt work inside)
55
56 mkschroot -s /a/bin/fai/fai/config/files/etc/apt/sources.list.d/focal.list/FOCAL focal
57 s ln -s /nocow/schroot/focal /var/lib/machines
58 https://docs.bigbluebutton.org/2.5/install.html
59 apt-get install -y language-pack-en
60 update-locale LANG=en_US.UTF-8
61 s systemd-nspawn -b -M focal --bind /a
62 s sed -i 's/^/#/' /etc/apache2/ports.conf