3ca9eb3eccd0865f3ae7b071123169ec1c5eb64d
[buildscripts] / bbb
1 #!/bin/bash
2 # I, Ian Kelling, follow the GNU license recommendations at
3 # https://www.gnu.org/licenses/license-recommendations.en.html. They
4 # recommend that small programs, < 300 lines, be licensed under the
5 # Apache License 2.0. This file contains or is part of one or more small
6 # programs. If a small program grows beyond 300 lines, I plan to switch
7 # its license to GPL.
8
9 # Copyright 2024 Ian Kelling
10
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
14
15 # http://www.apache.org/licenses/LICENSE-2.0
16
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
22
23
24 # misc interesting:
25 # https://github.com/sergeyksv/tingodb
26
27
28 #### begin bbb-docker-dev setup
29 mkc /a/opt/bbb-docker-dev-setup/
30 ln -s $PWD ~
31
32
33 ### begin vm setup, a/v didnt work, probably a nat issue
34
35 s virsh dumpxml ubuntu20.04-clone-bbb | gr mac
36 # use mac
37 virsh net-update default add ip-dhcp-host "<host mac='52:54:00:8e:c3:55' name='b8.nz' ip='192.168.122.17' />" --live --config
38
39 virsh start ubuntu20.04-clone-bbb
40
41 iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 16384:32768 -j DNAT --to 192.168.122.17:16384-32768
42 iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j DNAT --to 192.168.122.17:80
43 iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 443 -j DNAT --to 192.168.122.17:443
44 # based on https://serverfault.com/a/1083813
45 iptables -I LIBVIRT_FWI -o virbr0 -d 192.168.122.17 -m conntrack --ctstate DNAT,RELATED,ESTABLISHED -j ACCEPT
46 # alternate would be to have matching rule like this:
47 #iptables -D LIBVIRT_FWI -o virbr0 -p tcp -d 192.168.122.17 --dport 443 -j ACCEPT
48 # the accept rule here doesnt work without -i, and it is in the wrong chain.
49 # https://wiki.libvirt.org/page/Networking#Forwarding_Incoming_Connections
50
51
52 # on router, forward 80, 443 and these:
53
54 cat <<'EOF'
55 config redirect
56 option name bbbudp
57 option src wan
58 option src_dport 16384:32768
59 option dest lan
60 option dest_ip $l.7
61 option proto udp
62 config rule
63 option src wan
64 option target ACCEPT
65 option dest_port 16384:32768
66 option proto udp
67 EOF
68
69
70 wget -qO- https://ubuntu.bigbluebutton.org/bbb-install-2.5.sh | bash -sxe -- -v focal-250 -s b8.nz -e letsencrypt@b8.nz -a -g
71
72
73
74
75 ### failed systemd-nspawn steps (docker doesnt work inside)
76
77 mkschroot -s /a/bin/fai/fai/config/files/etc/apt/sources.list.d/focal.list/FOCAL focal
78 s ln -s /nocow/schroot/focal /var/lib/machines
79 https://docs.bigbluebutton.org/2.5/install.html
80 apt-get install -y language-pack-en
81 update-locale LANG=en_US.UTF-8
82 s systemd-nspawn -b -M focal --bind /a
83 s sed -i 's/^/#/' /etc/apache2/ports.conf