Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for vsftpd min & max ports #150

Merged
merged 1 commit into from
Mar 21, 2025
Merged

Add support for vsftpd min & max ports #150

merged 1 commit into from
Mar 21, 2025

Conversation

NateyB
Copy link
Contributor

@NateyB NateyB commented Mar 13, 2025

This PR aims to allow users to run more than one container on a single host. The reasoning:

  • In passive mode, vsftpd sends the data port number to the client
  • The client then attempts to initiate a data connection to the port provided
  • Since vsftpd is unaware of port mappings via docker because docker acts transparently, the host data ports must match the vsftpd data ports—in other words, you cannot remap the data ports on the host

Adding these environment variables allows the user to customize the range of ports used for data in the container (still subject to the requirement that the host ports match).

I tested this on my setup using podman with the following docker compose file (and FileZilla on another machine) and it worked as expected:

services:
  ftps-dev-service:
    image: localhost/ftps-dev
    container_name: ftps-dev-container
    environment:
      - BF_FTPS_VSFTPD_UID=1000
      - BF_FTPS_EXTERNAL_IP=10.0.0.240
      - BF_FTPS_VSFTPD_USER=ftp_user_user
      - BF_FTPS_VSFTPD_PASS=<REDACTED>
      - BF_FTPS_VSFTPD_ENABLE_DEBUG_LOG=1
      - BF_DEBUG=1
      - BF_FTPS_VSFTPD_MIN_PORT=30010
      - BF_FTPS_VSFTPD_MAX_PORT=30020
    ports:
      - 0.0.0.0:30000:21
      - 0.0.0.0:30001:990
      - 0.0.0.0:30010-30020:30010-30020
    volumes:
      - ./uploads:/files
      - ./ssl:/ssl

@NateyB
Copy link
Contributor Author

NateyB commented Mar 13, 2025

Would address #148

@bfren
Copy link
Owner

bfren commented Mar 14, 2025

Thanks I'll give it a test myself!

@bfren bfren changed the base branch from main to v4.3.3 March 21, 2025 10:04
@bfren bfren merged commit b858c63 into bfren:v4.3.3 Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants