Skip to content

Commit 48e8d36

Browse files
committed
Latest Release
1 parent ea912fa commit 48e8d36

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
FastAPI-powered micro CDN for storing and serving uploaded assets. Files are written to disk, indexed with SQLModel, and delivered with CDN-friendly cache headers plus live usage stats on the landing page.
44

55
## Features
6-
- Public upload and listing endpoints with UUID-based storage.
6+
- Public upload and listing endpoints with compact base62 slugs (Telegraph/ImgBB style URLs).
77
- 10 MB per-file upload cap with friendly error responses.
88
- In-memory rate limiting (per-client/minute) to prevent abuse.
99
- Automatic cleanup job that prunes files after the configured retention window.
@@ -37,6 +37,7 @@ Optional environment variables:
3737
| `CACHE_MAX_AGE_SECONDS` | `3600` | Cache lifetime used for served files. |
3838
| `ADMIN_PASSWORD` | `admin-dev-password` | Password required to access the `/admin` dashboard. |
3939
| `ADMIN_LOCK_STEP_SECONDS` | `300` | Lock duration increment (in seconds) after repeated failed admin logins. |
40+
| `FILE_ID_LENGTH` | `7` | Length of generated slug IDs (min 4, max 32). |
4041

4142
Run the API:
4243

@@ -88,9 +89,9 @@ Key environment variables for production deployments:
8889
| Method | Path | Description |
8990
|--------|------|-------------|
9091
| `POST` | `/upload` | Accepts multipart file upload (respecting the configured size limit) and returns metadata (`id`, `url`, `size`, `type`). |
91-
| `GET` | `/{filename}` | Serves a stored file by UUID filename and includes `Cache-Control` headers. |
92+
| `GET` | `/{filename}` | Serves a stored file by slug filename and includes `Cache-Control` headers. |
9293

93-
Returned `url` values are relative (e.g. `/3d4d...jpg`), suitable for prefixing with your CDN/API host.
94+
Returned `url` values are relative (e.g. `/aB7xYzQ.jpg`), suitable for prefixing with your CDN/API host.
9495

9596
### Admin Dashboard
9697
- Visit `/admin` with the header `X-Admin-Password: <ADMIN_PASSWORD>` (or include `password` in the query/form) to view uploads, downloads, cleanup counts, recent files, and trigger per-file or bulk deletions.

app/templates/pages/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<h1>AlterBase CDN</h1>
1212
<p>
1313
Fast minimal API for hosting images and assets. Upload files (up to ${max_file_text}), retrieve shareable
14-
URLs, and keep storage tidy with automatic cleanup.
14+
URLs, and keep storage tidy with automatic cleanup within 72h.
1515
</p>
1616
<div class="metrics-grid">
1717
<div class="metric" data-key="uploads" data-value="${uploads}">

0 commit comments

Comments
 (0)