Skip to content

Commit 5ce9be9

Browse files
committed
Set http2 disabled in nginx and haproxy config
1 parent 0de832b commit 5ce9be9

File tree

1 file changed

+42
-34
lines changed

1 file changed

+42
-34
lines changed

bbb-install.sh

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ OPTIONS (install BigBlueButton):
6060
6161
-c <hostname>:<secret> Configure with external coturn server at <hostname> using <secret> (instead of built-in TURN server)
6262
63-
-m <link_path> Create a Symbolic link from /var/bigbluebutton to <link_path>
63+
-m <link_path> Create a Symbolic link from /var/bigbluebutton to <link_path>
6464
6565
-p <host>[:<port>] Use apt-get proxy at <host> (default port 3142)
6666
-r <host> Use alternative apt repository (such as packages-eu.bigbluebutton.org)
@@ -143,7 +143,7 @@ main() {
143143

144144
s)
145145
HOST=$OPTARG
146-
if [ "$HOST" == "bbb.example.com" ]; then
146+
if [ "$HOST" == "bbb.example.com" ]; then
147147
err "You must specify a valid hostname (not the hostname given in the docs)."
148148
fi
149149
;;
@@ -152,7 +152,7 @@ main() {
152152
;;
153153
e)
154154
EMAIL=$OPTARG
155-
if [ "$EMAIL" == "[email protected]" ]; then
155+
if [ "$EMAIL" == "[email protected]" ]; then
156156
err "You must specify a valid email address (not the email in the docs)."
157157
fi
158158
;;
@@ -312,7 +312,7 @@ main() {
312312
install_docker # needed for bbb-libreoffice-docker
313313
need_pkg ruby
314314

315-
BBB_WEB_ETC_CONFIG=/etc/bigbluebutton/bbb-web.properties # Override file for local settings
315+
BBB_WEB_ETC_CONFIG=/etc/bigbluebutton/bbb-web.properties # Override file for local settings
316316

317317
need_pkg openjdk-17-jre
318318
update-java-alternatives -s java-1.17.0-openjdk-amd64
@@ -371,7 +371,7 @@ main() {
371371
systemctl restart systemd-journald
372372

373373
if [ -n "$UFW" ]; then
374-
setup_ufw
374+
setup_ufw
375375
fi
376376

377377
if [ -n "$HOST" ]; then
@@ -416,7 +416,7 @@ main() {
416416
<!ATTLIST policy stealth NMTOKEN #IMPLIED>
417417
<!ATTLIST policy value CDATA #IMPLIED>
418418
]>
419-
<!--
419+
<!--
420420
Creating a security policy that fits your specific local environment
421421
before making use of ImageMagick is highly advised. You can find guidance on
422422
setting up this policy at https://imagemagick.org/script/security-policy.php,
@@ -599,7 +599,7 @@ get_IP() {
599599

600600

601601
local external_ip
602-
# Determine external IP
602+
# Determine external IP
603603
if grep -sqi ^ec2 /sys/devices/virtual/dmi/id/product_uuid; then
604604
# EC2
605605
external_ip=$(wget -qO- http://169.254.169.254/latest/meta-data/public-ipv4)
@@ -631,17 +631,17 @@ get_IP() {
631631
nc -l -p 443 > /dev/null 2>&1 &
632632
nc_PID=$!
633633
sleep 1
634-
634+
635635
# Check if we can reach the server through it's external IP address
636636
if nc -zvw3 "$external_ip" 443 > /dev/null 2>&1; then
637637
INTERNAL_IP=$IP
638638
IP=$external_ip
639-
echo
639+
echo
640640
echo " Detected this server has an internal/external IP address."
641-
echo
641+
echo
642642
echo " INTERNAL_IP: $INTERNAL_IP"
643643
echo " (external) IP: $IP"
644-
echo
644+
echo
645645
fi
646646

647647
kill $nc_PID > /dev/null 2>&1;
@@ -671,7 +671,7 @@ need_pkg() {
671671
}
672672

673673
need_ppa() {
674-
need_pkg software-properties-common
674+
need_pkg software-properties-common
675675
if [ ! -f "/etc/apt/sources.list.d/$1" ]; then
676676
LC_CTYPE=C.UTF-8 add-apt-repository -y "$2"
677677
fi
@@ -714,18 +714,18 @@ check_coturn() {
714714
if [ -z "$COTURN_HOST" ]; then err "-c option must contain <hostname>"; fi
715715
if [ -z "$COTURN_SECRET" ]; then err "-c option must contain <secret>"; fi
716716

717-
if [ "$COTURN_HOST" == "turn.example.com" ]; then
717+
if [ "$COTURN_HOST" == "turn.example.com" ]; then
718718
err "You must specify a valid hostname (not the example given in the docs)"
719719
fi
720-
if [ "$COTURN_SECRET" == "1234abcd" ]; then
720+
if [ "$COTURN_SECRET" == "1234abcd" ]; then
721721
err "You must specify a new password (not the example given in the docs)."
722722
fi
723723

724724
check_host "$COTURN_HOST"
725725
}
726726

727727
check_apache2() {
728-
if dpkg -l | grep -q apache2-bin; then
728+
if dpkg -l | grep -q apache2-bin; then
729729
echo "You must uninstall the Apache2 server first"
730730
if [ "$SKIP_APACHE_INSTALLED_CHECK" != true ]; then
731731
exit 1
@@ -791,8 +791,8 @@ check_nat() {
791791

792792
# If dummy NIC is not in dummy-nic.service (or the file does not exist), update/create it
793793
if ! grep -q "$IP" /lib/systemd/system/dummy-nic.service > /dev/null 2>&1; then
794-
if [ -f /lib/systemd/system/dummy-nic.service ]; then
795-
DAEMON_RELOAD=true;
794+
if [ -f /lib/systemd/system/dummy-nic.service ]; then
795+
DAEMON_RELOAD=true;
796796
fi
797797

798798
cat > /lib/systemd/system/dummy-nic.service << HERE
@@ -824,7 +824,7 @@ check_LimitNOFILE() {
824824

825825
if [ "$CPU" -ge 8 ]; then
826826
if [ -f /lib/systemd/system/bbb-web.service ]; then
827-
# Let's create an override file to increase the number of LimitNOFILE
827+
# Let's create an override file to increase the number of LimitNOFILE
828828
mkdir -p /etc/systemd/system/bbb-web.service.d/
829829
cat > /etc/systemd/system/bbb-web.service.d/override.conf << HERE
830830
[Service]
@@ -885,7 +885,8 @@ defaults
885885
886886
887887
frontend nginx_or_turn
888-
bind *:443,:::443 ssl crt /etc/haproxy/certbundle.pem ssl-min-ver TLSv1.2 alpn h2,http/1.1,stun.turn
888+
# Http2 is disabled, include h2 to the list if you want to enable it: h2,http/1.1,stun.turn
889+
bind *:443,:::443 ssl crt /etc/haproxy/certbundle.pem ssl-min-ver TLSv1.2 alpn http/1.1,stun.turn
889890
mode tcp
890891
option tcplog
891892
tcp-request content capture req.payload(0,1) len 1
@@ -1010,7 +1011,7 @@ install_greenlight_v3(){
10101011
if [ ! -s $GL3_DIR/.env ]; then
10111012
err "failed to create greenlight-v3 .env file - is docker running?"
10121013
fi
1013-
1014+
10141015
say "greenlight-v3 .env file was created"
10151016
fi
10161017

@@ -1396,7 +1397,7 @@ wait_lti_broker_start() {
13961397
echo -n .
13971398
sleep 3
13981399
if (( ++tries == 3 )); then
1399-
err "failed to register LTI framework apps due to reaching LTI broker waiting timeout - retry to resolve"
1400+
err "failed to register LTI framework apps due to reaching LTI broker waiting timeout - retry to resolve"
14001401
fi
14011402
done
14021403

@@ -1416,7 +1417,7 @@ wait_postgres_start() {
14161417
echo -n .
14171418
sleep 3
14181419
if (( ++tries == 3 )); then
1419-
err "failed to start Postgres due to reaching waiting timeout - retry to resolve"
1420+
err "failed to start Postgres due to reaching waiting timeout - retry to resolve"
14201421
fi
14211422
done
14221423

@@ -1617,8 +1618,12 @@ server {
16171618
# Depending on the ALPN value traffic is redirected to either port 82 (HTTP2,
16181619
# ALPN value h2) or 81 (HTTP 1.0 or HTTP 1.1, ALPN value http/1.1 or no value)
16191620
1620-
listen 127.0.0.1:82 http2 proxy_protocol;
1621-
listen [::1]:82 http2;
1621+
# Http2 is disabled, include http2 to the list if you want to enable it
1622+
# listen 127.0.0.1:82 http2 proxy_protocol;
1623+
# listen [::1]:82 http2;
1624+
1625+
listen 127.0.0.1:82 proxy_protocol;
1626+
listen [::1]:82;
16221627
listen 127.0.0.1:81 proxy_protocol;
16231628
listen [::1]:81;
16241629
server_name $HOST;
@@ -1671,8 +1676,12 @@ server {
16711676
}
16721677
16731678
server {
1674-
listen 443 ssl http2;
1675-
listen [::]:443 ssl http2;
1679+
# Http2 is disabled, include http2 to the list if you want to enable it
1680+
# listen 443 ssl http2;
1681+
# listen [::]:443 ssl http2;
1682+
1683+
listen 443 ssl;
1684+
listen [::]:443 ssl;
16761685
server_name $HOST;
16771686
16781687
ssl_certificate /etc/letsencrypt/live/$HOST/fullchain.pem;
@@ -1682,7 +1691,7 @@ server {
16821691
ssl_protocols TLSv1.2 TLSv1.3;
16831692
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
16841693
ssl_dhparam /etc/nginx/ssl/ffdhe2048.pem;
1685-
1694+
16861695
# HSTS (comment out to enable)
16871696
#add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
16881697
@@ -1734,7 +1743,7 @@ fi
17341743

17351744
# Configure rest of BigBlueButton Configuration for SSL
17361745
xmlstarlet edit --inplace --update '//param[@name="wss-binding"]/@value' --value "$IP:7443" /opt/freeswitch/conf/sip_profiles/external.xml
1737-
1746+
17381747
# shellcheck disable=SC1091
17391748
eval "$(source /etc/bigbluebutton/bigbluebutton-release && declare -p BIGBLUEBUTTON_RELEASE)"
17401749
if [[ $BIGBLUEBUTTON_RELEASE == 2.2.* ]] && [[ ${BIGBLUEBUTTON_RELEASE#*.*.} -lt 29 ]]; then
@@ -1752,7 +1761,7 @@ fi
17521761
fi
17531762

17541763
yq e -i '.playback_protocol = "https"' /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml
1755-
chmod 644 /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml
1764+
chmod 644 /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml
17561765

17571766
# Update Greenlight (if installed) to use SSL
17581767
for gl_dir in ~/greenlight $GL3_DIR;do
@@ -1815,12 +1824,12 @@ configure_coturn() {
18151824
xsi:schemaLocation="http://www.springframework.org/schema/beans
18161825
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
18171826
1818-
<!--
1827+
<!--
18191828
We need turn0 for FireFox to workaround its limited ICE implementation.
18201829
This is UDP connection. Note that port 3478 must be open on this BigBlueButton
18211830
and reachable by the client.
18221831
1823-
Also, in 2.5, we previously defined turn:\$HOST:443?transport=tcp (not 'turns')
1832+
Also, in 2.5, we previously defined turn:\$HOST:443?transport=tcp (not 'turns')
18241833
to workaround a bug in Safari's handling of Let's Encrypt. This bug is now fixed
18251834
https://bugs.webkit.org/show_bug.cgi?id=219274, so we omit the 'turn' protocol over
18261835
port 443.
@@ -1835,7 +1844,7 @@ configure_coturn() {
18351844
<constructor-arg index="1" value="turns:$COTURN_HOST:443?transport=tcp"/>
18361845
<constructor-arg index="2" value="86400"/>
18371846
</bean>
1838-
1847+
18391848
<bean id="stunTurnService"
18401849
class="org.bigbluebutton.web.services.turn.StunTurnService">
18411850
<property name="stunServers">
@@ -1931,7 +1940,7 @@ HERE
19311940

19321941
# Eanble coturn to bind to port 443 with CAP_NET_BIND_SERVICE
19331942
mkdir -p /etc/systemd/system/coturn.service.d
1934-
rm -rf /etc/systemd/system/coturn.service.d/ansible.conf # Remove previous file
1943+
rm -rf /etc/systemd/system/coturn.service.d/ansible.conf # Remove previous file
19351944
cat > /etc/systemd/system/coturn.service.d/override.conf <<HERE
19361945
[Service]
19371946
LimitNOFILE=1048576
@@ -1962,4 +1971,3 @@ HERE
19621971
}
19631972

19641973
main "$@" || exit 1
1965-

0 commit comments

Comments
 (0)