Skip to content

Commit 7a9d41f

Browse files
author
Kristan Kenney
committed
Merge branch 'fix/2020-07_rework-repo' into staging/fixes
2 parents ce022d0 + b6af4d6 commit 7a9d41f

File tree

4 files changed

+51
-61
lines changed

4 files changed

+51
-61
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ All notable changes to this project will be documented in this file.
1515
- Fixed an issue where malformed JSON output was returned when custom theme files are present. (#967)
1616
- Fixed an error that would occur when running `v-change-user-php-cli` for the first time if .bash_aliases did not exist. (#960)
1717
- Corrected an issue where tooltips were not displayed when hovering over the top level menu items.
18-
18+
- Improved handling of APT repository keys during installation.
19+
1920
## [1.2.1] - Service Release 1
2021
### Features
2122
- Consolidated First and Last Name fields to a singular name field to simply input.

install/hst-install-debian.sh

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -586,53 +586,39 @@ echo
586586
# Installing Nginx repo
587587
if [ "$nginx" = 'yes' ]; then
588588
echo "[ * ] NGINX"
589-
echo "deb [arch=amd64] http://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
590-
wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
591-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
589+
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
590+
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
592591
fi
593592

594593
# Installing sury PHP repo
595594
echo "[ * ] PHP"
596595
echo "deb https://packages.sury.org/php/ $codename main" > $apt/php.list
597-
wget --quiet https://packages.sury.org/php/apt.gpg -O /tmp/php_signing.key
598-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/php_signing.key > /dev/null 2>&1
596+
apt-key adv --fetch-keys 'https://packages.sury.org/php/apt.gpg' > /dev/null 2>&1
599597

600598
# Installing sury Apache2 repo
601599
if [ "$apache" = 'yes' ]; then
602600
echo "[ * ] Apache2"
603601
echo "deb https://packages.sury.org/apache2/ $codename main" > $apt/apache2.list
604-
wget --quiet https://packages.sury.org/apache2/apt.gpg -O /tmp/apache2_signing.key
605-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/apache2_signing.key > /dev/null 2>&1
602+
apt-key adv --fetch-keys 'https://packages.sury.org/apache2/apt.gpg' > /dev/null 2>&1
606603
fi
607604

608605
# Installing MariaDB repo
609606
if [ "$mysql" = 'yes' ]; then
610607
echo "[ * ] MariaDB"
611-
echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
612-
if [ "$release" -eq 8 ]; then
613-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com CBCB082A1BB943DB > /dev/null 2>&1
614-
else
615-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F1656F24C74CD1D8 > /dev/null 2>&1
616-
fi
617-
fi
618-
619-
# Installing Backport repo for Debian 8
620-
if [ "$release" -eq 8 ]; then
621-
echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
608+
echo "deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
609+
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
622610
fi
623611

624612
# Installing HestiaCP repo
625613
echo "[ * ] Hestia Control Panel"
626614
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
627-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A189E93654F0B0E5 > /dev/null 2>&1
615+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A189E93654F0B0E5 > /dev/null 2>&1
628616

629617
# Installing PostgreSQL repo
630618
if [ "$postgresql" = 'yes' ]; then
631619
echo "[ * ] PostgreSQL"
632-
echo "deb http://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list
633-
wget --quiet https://www.postgresql.org/media/keys/ACCC4CF8.asc -O /tmp/psql_signing.key
634-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/psql_signing.key > /dev/null 2>&1
635-
rm /tmp/psql_signing.key
620+
echo "deb https://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list
621+
apt-key adv --fetch-keys 'https://www.postgresql.org/media/keys/ACCC4CF8.asc' > /dev/null 2>&1
636622
fi
637623

638624
# Echo for a new line
@@ -1587,31 +1573,6 @@ if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
15871573
sed -i "s/%des_key%/$rcDesKey/g" /etc/roundcube/config.inc.php
15881574
sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
15891575
mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
1590-
1591-
if [ "$release" -eq 8 ]; then
1592-
# RoundCube tinyMCE fix
1593-
tinymceFixArchiveURL=$HESTIA_INSTALL_DIR/roundcube/roundcube-tinymce.tar.gz
1594-
tinymceParentFolder=/usr/share/roundcube/program/js
1595-
tinymceFolder=$tinymceParentFolder/tinymce
1596-
tinymceBadJS=$tinymceFolder/tiny_mce.js
1597-
tinymceFixArchive=$tinymceParentFolder/roundcube-tinymce.tar.gz
1598-
if [[ -L "$tinymceFolder" && -d "$tinymceFolder" ]]; then
1599-
if [ -f "$tinymceBadJS" ]; then
1600-
wget $tinymceFixArchiveURL -O $tinymceFixArchive
1601-
if [[ -f "$tinymceFixArchive" && -s "$tinymceFixArchive" ]]
1602-
then
1603-
rm $tinymceFolder
1604-
tar -xzf $tinymceFixArchive -C $tinymceParentFolder
1605-
rm $tinymceFixArchive
1606-
chown -R root:root $tinymceFolder
1607-
else
1608-
echo -n "File roundcube-tinymce.tar.gz is not downloaded,"
1609-
echo "RoundCube tinyMCE fix is not applied"
1610-
rm $tinymceFixArchive
1611-
fi
1612-
fi
1613-
fi
1614-
fi
16151576

16161577
# Enable Roundcube plugins
16171578
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_newmail_notifier.inc.php /etc/roundcube/plugins/newmail_notifier/config.inc.php

install/hst-install-ubuntu.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,8 @@ echo
561561
# Installing Nginx repo
562562
if [ "$nginx" = 'yes' ]; then
563563
echo "[ * ] NGINX"
564-
echo "deb [arch=amd64] http://nginx.org/packages/mainline/$VERSION/ $codename nginx" \
565-
> $apt/nginx.list
566-
wget --quiet http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
567-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/nginx_signing.key > /dev/null 2>&1
564+
echo "deb [arch=amd64] https://nginx.org/packages/mainline/$VERSION/ $codename nginx" > $apt/nginx.list
565+
apt-key adv --fetch-keys 'https://nginx.org/keys/nginx_signing.key' > /dev/null 2>&1
568566
fi
569567

570568
# Installing sury PHP repo
@@ -580,22 +578,20 @@ fi
580578
# Installing MariaDB repo
581579
if [ "$mysql" = 'yes' ]; then
582580
echo "[ * ] MariaDB"
583-
echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
584-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 > /dev/null 2>&1
581+
echo "deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
582+
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
585583
fi
586584

587585
# Installing HestiaCP repo
588586
echo "[ * ] Hestia Control Panel"
589587
echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
590-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A189E93654F0B0E5 > /dev/null 2>&1
588+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A189E93654F0B0E5 > /dev/null 2>&1
591589

592590
# Installing PostgreSQL repo
593591
if [ "$postgresql" = 'yes' ]; then
594592
echo "[ * ] PostgreSQL"
595-
echo "deb http://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list
596-
wget --quiet https://www.postgresql.org/media/keys/ACCC4CF8.asc -O /tmp/psql_signing.key
597-
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/psql_signing.key > /dev/null 2>&1
598-
rm /tmp/psql_signing.key
593+
echo "deb https://apt.postgresql.org/pub/repos/apt/ $codename-pgdg main" > $apt/postgresql.list
594+
apt-key adv --fetch-keys 'https://www.postgresql.org/media/keys/ACCC4CF8.asc' > /dev/null 2>&1
599595
fi
600596

601597
# Echo for a new line

install/upgrade/versions/latest.sh

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,36 @@ $BIN/v-update-web-templates
1414
echo "[ ! ] Updating default mail domain templates..."
1515
$BIN/v-update-mail-templates
1616
echo "[ ! ] Updating default DNS zone templates..."
17-
$BIN/v-update-dns-templates
17+
$BIN/v-update-dns-templates
18+
19+
# Rework apt repositories
20+
apt="/etc/apt/sources.list.d"
21+
echo "[*] Hardening apt repositories..."
22+
23+
if [ -f "$apt/nginx.list" ]; then
24+
if grep -q "http://nginx.org/packages/mainline/" $apt/nginx.list; then
25+
echo " [ * ] NGINX"
26+
sed -i "s/http\:\/\/nginx.org/https\:\/\/nginx.org/g" $apt/nginx.list
27+
fi
28+
fi
29+
30+
if [ -f "$apt/php.list" ]; then
31+
if grep -q "http://packages.sury.org/" $apt/php.list; then
32+
echo " [ * ] PHP"
33+
sed -i "s/http\:\/\/packages.sury.org/https\:\/\/packages.sury.org/g" $apt/php.list
34+
fi
35+
fi
36+
37+
if [ -f "$apt/mariadb.list" ]; then
38+
if grep -q "http://ams2.mirrors.digitalocean.com" $apt/mariadb.list; then
39+
echo " [ * ] MariaDB"
40+
sed -i "s/http\:\/\/ams2.mirrors.digitalocean.com/https\:\/\/mirror.mva-n.net/g" $apt/mariadb.list
41+
fi
42+
fi
43+
44+
if [ -f "$apt/postgresql.list" ]; then
45+
if grep -q "http://apt.postgresql.org" $apt/postgresql.list; then
46+
echo " [ * ] PostgreSQL"
47+
sed -i "s/http\:\/\/apt.postgresql.org/https\:\/\/apt.postgresql.org/g" $apt/postgresql.list
48+
fi
49+
fi

0 commit comments

Comments
 (0)