2020-04-07 21:02:49 +00:00
|
|
|
#!/bin/bash
|
2020-04-11 07:57:28 +00:00
|
|
|
# JRA (Jibri Recordings Access) via Nextcloud
|
2024-03-21 20:09:38 +00:00
|
|
|
# SwITNet Ltd © - 2024, https://switnet.net/
|
2020-04-11 07:57:28 +00:00
|
|
|
# GPLv3 or later.
|
2022-05-21 01:07:02 +00:00
|
|
|
|
2020-09-30 02:27:13 +00:00
|
|
|
while getopts m: option
|
|
|
|
do
|
2022-05-21 01:07:02 +00:00
|
|
|
case "${option}"
|
|
|
|
in
|
|
|
|
m) MODE=${OPTARG};;
|
|
|
|
\?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;;
|
|
|
|
esac
|
2020-09-30 02:27:13 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
#DEBUG
|
|
|
|
if [ "$MODE" = "debug" ]; then
|
2024-01-23 08:46:53 +00:00
|
|
|
set -x
|
2020-09-30 02:27:13 +00:00
|
|
|
fi
|
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
if ! [ "$(id -u)" = 0 ]; then
|
2020-04-11 05:09:43 +00:00
|
|
|
echo "You need to be root or have sudo privileges!"
|
|
|
|
exit 0
|
|
|
|
fi
|
2020-10-09 04:40:46 +00:00
|
|
|
exit_if_not_installed() {
|
2022-05-21 01:07:02 +00:00
|
|
|
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" != "1" ]; then
|
2021-04-12 03:32:55 +00:00
|
|
|
echo " This instance doesn't have $1 installed, exiting..."
|
|
|
|
echo " If you think this is an error, please report to:
|
2023-11-07 20:42:50 +00:00
|
|
|
-> https://forge.switnet.net/switnet/quick-jibri-installer/issues "
|
2021-04-12 03:32:55 +00:00
|
|
|
exit
|
2020-10-09 04:40:46 +00:00
|
|
|
fi
|
|
|
|
}
|
2020-04-11 05:09:43 +00:00
|
|
|
clear
|
2020-10-05 08:19:03 +00:00
|
|
|
echo -e '\n
|
2020-04-11 05:09:43 +00:00
|
|
|
########################################################################
|
|
|
|
Jibri Recordings Access via Nextcloud
|
|
|
|
########################################################################
|
|
|
|
by Software, IT & Networks Ltd
|
2020-10-05 08:19:03 +00:00
|
|
|
\n'
|
2020-10-09 04:40:46 +00:00
|
|
|
exit_if_not_installed jitsi-meet
|
2023-08-23 06:51:24 +00:00
|
|
|
## APT checks
|
|
|
|
apt-get update -q2
|
|
|
|
# Manually add prerequisites.
|
|
|
|
apt-get install -y curl letsencrypt nginx
|
2020-10-09 04:40:46 +00:00
|
|
|
|
2024-01-23 08:46:53 +00:00
|
|
|
MIN_PHP="8.2"
|
2022-05-21 01:07:02 +00:00
|
|
|
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
|
2023-02-22 11:56:20 +00:00
|
|
|
PSGVER="$(apt-cache madison postgresql|tr -d '[:blank:]'|awk -F'[|+]' 'NR==1{print $2}')"
|
2022-05-21 01:07:02 +00:00
|
|
|
NC_NGINX_SSL_PORT="$(grep "listen 44" /etc/nginx/sites-available/"$DOMAIN".conf | awk '{print$2}')"
|
2023-02-22 09:54:21 +00:00
|
|
|
[ -z "$NC_NGINX_SSL_PORT" ] && NC_NGINX_SSL_PORT="443"
|
2020-10-09 04:40:46 +00:00
|
|
|
NC_REPO="https://download.nextcloud.com/server/releases"
|
|
|
|
NCVERSION="$(curl -s -m 900 $NC_REPO/ | sed --silent 's/.*href="nextcloud-\([^"]\+\).zip.asc".*/\1/p' | sort --version-sort | tail -1)"
|
|
|
|
STABLEVERSION="nextcloud-$NCVERSION"
|
|
|
|
NC_PATH="/var/www/nextcloud"
|
|
|
|
NC_CONFIG="$NC_PATH/config/config.php"
|
|
|
|
NC_DB_USER="nextcloud_user"
|
|
|
|
NC_DB="nextcloud_db"
|
|
|
|
NC_DB_PASSWD="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 14 | head -n1)"
|
2022-05-21 01:07:02 +00:00
|
|
|
DIR_RECORD="$(awk -F '"' '/RECORDING/{print$2}' /home/jibri/finalize_recording.sh|awk 'NR==1{print$1}')"
|
2020-10-09 04:40:46 +00:00
|
|
|
REDIS_CONF="/etc/redis/redis.conf"
|
|
|
|
JITSI_MEET_PROXY="/etc/nginx/modules-enabled/60-jitsi-meet.conf"
|
2023-08-23 06:51:24 +00:00
|
|
|
[ -f "$JITSI_MEET_PROXY" ] && PREAD_PROXY=$(grep -nr "preread_server_name" "$JITSI_MEET_PROXY" | cut -d ":" -f1)
|
2024-07-03 14:29:09 +00:00
|
|
|
PUBLIC_IP="$(dig -4 +short myip.opendns.com @resolver1.opendns.com)"
|
2021-07-05 16:55:50 +00:00
|
|
|
ISO3166_CODE=TBD
|
2022-05-21 01:07:02 +00:00
|
|
|
NL="$(printf '\n ')"
|
2023-08-23 06:51:24 +00:00
|
|
|
|
2024-01-23 08:46:53 +00:00
|
|
|
|
2023-08-23 06:51:24 +00:00
|
|
|
exit_ifinstalled() {
|
|
|
|
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
|
|
|
echo " This instance already has $1 installed, exiting..."
|
|
|
|
echo " If you think this is an error, please report to:
|
2023-11-07 20:42:50 +00:00
|
|
|
-> https://forge.switnet.net/switnet/quick-jibri-installer/issues "
|
2023-08-23 06:51:24 +00:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
install_ifnot() {
|
|
|
|
if [ "$(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
|
|
|
|
echo " $1 is installed, skipping..."
|
|
|
|
else
|
|
|
|
echo -e "\n---- Installing $1 ----"
|
|
|
|
apt-get -yq2 install "$1"
|
|
|
|
fi
|
|
|
|
}
|
2021-04-27 00:30:36 +00:00
|
|
|
while [[ "$ANS_NCD" != "yes" ]]
|
2020-06-03 07:46:08 +00:00
|
|
|
do
|
2022-05-21 01:07:02 +00:00
|
|
|
read -p "> Please set your domain (or subdomain) here for Nextcloud: (e.g.: cloud.domain.com)$NL" -r NC_DOMAIN
|
2021-04-27 00:30:36 +00:00
|
|
|
if [ -z "$NC_DOMAIN" ];then
|
2022-05-21 01:07:02 +00:00
|
|
|
echo " - This field is mandatory."
|
2021-04-27 00:30:36 +00:00
|
|
|
elif [ "$NC_DOMAIN" = "$DOMAIN" ]; then
|
2022-05-21 01:07:02 +00:00
|
|
|
echo " - You can not use the same domain for both, Jitsi Meet and JRA via Nextcloud."
|
2021-04-27 00:30:36 +00:00
|
|
|
fi
|
2022-05-21 01:07:02 +00:00
|
|
|
read -p " > Did you mean?: $NC_DOMAIN (yes or no)$NL" -r ANS_NCD
|
2021-04-27 00:30:36 +00:00
|
|
|
if [ "$ANS_NCD" = "yes" ]; then
|
2022-05-21 01:07:02 +00:00
|
|
|
echo " - Alright, let's use $NC_DOMAIN."
|
2021-04-27 00:30:36 +00:00
|
|
|
else
|
2022-05-21 01:07:02 +00:00
|
|
|
echo " - Please try again."
|
2021-04-27 00:30:36 +00:00
|
|
|
fi
|
2020-06-03 07:46:08 +00:00
|
|
|
done
|
2024-01-23 08:46:53 +00:00
|
|
|
sleep .1
|
2021-04-27 00:30:36 +00:00
|
|
|
#Simple DNS test
|
2022-05-21 01:07:02 +00:00
|
|
|
if [ "$PUBLIC_IP" = "$(dig -4 +short "$NC_DOMAIN"|awk -v RS='([0-9]+\\.){3}[0-9]+' 'RT{print RT}')" ]; then
|
|
|
|
echo -e "Server public IP & DNS record for $NC_DOMAIN seems to match, continuing...\n\n"
|
2024-01-23 08:46:53 +00:00
|
|
|
sleep .1
|
2021-04-27 00:30:36 +00:00
|
|
|
else
|
|
|
|
echo "Server public IP ($PUBLIC_IP) & DNS record for $NC_DOMAIN don't seem to match."
|
|
|
|
echo " > Please check your dns records are applied and updated, otherwise Nextcloud may fail."
|
2022-05-21 01:07:02 +00:00
|
|
|
read -p " > Do you want to continue?: (yes or no)$NL" -r DNS_CONTINUE
|
2021-04-27 00:30:36 +00:00
|
|
|
if [ "$DNS_CONTINUE" = "yes" ]; then
|
|
|
|
echo " - We'll continue anyway..."
|
|
|
|
else
|
|
|
|
echo " - Exiting for now..."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
2024-01-23 08:46:53 +00:00
|
|
|
sleep .1
|
2020-10-11 03:58:00 +00:00
|
|
|
NC_NGINX_CONF="/etc/nginx/sites-available/$NC_DOMAIN.conf"
|
2022-05-21 01:07:02 +00:00
|
|
|
while [ -z "$NC_USER" ]
|
2020-06-03 07:46:08 +00:00
|
|
|
do
|
2021-04-12 03:32:55 +00:00
|
|
|
read -p "Nextcloud user: " -r NC_USER
|
|
|
|
if [ -z "$NC_USER" ]; then
|
2022-05-21 01:07:02 +00:00
|
|
|
echo " - This field is mandatory."
|
2021-04-12 03:32:55 +00:00
|
|
|
fi
|
2020-06-03 07:46:08 +00:00
|
|
|
done
|
2024-01-23 08:46:53 +00:00
|
|
|
sleep .1
|
2023-08-23 06:51:24 +00:00
|
|
|
while [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 8 ]
|
2020-06-03 07:46:08 +00:00
|
|
|
do
|
2021-04-12 03:32:55 +00:00
|
|
|
read -p "Nextcloud user password: " -r NC_PASS
|
2023-02-22 09:54:21 +00:00
|
|
|
if [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 8 ]; then
|
2023-08-23 06:51:24 +00:00
|
|
|
echo -e " - This field is mandatory. \nPlease make sure it's at least 8 characters.\n"
|
2021-04-12 03:32:55 +00:00
|
|
|
fi
|
2020-06-03 07:46:08 +00:00
|
|
|
done
|
2024-01-23 08:46:53 +00:00
|
|
|
sleep .1
|
2020-04-11 21:35:11 +00:00
|
|
|
#Enable HSTS
|
2022-05-21 01:07:02 +00:00
|
|
|
while [ "$ENABLE_HSTS" != "yes" ] && [ "$ENABLE_HSTS" != "no" ]
|
2020-04-11 21:35:11 +00:00
|
|
|
do
|
2021-04-12 03:32:55 +00:00
|
|
|
read -p "> Do you want to enable HSTS for this domain?: (yes or no)
|
2020-04-11 21:35:11 +00:00
|
|
|
Be aware this option apply mid-term effects on the domain, choose \"no\"
|
2022-05-21 01:07:02 +00:00
|
|
|
in case you don't know what you are doing. More at https://hstspreload.org/$NL" -r ENABLE_HSTS
|
2021-04-12 03:32:55 +00:00
|
|
|
if [ "$ENABLE_HSTS" = "no" ]; then
|
2022-05-21 01:07:02 +00:00
|
|
|
echo " - HSTS won't be enabled."
|
2021-04-12 03:32:55 +00:00
|
|
|
elif [ "$ENABLE_HSTS" = "yes" ]; then
|
2022-05-21 01:07:02 +00:00
|
|
|
echo " - HSTS will be enabled."
|
2021-04-12 03:32:55 +00:00
|
|
|
fi
|
2020-04-11 21:35:11 +00:00
|
|
|
done
|
2024-01-23 08:46:53 +00:00
|
|
|
sleep .1
|
2021-07-05 16:55:50 +00:00
|
|
|
echo -e "#Default country phone code\n
|
|
|
|
> Starting at Nextcloud 21.x it's required to set a default country phone ISO 3166-1 alpha-2 code.\n
|
|
|
|
>>> https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements <<<\n"
|
2022-05-21 01:07:02 +00:00
|
|
|
sleep .1
|
2021-07-05 16:55:50 +00:00
|
|
|
while [ ${#ISO3166_CODE} -gt 2 ];
|
|
|
|
do
|
|
|
|
echo -e "Some examples might be: Germany > DE | Mexico > MX | Spain > ES | USA > US\n
|
2022-05-21 01:07:02 +00:00
|
|
|
Do you want to set such code for your installation?"
|
|
|
|
sleep .1
|
|
|
|
read -p "Leave empty if you don't want to set any: " -r ISO3166_CODE
|
2021-07-05 16:55:50 +00:00
|
|
|
if [ ${#ISO3166_CODE} -gt 2 ]; then
|
|
|
|
echo -e "\n-- This code is only 2 characters long, please check your input.\n"
|
|
|
|
fi
|
|
|
|
done
|
2022-05-21 01:07:02 +00:00
|
|
|
sleep .1
|
2020-09-30 02:27:13 +00:00
|
|
|
echo -e "\n# Check for jitsi-meet/jibri\n"
|
|
|
|
if [ "$(dpkg-query -W -f='${Status}' jibri 2>/dev/null | grep -c "ok installed")" == "1" ] || \
|
2022-05-21 01:07:02 +00:00
|
|
|
[ -f /etc/prosody/conf.d/"$DOMAIN".conf ]; then
|
2020-10-05 11:41:22 +00:00
|
|
|
echo "jitsi meet/jibri is installed, checking version:"
|
2020-09-30 02:27:13 +00:00
|
|
|
apt-show-versions jibri
|
|
|
|
else
|
2020-10-05 11:41:22 +00:00
|
|
|
echo "Wait!, jitsi-meet/jibri is not installed on this system using apt, exiting..."
|
2020-09-30 02:27:13 +00:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2020-04-27 22:49:25 +00:00
|
|
|
#Prevent root folder permission issues
|
2022-05-21 01:07:02 +00:00
|
|
|
cp "$PWD"/files/jra-nc-app-ef.json /tmp
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
exit_ifinstalled postgresql-"$PSGVER"
|
2020-04-11 05:09:43 +00:00
|
|
|
|
2020-04-07 21:02:49 +00:00
|
|
|
## Install software requirements
|
2020-07-01 01:35:53 +00:00
|
|
|
# PostgresSQL
|
2022-05-21 01:07:02 +00:00
|
|
|
install_ifnot postgresql-"$PSGVER"
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2024-01-23 08:46:53 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# Prepare PHP
|
|
|
|
#--------------------------------------------------
|
|
|
|
|
|
|
|
if [ "$MODE" = "debug" ]; then
|
|
|
|
bash -x "$PWD"/tools/prepare_php.sh "$MIN_PHP"
|
|
|
|
else
|
|
|
|
bash "$PWD"/tools/prepare_php.sh "$MIN_PHP"
|
|
|
|
fi
|
2020-04-07 21:02:49 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------
|
2020-08-08 05:36:08 +00:00
|
|
|
# Create DB user
|
2020-04-07 21:02:49 +00:00
|
|
|
#--------------------------------------------------
|
|
|
|
|
2020-07-01 01:35:53 +00:00
|
|
|
echo -e "\n---- Creating the PgSQL DB & User ----"
|
|
|
|
sudo -u postgres psql <<DB
|
2020-04-10 02:43:29 +00:00
|
|
|
CREATE DATABASE nextcloud_db;
|
2020-07-01 01:35:53 +00:00
|
|
|
CREATE USER ${NC_DB_USER} WITH ENCRYPTED PASSWORD '${NC_DB_PASSWD}';
|
|
|
|
GRANT ALL PRIVILEGES ON DATABASE ${NC_DB} TO ${NC_DB_USER};
|
2020-04-07 21:02:49 +00:00
|
|
|
DB
|
2024-01-23 08:46:53 +00:00
|
|
|
echo -e "\nDone!\n"
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2024-01-23 08:46:53 +00:00
|
|
|
# Add .mjs as a file extension for javascript
|
|
|
|
sed -i "/application\/javascript/s|js.*;|js mjs;|" /etc/nginx/mime.types
|
2020-04-10 02:43:29 +00:00
|
|
|
|
2024-01-23 08:46:53 +00:00
|
|
|
# nginx conf setup.
|
|
|
|
cp files/nextcloud.conf "$NC_NGINX_CONF"
|
|
|
|
sed -i "s|_PHPVER|$MIN_PHP|g" "$NC_NGINX_CONF"
|
|
|
|
sed -i "s|_NC_DOMAIN|$NC_DOMAIN|g" "$NC_NGINX_CONF"
|
|
|
|
sed -i "s|_NC_NGINX_SSL_PORT|$NC_NGINX_SSL_PORT|g" "$NC_NGINX_CONF"
|
|
|
|
sed -i "s|_NC_PATH|$NC_PATH|g" "$NC_NGINX_CONF"
|
2020-04-10 02:43:29 +00:00
|
|
|
|
|
|
|
systemctl stop nginx
|
2022-05-21 01:07:02 +00:00
|
|
|
letsencrypt certonly --standalone --renew-by-default --agree-tos -d "$NC_DOMAIN"
|
|
|
|
if [ -f /etc/letsencrypt/live/"$NC_DOMAIN"/fullchain.pem ];then
|
|
|
|
ln -s "$NC_NGINX_CONF" /etc/nginx/sites-enabled/
|
2020-04-10 02:43:29 +00:00
|
|
|
else
|
2021-04-12 03:32:55 +00:00
|
|
|
echo "There are issues on getting the SSL certs..."
|
|
|
|
read -n 1 -s -r -p "Press any key to continue"
|
2020-04-10 02:43:29 +00:00
|
|
|
fi
|
2020-04-07 21:02:49 +00:00
|
|
|
nginx -t
|
2020-04-11 16:52:53 +00:00
|
|
|
systemctl restart nginx
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2020-04-11 21:35:11 +00:00
|
|
|
if [ "$ENABLE_HSTS" = "yes" ]; then
|
2022-05-21 01:07:02 +00:00
|
|
|
sed -i "s|#add_header Strict-Transport-Security|add_header Strict-Transport-Security|g" "$NC_NGINX_CONF"
|
2020-04-11 21:35:11 +00:00
|
|
|
fi
|
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
if [ -n "$PREAD_PROXY" ]; then
|
2021-04-12 03:32:55 +00:00
|
|
|
echo "
|
2020-05-03 12:59:25 +00:00
|
|
|
Setting up Nextcloud domain on Jitsi Meet turn proxy
|
|
|
|
"
|
2022-05-21 01:07:02 +00:00
|
|
|
sed -i "/server {/i \ \ map \$ssl_preread_server_name \$upstream {" "$JITSI_MEET_PROXY"
|
|
|
|
sed -i "/server {/i \ \ \ \ \ \ $DOMAIN web;" "$JITSI_MEET_PROXY"
|
|
|
|
sed -i "/server {/i \ \ \ \ \ \ $NC_DOMAIN web;" "$JITSI_MEET_PROXY"
|
|
|
|
sed -i "/server {/i \ \ }" "$JITSI_MEET_PROXY"
|
2020-05-03 12:59:25 +00:00
|
|
|
fi
|
2020-04-11 21:35:11 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\n Latest version to be installed: $STABLEVERSION
|
|
|
|
(This might take sometime, please be patient...)\n"
|
|
|
|
curl -s "$NC_REPO"/"$STABLEVERSION".zip > /tmp/"$STABLEVERSION".zip
|
|
|
|
unzip -q /tmp/"$STABLEVERSION".zip
|
|
|
|
mv nextcloud "$NC_PATH"
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
chown -R www-data:www-data "$NC_PATH"
|
|
|
|
chmod -R 755 "$NC_PATH"
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\nDatabase installation...\n"
|
2024-01-23 08:46:53 +00:00
|
|
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ maintenance:install \
|
2020-07-01 01:35:53 +00:00
|
|
|
--database=pgsql \
|
2020-04-07 21:02:49 +00:00
|
|
|
--database-name="$NC_DB" \
|
|
|
|
--database-user="$NC_DB_USER" \
|
|
|
|
--database-pass="$NC_DB_PASSWD" \
|
|
|
|
--admin-user="$NC_USER" \
|
|
|
|
--admin-pass="$NC_PASS"
|
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\nApply custom mods...\n"
|
|
|
|
sed -i "/datadirectory/a \ \ \'skeletondirectory\' => \'\'," "$NC_CONFIG"
|
|
|
|
sed -i "/skeletondirectory/a \ \ \'simpleSignUpLink.shown\' => false," "$NC_CONFIG"
|
|
|
|
sed -i "/simpleSignUpLink.shown/a \ \ \'knowledgebaseenabled\' => false," "$NC_CONFIG"
|
2023-08-23 06:51:24 +00:00
|
|
|
sed -i "s|http://localhost|https://$NC_DOMAIN|" "$NC_CONFIG"
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\nAdd crontab...\n"
|
2024-01-23 08:46:53 +00:00
|
|
|
crontab -u www-data -l | { cat; echo "*/5 * * * * php$MIN_PHP -f $NC_PATH/cron.php"; } | crontab -u www-data -
|
2020-04-14 16:49:11 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\nAdd memcache support...\n"
|
|
|
|
sed -i "s|# unixsocket .*|unixsocket /var/run/redis/redis.sock|g" "$REDIS_CONF"
|
|
|
|
sed -i "s|# unixsocketperm .*|unixsocketperm 777|g" "$REDIS_CONF"
|
|
|
|
sed -i "s|port 6379|port 0|" "$REDIS_CONF"
|
2020-04-11 21:35:11 +00:00
|
|
|
systemctl restart redis-server
|
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\n--> Setting config.php...\n"
|
|
|
|
if [ -n "$ISO3166_CODE" ]; then
|
|
|
|
sed -i "/);/i \ \ 'default_phone_region' => '$ISO3166_CODE'," "$NC_CONFIG"
|
2021-07-05 16:55:50 +00:00
|
|
|
fi
|
2022-05-21 01:07:02 +00:00
|
|
|
sed -i "/);/i \ \ 'filelocking.enabled' => 'true'," "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ 'memcache.locking' => '\\\OC\\\Memcache\\\Redis'," "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ 'memcache.local' => '\\\OC\\\Memcache\\\Redis'," "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ 'memcache.local' => '\\\OC\\\Memcache\\\Redis'," "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ 'memcache.distributed' => '\\\OC\\\Memcache\\\Redis'," "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ 'redis' =>" "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ \ \ array (" "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ \ \ \ 'host' => '/var/run/redis/redis.sock'," "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ \ \ \ 'port' => 0," "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ \ \ \ 'timeout' => 0," "$NC_CONFIG"
|
|
|
|
sed -i "/);/i \ \ )," "$NC_CONFIG"
|
|
|
|
echo -e "Done\n"
|
|
|
|
|
|
|
|
echo -e "\nAddding & Setting up Files External App for Local storage...\n"
|
2024-01-23 08:46:53 +00:00
|
|
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ app:install files_external
|
|
|
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ app:enable files_external
|
|
|
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ app:disable support
|
|
|
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ files_external:import /tmp/jra-nc-app-ef.json
|
2020-04-07 21:02:49 +00:00
|
|
|
|
|
|
|
usermod -a -G jibri www-data
|
2022-05-21 01:07:02 +00:00
|
|
|
chmod -R 770 "$DIR_RECORD"
|
|
|
|
chmod -R g+s "$DIR_RECORD"
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\nFixing possible missing tables...\n\n"
|
2024-01-23 08:46:53 +00:00
|
|
|
echo "y"|sudo -u www-data php$MIN_PHP "$NC_PATH"/occ db:convert-filecache-bigint
|
|
|
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ db:add-missing-indices
|
|
|
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ db:add-missing-columns
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\nAdding trusted domain...\n"
|
2024-01-23 08:46:53 +00:00
|
|
|
sudo -u www-data php$MIN_PHP "$NC_PATH"/occ config:system:set trusted_domains 0 --value="$NC_DOMAIN"
|
2020-04-07 21:02:49 +00:00
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\nSetting JRA domain on jitsi-updater.sh\n"
|
2020-08-08 06:49:35 +00:00
|
|
|
sed -i "s|NC_DOMAIN=.*|NC_DOMAIN=\"$NC_DOMAIN\"|" jitsi-updater.sh
|
|
|
|
|
2022-05-21 01:07:02 +00:00
|
|
|
echo -e "\nQuick Nextcloud installation complete!\n"
|