Project

kanoko

0.01
No commit activity in last 3 years
No release in over 3 years
kanoko is a active image generater library.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

kanoko

Build Status

logo

kanoko is an active image generate application.

Quick Start

require 'kanoko/application/convert'

class MyApp < Kanoko::Application::Convert
end

run MyApp
$ KANOKO_DIGEST_FUNC=sha1 KANOKO_SECRET_KEY=devkey unicorn --config-file config/unicorn/development.rb

Arguments

http://{{kanoko.host}}/:hash/:func/:args/:path

  • hash: params signature (see also Signature)
  • func: a function name of image processing (e.g. fit)
  • args: image processing arguments (e.g. "100x100")
  • path: Target image path without scheme (e.g. "host/path/to/image?params_a=value_a")

Signature

hash is changeable.

By default, see Kanoko::Configure#initialize.

On application, It must be set hash same way as this.

If hash not match, application should be return 400 Bad Request.

This function behavior can change by Kanoko.configure.

Kanoko.configure.hash_proc = ->{
  "some_hash_value_on_url"
}

TODO

  • To be able to change digest_func and secret_key on graceful restart
  • More fast