From b5d667c17ac2b3ca4a885c076639eeec3e364837 Mon Sep 17 00:00:00 2001 From: bfren Date: Wed, 20 Nov 2024 10:44:00 +0000 Subject: [PATCH] v4.2.19 (#144) Minor updates * Using latest base image * Fixing debug logging --- .gitignore | 2 ++ Dockerfile | 2 +- VERSION | 2 +- overlay/etc/bf/templates/vsftpd.conf.esh | 14 +++++++++++--- .../s6-overlay/s6-rc.d/user/contents.d/vsftpd-log | 0 .../s6-rc.d/vsftpd-log/dependencies.d/vsftpd | 0 overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/finish | 8 ++++++++ overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/run | 8 ++++++++ overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/type | 1 + run.sh | 7 ++++++- 10 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 overlay/etc/s6-overlay/s6-rc.d/user/contents.d/vsftpd-log create mode 100644 overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/dependencies.d/vsftpd create mode 100644 overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/finish create mode 100644 overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/run create mode 100644 overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/type diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46b8804 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +files/ +ssl/ diff --git a/Dockerfile b/Dockerfile index 408b8ca..779cd0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/bfren/alpine-s6:alpine3.20-5.4.13 +FROM ghcr.io/bfren/alpine-s6:alpine3.20-5.4.14 LABEL org.opencontainers.image.source="https://github.com/bfren/docker-ftps" diff --git a/VERSION b/VERSION index 48a30b1..9bde2e8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.18 \ No newline at end of file +4.2.19 \ No newline at end of file diff --git a/overlay/etc/bf/templates/vsftpd.conf.esh b/overlay/etc/bf/templates/vsftpd.conf.esh index 4aeca5a..436e588 100644 --- a/overlay/etc/bf/templates/vsftpd.conf.esh +++ b/overlay/etc/bf/templates/vsftpd.conf.esh @@ -173,12 +173,11 @@ isolate_network=NO # # If enabled, then any log output which would have gone to /var/log/vsftpd.log # goes to the system log instead. Logging is done under the FTPD facility. -syslog_enable=YES +vsftpd_log_file=<% bf-env FTPS_VSFTPD_LOG_FILE %> # # When enabled, all FTP requests and responses are logged, providing the # option xferlog_std_format is not enabled. Useful for debugging. log_ftp_protocol=YES -<% else -%> # # The target log file can be vsftpd_log_file or xferlog_file. # This depends on setting xferlog_std_format parameter @@ -190,5 +189,14 @@ xferlog_file=<% bf-env FTPS_VSFTPD_LOG_FILE %> # # Switches between logging into vsftpd_log_file and xferlog_file files. # NO writes to vsftpd_log_file, YES to xferlog_file -xferlog_std_format=YES +xferlog_std_format=NO +<% else -%> +# +# When enabled, all FTP requests and responses are logged, providing the +# option xferlog_std_format is not enabled. Useful for debugging. +log_ftp_protocol=NO +# +# The target log file can be vsftpd_log_file or xferlog_file. +# This depends on setting xferlog_std_format parameter +xferlog_enable=NO <% fi %> diff --git a/overlay/etc/s6-overlay/s6-rc.d/user/contents.d/vsftpd-log b/overlay/etc/s6-overlay/s6-rc.d/user/contents.d/vsftpd-log new file mode 100644 index 0000000..e69de29 diff --git a/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/dependencies.d/vsftpd b/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/dependencies.d/vsftpd new file mode 100644 index 0000000..e69de29 diff --git a/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/finish b/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/finish new file mode 100644 index 0000000..f1defe0 --- /dev/null +++ b/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/finish @@ -0,0 +1,8 @@ +#!/usr/bin/nu + +use bf +use bf-s6 +bf env load -x vsftpd-log + +# Show helpful log message +def main [...args] { bf-s6 svc finish } diff --git a/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/run b/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/run new file mode 100644 index 0000000..f30975f --- /dev/null +++ b/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/run @@ -0,0 +1,8 @@ +#!/usr/bin/nu + +use bf +use bf-s6 +bf env load -x vsftpd-log + +# Forward vsftpd log to Docker +def main [...args] { bf-s6 log forward vsftpd-log (bf env FTPS_VSFTPD_LOG_FILE) } diff --git a/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/type b/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/type new file mode 100644 index 0000000..1780f9f --- /dev/null +++ b/overlay/etc/s6-overlay/s6-rc.d/vsftpd-log/type @@ -0,0 +1 @@ +longrun \ No newline at end of file diff --git a/run.sh b/run.sh index 55e21bb..be0d29c 100755 --- a/run.sh +++ b/run.sh @@ -17,6 +17,11 @@ docker buildx build \ -e BF_FTPS_EXTERNAL_IP=127.0.0.1 \ -e BF_FTPS_VSFTPD_USER=foo \ -e BF_FTPS_VSFTPD_PASS=bar \ - -p "127.0.0.1:5353:53/udp" \ + -e BF_FTPS_VSFTPD_ENABLE_DEBUG_LOG=1 \ + -p "127.0.0.1:21:21" \ + -p "127.0.0.1:990:990" \ + -p "127.0.0.1:18700-18710:18700-18710" \ + -v "$(pwd)/files:/files" \ + -v "$(pwd)/ssl:/ssl" \ ftps-dev \ sh