Skip to content

Commit

Permalink
Merge pull request #15 from AsyncWeb/dev
Browse files Browse the repository at this point in the history
settings.yml copied to html5
  • Loading branch information
nishekh-e-r committed Jul 17, 2023
2 parents 41c6e83 + 2c90546 commit d1e3fa8
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 41 deletions.
61 changes: 36 additions & 25 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ if [[ $EUID -eq 0 ]]; then
exit 1
fi



# Get the BigBlueButton version from the release file
version=$(grep -oP 'BIGBLUEBUTTON_RELEASE=\K[\d.]+' /etc/bigbluebutton/bigbluebutton-release)

Expand All @@ -28,13 +26,13 @@ if [[ $version == "2.6.10" ]]; then

# Check if .env file exists
if [[ -f .env ]]; then
# Overwrite existing environment variables if they exist
sed -i -E "s~^(BBB_URL=).*~\1${BBB_URL}~" .env
sed -i -E "s~^(BBB_SECRET=).*~\1${BBB_SECRET}~" .env
# Overwrite existing environment variables if they exist
sed -i -E "s~^(BBB_URL=).*~\1${BBB_URL}~" .env
sed -i -E "s~^(BBB_SECRET=).*~\1${BBB_SECRET}~" .env
else
# Create new .env file
echo "BBB_URL=${BBB_URL}" >> .env
echo "BBB_SECRET=${BBB_SECRET}" >> .env
# Create new .env file
echo "BBB_URL=${BBB_URL}" >> .env
echo "BBB_SECRET=${BBB_SECRET}" >> .env
fi

cat .env
Expand All @@ -47,20 +45,19 @@ if [[ $version == "2.6.10" ]]; then
sudo cp -R /usr/share/meteor/bundle /usr/share/meteor/bbb-html5-original || { echo "Error: Failed to copy bundle"; exit 1; }

# Set ownership of copied files to the current user

sudo chown -R $current_user:$current_user /usr/share/meteor/bbb-html5-original
else
echo "bbb-html5-original folder already exists. Skipping copy and ownership changes."
fi

# Navigate to src/bigbluebutton-html5 directory
# Navigate to src/bigbluebutton-html5 directory
cd src/bigbluebutton-html5

if npm install --legacy-peer-deps; then
echo "Packages installed successfully"
echo "Packages installed successfully"
else
echo "Error:Failed install packages"
exit 1
echo "Error: Failed to install packages"
exit 1
fi

# Check if Meteor is installed
Expand All @@ -71,6 +68,20 @@ if [[ $version == "2.6.10" ]]; then
else
echo "Meteor is already installed"
fi

if sudo rm "$(pwd)"/private/config/settings.yml; then
echo "settings.yml removed successfully"
else
echo "Error: Failed to remove settings.yml"
exit 1
fi

if cp /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml "$(pwd)"/private/config/; then
echo "Successfully copied settings.yml"
else
echo "Error: Failed to copy settings.yml"
exit 1
fi

# Create build folder if it doesn't exist
build_path=$(dirname "$(dirname "$(pwd)")")/build
Expand All @@ -88,11 +99,13 @@ if [[ $version == "2.6.10" ]]; then

cd ../../



if sudo tar -xzvf "$(pwd)"/build/*.tar.gz -C /usr/share/meteor; then
echo "files are copied to meteor"
echo "Files are copied to meteor"
else
echo "Error: Failed copy files to meteor"
exit 1
echo "Error: Failed to copy files to meteor"
exit 1
fi


Expand All @@ -119,14 +132,14 @@ if [[ $version == "2.6.10" ]]; then
cd "$(pwd)"/streaming-server

# Install packages
if npm install; then
if npm install; then
echo "Packages installed successfully"
else
echo "Error: Failed to install packages"
exit 1
fi

# Copy streaming.nginx file to /usr/share/bigbluebutton/nginx
# Copy streaming.nginx file to /usr/share/bigbluebutton/nginx
sudo cp streaming.nginx /usr/share/bigbluebutton/nginx || { echo "Error: Failed to copy streaming.nginx"; exit 1; }

# Reload Nginx server
Expand All @@ -148,8 +161,6 @@ if [[ $version == "2.6.10" ]]; then
# Install PM2
sudo npm install -g pm2



# Run npm start command with PM2
if pm2 start npm --name "bbb-streaming" -- start; then
echo "streaming-server started successfully"
Expand All @@ -159,13 +170,13 @@ if [[ $version == "2.6.10" ]]; then
fi

if sudo bbb-conf --restart; then
echo "BigBlueButton restarted"
echo "BigBlueButton restarted"
else
echo "Error: Failed to restart BigBlueButton"
exit 1
echo "Error: Failed to restart BigBlueButton"
exit 1
fi



else
echo "Please use BigBlueButton 2.6.10"
exit 1
fi
58 changes: 43 additions & 15 deletions src/bigbluebutton-html5/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi

# Set ownership of copied files to the current user

sudo chown -R $current_user:$current_user /usr/share/meteor/bundle
sudo chown -R $current_user:$current_user /usr/share/meteor/bundle

if sudo bbb-conf --restart; then
echo "BigBlueButton restarted"
Expand Down

0 comments on commit d1e3fa8

Please sign in to comment.