Skip to content

Commit 68ac780

Browse files
author
Alexandros
committed
Check before adding 3rd party repos
1 parent 3298656 commit 68ac780

File tree

3 files changed

+52
-38
lines changed

3 files changed

+52
-38
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ All notable changes to this project will be documented in this file.
77
### Bugfixes
88
- Disable Apache2 Server Status Module by default.
99
- Do not allow to change the password of a non-hestia user. Thanks to Alexandre Zanni!
10-
- Use sury repository for apache2 packages.
10+
- Use sury repository for Apache2 packages.
11+
- Check whether Nginx, Apache2 and MariaDB are selected for installation prior to adding third party repositories.
1112
- Remove duplicated set-cookie line in default fpm config.
1213
- Adjust let's encrypt validation check for idn domains, thanks to @zanami!
1314

install/hst-install-debian.sh

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -595,44 +595,51 @@ apt=/etc/apt/sources.list.d
595595
# Updating system
596596
echo "Adding required repositories to proceed with installation:"
597597
echo
598-
# Installing nginx repo
599-
echo "(*) NGINX"
600-
echo "deb [arch=amd64] http://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
601-
wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
602-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
603598

604-
# Installing sury php repo
599+
# Installing Nginx repo
600+
if [ "$nginx" = 'yes' ]; then
601+
echo "(*) NGINX"
602+
echo "deb [arch=amd64] http://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
603+
wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
604+
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
605+
fi
606+
607+
# Installing sury PHP repo
605608
echo "(*) PHP"
606609
echo "deb https://packages.sury.org/php/ $codename main" > $apt/php.list
607610
wget --quiet https://packages.sury.org/php/apt.gpg -O /tmp/php_signing.key
608611
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/php_signing.key > /dev/null 2>&1
609612

610-
# Installing sury apache2 repo
611-
echo "(*) Apache2"
612-
echo "deb https://packages.sury.org/apache2/ $codename main" > $apt/apache2.list
613-
wget --quiet https://packages.sury.org/apache2/apt.gpg -O /tmp/apache2_signing.key
614-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/apache2_signing.key > /dev/null 2>&1
613+
# Installing sury Apache2 repo
614+
if [ "$apache" = 'yes' ]; then
615+
echo "(*) Apache2"
616+
echo "deb https://packages.sury.org/apache2/ $codename main" > $apt/apache2.list
617+
wget --quiet https://packages.sury.org/apache2/apt.gpg -O /tmp/apache2_signing.key
618+
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/apache2_signing.key > /dev/null 2>&1
619+
fi
615620

616621
# Installing MariaDB repo
617-
echo "(*) MariaDB"
618-
echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
619-
if [ "$release" -eq 8 ]; then
620-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com CBCB082A1BB943DB > /dev/null 2>&1
621-
else
622-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F1656F24C74CD1D8 > /dev/null 2>&1
622+
if [ "$mysql" = 'yes' ]; then
623+
echo "(*) MariaDB"
624+
echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
625+
if [ "$release" -eq 8 ]; then
626+
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com CBCB082A1BB943DB > /dev/null 2>&1
627+
else
628+
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F1656F24C74CD1D8 > /dev/null 2>&1
629+
fi
623630
fi
624631

625-
# Installing Backport repo for debian 8
632+
# Installing Backport repo for Debian 8
626633
if [ "$release" -eq 8 ]; then
627634
echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
628635
fi
629636

630-
# Installing hestia repo
637+
# Installing HestiaCP repo
631638
echo "(*) Hestia Control Panel"
632639
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
633640
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A189E93654F0B0E5 > /dev/null 2>&1
634641

635-
# Installing postgresql repo
642+
# Installing PostgreSQL repo
636643
if [ "$postgresql" = 'yes' ]; then
637644
echo "(*) PostgreSQL"
638645
echo "deb http://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list

install/hst-install-ubuntu.sh

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -558,35 +558,41 @@ apt=/etc/apt/sources.list.d
558558
echo "Adding required repositories to proceed with installation:"
559559
echo
560560

561-
# Installing nginx repo
562-
echo "(*) NGINX"
563-
if [ -e $apt/nginx.list ]; then
564-
rm $apt/nginx.list
565-
fi
566-
echo "deb [arch=amd64] http://nginx.org/packages/mainline/$VERSION/ $codename nginx" \
561+
# Installing Nginx repo
562+
if [ "$nginx" = 'yes' ]
563+
echo "(*) NGINX"
564+
if [ -e $apt/nginx.list ]; then
565+
rm $apt/nginx.list
566+
fi
567+
echo "deb [arch=amd64] http://nginx.org/packages/mainline/$VERSION/ $codename nginx" \
567568
> $apt/nginx.list
568-
wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
569-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
569+
wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
570+
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
571+
fi
570572

571-
# Installing sury php repo
573+
# Installing sury PHP repo
572574
echo "(*) PHP"
573575
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php > /dev/null 2>&1
574576

575-
# Installing sury apache2 repo
576-
echo "(*) Apache2"
577-
echo "deb http://ppa.launchpad.net/ondrej/apache2/ubuntu $codename main" > $apt/apache2.list
577+
# Installing sury Apache2 repo
578+
if [ "$apache" = 'yes' ]
579+
echo "(*) Apache2"
580+
echo "deb http://ppa.launchpad.net/ondrej/apache2/ubuntu $codename main" > $apt/apache2.list
581+
fi
578582

579583
# Installing MariaDB repo
580-
echo "(*) MariaDB"
581-
echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
582-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 > /dev/null 2>&1
584+
if [ "$mysql" = 'yes' ]
585+
echo "(*) MariaDB"
586+
echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
587+
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 > /dev/null 2>&1
588+
fi
583589

584-
# Installing hestia repo
590+
# Installing HestiaCP repo
585591
echo "(*) Hestia Control Panel"
586592
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
587593
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A189E93654F0B0E5 > /dev/null 2>&1
588594

589-
# Installing postgresql repo
595+
# Installing PostgreSQL repo
590596
if [ "$postgresql" = 'yes' ]; then
591597
echo "(*) PostgreSQL"
592598
echo "deb http://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list

0 commit comments

Comments
 (0)