Own BLOB Server

Just uploaded dbedia::blob to CPAN.

Besides dbedia::blob module there is also dbedia-blob script that is doing sha256 checksumming and uploading to a server. Simply by:

$ dbedia-blob --meta --base-uri https://b.dbedia.com/ --upload dollar-camel.png
filename: dollar-camel.png
mime_type: image/png
size: 19876

and the dollar-camel.png is online.

a complete how-to would be something like:

  • on server eager to host blobs:
    • Install NGINX
    • `mkdir /var/www/blobs`
    • add location to YOUR_HOSTNAME nginx config:
      location ~ "^(/..)(..)(..)(.{58})(.*)$" {
          alias /var/www/blobs/$1/$2/$3/$4;
          expires max;
    • `adduser blob-user`
    • `chown blob-user /var/www/blobs`
    • `su - blob-user`
    • `ln -s /var/www/blobs`
  • on workstation full of blobs:
    • Install dbedia::blob → `sudo apt-get install cpanm && sudo cpanm dbedia::blob` on Debian/Ubuntu
    • Add host config to ~/.ssh/config
      Host dbedia-blob
      	HostName YOUR_SSH_SERVER
      	user blob-user
    • `ssh-copy-id YOUR_SSH_SERVER`
    • `dbedia-blob --meta --base-uri http://YOUR_HOSTNAME/ --upload *.jpg`