Skip to content

siputzx/uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Sptzx Uploader

Build Status License: MIT Rust

Temporary CDN service built with Rust (Axum) for maximum speed and security.


✨ Features

  • Ultra Fast — Rust-powered with RAM Disk (tmpfs) storage
  • Secure — HMAC-SHA256 signed URLs prevent unauthorized access
  • Smart View — Auto-detect media types for browser preview
  • Auto Cleanup — Files automatically deleted after expiration (default: 5 minutes)
  • Resource Efficient — Minimal RAM and CPU footprint

🚀 Quick Start

podman run -d \
  --name sptzx-cdn \
  --restart always \
  --memory 12g \
  --cpus 2 \
  --mount type=tmpfs,destination=/app/uploads,tmpfs-size=10737418240,tmpfs-mode=1777 \
  -p 3003:3003 \
  -e SPTZX_PORT=3003 \
  -e SPTZX_BIND_ADDR=0.0.0.0:3003 \
  -e SPTZX_BASE_URL='https://cdn.siputzx.my.id' \
  -e SPTZX_SECRET_KEY='your-secret-key-here' \
  -e SPTZX_MAX_FILE_SIZE=536870912 \
  -e SPTZX_FILE_LIFETIME=300 \
  -e RUST_LOG=info \
  ghcr.io/siputzx/uploader:latest

⚙️ Configuration

Variable Description Default
SPTZX_PORT Internal healthcheck port 3000
SPTZX_BIND_ADDR Application listen address 0.0.0.0:3000
SPTZX_BASE_URL Base URL for generated links http://localhost:3000
SPTZX_SECRET_KEY HMAC signing secret key ""
SPTZX_MAX_FILE_SIZE Max file size in bytes 536870912 (512MB)
SPTZX_FILE_LIFETIME File retention in seconds 300 (5 min)
RUST_LOG Log level info

💡 Usage

Upload a file:

curl -X POST http://localhost:3003/upload \
  -F "file=@image.jpg"

Response:

{
  "url": "https://cdn.siputzx.my.id/files/abc123?sig=xyz&exp=1234567890"
}

Access the file:

Open the URL in browser or download:

curl "https://cdn.siputzx.my.id/files/abc123?sig=xyz&exp=1234567890" -o image.jpg

🔒 Security

Files are protected with HMAC-SHA256 signed URLs:

  • Prevents unauthorized access
  • Prevents URL tampering
  • Automatic expiration

Generate a strong secret key:

openssl rand -hex 32

📝 License

MIT License - see LICENSE file for details.


🔗 Links


Made with ⚡ by Siputzx

About

simple web api uploader

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors