berkshelf-api 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,23 @@
1
+ # 1.4.0
2
+
3
+ * Enhancements
4
+ * Always return JSON to native HTTP clients
5
+ * Listen host can now be passed to cli with the `-h` flag
6
+ * berkshelf-api user will now be created as a system user
7
+ * Update many dependent gems
8
+
9
+ * Bug fixes
10
+ * Fix race condition when creating the user's home directory in cookbook
11
+ * Gracefully handle results from the community site which are empty
12
+
13
+ * Backwards incompatible changes
14
+ * Renamed cookbook from `berkshelf-api` to `berkshelf-api-server`
15
+
16
+ # 1.3.1
17
+
18
+ * Enhancements
19
+ * Fix cookbook issue when installing on `> Ubuntu 12.04`
20
+
1
21
  # 1.3.0
2
22
 
3
23
  * Enhancements
data/README.md CHANGED
@@ -12,9 +12,9 @@ The API server can be installed in two ways; from a Chef Cookbook (recommended)
12
12
 
13
13
  #### Basic
14
14
 
15
- 1. Select a [release](https://github.com/berkshelf/berkshelf-api/releases) and download it's cookbooks artifact (`cookbooks.tar.gz`).
15
+ 1. Select a [release](https://github.com/berkshelf/berkshelf-api/releases) and download its cookbooks artifact (`cookbooks.tar.gz`).
16
16
  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.
17
- 3. Add "recipe[berkshelf-api::default]" to your node's run_list and run Chef.
17
+ 3. Add "recipe[berkshelf-api-server::default]" to your node's run_list and run Chef.
18
18
 
19
19
  #### Express
20
20
 
@@ -30,15 +30,43 @@ Bootstrap a server into that environment
30
30
 
31
31
  Install the cookbooks into your environment
32
32
 
33
- $ blo in https://github.com/berkshelf/berkshelf-api/releases/download/v1.2.1/cookbooks.tar.gz
33
+ $ blo in https://github.com/berkshelf/berkshelf-api/releases/download/v1.3.1/cookbooks.tar.gz
34
34
 
35
35
  Add the recipe to your new node's run_list
36
36
 
37
- $ knife node run_list add i-c8cd9ac1 "recipe[berkshelf-api::default]"
37
+ $ knife node run_list add i-c8cd9ac1 "recipe[berkshelf-api-server::default]"
38
+
39
+ Edit the environment to configure the API server
40
+
41
+ $ knife environment edit berks-api-production
42
+
43
+ And add your configuration to the `node[:berkshelf_api][:config]` attribute
44
+
45
+ ```json
46
+ "default_attributes": {
47
+ "berkshelf_api": {
48
+ "config": {
49
+ "endpoints": [
50
+ {
51
+ "type": "chef_server",
52
+ "options": {
53
+ "url": "https://api.opscode.com/organizations/vialstudios",
54
+ "client_key": "/etc/berkshelf/api-server/client.pem",
55
+ "client_name": "berkshelf"
56
+ }
57
+ }
58
+ ]
59
+ },
60
+ "host":"your.fqdn.here"
61
+ }
62
+ }
63
+ ```
64
+
65
+ > See configuration endpoints below for a complete list of supported endpoints, and the [api cookbook readme](https://github.com/berkshelf/berkshelf-api/tree/master/cookbook) for all configuration options.
38
66
 
39
67
  Update the machine you bootstrapped to the latest version of Berkshelf-API
40
68
 
41
- $ blo up berks-api-production berkshelf-api 1.2.1
69
+ $ blo up berks-api-production berkshelf-api-server latest
42
70
 
43
71
  ### Gem install
44
72
 
@@ -137,6 +165,11 @@ A local directory containing cookbooks.
137
165
  }
138
166
  ```
139
167
 
168
+ ## Getting Help
169
+
170
+ * If you have an issue: report it on the [issue tracker](https://github.com/berkshelf/berkshelf/issues)
171
+ * If you have a question: visit the #chef or #berkshelf channel on irc.freenode.net
172
+
140
173
  # Authors and Contributors
141
174
 
142
175
  * Jamie Winsor (<jamie@vialstudios.com>)
@@ -7,6 +7,8 @@ module Berkshelf::API
7
7
  # Force inbound requests to be JSON
8
8
  def call(env)
9
9
  env['CONTENT_TYPE'] = 'application/json'
10
+ # If coming from a browser or other naive HTTP client, we want JSON back
11
+ env['HTTP_ACCEPT'] = 'application/json' if !env['HTTP_ACCEPT'] || env['HTTP_ACCEPT'].include?('text/html')
10
12
  super
11
13
  end
12
14
  end
@@ -60,9 +60,15 @@ module Berkshelf::API
60
60
  cookbooks = Array.new
61
61
 
62
62
  while count > 0
63
- cookbooks += connection.get("cookbooks?start=#{start}&items=#{count}").body["items"]
64
- start += 100
65
- count -= 100
63
+ req = connection.get("cookbooks?start=#{start}&items=#{count}")
64
+ chunk = req.body["items"]
65
+ if chunk
66
+ cookbooks += chunk
67
+ start += 100
68
+ count -= 100
69
+ else
70
+ log.warn "Didn't get any cookbooks - #{req.body}"
71
+ end
66
72
  end
67
73
 
68
74
  cookbooks.map { |cb| cb["cookbook_name"] }
@@ -12,6 +12,10 @@ module Berkshelf
12
12
  options = Hash.new
13
13
 
14
14
  OptionParser.new("Usage: #{filename} [options]") do |opts|
15
+ opts.on("-h", "--host HOST", String, "set the listening address") do |h|
16
+ options[:host] = h
17
+ end
18
+
15
19
  opts.on("-p", "--port PORT", Integer, "set the listening port") do |v|
16
20
  options[:port] = v
17
21
  end
@@ -1,5 +1,5 @@
1
1
  module Berkshelf
2
2
  module API
3
- VERSION = "1.3.1"
3
+ VERSION = "1.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-04-23 00:00:00.000000000 Z
13
+ date: 2014-06-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ridley
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: '3.1'
22
+ version: '4.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ~>
29
29
  - !ruby/object:Gem::Version
30
- version: '3.1'
30
+ version: '4.0'
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: celluloid
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -116,6 +116,9 @@ dependencies:
116
116
  - - ! '>='
117
117
  - !ruby/object:Gem::Version
118
118
  version: 2.0.4
119
+ - - <
120
+ - !ruby/object:Gem::Version
121
+ version: 3.0.0
119
122
  type: :runtime
120
123
  prerelease: false
121
124
  version_requirements: !ruby/object:Gem::Requirement
@@ -124,6 +127,9 @@ dependencies:
124
127
  - - ! '>='
125
128
  - !ruby/object:Gem::Version
126
129
  version: 2.0.4
130
+ - - <
131
+ - !ruby/object:Gem::Version
132
+ version: 3.0.0
127
133
  - !ruby/object:Gem::Dependency
128
134
  name: faraday
129
135
  requirement: !ruby/object:Gem::Requirement
@@ -179,7 +185,7 @@ dependencies:
179
185
  requirements:
180
186
  - - ~>
181
187
  - !ruby/object:Gem::Version
182
- version: '0.1'
188
+ version: '1.0'
183
189
  type: :runtime
184
190
  prerelease: false
185
191
  version_requirements: !ruby/object:Gem::Requirement
@@ -187,7 +193,7 @@ dependencies:
187
193
  requirements:
188
194
  - - ~>
189
195
  - !ruby/object:Gem::Version
190
- version: '0.1'
196
+ version: '1.0'
191
197
  - !ruby/object:Gem::Dependency
192
198
  name: octokit
193
199
  requirement: !ruby/object:Gem::Requirement
@@ -307,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
313
  version: '0'
308
314
  segments:
309
315
  - 0
310
- hash: -1558079963441890328
316
+ hash: 80644279196753361
311
317
  requirements: []
312
318
  rubyforge_project:
313
319
  rubygems_version: 1.8.23