Private gyazo server on sinatra

Posted by on April 22, 2014 in Ruby, Tech

Private gyazo server on sinatra


What is this?

This is a private gyazo server works on sinatra.
It provides not only gyazo server function but also image gallery.


  • Sinatra (includes WEBrick)
  • Rack (interface between sinatra and nginx)
  • Nginx (or other reverse-proxy/web-server)


Gyazo server

Nginx only works as a reverse proxy.
Upload procedure

Image gallery

Dynamic contents and static contents are provided by sinatra and nginx respectively.
Download procedure

Difference between official and mine

File name

Official gyazo names image files based on MD5 hash.
Mine creates 3-chars name (e.g. abc.png, 012.png, etc.) by using this function.


Official gyazo allows every users to upload images.
In contrast, mine allows only a user who registered in a config file.