diff --git a/Makefile b/Makefile index e5229ef..f7a873b 100644 --- a/Makefile +++ b/Makefile @@ -15,3 +15,8 @@ client-no-debug: clean: docker-compose down --volumes +docker-client: + docker exec -it project-ftp_client-1 bash + +docker-server: + docker exec -it project-ftp_server-1 bash diff --git a/README.md b/README.md index 1cb5e35..d6e9d2b 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,18 @@ # MyFTP +A Python implementation of a FTP server. Supports both TCP and UDP protocols. Tested on Python 3.11 and Python 3.10. + ## Dependencies -Zero. Only python standard libs were used. Tested on Python 3.11 +Zero. Only python standard libs were used. ## Running ### Client -You can run `python3 src/myftp/client.py --directory ` to start the client or `python3 src/myftp/client.py --debug 1 --directory ` for debugging purposes. +You can run `python3 src/myftp/client.py --directory ` to start the client. + +To run with debug info: `python3 src/myftp/client.py --debug 1 --directory `. Some example test commands: @@ -23,7 +27,9 @@ Some example test commands: By default, the server IP address or hostname or server name will be `0.0.0.0` or `localhost` (meaning it will bind to all interfaces). The `--port_number` flag, if not specified will be by default `12000`. -You can run `python3 src/myftp/server.py --directory ` to start the server or `python3 src/myftp/server.py --ip_addr --port_number --debug 1 --directory ` for debugging purposes and to specify the port number. +You can run `python3 src/myftp/server.py --directory ` to start the server. + +Or run `python3 src/myftp/server.py --ip_addr --port_number --debug 1 --directory ` for debugging purposes. ## Localhost testing @@ -55,6 +61,8 @@ Run `python3 src/myftp/server.py --debug 1 --directory server_directory` - Run the server with `make server` in a terminal. - Run the client with `make client` in a terminal. - For the client, when asked to put in the ip address and port number of the server, you can put in `ftp_server 12000` or adjust to your chosen port number. The IP address is resolved by Docker so ftp_server can not be changed. +- Go into the `client` docker container with `make docker-client`. The folder in which FTP is using to host client files is located at `/client_directory/` +- Or go into the `server` docker container with `make docker-server`. The folder in which FTP is using to host server files is located at `/server_directory/` - Tear down everything with `make clean`. #### Fast setup