vagrant-managed-servers 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. data/.gitignore +17 -0
  2. data/Berksfile +4 -0
  3. data/CHANGELOG.md +4 -0
  4. data/Gemfile +14 -0
  5. data/LICENSE +8 -0
  6. data/README.md +142 -0
  7. data/Rakefile +21 -0
  8. data/Vagrantfile +44 -0
  9. data/cookbooks/apache2/CHANGELOG.md +95 -0
  10. data/cookbooks/apache2/CONTRIBUTING.md +257 -0
  11. data/cookbooks/apache2/Gemfile +10 -0
  12. data/cookbooks/apache2/LICENSE +201 -0
  13. data/cookbooks/apache2/README.md +567 -0
  14. data/cookbooks/apache2/attributes/default.rb +149 -0
  15. data/cookbooks/apache2/attributes/mod_auth_cas.rb +2 -0
  16. data/cookbooks/apache2/attributes/mod_auth_openid.rb +32 -0
  17. data/cookbooks/apache2/definitions/apache_conf.rb +26 -0
  18. data/cookbooks/apache2/definitions/apache_module.rb +53 -0
  19. data/cookbooks/apache2/definitions/apache_site.rb +43 -0
  20. data/cookbooks/apache2/definitions/web_app.rb +49 -0
  21. data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +41 -0
  22. data/cookbooks/apache2/files/default/tests/minitest/default_test.rb +77 -0
  23. data/cookbooks/apache2/files/default/tests/minitest/god_monitor_test.rb +34 -0
  24. data/cookbooks/apache2/files/default/tests/minitest/mod_apreq2_test.rb +19 -0
  25. data/cookbooks/apache2/files/default/tests/minitest/mod_auth_cas_test.rb +11 -0
  26. data/cookbooks/apache2/files/default/tests/minitest/mod_auth_openid_test.rb +37 -0
  27. data/cookbooks/apache2/files/default/tests/minitest/mod_cgi_test.rb +13 -0
  28. data/cookbooks/apache2/files/default/tests/minitest/mod_dav_svn_test.rb +14 -0
  29. data/cookbooks/apache2/files/default/tests/minitest/mod_fastcgi.rb +11 -0
  30. data/cookbooks/apache2/files/default/tests/minitest/mod_perl_test.rb +18 -0
  31. data/cookbooks/apache2/files/default/tests/minitest/mod_php5_test.rb +13 -0
  32. data/cookbooks/apache2/files/default/tests/minitest/mod_python_test.rb +10 -0
  33. data/cookbooks/apache2/files/default/tests/minitest/mod_ssl_test.rb +23 -0
  34. data/cookbooks/apache2/files/default/tests/minitest/support/helpers.rb +50 -0
  35. data/cookbooks/apache2/metadata.json +513 -0
  36. data/cookbooks/apache2/metadata.rb +207 -0
  37. data/cookbooks/apache2/recipes/default.rb +208 -0
  38. data/cookbooks/apache2/recipes/god_monitor.rb +33 -0
  39. data/cookbooks/apache2/recipes/logrotate.rb +29 -0
  40. data/cookbooks/apache2/recipes/mod_alias.rb +22 -0
  41. data/cookbooks/apache2/recipes/mod_apreq2.rb +54 -0
  42. data/cookbooks/apache2/recipes/mod_auth_basic.rb +20 -0
  43. data/cookbooks/apache2/recipes/mod_auth_cas.rb +59 -0
  44. data/cookbooks/apache2/recipes/mod_auth_digest.rb +20 -0
  45. data/cookbooks/apache2/recipes/mod_auth_openid.rb +111 -0
  46. data/cookbooks/apache2/recipes/mod_authn_file.rb +20 -0
  47. data/cookbooks/apache2/recipes/mod_authnz_ldap.rb +20 -0
  48. data/cookbooks/apache2/recipes/mod_authz_default.rb +20 -0
  49. data/cookbooks/apache2/recipes/mod_authz_groupfile.rb +20 -0
  50. data/cookbooks/apache2/recipes/mod_authz_host.rb +20 -0
  51. data/cookbooks/apache2/recipes/mod_authz_user.rb +20 -0
  52. data/cookbooks/apache2/recipes/mod_autoindex.rb +22 -0
  53. data/cookbooks/apache2/recipes/mod_cgi.rb +20 -0
  54. data/cookbooks/apache2/recipes/mod_dav.rb +20 -0
  55. data/cookbooks/apache2/recipes/mod_dav_fs.rb +21 -0
  56. data/cookbooks/apache2/recipes/mod_dav_svn.rb +41 -0
  57. data/cookbooks/apache2/recipes/mod_deflate.rb +22 -0
  58. data/cookbooks/apache2/recipes/mod_dir.rb +22 -0
  59. data/cookbooks/apache2/recipes/mod_env.rb +20 -0
  60. data/cookbooks/apache2/recipes/mod_expires.rb +20 -0
  61. data/cookbooks/apache2/recipes/mod_fastcgi.rb +26 -0
  62. data/cookbooks/apache2/recipes/mod_fcgid.rb +55 -0
  63. data/cookbooks/apache2/recipes/mod_headers.rb +20 -0
  64. data/cookbooks/apache2/recipes/mod_include.rb +20 -0
  65. data/cookbooks/apache2/recipes/mod_ldap.rb +20 -0
  66. data/cookbooks/apache2/recipes/mod_log_config.rb +24 -0
  67. data/cookbooks/apache2/recipes/mod_logio.rb +24 -0
  68. data/cookbooks/apache2/recipes/mod_mime.rb +22 -0
  69. data/cookbooks/apache2/recipes/mod_negotiation.rb +22 -0
  70. data/cookbooks/apache2/recipes/mod_perl.rb +44 -0
  71. data/cookbooks/apache2/recipes/mod_php5.rb +77 -0
  72. data/cookbooks/apache2/recipes/mod_proxy.rb +22 -0
  73. data/cookbooks/apache2/recipes/mod_proxy_ajp.rb +21 -0
  74. data/cookbooks/apache2/recipes/mod_proxy_balancer.rb +20 -0
  75. data/cookbooks/apache2/recipes/mod_proxy_connect.rb +20 -0
  76. data/cookbooks/apache2/recipes/mod_proxy_http.rb +20 -0
  77. data/cookbooks/apache2/recipes/mod_python.rb +38 -0
  78. data/cookbooks/apache2/recipes/mod_rewrite.rb +20 -0
  79. data/cookbooks/apache2/recipes/mod_setenvif.rb +22 -0
  80. data/cookbooks/apache2/recipes/mod_ssl.rb +46 -0
  81. data/cookbooks/apache2/recipes/mod_status.rb +22 -0
  82. data/cookbooks/apache2/recipes/mod_wsgi.rb +38 -0
  83. data/cookbooks/apache2/recipes/mod_xsendfile.rb +38 -0
  84. data/cookbooks/apache2/templates/default/a2dismod.erb +22 -0
  85. data/cookbooks/apache2/templates/default/a2dissite.erb +29 -0
  86. data/cookbooks/apache2/templates/default/a2enmod.erb +37 -0
  87. data/cookbooks/apache2/templates/default/a2ensite.erb +38 -0
  88. data/cookbooks/apache2/templates/default/apache2.conf.erb +237 -0
  89. data/cookbooks/apache2/templates/default/apache2.god.erb +19 -0
  90. data/cookbooks/apache2/templates/default/charset.erb +6 -0
  91. data/cookbooks/apache2/templates/default/default-site.erb +57 -0
  92. data/cookbooks/apache2/templates/default/mods/README +2 -0
  93. data/cookbooks/apache2/templates/default/mods/alias.conf.erb +24 -0
  94. data/cookbooks/apache2/templates/default/mods/auth_cas.conf.erb +1 -0
  95. data/cookbooks/apache2/templates/default/mods/auth_cas.load.erb +1 -0
  96. data/cookbooks/apache2/templates/default/mods/authopenid.load.erb +1 -0
  97. data/cookbooks/apache2/templates/default/mods/autoindex.conf.erb +101 -0
  98. data/cookbooks/apache2/templates/default/mods/deflate.conf.erb +16 -0
  99. data/cookbooks/apache2/templates/default/mods/dir.conf.erb +5 -0
  100. data/cookbooks/apache2/templates/default/mods/fastcgi.conf.erb +5 -0
  101. data/cookbooks/apache2/templates/default/mods/fcgid.conf.erb +10 -0
  102. data/cookbooks/apache2/templates/default/mods/mime.conf.erb +198 -0
  103. data/cookbooks/apache2/templates/default/mods/negotiation.conf.erb +18 -0
  104. data/cookbooks/apache2/templates/default/mods/php5.conf.erb +16 -0
  105. data/cookbooks/apache2/templates/default/mods/proxy.conf.erb +19 -0
  106. data/cookbooks/apache2/templates/default/mods/setenvif.conf.erb +28 -0
  107. data/cookbooks/apache2/templates/default/mods/ssl.conf.erb +76 -0
  108. data/cookbooks/apache2/templates/default/mods/status.conf.erb +26 -0
  109. data/cookbooks/apache2/templates/default/port_apache.erb +2 -0
  110. data/cookbooks/apache2/templates/default/ports.conf.erb +6 -0
  111. data/cookbooks/apache2/templates/default/security.erb +50 -0
  112. data/cookbooks/apache2/templates/default/web_app.conf.erb +43 -0
  113. data/cookbooks/apt/Berksfile +8 -0
  114. data/cookbooks/apt/CHANGELOG.md +97 -0
  115. data/cookbooks/apt/CONTRIBUTING +29 -0
  116. data/cookbooks/apt/LICENSE +201 -0
  117. data/cookbooks/apt/README.md +243 -0
  118. data/cookbooks/apt/TESTING.md +25 -0
  119. data/cookbooks/apt/attributes/default.rb +4 -0
  120. data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
  121. data/cookbooks/apt/metadata.json +1 -0
  122. data/cookbooks/apt/metadata.rb +30 -0
  123. data/cookbooks/apt/providers/preference.rb +61 -0
  124. data/cookbooks/apt/providers/repository.rb +132 -0
  125. data/cookbooks/apt/recipes/cacher-client.rb +59 -0
  126. data/cookbooks/apt/recipes/cacher-ng.rb +40 -0
  127. data/cookbooks/apt/recipes/default.rb +68 -0
  128. data/cookbooks/apt/resources/preference.rb +30 -0
  129. data/cookbooks/apt/resources/repository.rb +40 -0
  130. data/cookbooks/apt/templates/debian-6.0/acng.conf.erb +174 -0
  131. data/cookbooks/apt/templates/default/01proxy.erb +2 -0
  132. data/cookbooks/apt/templates/default/acng.conf.erb +276 -0
  133. data/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +270 -0
  134. data/dummy.box +0 -0
  135. data/lib/vagrant-managed-servers.rb +18 -0
  136. data/lib/vagrant-managed-servers/action.rb +114 -0
  137. data/lib/vagrant-managed-servers/action/is_created.rb +18 -0
  138. data/lib/vagrant-managed-servers/action/is_reachable.rb +18 -0
  139. data/lib/vagrant-managed-servers/action/link_server.rb +31 -0
  140. data/lib/vagrant-managed-servers/action/message_not_reachable.rb +16 -0
  141. data/lib/vagrant-managed-servers/action/read_state.rb +84 -0
  142. data/lib/vagrant-managed-servers/action/sync_folders.rb +85 -0
  143. data/lib/vagrant-managed-servers/action/unlink_server.rb +30 -0
  144. data/lib/vagrant-managed-servers/action/warn_networks.rb +19 -0
  145. data/lib/vagrant-managed-servers/config.rb +28 -0
  146. data/lib/vagrant-managed-servers/errors.rb +19 -0
  147. data/lib/vagrant-managed-servers/plugin.rb +72 -0
  148. data/lib/vagrant-managed-servers/provider.rb +51 -0
  149. data/lib/vagrant-managed-servers/util/timer.rb +17 -0
  150. data/lib/vagrant-managed-servers/version.rb +5 -0
  151. data/locales/en.yml +45 -0
  152. data/spec/vagrant-managed-servers/config_spec.rb +28 -0
  153. data/vagrant-managed-servers.gemspec +56 -0
  154. metadata +264 -0
