vault-tree 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. data/.gitignore +26 -0
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +43 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +118 -0
  6. data/Rakefile +17 -0
  7. data/VagrantFile +30 -0
  8. data/features/core.feature +44 -0
  9. data/features/exceptions.feature +41 -0
  10. data/features/steps/core.steps.rb +168 -0
  11. data/features/steps/exceptions.steps.rb +103 -0
  12. data/features/support/env.rb +1 -0
  13. data/features/world.rb +3 -0
  14. data/lib/vault-tree.rb +7 -0
  15. data/lib/vault-tree/config/dependencies.rb +4 -0
  16. data/lib/vault-tree/config/lib.rb +2 -0
  17. data/lib/vault-tree/config/path_helpers.rb +49 -0
  18. data/lib/vault-tree/config/string.rb +25 -0
  19. data/lib/vault-tree/contract/close_validator.rb +35 -0
  20. data/lib/vault-tree/contract/contract.rb +85 -0
  21. data/lib/vault-tree/contract/contract_presenter.rb +27 -0
  22. data/lib/vault-tree/contract/doorman.rb +112 -0
  23. data/lib/vault-tree/contract/null_vault.rb +16 -0
  24. data/lib/vault-tree/contract/open_validator.rb +20 -0
  25. data/lib/vault-tree/contract/vault.rb +96 -0
  26. data/lib/vault-tree/exceptions/empty_vault.rb +8 -0
  27. data/lib/vault-tree/exceptions/fill_attempt_master_password.rb +6 -0
  28. data/lib/vault-tree/exceptions/invalid_signature.rb +0 -0
  29. data/lib/vault-tree/exceptions/malformed_json.rb +0 -0
  30. data/lib/vault-tree/exceptions/missing_external_data.rb +6 -0
  31. data/lib/vault-tree/exceptions/missing_partner_decryption_key.rb +6 -0
  32. data/lib/vault-tree/exceptions/missing_passphrase.rb +6 -0
  33. data/lib/vault-tree/exceptions/non_unique_vault_id.rb +0 -0
  34. data/lib/vault-tree/exceptions/unsupported_keyword.rb +6 -0
  35. data/lib/vault-tree/exceptions/vault_does_not_exist.rb +6 -0
  36. data/lib/vault-tree/exceptions/vault_tree_exception.rb +6 -0
  37. data/lib/vault-tree/keywords/decryption_key.rb +14 -0
  38. data/lib/vault-tree/keywords/external_data.rb +13 -0
  39. data/lib/vault-tree/keywords/keyword.rb +19 -0
  40. data/lib/vault-tree/keywords/keyword_interpreter.rb +45 -0
  41. data/lib/vault-tree/keywords/master_passphrase.rb +9 -0
  42. data/lib/vault-tree/keywords/public_encryption_key.rb +27 -0
  43. data/lib/vault-tree/keywords/random_number.rb +9 -0
  44. data/lib/vault-tree/keywords/shared_key.rb +24 -0
  45. data/lib/vault-tree/keywords/unlocked.rb +9 -0
  46. data/lib/vault-tree/keywords/vault_contents.rb +13 -0
  47. data/lib/vault-tree/lock_smith/asymmetric_cipher.rb +31 -0
  48. data/lib/vault-tree/lock_smith/crypto_hash.rb +11 -0
  49. data/lib/vault-tree/lock_smith/digital_signature.rb +32 -0
  50. data/lib/vault-tree/lock_smith/encryption_key_pair.rb +25 -0
  51. data/lib/vault-tree/lock_smith/null_vault.rb +4 -0
  52. data/lib/vault-tree/lock_smith/random_number.rb +11 -0
  53. data/lib/vault-tree/lock_smith/shared_key_pair.rb +12 -0
  54. data/lib/vault-tree/lock_smith/signing_key_pair.rb +25 -0
  55. data/lib/vault-tree/lock_smith/symmetric_cipher.rb +25 -0
  56. data/lib/vault-tree/util/json.rb +16 -0
  57. data/lib/vault-tree/version.rb +3 -0
  58. data/spec/app/locksmith/asymmetric_cipher_spec.rb +25 -0
  59. data/spec/app/locksmith/signing_key_pair_spec.rb +22 -0
  60. data/spec/spec_helper.rb +5 -0
  61. data/spec/support/fixtures/blank_simple_test_contract.json +14 -0
  62. data/spec/support/fixtures/broken_contract.json +55 -0
  63. data/spec/support/fixtures/one_two_three-0.5.0.EXP.json +105 -0
  64. data/spec/support/fixtures/reference_contract.1.0.0.json +227 -0
  65. data/spec/support/fixtures/simple_test_contract.json +14 -0
  66. data/support/cookbooks/ark/.gitignore +12 -0
  67. data/support/cookbooks/ark/.kitchen.yml +34 -0
  68. data/support/cookbooks/ark/.travis.yml +6 -0
  69. data/support/cookbooks/ark/Berksfile +9 -0
  70. data/support/cookbooks/ark/CHANGELOG.md +87 -0
  71. data/support/cookbooks/ark/CONTRIBUTING.md +257 -0
  72. data/support/cookbooks/ark/README.md +301 -0
  73. data/support/cookbooks/ark/Rakefile +36 -0
  74. data/support/cookbooks/ark/TESTING.md +25 -0
  75. data/support/cookbooks/ark/Toftfile +15 -0
  76. data/support/cookbooks/ark/attributes/default.rb +6 -0
  77. data/support/cookbooks/ark/chefignore +96 -0
  78. data/support/cookbooks/ark/files/default/foo.tar.gz +0 -0
  79. data/support/cookbooks/ark/files/default/foo.tbz +0 -0
  80. data/support/cookbooks/ark/files/default/foo.tgz +0 -0
  81. data/support/cookbooks/ark/files/default/foo.zip +0 -0
  82. data/support/cookbooks/ark/files/default/tests/minitest/default_test.rb +0 -0
  83. data/support/cookbooks/ark/files/default/tests/minitest/support/helpers.rb +0 -0
  84. data/support/cookbooks/ark/files/default/tests/minitest/test_test.rb +94 -0
  85. data/support/cookbooks/ark/libraries/default.rb +167 -0
  86. data/support/cookbooks/ark/metadata.rb +13 -0
  87. data/support/cookbooks/ark/providers/default.rb +370 -0
  88. data/support/cookbooks/ark/recipes/default.rb +31 -0
  89. data/support/cookbooks/ark/recipes/test.rb +138 -0
  90. data/support/cookbooks/ark/resources/default.rb +54 -0
  91. data/support/cookbooks/ark/templates/default/add_to_path.sh.erb +1 -0
  92. data/support/cookbooks/ark/test/support/Gemfile +4 -0
  93. data/support/cookbooks/build-essential/README.md +24 -0
  94. data/support/cookbooks/build-essential/metadata.rb +10 -0
  95. data/support/cookbooks/build-essential/recipes/default.rb +45 -0
  96. data/support/cookbooks/chruby/.gitignore +15 -0
  97. data/support/cookbooks/chruby/.kitchen.yml +26 -0
  98. data/support/cookbooks/chruby/.ruby_version +1 -0
  99. data/support/cookbooks/chruby/Berksfile +3 -0
  100. data/support/cookbooks/chruby/Gemfile +7 -0
  101. data/support/cookbooks/chruby/LICENSE +14 -0
  102. data/support/cookbooks/chruby/README.md +92 -0
  103. data/support/cookbooks/chruby/Rakefile +7 -0
  104. data/support/cookbooks/chruby/Thorfile +6 -0
  105. data/support/cookbooks/chruby/Vagrantfile +86 -0
  106. data/support/cookbooks/chruby/attributes/default.rb +10 -0
  107. data/support/cookbooks/chruby/chefignore +96 -0
  108. data/support/cookbooks/chruby/metadata.rb +11 -0
  109. data/support/cookbooks/chruby/recipes/default.rb +43 -0
  110. data/support/cookbooks/chruby/recipes/system.rb +25 -0
  111. data/support/cookbooks/chruby/templates/default/chruby.sh.erb +22 -0
  112. data/support/cookbooks/chruby/test/integration/default/bash/embedded_test.sh +1 -0
  113. data/support/cookbooks/git/.gitignore +14 -0
  114. data/support/cookbooks/git/.kitchen.yml +46 -0
  115. data/support/cookbooks/git/Berksfile +8 -0
  116. data/support/cookbooks/git/CHANGELOG.md +87 -0
  117. data/support/cookbooks/git/CONTRIBUTING +29 -0
  118. data/support/cookbooks/git/Gemfile +3 -0
  119. data/support/cookbooks/git/LICENSE +201 -0
  120. data/support/cookbooks/git/README.md +115 -0
  121. data/support/cookbooks/git/TESTING.md +25 -0
  122. data/support/cookbooks/git/attributes/default.rb +40 -0
  123. data/support/cookbooks/git/metadata.rb +35 -0
  124. data/support/cookbooks/git/recipes/default.rb +53 -0
  125. data/support/cookbooks/git/recipes/server.rb +58 -0
  126. data/support/cookbooks/git/recipes/source.rb +49 -0
  127. data/support/cookbooks/git/recipes/windows.rb +37 -0
  128. data/support/cookbooks/git/templates/default/git-xinetd.d.erb +10 -0
  129. data/support/cookbooks/git/templates/default/sv-git-daemon-log-run.erb +2 -0
  130. data/support/cookbooks/git/templates/default/sv-git-daemon-run.erb +3 -0
  131. data/support/cookbooks/install_ruby/README.md +3 -0
  132. data/support/cookbooks/install_ruby/metadata.rb +10 -0
  133. data/support/cookbooks/install_ruby/recipes/default.rb +14 -0
  134. data/support/cookbooks/ruby_build/.gitignore +6 -0
  135. data/support/cookbooks/ruby_build/.kitchen.yml +31 -0
  136. data/support/cookbooks/ruby_build/.travis.yml +4 -0
  137. data/support/cookbooks/ruby_build/Berksfile +10 -0
  138. data/support/cookbooks/ruby_build/CHANGELOG.md +72 -0
  139. data/support/cookbooks/ruby_build/Gemfile +14 -0
  140. data/support/cookbooks/ruby_build/README.md +338 -0
  141. data/support/cookbooks/ruby_build/Rakefile +21 -0
  142. data/support/cookbooks/ruby_build/attributes/default.rb +67 -0
  143. data/support/cookbooks/ruby_build/chefignore +53 -0
  144. data/support/cookbooks/ruby_build/libraries/ruby_build_recipe_helpers.rb +40 -0
  145. data/support/cookbooks/ruby_build/metadata.rb +18 -0
  146. data/support/cookbooks/ruby_build/providers/ruby.rb +88 -0
  147. data/support/cookbooks/ruby_build/recipes/default.rb +69 -0
  148. data/support/cookbooks/ruby_build/resources/ruby.rb +33 -0
  149. data/support/cookbooks/ruby_build/test/cookbooks/alltherubies/metadata.rb +10 -0
  150. data/support/cookbooks/ruby_build/test/cookbooks/alltherubies/recipes/default.rb +59 -0
  151. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/_verify_tests.bash +33 -0
  152. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.8.7.bats +29 -0
  153. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.9.2.bats +18 -0
  154. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.9.3.bats +18 -0
  155. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_2.0.0.bats +18 -0
  156. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_jruby.bats +20 -0
  157. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_rbx.bats +18 -0
  158. data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_ree.bats +19 -0
  159. data/support/cookbooks/ruby_build/test/integration/installation/bats/installation.bats +6 -0
  160. data/support/scripts/libsodium_ubuntu.sh +80 -0
  161. data/support/tasks/.gitkeep +0 -0
  162. data/support/tasks/libsodium_install.rb +57 -0
  163. data/vault-tree.gemspec +26 -0
  164. metadata +305 -0
