• Stars
    star
    19
  • Rank 1,163,249 (Top 23 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

multi cloud storage to image gallery + image proxy + file api - 350 LOC.

Code Climate Test Coverage Build Status

Poto

Turn your AWS S3 bucket into an image gallery.

Demo GIF

Example: http://jamesmoriarty-poto-aws-s3.herokuapp.com/

Usage

S3

$ PORT=? AWS_ACCESS_KEY_ID=? AWS_SECRET_ACCESS_KEY=? AWS_REGION=? AWS_S3_BUCKET=? poto-aws-s3

Google Cloud Storage

$ PORT=? GOOGLE_CLOUD_PROJECT_ID=? GOOGLE_CLOUD_KEYFILE=? GOOGLE_CLOUD_STORAGE_BUCKET=? poto-google-cloud-storage

Poto::ImageProxy

The image resizing proxy is rack middleware and can be used standalone.

require "poto"

# width  - max width in pixels.
# height - max height in pixels.
# src    - source image url.
#
# Examples
#
# GET /image_proxy?width=500&height=500&src=https%3A%2F%2Faqueous-cliffs-6127.herokuapp.com%3A443%2Fapi%2Ffiles%2FRGVhdGggVmFsbGV5LmpwZw%3D%3D%250A

map("/image_proxy") do
  run Poto::ImageProxy
end

Poto::API

As well as the API - query and access the storage backend via hal+json.

require "poto"
require "poto/file_repository/aws/s3"

# Examples
#
# GET /files&per_page=9
# {
#     "_embedded": {
#         "files": [{
#             "name": "Abstract.jpg",
#             "size": 15198281,
#             "_links": {
#                 "file": {
#                     "href": "https://aqueous-cliffs-6127.herokuapp.com:443/api/files/QWJzdHJhY3QuanBn%0A"
#                 }
#             }
#         }]
#     },
#     "_links": {
#         "self": {
#             "href": "https://aqueous-cliffs-6127.herokuapp.com:443/api/files?page="
#         },
#         "next": {
#             "href": "https://aqueous-cliffs-6127.herokuapp.com:443/api/files?page=Death+Valley.jpg&per_page=9"
#         }
#     }
# }

repository = Poto::FileRepository::AWS::S3.new(bucket: ENV["AWS_S3_BUCKET"])

map("/api") do
  run Poto::API.configure(repository: repository)
end

Installation

$ gem install poto

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/poto/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

More Repositories

1

forward-proxy

Minimal HTTP(S) forward proxy using 150LOC and only standard libraries.
Ruby
152
star
2

scorched_earth

Scorched Earth clone in JRuby with no dependencies.
Ruby
129
star
3

gohack

Experimental Go language CSGO exploit.
Go
68
star
4

lisp

Minimal Lisp interpreter using 75LOC and only standard libraries.
Ruby
52
star
5

gomem

A Go library for manipulating Windows processes.
Go
50
star
6

nebula

WebGL top down space shooter.
CoffeeScript
50
star
7

react-instagram-authless-feed

React component to provide a token-less Instagram feed.
JavaScript
49
star
8

cfn-cheapest-nat

Cheapest AWS VPC NAT.
36
star
9

angularjs-rss-reader

RSS reader in Javascript / AngularJS.
JavaScript
29
star
10

goforward

Go forward proxy with bandwidth limiting.
Go
27
star
11

alpaca-desktop

Experimental OSX menu bar widget for Alpaca.
Ruby
19
star
12

call-graph

Capture execution and create dependency graphs.
Ruby
17
star
13

interceptor

Ruby method interceptors.
Ruby
10
star
14

trie

Ruby trie data structure.
Ruby
5
star
15

chingu-template

Simple template for a Chingu application.
Ruby
5
star
16

redux-paint

Simple "time-traveling" paint application.
TypeScript
5
star
17

simple-sinatra-sequel-blog

A simple blog with Sinatra and Sequel.
Ruby
4
star
18

tf-idf

Ruby Gem to calculate tf*idf
CSS
3
star
19

k8s-gitops

k8s gitops home lab.
Shell
3
star
20

gobackground

Golang, winuser.dll, advapi32.dll, to create a random unsplashed background binary.
Go
3
star
21

godll

Example of Go & Windows DLL build and usage.
Go
3
star
22

gobat2exe

Convert Windows batch files into executable files.
Go
3
star
23

vagrant-metasploit

2
star
24

pi-playbook

Configure Raspberry Pi with Ansible
2
star
25

chef-pptpd

Chef PPTPDrecipe.
Ruby
2
star
26

thread-pool

Ruby thread pool.
Ruby
2
star
27

gobot

Go learning exercise.
Go
1
star
28

cfn-static-website-with-lambda-at-edge

Static website hosted from an S3 Bucket delivered via Cloudfront with Lambda@Edge.
Shell
1
star
29

jamesmoriarty.github.io

Github Pages
HTML
1
star
30

cfn-vpc

A simple VPC including public and private subnets over multiple AZs.
1
star
31

react-email-signature

JavaScript
1
star
32

scala-robot

Scala
1
star
33

mini-aasm

A State Machine library intended to be compatible with lightweight implementations of the Ruby language using 100LOC and only standard libraries.
Ruby
1
star
34

scheduler-dataflow-demo

Java
1
star
35

chef-minidlna

Chef MiniDLNA recipe.
Ruby
1
star
36

experiment-nginx-proxy-pass-forward-proxy

1
star
37

rack-playbook

Deploy compatible rack apps with ansible.
Ruby
1
star
38

docker-pmd

Dockerfile for PMD an extensible cross-language static code analyzer.
Dockerfile
1
star
39

kotlin-robot

Kotlin
1
star
40

victoria-exposure-site-bot

Ruby
1
star
41

chef-qt-webkit-devel

Ruby
1
star
42

experiment-dns-resolve

1
star
43

k3s-host-network-experiment

Why did my minidlna setup stop working?
Shell
1
star
44

experiment-fail-fast-mirroring

Shell
1
star