replace apt-key + other fixes (#2313)
Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
This commit is contained in:
Родитель
dd32c7f202
Коммит
3ba620be8d
|
@ -51,8 +51,9 @@ ram_check 3 "ClamAV"
|
|||
cpu_check 2 "ClamAV"
|
||||
|
||||
# Install needed tools
|
||||
apt-get update -q4 & spinner_loading
|
||||
apt-get install clamav clamav-freshclam clamav-daemon -y
|
||||
install_if_not clamav
|
||||
install_if_not clamav-freshclam
|
||||
install_if_not clamav-daemon
|
||||
|
||||
# stop freshclam and update the database
|
||||
check_command systemctl stop clamav-freshclam
|
||||
|
|
|
@ -18,18 +18,22 @@ debug_mode
|
|||
# Check if root
|
||||
root_check
|
||||
|
||||
# Currently only compatible with focal
|
||||
if [ "$(lsb_release -cs)" != "focal" ] || ! php --version | grep -q 'PHP 7.4.'
|
||||
# Check compatibility
|
||||
check_distro_version
|
||||
check_php
|
||||
if [[ "$PHPVER" != "8.1" ]] && [[ "$PHPVER" != "7.4" ]]
|
||||
then
|
||||
msg_box "Currently only Ubuntu 20.04 LTS with PHP 7.4 is supported by this script."
|
||||
msg_box "Currently only PHP 7.4 and PHP 8.1 is supported by this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Encryption may not be enabled
|
||||
if is_app_enabled encryption || is_app_enabled end_to_end_encryption
|
||||
then
|
||||
msg_box "It seems like you have encryption enabled which is unsupported by the $SCRIPT_NAME app!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Compatible with NC21 and above
|
||||
lowest_compatible_nc 21
|
||||
|
||||
|
@ -40,7 +44,7 @@ ram_check 2
|
|||
cpu_check 2
|
||||
|
||||
# Check if facerecognition is already installed
|
||||
if ! is_app_installed facerecognition && ! is_this_installed php7.4-pdlib
|
||||
if ! is_app_installed facerecognition && ! is_this_installed php7.4-pdlib && ! is_this_installed php8.1-pdli
|
||||
then
|
||||
# Ask for installing
|
||||
install_popup "$SCRIPT_NAME"
|
||||
|
@ -54,7 +58,14 @@ else
|
|||
rm -f /etc/apt/sources.list.d/20-pdlib.list
|
||||
apt-get update -q4 & spinner_loading
|
||||
apt-get autoremove -y
|
||||
rm -f /etc/apt/trusted.gpg.d/facerecognititon.gpg
|
||||
rm -f /etc/apt/trusted.gpg.d/facerecognition.gpg
|
||||
elif is_this_installed php8.1-pdlib
|
||||
then
|
||||
apt-get purge php8.1-pdlib -y
|
||||
rm -f /etc/apt/sources.list.d/facerecognition-pdlib.list
|
||||
apt-get update -q4 & spinner_loading
|
||||
apt-get autoremove -y
|
||||
rm -f /etc/apt/keyrings/repo.gpg.key
|
||||
fi
|
||||
crontab -u www-data -l | grep -v "face_background_job.log" | crontab -u www-data -
|
||||
crontab -u www-data -l | grep -v "face:background_job" | crontab -u www-data -
|
||||
|
@ -89,13 +100,25 @@ then
|
|||
fi
|
||||
|
||||
# Install requirements
|
||||
# https://github.com/matiasdelellis/facerecognition/wiki/Installation#ubuntu-focal
|
||||
curl_to_dir https://repo.delellis.com.ar "repo.gpg.key" "$SCRIPTS"
|
||||
check_command apt-key --keyring /etc/apt/trusted.gpg.d/facerecognititon.gpg add "$SCRIPTS/repo.gpg.key"
|
||||
rm -f "$SCRIPTS/repo.gpg.key"
|
||||
echo "deb https://repo.delellis.com.ar focal focal" > /etc/apt/sources.list.d/20-pdlib.list
|
||||
apt-get update -q4 & spinner_loading
|
||||
install_if_not php7.4-pdlib
|
||||
if version 20.04 "$DISTRO" 20.04.10
|
||||
then
|
||||
# https://github.com/matiasdelellis/facerecognition/wiki/PDlib-Installation#ubuntu-focal
|
||||
add_trusted_key_and_repo "repo.gpg.key" \
|
||||
"https://repo.delellis.com.ar" \
|
||||
"https://repo.delellis.com.ar" \
|
||||
"focal focal" \
|
||||
"facerecognition-pdlib.list"
|
||||
install_if_not php7.4-pdlib
|
||||
elif version 22.04 "$DISTRO" 22.04.10
|
||||
then
|
||||
# https://github.com/matiasdelellis/facerecognition/wiki/PDlib-Installation#ubuntu-jammy
|
||||
add_trusted_key_and_repo "repo.gpg.key" \
|
||||
"https://repo.delellis.com.ar" \
|
||||
"https://repo.delellis.com.ar" \
|
||||
"$CODENAME $CODENAME" \
|
||||
"facerecognition-pdlib.list"
|
||||
install_if_not php8.1-pdlib
|
||||
fi
|
||||
|
||||
# Install the app
|
||||
install_and_enable_app facerecognition
|
||||
|
|
|
@ -46,6 +46,7 @@ else
|
|||
/etc/apt/trusted.gpg.d/morph027-nats-server.asc \
|
||||
/etc/apt/trusted.gpg.d/morph027-nextcloud-spreed-signaling.asc \
|
||||
/etc/apt/trusted.gpg.d/morph027-coturn.asc \
|
||||
/etc/apt/keyrings/morph027-coturn.asc
|
||||
/etc/apt/sources.list.d/morph027-nextcloud-spreed-signaling.list\
|
||||
/etc/apt/sources.list.d/morph027-janus.list \
|
||||
/etc/apt/sources.list.d/morph027-nats-server.list \
|
||||
|
@ -110,9 +111,11 @@ done
|
|||
# Install TURN
|
||||
if [ "${CODENAME}" == "jammy" ]
|
||||
then
|
||||
curl -sL -o /etc/apt/trusted.gpg.d/morph027-coturn.asc https://packaging.gitlab.io/coturn/gpg.key
|
||||
echo "deb https://packaging.gitlab.io/coturn/$CODENAME $CODENAME main" > /etc/apt/sources.list.d/morph027-coturn.list
|
||||
apt-get update -q4 & spinner_loading
|
||||
add_trusted_key_and_repo "gpg.key" \
|
||||
"https://packaging.gitlab.io/coturn" \
|
||||
"https://packaging.gitlab.io/coturn/$CODENAME" \
|
||||
"$CODENAME main" \
|
||||
"morph027-coturn.list"
|
||||
fi
|
||||
check_command install_if_not coturn
|
||||
check_command sed -i '/TURNSERVER_ENABLED/c\TURNSERVER_ENABLED=1' /etc/default/coturn
|
||||
|
|
|
@ -35,6 +35,7 @@ else
|
|||
apt-get autoremove -y
|
||||
rm -f /etc/apt/sources.list.d/webmin.list
|
||||
rm -f /etc/apt/trusted.gpg.d/webmin.gpg
|
||||
rm -f /etc/apt/keyrings/jcameron-key.asc
|
||||
sed -i '/webmin/d' /etc/apt/sources.list
|
||||
# Show successful uninstall if applicable
|
||||
removal_popup "$SCRIPT_NAME"
|
||||
|
@ -58,14 +59,22 @@ apt-get clean all
|
|||
apt-get update -q4 & spinner_loading
|
||||
|
||||
# Install Webmin
|
||||
if ! curl_to_dir http://www.webmin.com "jcameron-key.asc" "$SCRIPTS"
|
||||
if curl_to_dir http://www.webmin.com "jcameron-key.asc" /tmp
|
||||
then
|
||||
curl_to_dir https://gist.githubusercontent.com/enoch85/092c8f4c4f5127b99d40/raw/186333393163b7e0d50c8d3b25cae4d63ac78b22 "jcameron-key.asc" "$SCRIPTS"
|
||||
# Use the original key URL
|
||||
add_trusted_key_and_repo "jcameron-key.asc" \
|
||||
"https://download.webmin.com" \
|
||||
"https://download.webmin.com/download/repository" \
|
||||
"sarge contrib" \
|
||||
"webmin.list"
|
||||
else
|
||||
# Use backup key URL
|
||||
add_trusted_key_and_repo "jcameron-key.asc" \
|
||||
"https://gist.githubusercontent.com/enoch85/092c8f4c4f5127b99d40/raw/186333393163b7e0d50c8d3b25cae4d63ac78b22" \
|
||||
"https://download.webmin.com/download/repository" \
|
||||
"sarge contrib" \
|
||||
"webmin.list"
|
||||
fi
|
||||
check_command apt-key --keyring /etc/apt/trusted.gpg.d/webmin.gpg add "$SCRIPTS/jcameron-key.asc"
|
||||
rm -f "$SCRIPTS/jcameron-key.asc"
|
||||
echo "deb https://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list
|
||||
apt-get update -q4 & spinner_loading
|
||||
install_if_not webmin
|
||||
|
||||
if ! dpkg-query -W -f='${Status}' "webmin" | grep -q "ok installed"
|
||||
|
|
34
lib.sh
34
lib.sh
|
@ -2003,6 +2003,40 @@ ${NONO_PORTS[*]}"
|
|||
fi
|
||||
}
|
||||
|
||||
add_trusted_key_and_repo() {
|
||||
# EXAMPLE: add_trusted_key_and_repo "jcameron-key.asc" \
|
||||
# "https://download.webmin.com" \
|
||||
# "https://download.webmin.com/download/repository" \
|
||||
# "sarge contrib" \
|
||||
# "webmin-test.list"
|
||||
|
||||
# $1 = whatever.asc
|
||||
# $2 = Key URL e.g. https://download.webmin.com
|
||||
# $3 = Deb URL e.g. https://download.webmin.com/download/repository
|
||||
# $4 = "$CODENAME $CODENAME main" (e.g. jammy jammy main)
|
||||
# $5 = debpackage-name.list
|
||||
|
||||
# This function is only supported in the currently supported release
|
||||
check_distro_version
|
||||
|
||||
# Do the magic
|
||||
if version 22.04 "$DISTRO" 22.04.10
|
||||
then
|
||||
# New recommended way not using apt-key
|
||||
print_text_in_color "$ICyan" "Adding trusted key in /etc/apt/keyrings/$1..."
|
||||
curl -sL "$2"/"$1" | tee -a /etc/apt/keyrings/"$1"
|
||||
echo "deb [signed-by=/etc/apt/keyrings/$1] $3 $4" > "/etc/apt/sources.list.d/$5"
|
||||
apt-get update -q4 & spinner_loading
|
||||
elif version 20.04 "$DISTRO" 20.04.10
|
||||
then
|
||||
# Legacy way with apt-key
|
||||
print_text_in_color "$ICyan" "Adding trusted key with apt-key..."
|
||||
curl -sL "$2"/"$1" | apt-key add -
|
||||
echo "deb $3 $4" > "/etc/apt/sources.list.d/$5"
|
||||
apt-get update -q4 & spinner_loading
|
||||
fi
|
||||
}
|
||||
|
||||
## bash colors
|
||||
# Reset
|
||||
Color_Off='\e[0m' # Text Reset
|
||||
|
|
|
@ -170,7 +170,7 @@ lowest_compatible_nc 21
|
|||
# Add temporary fix if needed
|
||||
if network_ok
|
||||
then
|
||||
run_script STATIC temporary-fix-begining
|
||||
run_script STATIC temporary-fix-beginning
|
||||
fi
|
||||
|
||||
# Import if missing and export again to import it with UUID
|
||||
|
|
|
@ -67,6 +67,8 @@ install_if_not apt-utils
|
|||
|
||||
# Nice to have dependencies
|
||||
install_if_not bash-completion
|
||||
install_if_not htop
|
||||
install_if_not iputils-ping
|
||||
|
||||
# Check for flags
|
||||
if [ "$1" = "" ]
|
||||
|
@ -330,10 +332,8 @@ $MENU_GUIDE" "$WT_HEIGHT" "$WT_WIDTH" 4 \
|
|||
done
|
||||
|
||||
# Install PostgreSQL
|
||||
# sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main"
|
||||
# curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
||||
apt-get update -q4 & spinner_loading
|
||||
apt-get install postgresql -y
|
||||
install_if_not postgresql
|
||||
|
||||
# Create DB
|
||||
cd /tmp
|
||||
|
@ -345,7 +345,7 @@ print_text_in_color "$ICyan" "PostgreSQL password: $PGDB_PASS"
|
|||
systemctl restart postgresql.service
|
||||
|
||||
# Install Apache
|
||||
check_command apt-get install apache2 -y
|
||||
check_command install_if_not apache2
|
||||
a2enmod rewrite \
|
||||
headers \
|
||||
proxy \
|
||||
|
@ -374,25 +374,21 @@ echo "ServerTokens Prod"
|
|||
fi
|
||||
|
||||
# Install PHP "$PHPVER"
|
||||
apt-get update -q4 & spinner_loading
|
||||
check_command apt-get install -y \
|
||||
php"$PHPVER"-fpm \
|
||||
php"$PHPVER"-intl \
|
||||
php"$PHPVER"-ldap \
|
||||
php"$PHPVER"-imap \
|
||||
php"$PHPVER"-gd \
|
||||
php"$PHPVER"-pgsql \
|
||||
php"$PHPVER"-curl \
|
||||
php"$PHPVER"-xml \
|
||||
php"$PHPVER"-zip \
|
||||
php"$PHPVER"-mbstring \
|
||||
php"$PHPVER"-soap \
|
||||
php"$PHPVER"-gmp \
|
||||
php"$PHPVER"-bz2 \
|
||||
php"$PHPVER"-bcmath \
|
||||
php-pear
|
||||
# php"$PHPVER"-imagick \
|
||||
# libmagickcore-6.q16-3-extra
|
||||
install_if_not php"$PHPVER"-fpm
|
||||
install_if_not php"$PHPVER"-intl
|
||||
install_if_not php"$PHPVER"-ldap
|
||||
install_if_not php"$PHPVER"-imap
|
||||
install_if_not php"$PHPVER"-gd
|
||||
install_if_not php"$PHPVER"-pgsql
|
||||
install_if_not php"$PHPVER"-curl
|
||||
install_if_not php"$PHPVER"-xml
|
||||
install_if_not php"$PHPVER"-zip
|
||||
install_if_not php"$PHPVER"-mbstring
|
||||
install_if_not php"$PHPVER"-soap
|
||||
install_if_not php"$PHPVER"-gmp
|
||||
install_if_not php"$PHPVER"-bz2
|
||||
install_if_not php"$PHPVER"-bcmath
|
||||
install_if_not php-pear
|
||||
|
||||
# Enable php-fpm
|
||||
a2enconf php"$PHPVER"-fpm
|
||||
|
@ -960,12 +956,11 @@ then
|
|||
if [ "$SYSVENDOR" == "Microsoft Corporation" ]
|
||||
then
|
||||
# Hyper-V
|
||||
apt-get install -y --install-recommends \
|
||||
linux-virtual \
|
||||
linux-image-virtual \
|
||||
linux-tools-virtual \
|
||||
linux-cloud-tools-virtual \
|
||||
linux-azure
|
||||
install_if_not linux-virtual
|
||||
install_if_not linux-image-virtual
|
||||
install_if_not linux-tools-virtual
|
||||
install_if_not linux-cloud-tools-virtual
|
||||
install_if_not linux-azure
|
||||
# linux-image-extra-virtual only needed for AUFS driver with Docker
|
||||
fi
|
||||
fi
|
||||
|
|
Загрузка…
Ссылка в новой задаче