forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.2.2.sh
More file actions
48 lines (41 loc) · 1.56 KB
/
1.2.2.sh
File metadata and controls
48 lines (41 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Hestia Control Panel upgrade script for target version 1.2.2
#######################################################################################
####### Place additional commands below. #######
#######################################################################################
# Enhance Vsftpd security
if [ "$FTP_SYSTEM" = "vsftpd" ]; then
echo "[ ! ] Hardening Vsftpd TLS configuration..."
if [ -e /etc/vsftpd.conf ]; then
rm -f /etc/vsftpd.conf
fi
cp -f $HESTIA_INSTALL_DIR/vsftpd/vsftpd.conf /etc/
chmod 644 /etc/vsftpd.conf
fi
# Rework apt repositories
apt="/etc/apt/sources.list.d"
echo "[ * ] Hardening APT repositories..."
if [ -f "$apt/nginx.list" ]; then
if grep -q "http://nginx.org/packages/mainline/" $apt/nginx.list; then
echo " ----- NGINX"
sed -i "s/http\:\/\/nginx.org/https\:\/\/nginx.org/g" $apt/nginx.list
fi
fi
if [ -f "$apt/php.list" ]; then
if grep -q "http://packages.sury.org/" $apt/php.list; then
echo " ----- PHP"
sed -i "s/http\:\/\/packages.sury.org/https\:\/\/packages.sury.org/g" $apt/php.list
fi
fi
if [ -f "$apt/mariadb.list" ]; then
if grep -q "http://ams2.mirrors.digitalocean.com" $apt/mariadb.list; then
echo " ----- MariaDB"
sed -i "s/http\:\/\/ams2.mirrors.digitalocean.com/https\:\/\/mirror.mva-n.net/g" $apt/mariadb.list
fi
fi
if [ -f "$apt/postgresql.list" ]; then
if grep -q "http://apt.postgresql.org" $apt/postgresql.list; then
echo " ----- PostgreSQL"
sed -i "s/http\:\/\/apt.postgresql.org/https\:\/\/apt.postgresql.org/g" $apt/postgresql.list
fi
fi