docker-ftp-server icon indicating copy to clipboard operation
docker-ftp-server copied to clipboard

[REQUEST] Set log level in Docker Compose

Open Feriman22 opened this issue 10 months ago • 6 comments

Currently the vsftpd in my environment generates a TON of log and I'd like to reduce it.

Please add a way to set the log parameters of vsftpd by setting a variable in Docker Compose, something like that:

services:
    ftp-server:
        container_name: my-ftp-server
        environment:
            - PUBLIC_IP=192.168.0.1
            - FTP_PASS=123
            - FTP_USER=user
            - xferlog_enable=YES
            - xferlog_std_format=NO
            - log_ftp_protocol=YES
        image: garethflowers/ftp-server
        ports:
            - "20-21:20-21/tcp"
            - "40000-40009:40000-40009/tcp" # For passive mode
        volumes:
            - "/data:/home/user"

It can be configured in /etc/vsftpd/vsftpd.conf file:

# This is by default YES
xferlog_enable=YES

# This was changed from default YES to NO.
# This was actually the setting preventing from logging properly.
xferlog_std_format=NO

# Enable verbose logging
log_ftp_protocol=YES

Thanks!

Feriman22 avatar Feb 26 '25 22:02 Feriman22

I want to accomplish something similar, disabling passive mode in my case.

I just submitted a PR that enabled setting arbitrary vsftpd.conf options: PR https://github.com/garethflowers/docker-ftp-server/pull/109

At the moment I inject the docker-entrypoint.sh from the PR via configs: into the container if you need a quick solution.

Michuelnik avatar Mar 21 '25 09:03 Michuelnik

As a temporary solution, I made a fork of the docker image: https://hub.docker.com/r/feriman25/ftp-server

Feriman22 avatar Mar 21 '25 09:03 Feriman22

As a temporary solution, I made a fork of the docker image: https://hub.docker.com/r/feriman25/ftp-server

Based upon my PR? I did not find the patched entrypoint in neither beta nor 0.9.2 tag of your image?

Michuelnik avatar Mar 21 '25 09:03 Michuelnik

As a temporary solution, I made a fork of the docker image: https://hub.docker.com/r/feriman25/ftp-server

Based upon my PR? I did not find the patched entrypoint in neither beta nor 0.9.2 tag of your image?

No. I did it 21 days ago, and you opened a PR 39 mins ago.

Feriman22 avatar Mar 21 '25 09:03 Feriman22

Oh, didn't see the age. Thought that had been a reaction to my case.

What did you change in your image, setting your desired logging options statically?

Michuelnik avatar Mar 21 '25 10:03 Michuelnik

Removed lines 18, 19, 20 and 21 in docker-entrypoint.sh

Set to NO for all logging things (line 31, 32, 33) in vsftpd.conf

That's all.

Feriman22 avatar Mar 21 '25 10:03 Feriman22