|
| 1 | +# Jump - Ephemeral Share Service |
| 2 | + |
| 3 | +Jump is a secure and efficient ephemeral sharing service built with Rust. It allows users to share content that automatically expires after a set duration, ensuring data privacy and security. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Ephemeral Sharing**: Content automatically expires after a configurable duration |
| 8 | +- **Secure**: Content is encrypted and only accessible via unique hash IDs |
| 9 | +- **Rate Limited**: Built-in protection against abuse |
| 10 | +- **Type Safe**: Strict MIME type validation for content |
| 11 | +- **Fast**: Built with Rust for optimal performance |
| 12 | +- **Simple API**: RESTful API for easy integration |
| 13 | + |
| 14 | +## Getting Started |
| 15 | + |
| 16 | +### Prerequisites |
| 17 | + |
| 18 | +- Rust 1.70 or higher |
| 19 | +- Redis 6.0 or higher |
| 20 | +- Cargo (Rust's package manager) |
| 21 | + |
| 22 | +### Installation |
| 23 | + |
| 24 | +1. Clone the repository: |
| 25 | + ```bash |
| 26 | + git clone https://github.com/yourusername/jump.git |
| 27 | + cd jump |
| 28 | + ``` |
| 29 | + |
| 30 | +2. Copy the example environment file: |
| 31 | + ```bash |
| 32 | + cp .env.example .env |
| 33 | + ``` |
| 34 | + |
| 35 | +3. Update the environment variables in `.env` with your configuration. |
| 36 | + |
| 37 | +4. Build the project: |
| 38 | + ```bash |
| 39 | + cargo build --release |
| 40 | + ``` |
| 41 | + |
| 42 | +5. Run the server: |
| 43 | + ```bash |
| 44 | + cargo run --release |
| 45 | + ``` |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +### Creating a Share |
| 50 | + |
| 51 | +```bash |
| 52 | +curl -X POST http://localhost:8080/api/v1/payloads \ |
| 53 | + -H "Content-Type: application/json" \ |
| 54 | + -d '{ |
| 55 | + "content": "Your content here", |
| 56 | + "mime_type": "text/plain", |
| 57 | + "expiry_time": "2024-03-14T12:00:00Z" |
| 58 | + }' |
| 59 | +``` |
| 60 | + |
| 61 | +### Retrieving a Share |
| 62 | + |
| 63 | +```bash |
| 64 | +curl http://localhost:8080/api/v1/payloads/{hash_id} |
| 65 | +``` |
| 66 | + |
| 67 | +## Configuration |
| 68 | + |
| 69 | +The service can be configured using environment variables: |
| 70 | + |
| 71 | +- `SERVER_HOST`: Host to bind the server to (default: "127.0.0.1") |
| 72 | +- `SERVER_PORT`: Port to listen on (default: 8080) |
| 73 | +- `REDIS_URL`: Redis connection URL |
| 74 | +- `RATE_LIMIT_REQUESTS`: Number of requests allowed per window |
| 75 | +- `RATE_LIMIT_WINDOW_SECS`: Rate limit window in seconds |
| 76 | +- `MAX_PAYLOAD_SIZE`: Maximum payload size in bytes |
| 77 | +- `DEFAULT_EXPIRY_HOURS`: Default expiry time in hours |
| 78 | + |
| 79 | +## Development |
| 80 | + |
| 81 | +### Running Tests |
| 82 | + |
| 83 | +```bash |
| 84 | +cargo test |
| 85 | +``` |
| 86 | + |
| 87 | +### Documentation |
| 88 | + |
| 89 | +Generate and view the documentation: |
| 90 | + |
| 91 | +```bash |
| 92 | +cargo doc --open |
| 93 | +``` |
| 94 | + |
| 95 | +## API Documentation |
| 96 | + |
| 97 | +The API documentation is available at `/api/docs` when running the server. |
| 98 | + |
| 99 | +## Contributing |
| 100 | + |
| 101 | +1. Fork the repository |
| 102 | +2. Create your feature branch (`git checkout -b feature/amazing-feature`) |
| 103 | +3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
| 104 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 105 | +5. Open a Pull Request |
| 106 | + |
| 107 | +## License |
| 108 | + |
| 109 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments