Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


sinopia (6) Versions 0.2.8

Install a sinopia NPM server (cache & private repo) See :

cookbook 'sinopia', '= 0.2.8', :supermarket
cookbook 'sinopia', '= 0.2.8'
knife supermarket install sinopia
knife supermarket download sinopia
Quality -%

sinopia cookbook

Build Status

Sinopia project :

Sinopia is a private/caching npm repository server.

It allows you to have a local npm registry with zero configuration. You don't have to install and replicate an entire CouchDB database. Sinopia keeps its own small database and, if a package doesn't exist there, it asks for it keeping only those packages you use.


  • Chef >= 11
  • Currently only tested with chef 11.10 on Ubuntu 12.04.
  • Sinopia Cookbook heavily depends on nodejs and node community cookbooks.


Add recipe[sinopia] to the node runlist.

Default recipe with no other options will :

  • Configure sinopia folders (in /etc, /var & /var/log)
  • Install node + npm from the official repo at the latest version
  • Create a passwordless sinopia user who will run the service
  • Install latest version of sinopia from
  • Configure log rotation to 30d
  • Setup and start sinopia service (based on upstart for now)


  • Sinopia will bind to, so you probably need to setup a web frontend.
  • Access to the npm service is allowed to everyone.
  • All desired packages are cached from
  • A single npm account is provisionned to publish private packages with :
    • login : admin
    • passw : admin


Every single Sinopia configuration item can be managed from node attributes.
Default values are specified each time.

System configuration

  • node['sinopia']['user'] : (sinopia) default user running sinopia
  • node['sinopia']['confdir'] : (/etc/sinopia) config.yaml file location
  • node['sinopia']['datadir'] : (/var/lib/sinopia) Sinopia cache & private stores location
  • node['sinopia']['logdir'] : (/var/log/sinopia) sinopia.log file location
  • node['sinopia']['logdays'] : (30) log retention policy, Integer days
  • node['sinopia']['loglevel'] : (warn) log level, trace | debug | info | http | warn | error | fatal

Sinopia global conf

  • node['sinopia']['version'] : (nil) Sinopia npm package version, use nil for latest
  • node['sinopia']['admin']['pass'] : (admin) Sinopia admin account clear password
  • node['sinopia']['public_url'] : Sinopia rewrite url, url prefix for provided links
  • node['sinopia']['timeout'] : (nil) Cached repo timeout in ms, software default is 30000 ms
  • node['sinopia']['maxage'] : (nil) Sinopia metadata cache max age in sec, software defaut is 120s
  • node['sinopia']['max_body_size'] : (nil) Maximum size of uploaded json document, software default is 1mb

Users and rights

No users are created by default.

  • You can set user list with a hash under default['sinopia']['users'], you need to specify a password for each user
  • You can give admin right to a specific user with user['admin'] = true hash

node['sinopia']['users']['bob']['pass'] = 'incredible'
node['sinopia']['users']['bob']['admin'] = true

node['sinopia']['users']['andy']['pass'] = 'toys'
node['sinopia']['users']['andy']['admin'] = true

node['sinopia']['users']['woody']['pass'] = 'buzz'

NPM Registry

You can store a list of available npm repositories in node['sinopia']['repos'] following {'name' => 'url'} syntax.

Default hash is loaded with official npmjs repo : default['sinopia']['repos'] = {'npmjs' => ''}

Example :
node['sinopia']['repos'] = {
'npmjs' => '', # official npmjs repo
'myrepo' => 'https://myrepo.local/',
'other' => ''

node['sinopia']['mainrepo'] : (npmjs) Caching repository name selected from available repos list


  • You can define access & publish filters based on package name under default['sinopia']['filters']
  • Filter format is an Array with one Hash for one rule
  • Wildcard is accepted in the filter name rule
  • Access can be provided to :
    • Default (all)
    • Specified available users : ['user1', 'user2']
    • admin account + all admin user : '@admins'
  • publish can be provided to :
    • Default (admin account only)
    • Specified available users + admin : ['user1', 'user2']
    • admin account + all admin user : '@admins'
  • Storage value is the name of the folder where filtered packages will be set.

Example :
node['sinopia']['filters'] = [
'name' => 'private-*',
'storage' => 'private-repo'
'name' => 'admin-*',
'access' => ['andy', 'woody']
'name' => 'test-*',
'access' => '@admins'


This cookbook is reusing specific logging format of Sinopia :

type: file | stdout | stderr
level: trace | debug | info | http (default) | warn | error | fatal

{type: 'file', path: 'sinopia.log', level: 'debug'},

parameters for stdout and stderr: format: json | pretty
{type: 'stdout', format: 'pretty', level: 'debug'}

You can add as much logger as you want (including '{}') in default['sinopia']['logs'] Array

Default value is :
node['sinopia']['logs'] = [
"{type: file, path: '/var/log/sinopia/sinopia.log', level: warn}"


See attributes/default.rb to view how to configure node['sinopia']['use_proxy'] and node['sinopia']['proxy'].


See attributes/default.rb to view Node & npm install options (version, source/package, ...)


sinopia::default recipe includes :
- sinopia::users : creates users
- sinopia::nodejs : install node & npm
- sinopia::sinopia : install sinopia, directories, conf and start service


Sinopia cookbook is bundled with a Vagrantfile. If you have virtualbox and vagrant ready, just fire a vagrant up and this will setup a box running Sinopia and listening Port 4873 is forwaded to your for test purposes.


Author:: Barthelemy Vessemont (

Dependent cookbooks

apt >= 0.0.0
nodejs ~> 2.0
user >= 0.0.0
logrotate >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

No quality metric results found