bigbluebutton-Github/bbb-graphql-server/install-hasura.sh

53 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Please run this script as root ( or with sudo )" ;
exit 1;
fi;
cd "$(dirname "$0")"
# Install Postgresql
2023-03-11 23:11:50 +08:00
apt update
apt install postgresql postgresql-contrib -y
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'bigbluebutton'"
sudo -u postgres psql -c "create database bigbluebutton"
sudo -u postgres psql -U postgres -d bigbluebutton -a -f bbb_schema.sql
sudo -u postgres psql -c "create database hasura_app"
echo "Postgresql installed!"
2023-03-11 23:11:50 +08:00
#Build Hasura
# https://github.com/hasura/graphql-engine/blob/master/server/CONTRIBUTING.md
2023-03-11 23:11:50 +08:00
# sudo apt install haskell-platform -y
# sudo apt-get install cabal-install -y
#wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
#sudo sh -c "rm -rf /usr/local/go && tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz"
#export PATH=$PATH:/usr/local/go/bin
#go version
# Configs nginx
2023-03-11 23:11:50 +08:00
cp ./graphql.nginx /usr/share/bigbluebutton/nginx
systemctl restart nginx
# Install Hasura graphql as service
wget https://graphql-engine-cdn.hasura.io/server/latest/linux-amd64 -O /usr/local/bin/hasura-graphql-engine
chmod +x /usr/local/bin/hasura-graphql-engine
apt-get install -y gnupg2 curl apt-transport-https ca-certificates libkrb5-3 libpq5 libnuma1 unixodbc-dev libmariadb-dev-compat mariadb-client-10.3
cp ./hasura-config.env /etc/default/bbb-graphql-server
cp ./bbb-graphql-server.service /lib/systemd/system/bbb-graphql-server.service
2023-03-11 23:11:50 +08:00
systemctl enable bbb-graphql-server
systemctl start bbb-graphql-server
# Install Hasura CLI
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
# Apply BBB metadata in Hasura
/usr/local/bin/hasura metadata apply
echo ""
echo ""
echo "Bbb-graphql-server Installed!"
echo "http://bbb26.bbbvm.imdt.com.br:8080/console"