File tree Expand file tree Collapse file tree 5 files changed +25
-29
lines changed Expand file tree Collapse file tree 5 files changed +25
-29
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " async_ftp"
3
- version = " 4 .0.4 "
3
+ version = " 5 .0.0 "
4
4
authors = [" Daniel García <dani-garcia@users.noreply.github.com>" , " Matt McCoy <mattnenterprise@yahoo.com>" ]
5
5
documentation = " https://docs.rs/async_ftp/"
6
6
repository = " https://github.com/dani-garcia/rust_async_ftp"
@@ -26,11 +26,11 @@ lazy_static = "1.4.0"
26
26
regex = " 1.3.9"
27
27
chrono = " 0.4.11"
28
28
29
- tokio = { version = " 0.3 .1" , features = [" net" , " io-util" ] }
30
- tokio-rustls = { version = " 0.20 .0" , optional = true }
29
+ tokio = { version = " 1.0 .1" , features = [" net" , " io-util" ] }
30
+ tokio-rustls = { version = " 0.22 .0" , optional = true }
31
31
pin-project = " 1.0.0"
32
32
33
33
[dev-dependencies ]
34
- tokio = { version = " 0.3. 1" , features = [" macros" , " stream " , " rt" ] }
35
- tokio-util = { version = " 0.4 .0" , features = [" io" ] }
36
-
34
+ tokio = { version = " 1.0. 1" , features = [" macros" , " rt" ] }
35
+ tokio-util = { version = " 0.6 .0" , features = [" io" ] }
36
+ tokio-stream = " 0.1.0 "
Original file line number Diff line number Diff line change @@ -617,12 +617,12 @@ impl FtpStream {
617
617
#[ cfg( test) ]
618
618
mod tests {
619
619
use super :: FtpStream ;
620
- use tokio :: { stream } ;
620
+ use tokio_stream :: once ;
621
621
use tokio_util:: io:: StreamReader ;
622
622
623
623
#[ tokio:: test]
624
624
async fn list_command_dos_newlines ( ) {
625
- let data_stream = StreamReader :: new ( stream :: once ( Ok :: < _ , std:: io:: Error > (
625
+ let data_stream = StreamReader :: new ( once ( Ok :: < _ , std:: io:: Error > (
626
626
b"Hello\r \n World\r \n \r \n Be\r \n Happy\r \n " as & [ u8 ]
627
627
) ) ) ;
628
628
@@ -637,7 +637,7 @@ mod tests {
637
637
638
638
#[ tokio:: test]
639
639
async fn list_command_unix_newlines ( ) {
640
- let data_stream = StreamReader :: new ( stream :: once ( Ok :: < _ , std:: io:: Error > ( b"Hello\n World\n \n Be\n Happy\n " as & [ u8 ] ) ) ) ;
640
+ let data_stream = StreamReader :: new ( once ( Ok :: < _ , std:: io:: Error > ( b"Hello\n World\n \n Be\n Happy\n " as & [ u8 ] ) ) ) ;
641
641
642
642
assert_eq ! (
643
643
FtpStream :: get_lines_from_stream( data_stream) . await . unwrap( ) ,
Original file line number Diff line number Diff line change 1
- FROM i386/ ubuntu:latest
1
+ FROM ubuntu:latest
2
2
3
- RUN apt-get update -qq &&\
4
- apt-get install -yqq vsftpd
3
+ RUN apt update && apt install -y vsftpd
5
4
6
- RUN mkdir -p /var/run/vsftpd/empty &&\
7
- useradd -s /bin/bash -d /home/ftp -m -c "Doe ftp user" -g ftp Doe &&\
8
- echo "Doe:mumble" | chpasswd &&\
9
- echo "listen=yes\n \
10
- anon_root=/home/ftp\n \
11
- local_enable=yes\n \
12
- local_umask=022\n \
13
- pasv_enable=YES\n \
14
- pasv_min_port=65000\n \
15
- pasv_max_port=65010\n \
16
- write_enable=yes\n \
17
- log_ftp_protocol=yes" > /etc/vsftpd.conf &&\
18
- echo "/etc/init.d/vsftpd start" | tee -a /etc/bash.bashrc
5
+ RUN useradd --home-dir /home/ftp --create-home --groups ftp Doe
6
+ RUN echo "Doe:mumble" | chpasswd
7
+
8
+ RUN cp /etc/vsftpd.conf /etc/vsftpd.conf.orig
9
+ RUN echo "write_enable=yes\n log_ftp_protocol=yes" > /etc/vsftpd.conf
10
+ RUN cat /etc/vsftpd.conf.orig >> /etc/vsftpd.conf
11
+
12
+ RUN echo "/etc/init.d/vsftpd start" | tee -a /etc/bash.bashrc
19
13
20
14
CMD ["/bin/bash" ]
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- # run the ftp server instance in detached mode (in the background)
4
- # but also with TTY and interactive mode, so we can attach to it if we want to
5
- docker run -dti --privileged -p 21:21 -p 65000-65010:65000-65010 ftp-server
3
+ # Build the docker image
4
+ docker build -t ftp-server .
5
+
6
+ # run the ftp server instance
7
+ docker run --rm --name ftp-server -ti --net=host ftp-server
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::io::Cursor;
5
5
#[ test]
6
6
fn test_ftp ( ) {
7
7
let future = async {
8
- let mut ftp_stream = FtpStream :: connect ( "172.25.82.139 :21" ) . await ?;
8
+ let mut ftp_stream = FtpStream :: connect ( "192.168.1.60 :21" ) . await ?;
9
9
let _ = ftp_stream. login ( "Doe" , "mumble" ) . await ?;
10
10
11
11
ftp_stream. mkdir ( "test_dir" ) . await ?;
You can’t perform that action at this time.
0 commit comments