A netty based ftp server
- Implements most frequently used ftp commands (see details)
- Support configurations of user access priviledge and file transfer rate limit (see options)
- Both active mode and passive mode are supported under cleartext transmission
- Only passive mode is supported when transfer data over TLS
- Only passive mode is supported when running inside a docker container
- Running an embedded server
- Import the dependency
<dependency> <groupId>io.github.yangziwen</groupId> <artifactId>zy-ftp</artifactId> <version>0.0.2</version> </dependency>
- Start the server
FtpRunner runner = FtpRunner.builder() .localIp("127.0.0.1") .localPort(8121) .configFile(new File("conf/server.config")) .logFile(new File("log/zy-ftp.log")) .build(); runner.run();
- Running the JAR file standalone
- Build the JAR file :
mvn package -Pstandalone
orsh gradlew build
- Start the server:
java -jar zy-ftp.jar -c ${config_file_path}
- Build the JAR file :
- Running inside a docker container
- Build the docker image:
mvn package dockerfile:build -Pstandalone
orsh gradlew dockerBuild
- Start the container:
docker run -d \ -v ${your_config_file}:/zy-ftp/server.config \ -v ${your_resource_folder}:/zy-ftp/res \ -e LOCAL_PORT=8121 \ -p 8121:8121 \ -e PASSIVE_PORTS=40000-40060 \ -p 40000-40060:40000-40060 \ zy-ftp:0.0.2
- Build the docker image:
- See more options:
java -jar zy-ftp.jar -h