{"id":22165438,"url":"https://github.com/cypher-o/windrop-server-side","last_synced_at":"2025-03-24T16:13:56.500Z","repository":{"id":263201644,"uuid":"889660047","full_name":"Cypher-O/windrop-server-side","owner":"Cypher-O","description":"Windrop is a file sharing app that allows you to easily upload and download files, just like an Airdrop service. Quickly share your files with others via simple HTTP requests—no complicated setup required!","archived":false,"fork":false,"pushed_at":"2024-11-28T22:12:19.000Z","size":113,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T21:50:45.863Z","etag":null,"topics":["airdrop","api","rust","share"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cypher-O.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-11-16T22:14:11.000Z","updated_at":"2024-11-28T22:12:23.000Z","dependencies_parsed_at":"2025-01-29T21:44:50.659Z","dependency_job_id":null,"html_url":"https://github.com/Cypher-O/windrop-server-side","commit_stats":null,"previous_names":["cypher-o/windrop","cypher-o/windrop-server-side"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cypher-O%2Fwindrop-server-side","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cypher-O%2Fwindrop-server-side/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cypher-O%2Fwindrop-server-side/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cypher-O%2Fwindrop-server-side/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cypher-O","download_url":"https://codeload.github.com/Cypher-O/windrop-server-side/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245304873,"owners_count":20593626,"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":["airdrop","api","rust","share"],"created_at":"2024-12-02T05:14:53.917Z","updated_at":"2025-03-24T16:13:56.478Z","avatar_url":"https://github.com/Cypher-O.png","language":"Rust","readme":"# Windrop - File Upload Service with Rate Limiting and Logging Middleware\n\n## Overview\n\nWindrop is an Actix Web-based file upload service that allows users to upload files with rate limiting and request logging. The service integrates several key features:\n\n- **File Upload**: Handles multipart file uploads and stores them on disk.\n- **File Retrieval**: Retrieves and streams files from disk, allowing users to download files by their ID.\n- **Rate Limiting**: Protects the server from abuse by limiting the number of requests per client IP.\n- **Request Logging**: Logs HTTP request details including status codes and response times.\n\nThis project aims to provide a simple and effective file upload service with essential protections for handling large traffic volumes.\n\n## Features\n\n- **Rate Limiting**: Limits the number of requests per client IP within a given time window (e.g., 100 requests per minute).\n- **File Upload**: Allows users to upload files, which are stored in a configurable storage directory.\n- **File Download**: Users can retrieve files using a unique file ID.\n- **Logging**: Logs all incoming HTTP requests, including method, path, status code, and response time.\n- **Error Handling**: Returns appropriate error responses when upload or file retrieval fails.\n\n## Installation\n\nTo install and run this project locally, follow the steps below:\n\n### Prerequisites\n\n- Rust (1.70.0 or later)\n- Actix Web (4.0 or later)\n- Tokio\n- Actix Multipart\n\n### Steps\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/yourusername/windrop.git\n    cd windrop\n    ```\n\n2. Build the project:\n\n    ```bash\n    cargo build\n    ```\n\n3. Run the server:\n\n    ```bash\n    cargo run\n    ```\n\n    The server will start at `http://127.0.0.1:8080`.\n\n4. You can now test the rate-limiting and file upload functionality by making requests to the `/upload` and `/files/{id}` endpoints.\n\n## Configuration\n\nYou can customize the rate-limiting behavior by adjusting the `max_requests` and `window_duration` when creating the `RateLimiter`.\n\n- **`max_requests`**: The maximum number of requests allowed per client IP within the time window.\n- **`window_duration`**: The duration of the time window in which requests are counted (e.g., 1 minute, 10 seconds).\n\n### Example Rate Limiting Configuration\n\n```rust\nlet rate_limiter = RateLimiter::new(100, Duration::from_secs(60));\n```\n\n## API Endpoints\n\n### Upload a File\n\n- **Endpoint**: `/api/upload`\n- **Method**: `POST`\n- **Description**: Uploads a file and stores it on the server.\n- **Request**: Multipart form-data containing the file.\n- **Response**: Returns a JSON response with the status and file metadata if successful, or an error message if the upload fails.\n\n## Contributing\n\n- We welcome contributions! If you'd like to contribute to Windrop, please fork the repository, create a new branch, and submit a pull request with your changes. Be sure to include a description of the changes in your PR.\n\n## License\n\n- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcypher-o%2Fwindrop-server-side","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcypher-o%2Fwindrop-server-side","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcypher-o%2Fwindrop-server-side/lists"}