2019-10-30T21:32:00

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
https://b.dbedia.com/e018cdef54178fa53e63673697cfb59fd908707c4c379fb7f5e2bb2970ff8996/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`
    • `cd FOLDER_FULL_OF_BLOBS`
    • `dbedia-blob --meta --base-uri http://YOUR_HOSTNAME/ --upload *.jpg`