Major update to stretch and many improvements

Improvements:
* Update to debian stretch
* Fix Dockerfile style
* Add FTP UID/GID Docker build args
* Add run-ssl to Makefile for testing SSL config
* Fix scripts style
* Fix scripts issues reported by shellcheck
* Add FTP_CHOWN_ROOT function to chown /srv in the container
* Add allow_writeable_chroot=YES to vsftpd_ssl.conf to match vsftpd.conf
* Update README.md
This commit is contained in:
Tim Robinson
2018-05-01 22:01:08 +10:00
parent 8140d6f5af
commit 07b4a555ff
7 changed files with 97 additions and 62 deletions

View File

@@ -1,23 +1,24 @@
#!/usr/bin/env bash
# Adds a virtual ftp user to /etc/vsftpd/virtual-users.db
set -e
[ "$DEBUG" == 'true' ] && set -x
[[ "${DEBUG}" == "true" ]] && set -x
DB=/etc/vsftpd/virtual-users.db
DB="/etc/vsftpd/virtual-users.db"
if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
echo "Usage: $0 [-d] <user> <password>" >&2
echo >&2
echo "[ -d ] Delete the database first" >&2
exit 1
if [[ "${#}" -lt 2 ]] || [[ "${#}" -gt 3 ]]; then
echo "Usage: $0 [-d] <user> <password>" >&2
echo >&2
echo "[ -d ] Delete the database first" >&2
exit 1
fi
if [ "$1" == "-d" ]; then
if [ -f $DB ]; then
rm $DB
fi
shift
if [[ "${1}" == "-d" ]]; then
if [[ -f "${DB}" ]]; then
rm "${DB}"
fi
shift
fi
echo -e "$1\n$2" | db5.3_load -T -t hash $DB
printf '%s\n%s\n' "${1}" "${2}" | db5.3_load -T -t hash "${DB}"