@@ -0,0 +1,59 @@
1
+ #
2
+ # Cookbook Name:: apt
3
+ # Recipe:: cacher-client
4
+ #
5
+ # Copyright 2011, 2012 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
+
20
+ #remove Acquire::http::Proxy lines from /etc/apt/apt.conf since we use 01proxy
21
+ #these are leftover from preseed installs
22
+ execute 'Remove proxy from /etc/apt/apt.conf' do
23
+ command "sed --in-place '/^Acquire::http::Proxy/d' /etc/apt/apt.conf"
24
+ only_if "grep Acquire::http::Proxy /etc/apt/apt.conf"
25
+ end
26
+
27
+ servers = []
28
+ if node['apt'] && node['apt']['cacher_ipaddress']
29
+ cacher = Chef::Node.new
30
+ cacher.name(node['apt']['cacher_ipaddress'])
31
+ cacher.set['ipaddress'] = node['apt']['cacher_ipaddress']
32
+ servers << cacher
33
+ end
34
+
35
+ unless Chef::Config[:solo]
36
+ query = "apt_caching_server:true NOT name:#{node.name}"
37
+ query += " AND chef_environment:#{node.chef_environment}" if node['apt']['cacher-client']['restrict_environment']
38
+ Chef::Log.debug("apt::cacher-client searching for '#{query}'")
39
+ servers += search(:node, query)
40
+ end
41
+
42
+ if servers.length > 0
43
+ Chef::Log.info("apt-cacher-ng server found on #{servers[0]}.")
44
+ template '/etc/apt/apt.conf.d/01proxy' do
45
+ source '01proxy.erb'
46
+ owner 'root'
47
+ group 'root'
48
+ mode 00644
49
+ variables(
50
+ :proxy => servers[0]['ipaddress'],
51
+ :port => node['apt']['cacher_port']
52
+ )
53
+ end.run_action(:create)
54
+ else
55
+ Chef::Log.info('No apt-cacher-ng server found.')
56
+ file '/etc/apt/apt.conf.d/01proxy' do
57
+ action :delete
58
+ end
59
+ end
@@ -0,0 +1,40 @@
1
+ #
2
+ # Cookbook Name:: apt
3
+ # Recipe:: cacher-ng
4
+ #
5
+ # Copyright 2008-2012, 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
+
20
+ node.set['apt']['caching_server'] = true
21
+
22
+ package "apt-cacher-ng" do
23
+ action :install
24
+ end
25
+
26
+ template "/etc/apt-cacher-ng/acng.conf" do
27
+ source "acng.conf.erb"
28
+ owner "root"
29
+ group "root"
30
+ mode 00644
31
+ notifies :restart, "service[apt-cacher-ng]"
32
+ end
33
+
34
+ service "apt-cacher-ng" do
35
+ supports :restart => true, :status => false
36
+ action [:enable, :start]
37
+ end
38
+
39
+ #this will help seed the proxy
40
+ include_recipe "apt::cacher-client"
@@ -0,0 +1,68 @@
1
+ #
2
+ # Cookbook Name:: apt
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2008-2011, Opscode, Inc.
6
+ # Copyright 2009, Bryan McLellan <btm@loftninjas.org>
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
+
21
+ # Run apt-get update to create the stamp file
22
+ execute "apt-get-update" do
23
+ command "apt-get update"
24
+ ignore_failure true
25
+ not_if do ::File.exists?('/var/lib/apt/periodic/update-success-stamp') end
26
+ end
27
+
28
+ # For other recipes to call to force an update
29
+ execute "apt-get update" do
30
+ command "apt-get update"
31
+ ignore_failure true
32
+ action :nothing
33
+ end
34
+
35
+ # Automatically remove packages that are no longer needed for dependencies
36
+ execute "apt-get autoremove" do
37
+ command "apt-get -y autoremove"
38
+ action :nothing
39
+ end
40
+
41
+ # Automatically remove .deb files for packages no longer on your system
42
+ execute "apt-get autoclean" do
43
+ command "apt-get -y autoclean"
44
+ action :nothing
45
+ end
46
+
47
+ # provides /var/lib/apt/periodic/update-success-stamp on apt-get update
48
+ package "update-notifier-common" do
49
+ notifies :run, 'execute[apt-get-update]', :immediately
50
+ end
51
+
52
+ execute "apt-get-update-periodic" do
53
+ command "apt-get update"
54
+ ignore_failure true
55
+ only_if do
56
+ ::File.exists?('/var/lib/apt/periodic/update-success-stamp') &&
57
+ ::File.mtime('/var/lib/apt/periodic/update-success-stamp') < Time.now - 86400
58
+ end
59
+ end
60
+
61
+ %w{/var/cache/local /var/cache/local/preseeding}.each do |dirname|
62
+ directory dirname do
63
+ owner "root"
64
+ group "root"
65
+ mode 00755
66
+ action :create
67
+ end
68
+ end
@@ -0,0 +1,30 @@
1
+ #
2
+ # Cookbook Name:: apt
3
+ # Resource:: preference
4
+ #
5
+ # Copyright 2010-2011, 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
+
20
+ actions :add, :remove
21
+
22
+ def initialize(*args)
23
+ super
24
+ @action = :add
25
+ end
26
+
27
+ attribute :package_name, :kind_of => String, :name_attribute => true
28
+ attribute :glob, :kind_of => String
29
+ attribute :pin, :kind_of => String
30
+ attribute :pin_priority, :kind_of => String
@@ -0,0 +1,40 @@
1
+ #
2
+ # Cookbook Name:: apt
3
+ # Resource:: repository
4
+ #
5
+ # Copyright 2010-2011, 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
+
20
+ actions :add, :remove
21
+
22
+ def initialize(*args)
23
+ super
24
+ @action = :add
25
+ end
26
+
27
+ #name of the repo, used for source.list filename
28
+ attribute :repo_name, :kind_of => String, :name_attribute => true
29
+ attribute :uri, :kind_of => String
30
+ attribute :distribution, :kind_of => String
31
+ attribute :components, :kind_of => Array, :default => []
32
+ attribute :arch, :kind_of => String, :default => nil
33
+ #whether or not to add the repository as a source repo as well
34
+ attribute :deb_src, :default => false
35
+ attribute :keyserver, :kind_of => String, :default => nil
36
+ attribute :key, :kind_of => String, :default => nil
37
+ attribute :cookbook, :kind_of => String, :default => nil
38
+ #trigger cache rebuild
39
+ #If not you can trigger in the recipe itself after checking the status of resource.updated{_by_last_action}?
40
+ attribute :cache_rebuild, :kind_of => [TrueClass, FalseClass], :default => true
@@ -0,0 +1,174 @@
1
+
2
+ # Letter case in directive names does not matter. Must be separated with colons.
3
+ # Valid boolean values are a zero number for false, non-zero numbers for true.
4
+
5
+ CacheDir: /var/cache/apt-cacher-ng
6
+
7
+ # set empty to disable logging
8
+ LogDir: /var/log/apt-cacher-ng
9
+
10
+ # TCP (http) port
11
+ # Set to 9999 to emulate apt-proxy
12
+ Port:<%= node['apt']['cacher_port'] %>
13
+
14
+ # Addresses or hostnames to listen on. Multiple addresses must be separated by
15
+ # spaces. Each entry must be associated with a local interface. DNS resolution
16
+ # is performed using getaddrinfo(3) for all available protocols (i.e. IPv4 and
17
+ # IPv6 if available).
18
+ #
19
+ # Default: not set, will listen on all interfaces.
20
+ #
21
+ # BindAddress: localhost 192.168.7.254 publicNameOnMainInterface
22
+
23
+ #Proxy: http://www-proxy.example.net:80
24
+ #proxy: http://username:proxypassword@proxy.example.net:3128
25
+
26
+ # Repository remapping. See manual for details.
27
+ # In this example, backends file is generated during package installation.
28
+ Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian
29
+ Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu
30
+ Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol
31
+ Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file
32
+
33
+ # Virtual page accessible in a web browser to see statistics and status
34
+ # information, i.e. under http://localhost:3142/acng-report.html
35
+ ReportPage: acng-report.html
36
+
37
+ # Socket file for accessing through local UNIX socket instead of TCP/IP. Can be
38
+ # used with inetd bridge or cron client.
39
+ # SocketPath:/var/run/apt-cacher-ng/socket
40
+
41
+ # Forces log file to be written to disk after every line when set to 1. Default
42
+ # is 0, buffer flush happens after client disconnects.
43
+ #
44
+ # (technically, this is an alias to the Debug option provided for convenience)
45
+ #
46
+ # UnbufferLogs: 0
47
+
48
+ # Set to 0 to store only type, time and transfer sizes.
49
+ # 1 -> client IP and relative local path are logged too
50
+ # VerboseLog: 1
51
+
52
+ # Don't detach from the console
53
+ # ForeGround: 0
54
+
55
+ # Store the pid of the daemon process therein
56
+ # PidFile: /var/run/apt-cacher-ng/pid
57
+
58
+ # Forbid outgoing connections, work around them or respond with 503 error
59
+ # offlinemode:0
60
+
61
+ # Forbid all downloads that don't run through preconfigured backends (.where)
62
+ #ForceManaged: 0
63
+
64
+ # Days before considering an unreferenced file expired (to be deleted).
65
+ # Warning: if the value is set too low and particular index files are not
66
+ # available for some days (mirror downtime) there is a risk of deletion of
67
+ # still usefull package files.
68
+ ExTreshold: 4
69
+
70
+ # Stop expiration when a critical problem appeared. Currently only failed
71
+ # refresh of an index file is considered as critical.
72
+ #
73
+ # WARNING: don't touch this option or set to a non-zero number.
74
+ # Anything else is DANGEROUS and may cause data loss.
75
+ #
76
+ # ExAbortOnProblems: 1
77
+
78
+ # Replace some Windows/DOS-FS incompatible chars when storing
79
+ # StupidFs: 0
80
+
81
+ # Experimental feature for apt-listbugs: pass-through SOAP requests and
82
+ # responses to/from bugs.debian.org. If not set, default is true if
83
+ # ForceManaged is enabled and false otherwise.
84
+ # ForwardBtsSoap: 1
85
+
86
+ # The daemon has a small cache for DNS data, to speed up resolution. The
87
+ # expiration time of the DNS entries can be configured in seconds.
88
+ # DnsCacheSeconds: 3600
89
+
90
+ # Don't touch the following values without good consideration!
91
+ #
92
+ # Max. count of connection threads kept ready (for faster response in the
93
+ # future). Should be a sane value between 0 and average number of connections,
94
+ # and depend on the amount of spare RAM.
95
+ # MaxStandbyConThreads: 8
96
+ #
97
+ # Hard limit of active thread count for incomming connections, i.e. operation
98
+ # is refused when this value is reached (below zero = unlimited).
99
+ # MaxConThreads: -1
100
+ #
101
+ #VfilePattern = (^|.*?/)(Index|Packages\.bz2|Packages\.gz|Packages|Release|Release\.gpg|Sources\.bz2|Sources\.gz|Sources|release|index\.db-.*\.gz|Contents-[^/]*\.gz|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*\.bz2)$
102
+ #PfilePattern = .*(\.deb|\.rpm|\.dsc|\.tar\.gz\.gpg|\.tar\.gz|\.diff\.gz|\.diff\.bz2|\.jigdo|\.template|changelog|copyright|\.udeb|\.diff/.*\.gz|vmlinuz|initrd\.gz|(Devel)?ReleaseAnnouncement(\\?.*)?)$
103
+ # Whitelist for expiration, file types not to be removed even when being
104
+ # unreferenced. Default: same as VfilePattern which is a safe bed. When and
105
+ # only when the only used mirrors are official repositories (with working
106
+ # Release files) then it might be set to something more restrictive, like
107
+ # (^|.*?/)(Release|Release\.gpg|release|meta-release|Translation[^/]*\.bz2)$
108
+ #WfilePattern = (^|.*?/)(Index|Packages\.bz2|Packages\.gz|Packages|Release|Release\.gpg|Sources\.bz2|Sources\.gz|Sources|release|index\.db-.*\.gz|Contents-[^/]*\.gz|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*\.bz2)$
109
+
110
+ # Higher modes only working with the debug version
111
+ # Warning, writes a lot into apt-cacher.err logfile
112
+ # Value overwrites UnbufferLogs setting (aliased)
113
+ # Debug:3
114
+
115
+ # Usually, general purpose proxies like Squid expose the IP adress of the
116
+ # client user to the remote server using the X-Forwarded-For HTTP header. This
117
+ # behaviour can be optionally turned on with the Expose-Origin option.
118
+ # ExposeOrigin: 0
119
+
120
+ # When logging the originating IP address, trust the information supplied by
121
+ # the client in the X-Forwarded-For header.
122
+ # LogSubmittedOrigin: 0
123
+
124
+ # The version string reported to the peer, to be displayed as HTTP client (and
125
+ # version) in the logs of the mirror.
126
+ # WARNING: some archives use this header to detect/guess capabilities of the
127
+ # client (i.e. redirection support) and change the behaviour accordingly, while
128
+ # ACNG might not support the expected features. Expect side effects.
129
+ #
130
+ # UserAgent: Yet Another HTTP Client/1.2.3p4
131
+
132
+ # In some cases the Import and Expiration tasks might create fresh volatile
133
+ # data for internal use by reconstructing them using patch files. This
134
+ # by-product might be recompressed with bzip2 and with some luck the resulting
135
+ # file becomes identical to the *.bz2 file on the server, usable for APT
136
+ # clients trying to fetch the full .bz2 compressed version. Injection of the
137
+ # generated files into the cache has however a disadvantage on underpowered
138
+ # servers: bzip2 compession can create high load on the server system and the
139
+ # visible download of the busy .bz2 files also becomes slower.
140
+ #
141
+ # RecompBz2: 0
142
+
143
+ # Network timeout for outgoing connections.
144
+ # NetworkTimeout: 60
145
+
146
+ # Sometimes it makes sense to not store the data in cache and just return the
147
+ # package data to client as it comes in. DontCache parameters can enable this
148
+ # behaviour for certain URL types. The tokens are extended regular expressions
149
+ # that URLs are matched against.
150
+ #
151
+ # DontCacheRequested is applied to the URL as it comes in from the client.
152
+ # Example: exclude packages built with kernel-package for x86
153
+ # DontCacheRequested: linux-.*_10\...\.Custo._i386
154
+ # Example usecase: exclude popular private IP ranges from caching
155
+ # DontCacheRequested: 192.168.0 ^10\..* 172.30
156
+ #
157
+ # DontCacheResolved is applied to URLs after mapping to the target server. If
158
+ # multiple backend servers are specified then it's only matched against the
159
+ # download link for the FIRST possible source (due to implementation limits).
160
+ # Example usecase: all Ubuntu stuff comes from a local mirror (specified as
161
+ # backend), don't cache it again:
162
+ # DontCacheResolved: ubuntumirror.local.net
163
+ #
164
+ # DontCache directive sets (overrides) both, DontCacheResolved and
165
+ # DontCacheRequested. Provided for convenience, see those directives for
166
+ # details.
167
+ #
168
+ # Default permission set of freshly created files and directories, as octal
169
+ # numbers (see chmod(1) for details).
170
+ # Can by limited by the umask value (see umask(2) for details) if it's set in
171
+ # the environment of the starting shell, e.g. in apt-cacher-ng init script or
172
+ # in its configuration file.
173
+ # DirPerms: 00755
174
+ # FilePerms: 00664
@@ -0,0 +1,2 @@
1
+ Acquire::http::Proxy "http://<%= @proxy %>:<%= @port %>";
2
+ Acquire::https::Proxy "DIRECT";
@@ -0,0 +1,276 @@
1
+
2
+ # Letter case in directive names does not matter. Must be separated with colons.
3
+ # Valid boolean values are a zero number for false, non-zero numbers for true.
4
+
5
+ CacheDir: /var/cache/apt-cacher-ng
6
+
7
+ # set empty to disable logging
8
+ LogDir: /var/log/apt-cacher-ng
9
+
10
+ # place to look for additional configuration and resource files if they are not
11
+ # found in the configuration directory
12
+ # SupportDir: /usr/lib/apt-cacher-ng
13
+
14
+ # TCP (http) port
15
+ # Set to 9999 to emulate apt-proxy
16
+ Port:<%= node['apt']['cacher_port'] %>
17
+
18
+ # Addresses or hostnames to listen on. Multiple addresses must be separated by
19
+ # spaces. Each entry must be an exact local address which is associated with a
20
+ # local interface. DNS resolution is performed using getaddrinfo(3) for all
21
+ # available protocols (IPv4, IPv6, ...). Using a protocol specific format will
22
+ # create binding(s) only on protocol specific socket(s) (e.g. 0.0.0.0 will listen
23
+ # only to IPv4).
24
+ #
25
+ # Default: not set, will listen on all interfaces and protocols
26
+ #
27
+ # BindAddress: localhost 192.168.7.254 publicNameOnMainInterface
28
+
29
+ # The specification of another proxy which shall be used for downloads.
30
+ # Username and password are, and see manual for limitations.
31
+ #
32
+ #Proxy: http://www-proxy.example.net:80
33
+ #proxy: username:proxypassword@proxy.example.net:3128
34
+
35
+ # Repository remapping. See manual for details.
36
+ # In this example, some backends files might be generated during package
37
+ # installation using information collected on the system.
38
+ Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives
39
+ Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives
40
+ Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol # Debian Volatile Archives
41
+ Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file or specify preferred mirrors here
42
+ Remap-sfnet: file:sfnet_mirrors # ; file:backends_sfnet # incomplete, please create this file or specify preferred mirrors here
43
+ Remap-alxrep: file:archlx_mirrors /archlinux # ; file:backend_archlx # Arch Linux
44
+ Remap-fedora: file:fedora_mirrors # Fedora Linux
45
+ Remap-epel: file:epel_mirrors # Fedora EPEL
46
+ Remap-slrep: file:sl_mirrors # Scientific Linux
47
+
48
+ # This is usually not needed for security.debian.org because it's always the
49
+ # same DNS hostname. However, it might be enabled in order to use hooks,
50
+ # ForceManaged mode or special flags in this context.
51
+ # Remap-secdeb: security.debian.org
52
+
53
+ # Virtual page accessible in a web browser to see statistics and status
54
+ # information, i.e. under http://localhost:3142/acng-report.html
55
+ ReportPage: acng-report.html
56
+
57
+ # Socket file for accessing through local UNIX socket instead of TCP/IP. Can be
58
+ # used with inetd bridge or cron client.
59
+ # SocketPath:/var/run/apt-cacher-ng/socket
60
+
61
+ # Forces log file to be written to disk after every line when set to 1. Default
62
+ # is 0, buffers are flushed when the client disconnects.
63
+ #
64
+ # (technically, alias to the Debug option, see its documentation for details)
65
+ #
66
+ # UnbufferLogs: 0
67
+
68
+ # Set to 0 to store only type, time and transfer sizes.
69
+ # 1 -> client IP and relative local path are logged too
70
+ # VerboseLog: 1
71
+
72
+ # Don't detach from the console
73
+ # ForeGround: 0
74
+
75
+ # Store the pid of the daemon process therein
76
+ # PidFile: /var/run/apt-cacher-ng/pid
77
+
78
+ # Forbid outgoing connections, work around them or respond with 503 error
79
+ # offlinemode:0
80
+
81
+ # Forbid all downloads that don't run through preconfigured backends (.where)
82
+ #ForceManaged: 0
83
+
84
+ # Days before considering an unreferenced file expired (to be deleted).
85
+ # Warning: if the value is set too low and particular index files are not
86
+ # available for some days (mirror downtime) there is a risk of deletion of
87
+ # still useful package files.
88
+ ExTreshold: 4
89
+
90
+ # Stop expiration when a critical problem appeared. Currently only failed
91
+ # refresh of an index file is considered as critical.
92
+ #
93
+ # WARNING: don't touch this option or set to zero.
94
+ # Anything else is DANGEROUS and may cause data loss.
95
+ #
96
+ # ExAbortOnProblems: 1
97
+
98
+ # Replace some Windows/DOS-FS incompatible chars when storing
99
+ # StupidFs: 0
100
+
101
+ # Experimental feature for apt-listbugs: pass-through SOAP requests and
102
+ # responses to/from bugs.debian.org. If not set, default is true if
103
+ # ForceManaged is enabled and false otherwise.
104
+ # ForwardBtsSoap: 1
105
+
106
+ # The daemon has a small cache for DNS data, to speed up resolution. The
107
+ # expiration time of the DNS entries can be configured in seconds.
108
+ # DnsCacheSeconds: 3600
109
+
110
+ # Don't touch the following values without good consideration!
111
+ #
112
+ # Max. count of connection threads kept ready (for faster response in the
113
+ # future). Should be a sane value between 0 and average number of connections,
114
+ # and depend on the amount of spare RAM.
115
+ # MaxStandbyConThreads: 8
116
+ #
117
+ # Hard limit of active thread count for incoming connections, i.e. operation
118
+ # is refused when this value is reached (below zero = unlimited).
119
+ # MaxConThreads: -1
120
+ #
121
+ # Pigeonholing files with regular expressions (static/volatile). Can be
122
+ # overriden here but not should not be done permanently because future update
123
+ # of default settings would not be applied later.
124
+ # VfilePattern = (^|.*?/)(Index|Packages(\.gz|\.bz2|\.lzma|\.xz)?|InRelease|Release|Release\.gpg|Sources(\.gz|\.bz2|\.lzma|\.xz)?|release|index\.db-.*\.gz|Contents-[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|((setup|setup-legacy)(\.ini|\.bz2|\.hint)(\.sig)?)|mirrors\.lst|repo(index|md)\.xml(\.asc|\.key)?|directory\.yast|products|content(\.asc|\.key)?|media|filelists\.xml\.gz|filelists\.sqlite\.bz2|repomd\.xml|packages\.[a-zA-Z][a-zA-Z]\.gz|info\.txt|license\.tar\.gz|license\.zip|.*\.db(\.tar\.gz)?|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|metalink\?repo|.*prestodelta\.xml\.gz)$|/dists/.*/installer-[^/]+/[^0-9][^/]+/images/.*
125
+ # PfilePattern = .*(\.d?deb|\.rpm|\.dsc|\.tar(\.gz|\.bz2|\.lzma|\.xz)(\.gpg)?|\.diff(\.gz|\.bz2|\.lzma|\.xz)|\.jigdo|\.template|changelog|copyright|\.udeb|\.debdelta|\.diff/.*\.gz|(Devel)?ReleaseAnnouncement(\?.*)?|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.*)?|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*)$
126
+ # Whitelist for expiration, file types not to be removed even when being
127
+ # unreferenced. Default: many parts from VfilePattern where no parent index
128
+ # exists or might be unknown.
129
+ # WfilePattern = (^|.*?/)(Release|InRelease|Release\.gpg|(Packages|Sources)(\.gz|\.bz2|\.lzma|\.xz)?|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|.*\.xml|.*\.db\.tar\.gz|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|[a-z]+32.exe)$|/dists/.*/installer-.*/images/.*
130
+
131
+ # Higher modes only working with the debug version
132
+ # Warning, writes a lot into apt-cacher.err logfile
133
+ # Value overwrites UnbufferLogs setting (aliased)
134
+ # Debug:3
135
+
136
+ # Usually, general purpose proxies like Squid expose the IP address of the
137
+ # client user to the remote server using the X-Forwarded-For HTTP header. This
138
+ # behaviour can be optionally turned on with the Expose-Origin option.
139
+ # ExposeOrigin: 0
140
+
141
+ # When logging the originating IP address, trust the information supplied by
142
+ # the client in the X-Forwarded-For header.
143
+ # LogSubmittedOrigin: 0
144
+
145
+ # The version string reported to the peer, to be displayed as HTTP client (and
146
+ # version) in the logs of the mirror.
147
+ # WARNING: some archives use this header to detect/guess capabilities of the
148
+ # client (i.e. redirection support) and change the behaviour accordingly, while
149
+ # ACNG might not support the expected features. Expect side effects.
150
+ #
151
+ # UserAgent: Yet Another HTTP Client/1.2.3p4
152
+
153
+ # In some cases the Import and Expiration tasks might create fresh volatile
154
+ # data for internal use by reconstructing them using patch files. This
155
+ # by-product might be recompressed with bzip2 and with some luck the resulting
156
+ # file becomes identical to the *.bz2 file on the server, usable for APT
157
+ # clients trying to fetch the full .bz2 compressed version. Injection of the
158
+ # generated files into the cache has however a disadvantage on underpowered
159
+ # servers: bzip2 compression can create high load on the server system and the
160
+ # visible download of the busy .bz2 files also becomes slower.
161
+ #
162
+ # RecompBz2: 0
163
+
164
+ # Network timeout for outgoing connections.
165
+ # NetworkTimeout: 60
166
+
167
+ # Sometimes it makes sense to not store the data in cache and just return the
168
+ # package data to client as it comes in. DontCache parameters can enable this
169
+ # behaviour for certain URL types. The tokens are extended regular expressions
170
+ # that URLs are matched against.
171
+ #
172
+ # DontCacheRequested is applied to the URL as it comes in from the client.
173
+ # Example: exclude packages built with kernel-package for x86
174
+ # DontCacheRequested: linux-.*_10\...\.Custo._i386
175
+ # Example usecase: exclude popular private IP ranges from caching
176
+ # DontCacheRequested: 192.168.0 ^10\..* 172.30
177
+ #
178
+ # DontCacheResolved is applied to URLs after mapping to the target server. If
179
+ # multiple backend servers are specified then it's only matched against the
180
+ # download link for the FIRST possible source (due to implementation limits).
181
+ # Example usecase: all Ubuntu stuff comes from a local mirror (specified as
182
+ # backend), don't cache it again:
183
+ # DontCacheResolved: ubuntumirror.local.net
184
+ #
185
+ # DontCache directive sets (overrides) both, DontCacheResolved and
186
+ # DontCacheRequested. Provided for convenience, see those directives for
187
+ # details.
188
+ #
189
+ # Default permission set of freshly created files and directories, as octal
190
+ # numbers (see chmod(1) for details).
191
+ # Can by limited by the umask value (see umask(2) for details) if it's set in
192
+ # the environment of the starting shell, e.g. in apt-cacher-ng init script or
193
+ # in its configuration file.
194
+ # DirPerms: 00755
195
+ # FilePerms: 00664
196
+ #
197
+ #
198
+ # It's possible to use use apt-cacher-ng as a regular web server with limited
199
+ # feature set, i.e.
200
+ # including directory browsing and download of any file;
201
+ # excluding sorting, mime types/encodings, CGI execution, index page
202
+ # redirection and other funny things.
203
+ # To get this behavior, mappings between virtual directories and real
204
+ # directories on the server must be defined with the LocalDirs directive.
205
+ # Virtual and real dirs are separated by spaces, multiple pairs are separated
206
+ # by semi-colons. Real directories must be absolute paths.
207
+ # NOTE: Since the names of that key directories share the same namespace as
208
+ # repository names (see Remap-...) it's administrators job to avoid such
209
+ # collisions on them (unless created deliberately).
210
+ #
211
+ # LocalDirs: woo /data/debarchive/woody ; hamm /data/debarchive/hamm
212
+
213
+ # Precache a set of files referenced by specified index files. This can be used
214
+ # to create a partial mirror usable for offline work. There are certain limits
215
+ # and restrictions on the path specification, see manual for details. A list of
216
+ # (maybe) relevant index files could be retrieved via
217
+ # "apt-get --print-uris update" on a client machine.
218
+ #
219
+ # PrecacheFor: debrep/dists/unstable/*/source/Sources* debrep/dists/unstable/*/binary-amd64/Packages*
220
+
221
+ # Arbitrary set of data to append to request headers sent over the wire. Should
222
+ # be a well formated HTTP headers part including newlines (DOS style) which
223
+ # can be entered as escape sequences (\r\n).
224
+ # RequestAppendix: X-Tracking-Choice: do-not-track\r\n
225
+
226
+ # Specifies the IP protocol families to use for remote connections. Order does
227
+ # matter, first specified are considered first. Possible combinations:
228
+ # v6 v4
229
+ # v4 v6
230
+ # v6
231
+ # v4
232
+ # (empty or not set: use system default)
233
+ #
234
+ # ConnectProto: v6 v4
235
+
236
+ # Regular expiration algorithm finds package files which are no longer listed
237
+ # in any index file and removes them of them after a safety period.
238
+ # This option allows to keep more versions of a package in the cache after
239
+ # safety period is over.
240
+ # KeepExtraVersions: 1
241
+
242
+ # Optionally uses TCP access control provided by libwrap, see hosts_access(5)
243
+ # for details. Daemon name is apt-cacher-ng. Default if not set: decided on
244
+ # startup by looking for explicit mentioning of apt-cacher-ng in
245
+ # /etc/hosts.allow or /etc/hosts.deny files.
246
+ # UseWrap: 0
247
+
248
+ # If many machines from the same local network attempt to update index files
249
+ # (apt-get update) at nearly the same time, the known state of these index file
250
+ # is temporarily frozen and multiple requests receive the cached response
251
+ # without contacting the server. This parameter (in seconds) specifies the
252
+ # length of this period before the files are considered outdated.
253
+ # Setting it too low transfers more data and increases remote server load,
254
+ # setting it too high (more than a couple of minutes) increases the risk of
255
+ # delivering inconsistent responses to the clients.
256
+ # FreshIndexMaxAge: 27
257
+
258
+ # Usually the users are not allowed to specify custom TCP ports of remote
259
+ # mirrors in the requests, only the default HTTP port can be used (instead,
260
+ # proxy administrator can create Remap- rules with custom ports). This
261
+ # restriction can be disabled by specifying a list of allowed ports or 0 for
262
+ # any port.
263
+ #
264
+ # AllowUserPorts: 80
265
+
266
+ # Normally the HTTP redirection responses are forwarded to the original caller
267
+ # (i.e. APT) which starts a new download attempt from the new URL. This
268
+ # solution is ok for client configurations with proxy mode but doesn't work
269
+ # well with configurations using URL prefixes. To work around this the server
270
+ # can restart its own download with another URL. However, this might be used to
271
+ # circumvent download source policies by malicious users.
272
+ # The RedirMax option specifies how many such redirects the server should
273
+ # follow per request, 0 disables the internal redirection. If not set,
274
+ # default value is 0 if ForceManaged is used and 5 otherwise.
275
+ #
276
+ # RedirMax: 5