Add ability to set passive address

This commit is contained in:
Marc Huffnagle
2018-10-29 15:13:32 -04:00
parent cc1a8954ce
commit 01184880cd
2 changed files with 13 additions and 3 deletions

View File

@@ -30,6 +30,9 @@ which is in the _whois_ debian package.
- `FTP_CHOWN_ROOT`: if set `chown` will be run against `/srv` setting the FTP user and group as owner and group of the directory. _Note: chown is run non-recursively ie. will only chown the root`_
- `FTP_PASV_ADDRESS`: override the IP address that vsftpd will advertise in
response to the PASV command
## Usage Example
```

View File

@@ -27,6 +27,13 @@ if [[ ! -z "${FTP_USERS_ROOT}" ]]; then
sed -i 's/local_root=.*/local_root=\/srv\/$USER/' /etc/vsftpd*.conf
fi
# Support setting the passive address
if [[ ! -z "$FTP_PASV_ADDRESS" ]]; then
for f in /etc/vsftpd*.conf; do
echo "pasv_address=${FTP_PASV_ADDRESS}" >> "$f"
done
fi
# Manage /srv permissions
if [[ ! -z "${FTP_CHOWN_ROOT}" ]]; then
chown ftp:ftp /srv