cookbook 'thumbor', '~> 1.0.2'
thumbor (7) Versions 1.0.2 Follow0
Installs and configures thumbor
cookbook 'thumbor', '~> 1.0.2', :supermarket
knife supermarket install thumbor
knife supermarket download thumbor
thumbor Cookbook
Installs/configures thumbor - an open-source photo thumbnail service by globo.com
NOTE: This cookbook has been heavily refactored. Please read the CHANGELOG.
Features
- Install packages for engines
pil
,opencv
,graphicsmagick
,gifsicle
- Install methods
package
,source
,pip
- Support image format WEBP
- Support Storage AWS S3
- ServerSpec/Infrataster Tests
- thumbor Stack on AWS OpsWorks in 10 minutes
Requirements
Platform:
- Ubuntu (>= 12.04)
Cookbooks:
-
apt
- Configures apt and apt services and LWRPs for managing apt repositories and preferences -
python
- Installs Python, pip and virtualenv. -
nginx
- Installs and configures nginx -
monit-ng
- Installs and configures monit -
redisio
- Installs/Configures redis
Attributes
The list of attributes found in the documentation is just an overview of important attributes.
Please look through the attributes
directory in order to find attributes that may not be listed here.
thumbor::default
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>node['thumbor']['version']</tt></td>
<td>String</td>
<td></td>
<td><tt>4.11.1</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['workers']</tt></td>
<td>Integer</td>
<td></td>
<td><tt>node['cpu']['total']</tt></td>
</tr>
</table>
thumbor::config
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>node['thumbor']['conf_file']</tt></td>
<td>String</td>
<td></td>
<td><tt>/etc/thumbor.conf</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['key_file']</tt></td>
<td>String</td>
<td></td>
<td><tt>/etc/thumbor.key</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "{ ... }"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['QUALITY']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "85"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['MAX_AGE']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "24 * 60 * 60"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['MAX_AGE_TEMP_IMAGE']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "0"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['ALLOW_UNSAFE_URL']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "true"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['LOADER']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "thumbor.loaders.http_loader"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['UPLOAD_ENABLED']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "false"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['UPLOAD_PHOTO_STORAGE']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "false"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['STORAGE']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "thumbor.storages.no_storage"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['FILE_STORAGE_ROOT_PATH']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "/var/lib/thumbor/storage"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['RESULT_STORAGE_FILE_STORAGE_ROOT_PATH']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "/var/lib/thumbor/result-storage"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['RESULT_STORAGE_STORES_UNSAFE']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "false"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['STORES_CRYPTO_KEY_FOR_EACH_IMAGE']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "true"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['ENGINE']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "thumbor.engines.pil"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['DETECTORS']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "[ ... ]"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['REDIS_QUEUE_SERVER_HOST']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "127.0.0.1"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['REDIS_QUEUE_SERVER_PORT']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "6379"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['REDIS_QUEUE_SERVER_DB']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "0"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['REDIS_QUEUE_SERVER_PASSWORD']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "None"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['AUTO_WEBP']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "true"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['options']['FILTERS']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "[ ... ]"
.</tt></td>
</tr>
</table>
thumbor::initstyle
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>node['thumbor']['version']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "4.11.1"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['package_name']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "thumbor"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['workers']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "node['cpu']['total']"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['base_port']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "9000"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['key']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "secretkey"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['result_storage']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "file"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['install_method']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "pip"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['source']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "git+git://github.com/globocom/thumbor.git@\#{node['thumbor']['version']}"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['init_style']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "upstart"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['listen_address']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "127.0.0.1"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['proxy']['type']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "nginx"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['monit']['enable']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "true"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['queue']['type']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "none"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['pip_dependencies']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "[ ... ]"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['package_dependencies']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "%w(cmake git)"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['package_dependencies'] +</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "%w(python-pgmagick python-pycurl)"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['service_config_file']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "case node['platform_family']"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['work_dir']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "/var/lib/thumbor"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['binary']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "case node['thumbor']['install_method']"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['limits']['memlock']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "unlimited"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['limits']['nofile']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "48_000"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['limits']['nproc']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "unlimited"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['log_level']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "warning"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['log_dir']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "/var/log/thumbor"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['logrotate']['rotate']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "7"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['port']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "81"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['server_name']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "_"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['client_max_body_size']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "10M"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['proxy_read_timeout']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "300"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['proxy_cache']['enabled']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "false"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['proxy_cache']['path']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "/var/www/thumbor_cache"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['proxy_cache']['key_zone']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "thumbor_cache"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['proxy_cache']['valid']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "900s"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['vhost']['cookbook']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "thumbor"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['vhost']['template']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "nginx.vhost.erb"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['nginx']['vhost']['variables']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "{ ... }"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['thumbor']['uri']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "http://ppa.launchpad.net/thumbor/ppa/ubuntu"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['thumbor']['keyserver']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "keyserver.ubuntu.com"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['thumbor']['components']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "%w(main)"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['thumbor']['key']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "68DFB11CCBEC8F27"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['thumbor']['deb_src']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "false"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['thumbor']['action']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "add"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['multiverse']['uri']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "http://archive.ubuntu.com/ubuntu"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['multiverse']['distribution']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "node['lsb']['codename']"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['multiverse']['keyserver']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "keyserver.ubuntu.com"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['multiverse']['components']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "%w(main multiverse restricted universe)"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['multiverse']['key']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "40976EAF437D05B5"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['multiverse']['deb_src']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "false"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['multiverse']['action']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "add"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['apt']['thumbor']['distribution']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "node['lsb']['codename']"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['user']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "thumbor"
.</tt></td>
</tr>
<tr>
<td><tt>node['thumbor']['group']</tt></td>
<td>Boolean</td>
<td></td>
<td><tt>Defaults to "thumbor"
.</tt></td>
</tr>
</table>
Usage
thumbor::default
Simple:
json
{
"name":"my_node",
"run_list": [
"recipe[thumbor]"
]
}
Generate a secret and disable unsafe-mode:
json
{
"name":"my_node",
"run_list": [
"recipe[thumbor]"
],
"default_attributes": {
"thumbor": {
"key": "This-Is-A-Secret-Key",
"options": {
"ALLOW_UNSAFE_URL": false
}
}
}
}
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
Prerequisites
- ChefDK
- Recent RuboCop
chef gem install rubocop
Testing
Test changes using
chef exec rake
chef exec kitchen verify
License and Authors
Author:: Enrico Stahn (mail@enricostahn.com)
Copyright 2015, Zanui
See LICENSE for license details
Dependent cookbooks
apt >= 0.0.0 |
python >= 0.0.0 |
nginx >= 0.0.0 |
monit-ng >= 0.0.0 |
redisio >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Change Log
v1.0.2 (2015-03-24)
Implemented enhancements:
- Reduce cookbook size with chefignore #11
- Change NGINX port from 81 to 80 to reduce JSON configuration #10
- Add documentation for usage with AWS OpsWorks #2
v1.0.1 (2015-03-10)
Implemented enhancements:
v1.0.0 (2015-03-10)
Implemented enhancements:
- Add kitchen tests #6
Closed issues:
- add upstart custom log location capability #8
Merged pull requests:
Additional Information:
- Major refactoring of the cookbook
-
Deprecated: "do-all"
experimental
recipe - Code separated into recipes
- Add serverspec tests to validate processes are running correctly
- Test thumbor service
enabled
,running
- Test ports are listening via
tcp
on9000
,9001
,9003
- Test thumbor service
- Add infrataster tests to validate thumbor results are correct and installed libraries are working as expected
- Test
/healthcheck
responds with contentWORKING
- Test
responds successfully
- Test
responds as 'image/gif'
- Test
responds with the correct size
- Test
- Add attribute
install_method
with valuespackage
,pip
andsource
. This also allows to install all version and branches from any git repository such as GitHub. - Add monit for nginx and thumbor
- Add redis through redisio cookbook
-
Deprecated: "do-all"
v0.4.1 (2014-09-09)
v0.4.0 (2014-07-23)
Merged pull requests:
v0.1.0
- Enrico Stahn - Initial release of thumbor
Collaborator Number Metric
1.0.2 failed this metric
Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.2 passed this metric
No Binaries Metric
1.0.2 passed this metric
Testing File Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.2 failed this metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.2 passed this metric
No Binaries Metric
1.0.2 passed this metric
Testing File Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.2 passed this metric
1.0.2 passed this metric
Testing File Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.2 failed this metric
1.0.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number