Update to install version 2.3
This commit is contained in:
@@ -354,8 +354,8 @@ blank_line
|
||||
|
||||
# Add Docker’s official GPG key
|
||||
#
|
||||
echononl "Add Docker’s official GPG key .."
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg 2> "$log_file" | sudo apt-key add - >> "$log_file" 2>&1
|
||||
echononl "Add Docker's official GPG key .."
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg 2> "$log_file" | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg >> "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
@@ -363,11 +363,12 @@ else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
|
||||
# Add Dockers stable repository
|
||||
#
|
||||
echononl "Add Dockers stable repositor .."
|
||||
cat <<EOF > /etc/apt/sources.list.d/docker.list 2> "$log_file"
|
||||
deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
|
||||
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
|
||||
EOF
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
@@ -400,21 +401,21 @@ fi
|
||||
|
||||
blank_line
|
||||
|
||||
# Deinstall apparmor
|
||||
## Deinstall apparmor
|
||||
##
|
||||
## Needed if docker is running in a LX Conatiner
|
||||
##
|
||||
#echononl "Deinstall apparmor - Needed because docker is running in a LX-Container .."
|
||||
#DEBIAN_FRONTEND=noninteractive apt-get -y remove apparmor > "$log_file" 2>&1
|
||||
#if [[ $? -ne 0 ]]; then
|
||||
# echo_failed
|
||||
# error "$(cat "$log_file")"
|
||||
#else
|
||||
# echo_ok
|
||||
#fi
|
||||
#
|
||||
# Needed if docker is running in a LX Conatiner
|
||||
#
|
||||
echononl "Deinstall apparmor - Needed because docker is running in a LX-Container .."
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y remove apparmor > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
|
||||
blank_line
|
||||
#blank_line
|
||||
|
||||
# Create the Greenlight directory for its configuration to live in.
|
||||
#
|
||||
@@ -563,6 +564,28 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# Set SAFE_HOSTSA (Setting Allowed Hosts)
|
||||
#
|
||||
# For reasons related to security, you'll also need to specify the domain from
|
||||
# which the application will be accessible from.
|
||||
#
|
||||
_key="SAFE_HOSTS"
|
||||
_val="${FQDN_HOSTNAME}"
|
||||
echononl "Set '${_key}' to '${_val}' (file .env).."
|
||||
if $(grep -E -q "^\s*${_key}\s*=\s*${_val}" ${GREENLIGTH_DIR}/.env 2> /dev/null) ; then
|
||||
echo_skipped
|
||||
else
|
||||
perl -i -n -p -e "s#^(\s*${_key}\s*=.*)#\#\#! \1\n${_key}=${_val}#" \
|
||||
${GREENLIGTH_DIR}/.env > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Set ALLOW_GREENLIGHT_ACCOUNTS
|
||||
#
|
||||
_key="ALLOW_GREENLIGHT_ACCOUNTS"
|
||||
@@ -581,53 +604,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
blank_line
|
||||
|
||||
|
||||
# randomly generate a password for the PostgreSQL database and replace the entries
|
||||
# in the .env and docker-compose.yml
|
||||
#
|
||||
# export pass=$(openssl rand -hex 8)
|
||||
# sed -i 's/POSTGRES_PASSWORD=password/POSTGRES_PASSWORD='$_postgresql_pass'/g' docker-compose.yml
|
||||
# sed -i 's/DB_PASSWORD=password/DB_PASSWORD='$_postgresql_pass'/g' .env
|
||||
#
|
||||
_postgresql_pass=""
|
||||
_pass_generated=false
|
||||
echononl "Generate password for the PostgreSQL database.."
|
||||
if $_new_env ; then
|
||||
_postgresql_pass="$(openssl rand -hex 8 2> $log_file)"
|
||||
if [[ -s "$log_file" ]] ; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
_pass_generated=true
|
||||
fi
|
||||
else
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
|
||||
# Set DB_PASSWORD'
|
||||
#
|
||||
_key="DB_PASSWORD"
|
||||
_val="$_postgresql_pass"
|
||||
echononl "Set DB_PASSWORD (file .env).."
|
||||
if $_pass_generated ; then
|
||||
perl -i -n -p -e "s#^(\s*${_key}\s*=.*)#\#\#! \1\n${_key}=${_val}#" \
|
||||
${GREENLIGTH_DIR}/.env > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
else
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
|
||||
|
||||
blank_line
|
||||
|
||||
echononl "Verify the configuration settings (.env file).."
|
||||
@@ -664,13 +640,23 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
echononl "Restart nginx service.."
|
||||
systemctl restart nginx > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
|
||||
blank_line
|
||||
|
||||
|
||||
# Download the current stable release of Docker Compose:
|
||||
#
|
||||
echononl "Download the current stable release (v 1.25.4) of Docker Compose .."
|
||||
curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" \
|
||||
echononl "Download the current stable release (v 1.29.2) of Docker Compose .."
|
||||
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" \
|
||||
-o /usr/local/bin/docker-compose > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
@@ -688,9 +674,89 @@ else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
info "To install a different version of Compose, substitute 1.25.4 with the
|
||||
info "To install a different version of Compose, substitute 1.29.2 with the
|
||||
version of Compose you want to use."
|
||||
|
||||
|
||||
|
||||
blank_line
|
||||
|
||||
|
||||
echononl "Copy the docker-compose.yml file from the Greenlight image in to greenlight directory.."
|
||||
cd ${GREENLIGTH_DIR} \
|
||||
&& docker run --rm bigbluebutton/greenlight:v2 cat ./docker-compose.yml > docker-compose.yml 2> $log_file
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
blank_line
|
||||
|
||||
|
||||
# randomly generate a password for the PostgreSQL database and replace the entries
|
||||
# in the .env and docker-compose.yml
|
||||
#
|
||||
# export pass=$(openssl rand -hex 8)
|
||||
# sed -i 's/POSTGRES_PASSWORD=password/POSTGRES_PASSWORD='$_postgresql_pass'/g' docker-compose.yml
|
||||
# sed -i 's/DB_PASSWORD=password/DB_PASSWORD='$_postgresql_pass'/g' .env
|
||||
#
|
||||
_postgresql_pass=""
|
||||
_pass_generated=false
|
||||
echononl "Generate password for the PostgreSQL database.."
|
||||
if $_new_env ; then
|
||||
_postgresql_pass="$(openssl rand -base64 24 2> $log_file)"
|
||||
if [[ -s "$log_file" ]] ; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
_pass_generated=true
|
||||
fi
|
||||
else
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
|
||||
echononl "Set 'POSTGRES_PASSWORD' (file docker-compose.yml).."
|
||||
if $_pass_generated ; then
|
||||
sed -i 's/POSTGRES_PASSWORD=password/POSTGRES_PASSWORD='$_postgresql_pass'/g' \
|
||||
${GREENLIGTH_DIR}/docker-compose.yml > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
else
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
# Set DB_PASSWORD'
|
||||
#
|
||||
_key="DB_PASSWORD"
|
||||
_val="$_postgresql_pass"
|
||||
echononl "Set DB_PASSWORD (file .env).."
|
||||
if $_pass_generated ; then
|
||||
perl -i -n -p -e "s#^(\s*${_key}\s*=.*)#\#\#! \1\n${_key}=${_val}#" \
|
||||
${GREENLIGTH_DIR}/.env > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
else
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
|
||||
blank_line
|
||||
|
||||
echononl "Create cronjob to start Greenlight service after booting the system.."
|
||||
if $(crontab -l 2>/dev/null | grep -q -E "^@reboot\s+.*\s+docker-compose up -d" 2> /dev/null) ; then
|
||||
echo_skipped
|
||||
@@ -717,31 +783,6 @@ fi
|
||||
|
||||
blank_line
|
||||
|
||||
|
||||
echononl "Copy the docker-compose.yml file from the Greenlight image in to greenlight directory.."
|
||||
cd ${GREENLIGTH_DIR} \
|
||||
&& docker run --rm bigbluebutton/greenlight:v2 cat ./docker-compose.yml > docker-compose.yml 2> $log_file
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
echononl "Set 'POSTGRES_PASSWORD' (file docker-compose.yml).."
|
||||
if $_pass_generated ; then
|
||||
sed -i 's/POSTGRES_PASSWORD=password/POSTGRES_PASSWORD='$_postgresql_pass'/g' \
|
||||
${GREENLIGTH_DIR}/docker-compose.yml > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
else
|
||||
echo_skipped
|
||||
fi
|
||||
|
||||
echononl "Start Greenlight service (vi docker).."
|
||||
cd ${GREENLIGTH_DIR} && docker-compose up -d > $log_file 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
@@ -751,15 +792,6 @@ else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
echononl "Restart nginx service.."
|
||||
systemctl restart nginx > "$log_file" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo_failed
|
||||
error "$(cat "$log_file")"
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
|
||||
|
||||
blank_line
|
||||
@@ -776,7 +808,7 @@ note "To create an Administrator account with the default values, in the Greenli
|
||||
# cd $GREENLIGTH_DIR
|
||||
# \033[1mdocker exec greenlight-v2 bundle exec rake user:create[\"name\",\"email\",\"password\",\"admin\"]\033[m
|
||||
|
||||
Once the command has finished it will print the account’s email and password."
|
||||
Once the command has finished it will print the account's email and password."
|
||||
|
||||
note "Optionally, if you wish to have the default landing page at the root of your BigBlueButton
|
||||
server redirect to Greenlight, add the following entry to the bottom
|
||||
|
||||
Reference in New Issue
Block a user