Xetera / otaku

📷 Firebase JWT based image upload server for Bunny CDN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Otaku

A simple jwt based image upload server that works off bunny CDN

Building for development

  1. mix deps.get
  2. iex -S mix

Building for production

  1. docker build otaku .
  2. docker run -it -p 4000:4000 --name otaku -e OTAKU_ACCESS_KEY=<your_access_key_here> -e OTAKU_STORAGE=<storage_name_here> otaku

Processing requests

POST /upload

  • Headers

    • Authorization="Bearer $YOUR_GOOGLE_SIGNED_JWT"
    • Content-Type="multipart/form-data"
  • Form-Data

    • image: file binary
  • Response: { "url": "$OTAKU_CDN_URL/$USER_ID/$IMAGE_NAME" }

Todo

  • Rate limiting
  • Role checks using jwt claims
  • Separate endpoints that accepts API keys for pre-approved users using ShareX and the like

About

📷 Firebase JWT based image upload server for Bunny CDN


Languages

Language:Elixir 97.9%Language:Dockerfile 2.1%