chore: release v1.0.0
All checks were successful
Build & Publish / build_publish (push) Successful in 1m30s
All checks were successful
Build & Publish / build_publish (push) Successful in 1m30s
This commit is contained in:
17
CHANGELOG.md
17
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/),
|
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).
|
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
|
## [0.3.0] - 2026-01-13
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
116
README.md
116
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.
|
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
|
### Run locally
|
||||||
- **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
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run from repo root (paths resolve to data/html/, data/logs/, data/storage/)
|
|
||||||
cargo run --release
|
cargo run --release
|
||||||
```
|
```
|
||||||
|
|
||||||
Server starts at `http://0.0.0.0:8080` by default.
|
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/`.
|
### Run with Docker
|
||||||
|
|
||||||
### Toolchain
|
|
||||||
|
|
||||||
Rust toolchain is pinned in `rust-toolchain.toml` (current: 1.90.0).
|
|
||||||
|
|
||||||
### Docker
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up --build
|
docker-compose up --build
|
||||||
@@ -38,95 +20,21 @@ docker-compose up --build
|
|||||||
|
|
||||||
Exposes port `8080` mapped to container port `80`. Volume mounts `./data:/data`.
|
Exposes port `8080` mapped to container port `80`. Volume mounts `./data:/data`.
|
||||||
|
|
||||||
## Configuration
|
### Configuration
|
||||||
|
|
||||||
| Environment Variable | Default | Description |
|
| Environment Variable | Default | Description |
|
||||||
| -------------------- | --------- | --------------- |
|
| -------------------- | --------- | --------------- |
|
||||||
| `BIND_ADDR` | `0.0.0.0` | Address to bind |
|
| `BIND_ADDR` | `0.0.0.0` | Address to bind |
|
||||||
| `BIND_PORT` | `8080` | Port 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
|
### API
|
||||||
POST /api/upload
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
- `POST /api/upload` with JSON `{ duration, content_type, content }`
|
||||||
"duration": 5,
|
- `GET /api/content/{id}`
|
||||||
"content_type": "text/plain",
|
- `GET /api/stats`
|
||||||
"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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user