Skip to content

Commit 6605f7b

Browse files
tlcd96jaapmarcus
andauthored
Fix hestiacp#3266 HestiaCP with PROFTPD Passive Mode External IP (hestiacp#3301)
* Issue hestiacp#3266 - Update nat address Update nat address for proftpd * Issue hestiacp#3266 - Update nat address This will check for the line `Include /etc/proftpd/conf.d/*.conf` and if does not exist, creates it * Fix format --------- Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent 351b6a6 commit 6605f7b

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

bin/v-change-sys-ip-nat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ if [ -n "$old" ] && [ -n "$FTP_SYSTEM" ]; then
9494
fi
9595
fi
9696
fi
97+
if [ "$FTP_SYSTEM" = 'proftpd' ]; then
98+
conf="/etc/$FTP_SYSTEM/conf.d/external_ip.conf"
99+
content="MasqueradeAddress ${nat_ip}"
100+
echo "$content" > $conf
101+
fi
97102
$BIN/v-restart-ftp "$restart"
98103
fi
99104

install/upgrade/versions/1.7.0.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717
####### You can use \n within the string to create new lines. #######
1818
#######################################################################################
1919

20+
# load config because we need to know if proftpd is installed
21+
22+
# Includes
23+
# shellcheck source=/etc/hestiacp/hestia.conf
24+
source /etc/hestiacp/hestia.conf
25+
# shellcheck source=/usr/local/hestia/func/main.sh
26+
source $HESTIA/func/main.sh
27+
# shellcheck source=/usr/local/hestia/func/ip.sh
28+
source $HESTIA/func/ip.sh
29+
# load config file
30+
source_conf "$HESTIA/conf/hestia.conf"
31+
2032
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'true'
2133
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'true'
2234
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'true'
@@ -72,6 +84,17 @@ for file in /etc/php/*/fpm/pool.d/www.conf; do
7284
sed -i 's|/var/run/|/run/|g' $file
7385
done
7486

87+
#update proftpd
88+
if [ "$FTP_SYSTEM" = 'proftpd' ]; then
89+
contains_conf_d=$(grep -c "Include /etc/proftpd/conf.d/\*.conf" "/etc/proftpd/proftpd.conf")
90+
# the line below is for testing only:
91+
# echo "contains proftpd? $contains_conf_d"
92+
if [ $contains_conf_d = 0 ]; then
93+
sed -i 's/Include \/etc\/proftpd\/tls.conf/&\nInclude \/etc\/proftpd\/conf.d\/*.conf/' /etc/proftpd/proftpd.conf
94+
fi
95+
$BIN/v-restart-ftp
96+
fi
97+
7598
if echo "$BACKUP_SYSTEM" | grep "google" > /dev/null; then
7699
echo "[ ! ] Deprecation notice: Backup via Google Cloud has been removed setup backup again via Rclone to reinstate the backup and restore capebilities!"
77100
add_upgrade_message "Deprecation notice: Backup via Google Cloud has been removed setup backup again via Rclone to reinstate the backup and restore capebilities!"

0 commit comments

Comments
 (0)