Skip to content

Commit d8c43d3

Browse files
committed
Hardening repositories as well on upgrades.
1 parent 2ff4643 commit d8c43d3

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

install/upgrade/versions/latest.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,35 @@ echo "[ ! ] Updating default mail domain templates..."
1515
$BIN/v-update-mail-templates
1616
echo "[ ! ] Updating default DNS zone templates..."
1717
$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)