@@ -0,0 +1,115 @@
1
+ Description
2
+ ===========
3
+
4
+ Installs git and optionally sets up a git server as a daemon under runit.
5
+
6
+ Requirements
7
+ ============
8
+ ## Ohai and Chef:
9
+
10
+ * Ohai: 6.14.0+
11
+
12
+ This cookbook makes use of `node['platform_family']` to simplify platform
13
+ selection logic. This attribute was introduced in Ohai v0.6.12.
14
+
15
+ ## Platform:
16
+
17
+ The following platform families are supported:
18
+
19
+ * Debian
20
+ * Arch
21
+ * RHEL
22
+ * Fedora
23
+ * Mac OS X (10.6.0+)
24
+ * Windows
25
+
26
+ ## Cookbooks:
27
+
28
+ * runit (for `git::server`)
29
+ * build-essential (for `git::source`)
30
+ * dmg (for OS X installation)
31
+ * yum (for RHEL 5 installation)
32
+
33
+ ### Windows Dependencies
34
+ The [`windows_package`](https://github.com/opscode-cookbooks/windows#windows_package) resource from the Windows cookbook is required to
35
+ install the git package on Windows.
36
+
37
+ ## Attributes
38
+
39
+ ### default
40
+ The following attributes are platform-specific.
41
+
42
+ #### Windows
43
+
44
+ * `node['git']['version']` - git version to install
45
+ * `node['git']['url']` - URL to git package
46
+ * `node['git']['checksum']` - package SHA256 checksum
47
+ * `node['git']['display_name']` - `windows_package` resource Display Name (makes the package install idempotent)
48
+
49
+ #### Mac OS X
50
+
51
+ * `node['git']['osx_dmg']['url']` - URL to git package
52
+ * `node['git']['osx_dmg']['checksum']` - package SHA256 checksum
53
+
54
+ #### Linux
55
+
56
+ * `node['git']['prefix']` - git install directory
57
+ * `node['git']['version']` - git version to install
58
+ * `node['git']['url']` - URL to git tarball
59
+ * `node['git']['checksum']` - tarball SHA256 checksum
60
+
61
+ Recipes
62
+ =======
63
+
64
+ ## default
65
+
66
+ Installs base git packages based on platform.
67
+
68
+ ## server
69
+
70
+ Sets up a git daemon to provide a server.
71
+
72
+ ## source
73
+
74
+ Installs git from source.
75
+
76
+ ## windows
77
+
78
+ Installs git client on Windows
79
+
80
+ Usage
81
+ =====
82
+
83
+
84
+ This cookbook primarily installs git core packages. It can also be
85
+ used to serve git repositories.
86
+
87
+ To install git client (all supported platforms):
88
+
89
+ include_recipe 'git'
90
+
91
+ To install git server:
92
+
93
+ include_recipe "git::server"
94
+
95
+ This creates the directory specified by git/server/base_path (default is /srv/git)
96
+ and starts a git daemon, exporting all repositories found. Repositories need to be
97
+ added manually, but will be available once they are created.
98
+
99
+ License and Author
100
+ ==================
101
+
102
+ - Author:: Joshua Timberman (<joshua@opscode.com>)
103
+ - Copyright:: 2009-2012, Opscode, Inc.
104
+
105
+ Licensed under the Apache License, Version 2.0 (the "License");
106
+ you may not use this file except in compliance with the License.
107
+ You may obtain a copy of the License at
108
+
109
+ http://www.apache.org/licenses/LICENSE-2.0
110
+
111
+ Unless required by applicable law or agreed to in writing, software
112
+ distributed under the License is distributed on an "AS IS" BASIS,
113
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114
+ See the License for the specific language governing permissions and
115
+ limitations under the License.
@@ -0,0 +1,25 @@
1
+ This cookbook includes support for running tests via Test Kitchen (1.0). This has some requirements.
2
+
3
+ 1. You must be using the Git repository, rather than the downloaded cookbook from the Chef Community Site.
4
+ 2. You must have Vagrant 1.1 installed.
5
+ 3. You must have a "sane" Ruby 1.9.3 environment.
6
+
7
+ Once the above requirements are met, install the additional requirements:
8
+
9
+ Install the berkshelf plugin for vagrant, and berkshelf to your local Ruby environment.
10
+
11
+ vagrant plugin install vagrant-berkshelf
12
+ gem install berkshelf
13
+
14
+ Install Test Kitchen 1.0 (unreleased yet, use the alpha / prerelease version).
15
+
16
+ gem install test-kitchen --pre
17
+
18
+ Install the Vagrant driver for Test Kitchen.
19
+
20
+ gem install kitchen-vagrant
21
+
22
+ Once the above are installed, you should be able to run Test Kitchen:
23
+
24
+ kitchen list
25
+ kitchen test
@@ -0,0 +1,40 @@
1
+ #
2
+ # Author:: Jamie Winsor (<jamie@vialstudios.com>)
3
+ # Cookbook Name:: git
4
+ # Attributes:: default
5
+ #
6
+ # Copyright 2008-2012, Opscode, Inc.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+
20
+ case node['platform_family']
21
+ when 'windows'
22
+ default['git']['version'] = "1.8.1.2-preview20130201"
23
+ default['git']['url'] = "https://msysgit.googlecode.com/files/Git-#{node['git']['version']}.exe"
24
+ default['git']['checksum'] = "796ac91f0c7456b53f2717a81f475075cc581af2f447573131013cac5b63bb2a"
25
+ default['git']['display_name'] = "Git version #{ node['git']['version'] }"
26
+ when "mac_os_x"
27
+ default['git']['osx_dmg']['app_name'] = "git-1.8.2-intel-universal-snow-leopard"
28
+ default['git']['osx_dmg']['volumes_dir'] = "Git 1.8.2 Snow Leopard Intel Universal"
29
+ default['git']['osx_dmg']['package_id'] = "GitOSX.Installer.git182.git.pkg"
30
+ default['git']['osx_dmg']['url'] = "https://git-osx-installer.googlecode.com/files/git-1.8.2-intel-universal-snow-leopard.dmg"
31
+ default['git']['osx_dmg']['checksum'] = "e1d0ec7a9d9d03b9e61f93652b63505137f31217908635cdf2f350d07cb33e15"
32
+ else
33
+ default['git']['prefix'] = "/usr/local"
34
+ default['git']['version'] = "1.8.2.1"
35
+ default['git']['url'] = "https://nodeload.github.com/git/git/tar.gz/v#{node['git']['version']}"
36
+ default['git']['checksum'] = "bdc1768f70ce3d8f3e4edcdcd99b2f85a7f8733fb684398aebe58dde3e6bcca2"
37
+ end
38
+
39
+ default['git']['server']['base_path'] = "/srv/git"
40
+ default['git']['server']['export_all'] = "true"
@@ -0,0 +1,35 @@
1
+ name "git"
2
+ maintainer "Opscode, Inc."
3
+ maintainer_email "cookbooks@opscode.com"
4
+ license "Apache 2.0"
5
+ description "Installs git and/or sets up a Git server daemon"
6
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
+ version "2.7.1"
8
+ recipe "git", "Installs git"
9
+ recipe "git::server", "Sets up a runit_service for git daemon"
10
+ recipe "git::source", "Installs git from source"
11
+
12
+ %w{ amazon arch centos debian fedora redhat scientific oracle amazon ubuntu windows }.each do |os|
13
+ supports os
14
+ end
15
+
16
+ supports "mac_os_x", ">= 10.6.0"
17
+
18
+ %w{ dmg build-essential yum windows }.each do |cookbook|
19
+ depends cookbook
20
+ end
21
+
22
+ depends "runit", ">= 1.0"
23
+
24
+ attribute "git/server/base_path",
25
+ :display_name => "Git Daemon Base Path",
26
+ :description => "A directory containing git repositories to be exposed by the git-daemon",
27
+ :default => "/srv/git",
28
+ :recipes => ["git::server"]
29
+
30
+ attribute "git/server/export_all",
31
+ :display_name => "Git Daemon Export All",
32
+ :description => "Adds the --export-all option to the git-daemon parameters, making all repositories publicly readable even if they lack the \"git-daemon-export-ok\" file",
33
+ :choice => ["true", "false"],
34
+ :default => "true",
35
+ :recipes => ["git::server"]
@@ -0,0 +1,53 @@
1
+ #
2
+ # Cookbook Name:: git
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ case node['platform_family']
20
+ when "debian"
21
+ if node['platform'] == "ubuntu" && node['platform_version'].to_f < 10.10
22
+ package "git-core"
23
+ else
24
+ package "git"
25
+ end
26
+ when "rhel","fedora"
27
+ case node['platform_version'].to_i
28
+ when 5
29
+ include_recipe "yum::epel"
30
+ end
31
+ package "git"
32
+ when "windows"
33
+ include_recipe 'git::windows'
34
+ when "mac_os_x"
35
+ dmg_package "GitOSX-Installer" do
36
+ app node['git']['osx_dmg']['app_name']
37
+ package_id node['git']['osx_dmg']['package_id']
38
+ volumes_dir node['git']['osx_dmg']['volumes_dir']
39
+ source node['git']['osx_dmg']['url']
40
+ checksum node['git']['osx_dmg']['checksum']
41
+ type "pkg"
42
+ action :install
43
+ end
44
+ else
45
+ package "git" do
46
+ package_name case node['platform']
47
+ when 'omnios'
48
+ 'developer/versioning/git'
49
+ when 'smartos'
50
+ 'scmgit'
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,58 @@
1
+ #
2
+ # Cookbook Name:: git
3
+ # Recipe:: server
4
+ #
5
+ # Copyright 2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ if node["platform"] == "windows"
20
+ return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe"
21
+ end
22
+
23
+ include_recipe "git"
24
+
25
+ directory node["git"]["server"]["base_path"] do
26
+ owner "root"
27
+ group "root"
28
+ mode 00755
29
+ end
30
+
31
+ case node['platform_family']
32
+ when "debian"
33
+ include_recipe "runit"
34
+
35
+ package "git-daemon-run"
36
+
37
+ runit_service "git-daemon" do
38
+ sv_templates false
39
+ end
40
+ when "rhel"
41
+ package "git-daemon"
42
+
43
+ template "/etc/xinetd.d/git" do
44
+ backup false
45
+ source "git-xinetd.d.erb"
46
+ owner "root"
47
+ group "root"
48
+ mode 00644
49
+ notifies :restart, "service[xinetd]"
50
+ end
51
+
52
+ service "xinetd" do
53
+ action [:enable, :start]
54
+ end
55
+ else
56
+ log "Platform requires setting up a git daemon service script."
57
+ log "Hint: /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=#{node["git"]["server"]["base_path"]}"
58
+ end
@@ -0,0 +1,49 @@
1
+ #
2
+ # Cookbook Name:: git
3
+ # Recipe:: source
4
+ #
5
+ # Copyright 2012, Brian Flad, Fletcher Nichol
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ if node["platform"] == "windows"
20
+ return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe"
21
+ end
22
+
23
+ include_recipe "build-essential"
24
+
25
+ pkgs = value_for_platform_family(
26
+ ["rhel"] => %w{ expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel },
27
+ ["debian"] => %w{ libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev }
28
+ )
29
+
30
+ pkgs.each do |pkg|
31
+ package pkg
32
+ end
33
+
34
+ remote_file "#{Chef::Config['file_cache_path']}/git-#{node['git']['version']}.tar.gz" do
35
+ source node['git']['url']
36
+ checksum node['git']['checksum']
37
+ mode 00644
38
+ not_if "test -f #{Chef::Config['file_cache_path']}/git-#{node['git']['version']}.tar.gz"
39
+ end
40
+
41
+ execute "Extracting and Building Git #{node['git']['version']} from Source" do
42
+ cwd Chef::Config['file_cache_path']
43
+ command <<-COMMAND
44
+ (mkdir git-#{node['git']['version']} && tar -zxf git-#{node['git']['version']}.tar.gz -C git-#{node['git']['version']} --strip-components 1)
45
+ (cd git-#{node['git']['version']} && make prefix=#{node['git']['prefix']} install)
46
+ COMMAND
47
+ creates "#{node['git']['prefix']}/bin/git"
48
+ not_if "git --version | grep #{node['git']['version']}"
49
+ end
@@ -0,0 +1,37 @@
1
+ #
2
+ # Cookbook Name:: git
3
+ # Recipe:: windows
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ windows_package node['git']['display_name'] do
20
+ action :install
21
+ source node['git']['url']
22
+ checksum node['git']['checksum']
23
+ installer_type :inno
24
+ end
25
+
26
+ # Git is installed to Program Files (x86) on 64-bit machines and
27
+ # 'Program Files' on 32-bit machines
28
+ PROGRAM_FILES = ENV['ProgramFiles(x86)'] || ENV['ProgramFiles']
29
+ GIT_PATH = ";#{ PROGRAM_FILES }\\Git\\Cmd"
30
+
31
+ # COOK-3482 - windows_path resource doesn't change the current process
32
+ # environment variables. Therefore, git won't actually be on the PATH
33
+ # until the next chef-client run
34
+ ENV['PATH'] += ";#{GIT_PATH}"
35
+ windows_path GIT_PATH do
36
+ action :add
37
+ end
@@ -0,0 +1,10 @@
1
+ service git
2
+ {
3
+ disable = no
4
+ socket_type = stream
5
+ wait = no
6
+ user = nobody
7
+ server = /usr/libexec/git-core/git-daemon
8
+ server_args = --base-path=<%= node["git"]["server"]["base_path"] %> <% if node["git"]["server"]["export_all"] == "true" %>--export-all <% end %>--syslog --inetd --verbose
9
+ log_on_failure += USERID
10
+ }
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ exec svlogd -tt ./main
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ exec 2>&1
3
+ exec /usr/bin/git daemon <% if node["git"]["server"]["export_all"] == "true" %>--export-all <% end %>--user=nobody --group=daemon --syslog --base-path=<%= node["git"]["server"]["base_path"] %> <%= node["git"]["server"]["base_path"] %>
@@ -0,0 +1,3 @@
1
+ # Description
2
+
3
+ Install Ruby 1.9.3