Giter Club home page Giter Club logo

berkshelf-api's Introduction

Berkshelf::API

Gem Version Build Status

A server which indexes cookbooks from various sources and hosts it over a REST API

Installation

The API server can be installed in two ways; from a Chef Cookbook (recommended) and from a Rubygem.

Cookbook install

Basic

  1. Select a release and download its cookbooks artifact (cookbooks.tar.gz).
  2. Upload the cookbooks to your Chef Server if you're using Chef Client or just give them to Chef Solo if that's your thing.
  3. Add "recipe[berkshelf-api-server::default]" to your node's run_list and run Chef.

Express

Install and configure Chef/Knife and Berkflow on your machine.

Create an environment

$ knife environment create berks-api-production -d

Bootstrap a server into that environment

$ knife ec2 server create -I ami-22e08b12 -f t1.micro -E berks-api-production -r "recipe[organization-base::default]" -G ssh-admin,http-https --ssh-user ubuntu

Install the cookbooks into your environment

$ blo in https://github.com/berkshelf/berkshelf-api/releases/download/v1.3.1/cookbooks.tar.gz

Add the recipe to your new node's run_list

$ knife node run_list add i-c8cd9ac1 "recipe[berkshelf-api-server::default]"

Edit the environment to configure the API server

$ knife environment edit berks-api-production

And add your configuration to the node[:berkshelf_api][:config] attribute

"default_attributes": {
  "berkshelf_api": {
    "config": {
      "endpoints": [
        {
          "type": "chef_server",
          "options": {
            "url": "https://api.opscode.com/organizations/vialstudios",
            "client_key": "/etc/berkshelf/api-server/client.pem",
            "client_name": "berkshelf"
          }
        }
      ]
    },
    "host":"your.fqdn.here"
  }
}

See configuration endpoints below for a complete list of supported endpoints, and the api cookbook readme for all configuration options.

Update the machine you bootstrapped to the latest version of Berkshelf-API

$ blo up berks-api-production berkshelf-api-server latest

Gem install

$ gem install berkshelf-api

Running the server

$ berks-api
I, [2014-02-21T12:05:07.639699 #43671]  INFO -- : Cache Manager starting...
I, [2014-02-21T12:05:07.639883 #43671]  INFO -- : Loading save from /Users/reset/.berkshelf/api-server/cerch
I, [2014-02-21T12:05:07.640462 #43671]  INFO -- : Cache contains 0 items
I, [2014-02-21T12:05:07.641021 #43671]  INFO -- : Cache Builder starting...
I, [2014-02-21T12:05:07.723779 #43671]  INFO -- : REST Gateway listening on 0.0.0.0:26200

Supported Platforms

Berkshelf-API is tested on Ruby 1.9.3, 2.0.0, and JRuby 1.7+.

Ruby 1.9 mode is required on all interpreters.

Configuring Endpoints

You may configure the endpoints to index by editing the JSON configuration file (default: #{ENV['HOME']}/.berkshelf/api-server/config.json).

Opscode Community Site

{
  "endpoints": [
    {
      "type": "opscode",
      "options": {
        "url": "http://cookbooks.opscode.com/api/v1"
      }
    }
  ]
}
```

### Chef Server

```json
{
  "endpoints": [
    {
      "type": "chef_server",
      "options": {
        "url": "https://api.opscode.com/organizations/vialstudios",
        "client_name": "berkshelf",
        "client_key": "/etc/berkshelf/api-server/client.pem"
      }
    }
  ]
}
```

### GitHub Organization

> WARNING: Using the GitHub endpoint is *STRONGLY FROWNED UPON* and potentially *DANGEROUS*. Please consider setting up a proper release process for the cookbooks you wish to index instead where they are uploaded to the community site or a Chef Server and use the chef_server endpoint instead.

GitHub limits the rate of requests to their API if not authenticated. For this reason the access_token option
is required. The api_endpoint, web_endpoint and ssl_verify options are only needed when you want to point to
a GitHub Enterprise server within your own organization

```json
{
  "endpoints": [
    {
      "type": "github",
      "options": {
        "organization": "opscode-cookbooks",
        "access_token": "",
        "api_endpoint": "https://github.enterprise.local/api/v3",
        "web_endpoint": "https://github.enterprise.local",
        "ssl_verify": true
      }
    }
  ]
}
```

### FileStore directory

A local directory containing cookbooks.

```json
{
  "endpoints": [
    {
      "type": "file_store",
      "options": {
        "path": "/Users/chef/code/cookbooks"
      }
    }
  ]
}
```

## Getting Help

* If you have an issue: report it on the [issue tracker](https://github.com/berkshelf/berkshelf/issues)
* If you have a question: visit the #chef or #berkshelf channel on irc.freenode.net

# Authors and Contributors

* Jamie Winsor (<[email protected]>)
* Andrew Garson (<[email protected]>)

Thank you to all of our [Contributors](https://github.com/berkshelf/berkshelf-api/graphs/contributors), testers, and users.

berkshelf-api's People

Contributors

andrewgarson avatar coderanger avatar docwhat avatar eherot avatar gavinheavyside avatar ivey avatar jossy avatar justincampbell avatar mindlace avatar punkle avatar reset avatar sethvargo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.