From e0d1f263ddb1a31eeaa5475d90879f847b37d246 Mon Sep 17 00:00:00 2001 From: icsboyx Date: Fri, 16 Jan 2026 11:29:22 +0100 Subject: [PATCH] chore: release v1.0.0 --- CHANGELOG.md | 17 ++++++++ README.md | 116 ++++++--------------------------------------------- 2 files changed, 29 insertions(+), 104 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75f47d3..219aeb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.0] - 2026-01-14 + +### Added + +- UI error banner for failed uploads, including retry timing. +- `retry_after_seconds` in the upload error response to inform clients when to retry. +- Server-side duration clamping for uploads (1-60 minutes). + +### Changed + +- Upload throttling now tracks active assets per user using asset expiration times. +- Upload error responses are consistently JSON. + +### Removed + +- `Retry-After` response header on upload limit errors. + ## [0.3.0] - 2026-01-13 ### Added diff --git a/README.md b/README.md index d0cb9d1..332fea5 100644 --- a/README.md +++ b/README.md @@ -2,35 +2,17 @@ A lightweight, ephemeral file sharing service built with Rust and Actix-Web. Upload images or text with a configurable TTL (1-60 minutes) and share via a unique link. Content is automatically purged after expiration. -## Features +## Usage -- **Ephemeral sharing** – uploads auto-delete after the specified duration -- **Image & text support** – drag/drop, paste, or file picker for images; paste text directly -- **Zero database** – assets stored as JSON files on disk -- **Dark theme UI** – clean, responsive interface with zoom overlay -- **Statistics dashboard** – real-time stats at `/stats.html` (active assets, uploads, response times) -- **Access logging** – request and asset events logged to `data/logs/log.txt` with IP, timing, and metadata -- **Code-friendly text view** – code-like text content auto-formats with syntax highlighting -- **Site assets** – favicon set and web manifest for installable branding - -## Quick Start - -### Local Development +### Run locally ```bash -# Run from repo root (paths resolve to data/html/, data/logs/, data/storage/) cargo run --release ``` Server starts at `http://0.0.0.0:8080` by default. -> **Note:** All paths are relative to the repo root: `data/html/`, `data/logs/`, `data/storage/`. - -### Toolchain - -Rust toolchain is pinned in `rust-toolchain.toml` (current: 1.90.0). - -### Docker +### Run with Docker ```bash docker-compose up --build @@ -38,95 +20,21 @@ docker-compose up --build Exposes port `8080` mapped to container port `80`. Volume mounts `./data:/data`. -## Configuration +### Configuration | Environment Variable | Default | Description | | -------------------- | --------- | --------------- | | `BIND_ADDR` | `0.0.0.0` | Address to bind | | `BIND_PORT` | `8080` | Port to bind | -## API +### Web -### Upload +- `GET /` - Upload page +- `GET /stats` - Stats dashboard +- `GET /bhs/{id}` - View shared content -```http -POST /api/upload -Content-Type: application/json +### API -{ - "duration": 5, - "content_type": "text/plain", - "content": "Hello, world!" -} -``` - -- `duration` – TTL in minutes (1-60) -- `content_type` – MIME type (`text/plain` or `image/*`) -- `content` – raw text or base64-encoded image data - -**Response:** - -```json -{ "link": "/bhs/550e8400-e29b-41d4-a716-446655440000" } -``` - -### Fetch - -```http -GET /api/content/{id} -``` - -Returns the original content with appropriate MIME type, or `404` if expired/missing. - -### Statistics - -```http -GET /api/stats -``` - -**Response:** - -```json -{ - "active_assets": 5, - "total_uploads": 42, - "total_deleted": 37, - "storage_bytes": 1048576, - "image_count": 3, - "text_count": 2, - "total_requests": 150, - "recent_activity": [...] -} -``` - -## Project Structure - -``` -├── src/ -│ ├── main.rs # HTTP server, routing, background cleanup -│ ├── api.rs # Upload/fetch endpoints -│ ├── data_mgt.rs # Asset model, persistence, expiration -│ └── logs.rs # Request and asset event logging -├── data/ -│ ├── html/ # Frontend (index.html, view.html, stats.html, style.css) -│ ├── logs/ # Access logs -│ └── storage/ # Stored assets (auto-created) -├── Dockerfile -├── docker-compose.yaml -└── Cargo.toml -``` - -## Runtime Layout - -The server uses paths relative to the repo root under `data/`: - -- `data/html/` – frontend assets (index.html, view.html, style.css) -- `data/logs/` – access logs (`log.txt`, rotated on startup with timestamps) -- `data/storage/` – uploaded assets (auto-created) - -- **Local dev:** Run from repo root with `cargo run --release` -- **Docker:** Volume mounts `./data:/data`, container WORKDIR is `/` - -## License - -MIT +- `POST /api/upload` with JSON `{ duration, content_type, content }` +- `GET /api/content/{id}` +- `GET /api/stats`