2023-04-28 00:38:44 +08:00
|
|
|
#!/bin/bash
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
|
|
echo "Please run this script as root ( or with sudo )" ;
|
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
|
|
#Install Go
|
2023-07-18 20:16:31 +08:00
|
|
|
#sudo apt install golang -y
|
2023-10-07 02:12:16 +08:00
|
|
|
GO_VERSION=1.20.8
|
2023-07-19 02:03:37 +08:00
|
|
|
wget --no-verbose https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz \
|
2023-10-07 02:12:16 +08:00
|
|
|
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
|
|
|
|
&& rm go${GO_VERSION}.linux-amd64.tar.gz \
|
|
|
|
&& ln -sf /usr/local/go/bin/go /usr/bin/go
|
2023-07-18 20:16:31 +08:00
|
|
|
|
2023-04-28 00:38:44 +08:00
|
|
|
go version
|
|
|
|
|
|
|
|
# Build Graphql Middleware
|
2023-07-18 17:30:02 +08:00
|
|
|
./local-build.sh
|
2023-04-28 00:38:44 +08:00
|
|
|
mv bbb-graphql-middleware /usr/local/bin/bbb-graphql-middleware
|
|
|
|
|
|
|
|
# Create service bbb-graphql-middleware
|
|
|
|
cp ./bbb-graphql-middleware-config.env /etc/default/bbb-graphql-middleware
|
|
|
|
cp ./bbb-graphql-middleware.service /lib/systemd/system/bbb-graphql-middleware.service
|
|
|
|
systemctl enable bbb-graphql-middleware
|
|
|
|
systemctl start bbb-graphql-middleware
|
|
|
|
|
|
|
|
|
|
|
|
# Set nginx location
|
|
|
|
cp ./graphql.nginx /usr/share/bigbluebutton/nginx
|
|
|
|
systemctl restart nginx
|
|
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Bbb-graphql-middleware Installed!"
|