{"id":19436579,"url":"https://github.com/mvarrone/simulate-ip-printer-webserver","last_synced_at":"2026-04-29T23:03:03.003Z","repository":{"id":157179003,"uuid":"633329262","full_name":"mvarrone/simulate-ip-printer-webserver","owner":"mvarrone","description":"Recreate a small webserver for network printers using Docker","archived":false,"fork":false,"pushed_at":"2023-04-28T09:08:26.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T21:13:52.020Z","etag":null,"topics":["api","api-rest","csv","docker","docker-compose","fastapi","ipvlan","monitoring","network-programming","printer","printer-controller","python3","ubuntu","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvarrone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-27T09:08:29.000Z","updated_at":"2024-11-07T19:49:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b89669a-b283-41e9-a980-c1c3d876d0ae","html_url":"https://github.com/mvarrone/simulate-ip-printer-webserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvarrone%2Fsimulate-ip-printer-webserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvarrone%2Fsimulate-ip-printer-webserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvarrone%2Fsimulate-ip-printer-webserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvarrone%2Fsimulate-ip-printer-webserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvarrone","download_url":"https://codeload.github.com/mvarrone/simulate-ip-printer-webserver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240619427,"owners_count":19830204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-rest","csv","docker","docker-compose","fastapi","ipvlan","monitoring","network-programming","printer","printer-controller","python3","ubuntu","virtual-machine"],"created_at":"2024-11-10T15:11:51.847Z","updated_at":"2026-04-29T23:03:02.953Z","avatar_url":"https://github.com/mvarrone.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simulation of Multiple IP Printer Web Servers\n\nThis project aims to provide a simulation of a small partial replica of a IP Printer web server, allowing to recreate an endpoint that offers a CSV file to be downloaded. \n\nThis feature was built to complement the [printer-monitoring project](https://github.com/mvarrone/printer-monitoring)\n\n## Technologies used\n\n- Docker\n\n    - By using Docker and Docker Compose, it is possible to create various containers in order to simulate we have multiple IP Printers connected directly in our physical network\n    \n    - So, this way we can use those IP addresses from each container and writing them in the `devices.json` file available at the `app` folder on [printer-monitoring project](https://github.com/mvarrone/printer-monitoring) to make some tests\n    \n- FastAPI\n\n    - FastAPI is a web framework for building APIs with Python 3. Only a small amount of what this framework offers has been used\n\n## Considerations\n\n### About networking\n- In this project, network chosen was 192.168.1.0/24 with a gateway of 192.168.1.1 and containers were configured to obtain the following IP addresses: 192.168.1.201/24 and 192.168.1.202/24\n\n- So, unless your network be the same and you have those specific IP addresses available to assign to new hosts, you should adapt this [docker-compose.yml](https://github.com/mvarrone/simulate-ip-printer-webserver/blob/main/docker-compose.yml) file to your network specs\n\n### About Docker Desktop on Windows\n- Driver `ipvlan` is needed to make containers obtain an IP address directly from your physical network. Unfortunately, it is not available on Windows systems at the moment.\n\n- So, to mitigate this problem an Ubuntu VM has been deployed on Windows. Inside that VM, docker and docker compose were installed.\n\n## Resources used\n\n- A CSV file downloaded from a Brother HL-1210W Series printer is provided to make it available in the correspondant endpoint to be downloaded\n\n## Endpoints\n\n1. Root Endpoint: `/`\n\n    * This endpoint was created to test the availability of the API\n    * It returns a dictionary with a message and datetime information\n\n2. CSV Endpoint: `/etc/mnt_info.csv`\n\n    * This endpoint was created to download a maintenance CSV file\n    * It returns the CSV file\n\n## Usage\n\n1. Install Docker and Docker Compose\n    ```md\n    sudo apt-get update \u0026\u0026 sudo apt-get install docker docker-compose -y\n    ```\n\n2. Clone this repository\n\n    ```md\n    git clone https://github.com/mvarrone/simulate-ip-printer-webserver.git \u0026\u0026 cd simulate-ip-printer-webserver\n    ```\n3. Run Docker Compose\n\n    a) Start\n    ```md\n    docker-compose up -d\n    ```\n\n    b) Stop\n    ```md\n    docker-compose down\n    ```\n\n4. Test the containers are working by using a web browser and visiting `http://192.168.1.201/` and `http://192.168.1.202/`\n\n    You can also use `curl` or `Postman`\n    \n    If working, you should see something like:\n    ```md\n    {\"message\":\"App is working\",\"time\":\"2023-04-28T06:41:52.060170\"}\n    ```\n\n5. Add data printer inside the `devices.json` file. It must be added in the format of Python 3 dictionaries\n\n    Example:\n    ```md\n    {\n        \"protocol\": \"http\",\n        \"ip_address\": \"192.168.1.201\",\n        \"port\": 80,\n        \"path\": \"etc\",\n        \"csv_filename\": \"mnt_info.csv\"\n    }\n    ```\n\n6. You can now test the other project with the new available hosts\n\n## Contributions\n\nContributions are welcome! Please create a pull request with any changes or improvements you would like to make\n\n## License\nThis project is licensed under the MIT License. See the [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n file for details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvarrone%2Fsimulate-ip-printer-webserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvarrone%2Fsimulate-ip-printer-webserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvarrone%2Fsimulate-ip-printer-webserver/lists"}