melissadata 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Gemfile.lock +46 -16
- data/README.md +50 -2
- data/Rakefile +58 -23
- data/Vagrantfile +12 -12
- data/bin/md_tcp_server +5 -0
- data/bin/md_unix_server +5 -0
- data/chef/cookbooks/apt/README.md +109 -0
- data/chef/cookbooks/apt/files/default/apt-cacher +9 -0
- data/chef/cookbooks/apt/files/default/apt-cacher.conf +144 -0
- data/chef/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/chef/cookbooks/apt/metadata.json +34 -0
- data/chef/cookbooks/apt/metadata.rb +13 -0
- data/chef/cookbooks/apt/providers/repository.rb +72 -0
- data/chef/cookbooks/apt/recipes/cacher-client.rb +37 -0
- data/chef/cookbooks/apt/recipes/cacher.rb +45 -0
- data/chef/cookbooks/apt/recipes/default.rb +33 -0
- data/chef/cookbooks/apt/resources/repository.rb +30 -0
- data/chef/cookbooks/build-essential/README.md +24 -0
- data/chef/cookbooks/build-essential/metadata.json +35 -0
- data/chef/cookbooks/build-essential/metadata.rb +10 -0
- data/chef/cookbooks/build-essential/recipes/default.rb +45 -0
- data/chef/cookbooks/melissadata/attributes/default.rb +5 -0
- data/chef/cookbooks/melissadata/metadata.rb +8 -0
- data/chef/cookbooks/melissadata/recipes/default.rb +37 -0
- data/chef/cookbooks/melissadata/templates/default/Makefile.erb +39 -0
- data/chef/cookbooks/melissadata/templates/default/md_tcp_server.init.erb +82 -0
- data/chef/cookbooks/melissadata/templates/default/md_unix_server.init.erb +81 -0
- data/chef/cookbooks/rvm/recipes/default.rb +1 -0
- data/chef/cookbooks/rvm/recipes/r187.rb +6 -0
- data/chef/cookbooks/rvm/recipes/r192.rb +6 -0
- data/chef/cookbooks/rvm/recipes/system.rb +28 -0
- data/chef/cookbooks/ubuntu/attributes/default.rb +24 -0
- data/chef/cookbooks/ubuntu/metadata.json +36 -0
- data/chef/cookbooks/ubuntu/metadata.rb +8 -0
- data/chef/cookbooks/ubuntu/recipes/default.rb +27 -0
- data/chef/cookbooks/ubuntu/templates/default/sources.list.erb +15 -0
- data/lib/melissadata.rb +1 -2
- data/lib/melissadata/client.rb +8 -0
- data/lib/melissadata/client/base.rb +56 -0
- data/lib/melissadata/client/tcp.rb +28 -0
- data/lib/melissadata/client/unix.rb +22 -0
- data/lib/melissadata/client/vagrant.rb +9 -0
- data/lib/melissadata/command.rb +1 -0
- data/lib/melissadata/command/base.rb +0 -1
- data/lib/melissadata/command/compile.rb +37 -0
- data/lib/melissadata/command/package.rb +32 -73
- data/lib/melissadata/constants.rb +6 -5
- data/lib/melissadata/melissadata.rb +26 -91
- data/lib/melissadata/native_object.rb +0 -8
- data/lib/melissadata/native_object/address.rb +2 -0
- data/lib/melissadata/native_object/base.rb +18 -5
- data/lib/melissadata/native_object/email.rb +2 -0
- data/lib/melissadata/native_object/geo.rb +2 -0
- data/lib/melissadata/native_object/ip_locator.rb +2 -0
- data/lib/melissadata/native_object/name.rb +2 -0
- data/lib/melissadata/native_object/phone.rb +2 -0
- data/lib/melissadata/server.rb +10 -0
- data/lib/melissadata/server/base.rb +145 -0
- data/lib/melissadata/server/tcp.rb +22 -0
- data/lib/melissadata/server/unix.rb +24 -0
- data/lib/melissadata/vagrant_plugin.rb +23 -0
- data/lib/melissadata/vagrant_plugin/actions.rb +9 -0
- data/lib/melissadata/vagrant_plugin/actions/base.rb +60 -0
- data/lib/melissadata/vagrant_plugin/actions/install.rb +78 -0
- data/lib/melissadata/vagrant_plugin/actions/update.rb +22 -0
- data/lib/melissadata/vagrant_plugin/command.rb +21 -0
- data/lib/melissadata/vagrant_plugin/config.rb +18 -0
- data/lib/melissadata/version.rb +1 -1
- data/locales/en.yml +16 -0
- data/melissadata.gemspec +11 -12
- data/pkg/melissadata-0.0.1.gem +0 -0
- data/spec/helpers/vagrant_helpers.rb +17 -0
- data/spec/melissadata/command/package_spec.rb +1 -1
- data/spec/melissadata/vagrant_plugin/actions/install_spec.rb +40 -0
- data/spec/melissadata/vagrant_plugin/config_spec.rb +17 -0
- data/spec/spec_helper.rb +12 -7
- metadata +201 -228
- data/bin/md +0 -4
- data/bin/md-rpc +0 -9
- data/bin/md-server +0 -18
- data/bin/melissadata +0 -4
- data/lib/melissadata/native_object/client.rb +0 -33
- data/lib/melissadata/prev/command_old.rb +0 -80
- data/lib/melissadata/prev/shared_objects.rb +0 -54
- data/lib/melissadata/rpc.rb +0 -39
- data/pkg/melissa-data-0.0.1.gem +0 -0
- data/pkg/melissa-data-0.0.2.gem +0 -0
- data/pkg/melissa-data-0.0.3.gem +0 -0
- data/templates/config.rb +0 -20
- data/templates/locales/en.yml +0 -4
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/mitchellh/vagrant.git
|
3
|
+
revision: a42ab2ce208a39df783c5942c50f46883cbf2f4c
|
4
|
+
specs:
|
5
|
+
vagrant (0.8.3.dev)
|
6
|
+
archive-tar-minitar (= 0.5.2)
|
7
|
+
erubis (~> 2.7.0)
|
8
|
+
i18n (~> 0.5.0)
|
9
|
+
json (~> 1.5.1)
|
10
|
+
net-scp (~> 1.0.4)
|
11
|
+
net-ssh (~> 2.1.4)
|
12
|
+
thor (~> 0.14.6)
|
13
|
+
virtualbox (~> 0.9.1)
|
14
|
+
|
1
15
|
PATH
|
2
16
|
remote: .
|
3
17
|
specs:
|
@@ -15,29 +29,34 @@ GEM
|
|
15
29
|
remote: http://rubygems.org/
|
16
30
|
specs:
|
17
31
|
activesupport (3.0.9)
|
32
|
+
archive-tar-minitar (0.5.2)
|
18
33
|
awesome_print (0.4.0)
|
19
34
|
cloudfiles (1.4.17)
|
20
35
|
mime-types (>= 1.16)
|
21
36
|
columnize (0.3.4)
|
22
37
|
diff-lcs (1.1.2)
|
38
|
+
erubis (2.7.0)
|
39
|
+
ffi (1.0.9)
|
23
40
|
growl (1.0.3)
|
24
41
|
guard (0.5.1)
|
25
42
|
thor (~> 0.14.6)
|
26
|
-
guard-rspec (0.4.
|
43
|
+
guard-rspec (0.4.1)
|
27
44
|
guard (>= 0.4.0)
|
28
|
-
i18n (0.
|
45
|
+
i18n (0.5.0)
|
29
46
|
iobuffer (1.0.0)
|
30
|
-
|
31
|
-
|
47
|
+
json (1.5.3)
|
48
|
+
linecache19 (0.5.12)
|
49
|
+
ruby_core_source (>= 0.1.4)
|
32
50
|
mime-types (1.16)
|
33
|
-
msgpack (0.4.
|
51
|
+
msgpack (0.4.6)
|
34
52
|
msgpack-rpc (0.4.5)
|
35
53
|
msgpack (>= 0.4.4)
|
36
54
|
rev (>= 0.3.0)
|
37
55
|
multi_json (1.0.3)
|
38
|
-
|
39
|
-
|
40
|
-
|
56
|
+
net-scp (1.0.4)
|
57
|
+
net-ssh (>= 1.99.1)
|
58
|
+
net-ssh (2.1.4)
|
59
|
+
rake (0.9.2)
|
41
60
|
rev (0.3.2)
|
42
61
|
iobuffer (>= 0.1.3)
|
43
62
|
rspec (2.6.0)
|
@@ -48,12 +67,22 @@ GEM
|
|
48
67
|
rspec-expectations (2.6.0)
|
49
68
|
diff-lcs (~> 1.1.2)
|
50
69
|
rspec-mocks (2.6.0)
|
51
|
-
ruby-debug (0.
|
52
|
-
columnize (>= 0.1)
|
53
|
-
|
54
|
-
|
55
|
-
|
70
|
+
ruby-debug-base19 (0.11.25)
|
71
|
+
columnize (>= 0.3.1)
|
72
|
+
linecache19 (>= 0.5.11)
|
73
|
+
ruby_core_source (>= 0.1.4)
|
74
|
+
ruby-debug19 (0.11.6)
|
75
|
+
columnize (>= 0.3.1)
|
76
|
+
linecache19 (>= 0.5.11)
|
77
|
+
ruby-debug-base19 (>= 0.11.19)
|
78
|
+
ruby_core_source (0.1.5)
|
79
|
+
archive-tar-minitar (>= 0.5.2)
|
80
|
+
simplecov (0.4.2)
|
81
|
+
simplecov-html (~> 0.4.4)
|
82
|
+
simplecov-html (0.4.5)
|
56
83
|
thor (0.14.6)
|
84
|
+
virtualbox (0.9.1)
|
85
|
+
ffi (~> 1.0.9)
|
57
86
|
yajl-ruby (0.8.2)
|
58
87
|
|
59
88
|
PLATFORMS
|
@@ -63,7 +92,8 @@ DEPENDENCIES
|
|
63
92
|
growl
|
64
93
|
guard-rspec
|
65
94
|
melissadata!
|
66
|
-
rake
|
67
|
-
rcov
|
95
|
+
rake
|
68
96
|
rspec (> 2.4)
|
69
|
-
ruby-
|
97
|
+
ruby-debug19
|
98
|
+
simplecov (>= 0.4.0)
|
99
|
+
vagrant!
|
data/README.md
CHANGED
@@ -1,5 +1,53 @@
|
|
1
1
|
# MelissaData
|
2
2
|
|
3
|
-
|
3
|
+
Links to products/projects used:
|
4
4
|
|
5
|
-
|
5
|
+
* MelissaData Data Quality Website: [http://www.melissadata.com/dqt/index.htm](http://www.melissadata.com/dqt/index.htm)
|
6
|
+
* Vagrant: [http://vagrantup.com/](http://vagrantup.com/)
|
7
|
+
* Oracle's VirtualBox: [VirtualBox](http://www.virtualbox.org)
|
8
|
+
|
9
|
+
Ruby wrappers around the MelissaData objects. The code to access the raw
|
10
|
+
shared objects is based on the sample code provided by the MelissaData
|
11
|
+
DVDs / downloads.
|
12
|
+
|
13
|
+
## Prereqs
|
14
|
+
|
15
|
+
Make sure these are all installed on your development machine:
|
16
|
+
|
17
|
+
* Oracle's VirtualBox: [VirtualBox](http://www.virtualbox.org)
|
18
|
+
* RVM: [http://beginrescueend.com](http://beginrescueend.com)
|
19
|
+
* Ruby 1.9.2 via RVM: `rvm install 1.9.2`
|
20
|
+
* A MelissaData DVD or .dmg (e.g. IPL-DVD-2011-Q1 or DQ-DVD-2011-05)
|
21
|
+
|
22
|
+
## Quick Start
|
23
|
+
|
24
|
+
Once all the prereqs are installed, this should get you a running
|
25
|
+
Vagrant VM:
|
26
|
+
|
27
|
+
git clone git://github.com/johnnyt/melissadata.git
|
28
|
+
cd melissadata
|
29
|
+
rake setup
|
30
|
+
|
31
|
+
Now make sure you have a MelissaData DVD (or .dmg) mounted (e.g. IPL-DVD-2011-Q1), and run:
|
32
|
+
|
33
|
+
rake install_md
|
34
|
+
|
35
|
+
Then SSH into the Vagrant VM:
|
36
|
+
|
37
|
+
bundle exec vagrant ssh
|
38
|
+
|
39
|
+
Once logged into the VM - run:
|
40
|
+
|
41
|
+
cd /opt/melissadata/gem
|
42
|
+
irb -r lib/md
|
43
|
+
|
44
|
+
Inside the IRB session run:
|
45
|
+
|
46
|
+
irb> ip = MelissaData::NativeObject::IpLocator.new :license => 'YOUR_LICENSE_KEY'
|
47
|
+
irb> ip.process :ip => '74.125.224.81'
|
48
|
+
|
49
|
+
which should return:
|
50
|
+
|
51
|
+
=> {:domain_name=>"google.com", :country_abbrev=>"US", :region=>"California", :zip=>"94043",
|
52
|
+
:isp=>"Google Inc", :lat=>"37.386052", :country=>"United States", :city=>"Mountain View",
|
53
|
+
:lng=>"-122.083851", :messages=>{:status=>["IP Address found in database"]}, :result_codes=>"IS01"}
|
data/Rakefile
CHANGED
@@ -5,42 +5,77 @@ task :setup do
|
|
5
5
|
sh %Q!gem install bundler --no-ri --no-rdoc! unless bundler_installed
|
6
6
|
output = `bundle check 2>&1`
|
7
7
|
unless $?.to_i == 0
|
8
|
-
# puts output
|
9
8
|
sh "bundle install"
|
10
|
-
# puts
|
11
9
|
end
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
unless %x[bundle exec vagrant box list] =~ /lucid64$/
|
12
|
+
sh "bundle exec vagrant box add lucid64 http://files.vagrantup.com/lucid64.box"
|
13
|
+
end
|
14
|
+
|
15
|
+
sh "bundle exec vagrant up"
|
16
|
+
|
17
|
+
puts <<-STR
|
18
|
+
|
19
|
+
|
20
|
+
Now make sure you have a MelissaData DVD (or .dmg) mounted (e.g. IPL-DVD-2011-Q1),
|
21
|
+
then run:
|
17
22
|
|
18
|
-
|
23
|
+
rake md:install
|
24
|
+
|
25
|
+
STR
|
19
26
|
end
|
20
27
|
|
21
28
|
if bundler_installed
|
29
|
+
desc "SSH into the Vagrant VM"
|
30
|
+
task :ssh do
|
31
|
+
sh "bundle exec vagrant ssh"
|
32
|
+
end
|
33
|
+
|
34
|
+
task :console => 'md:console'
|
35
|
+
|
36
|
+
namespace :md do
|
37
|
+
desc "Open a MelissaData console (IRB session)"
|
38
|
+
task :console do
|
39
|
+
sh "bundle exec irb -r./lib/md"
|
40
|
+
end
|
41
|
+
|
42
|
+
desc "Install MelissaData onto the Vagrant VM"
|
43
|
+
task :install do
|
44
|
+
sh "bundle exec rake build"
|
45
|
+
sh "bundle exec vagrant md install"
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "Update the MelissaData gem on the Vagrant VM"
|
49
|
+
task :update do
|
50
|
+
sh "bundle exec rake build"
|
51
|
+
sh "bundle exec vagrant md update"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
22
55
|
require 'bundler'
|
23
56
|
Bundler::GemHelper.install_tasks
|
24
57
|
|
25
|
-
|
58
|
+
if defined?(RSpec)
|
59
|
+
require 'rspec/core/rake_task'
|
26
60
|
|
27
|
-
|
28
|
-
|
61
|
+
task :default => [:spec]
|
62
|
+
task :test => [:spec]
|
29
63
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
64
|
+
desc "Run specs"
|
65
|
+
RSpec::Core::RakeTask.new('spec') do |t|
|
66
|
+
t.rspec_opts = ['--backtrace', '--format', 'documentation']
|
67
|
+
t.pattern = 'spec/**/*_spec.rb'
|
68
|
+
end
|
35
69
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
70
|
+
if RUBY_VERSION !~ /^1\.9/
|
71
|
+
namespace :spec do
|
72
|
+
desc "Run specs with RCov"
|
73
|
+
RSpec::Core::RakeTask.new('rcov') do |t|
|
74
|
+
t.pattern = 'spec/**/*_spec.rb'
|
75
|
+
t.rspec_opts = ['--backtrace', '--format', 'documentation']
|
76
|
+
t.rcov = true
|
77
|
+
# t.rcov_opts = ['--exclude', 'some/path']
|
78
|
+
end
|
44
79
|
end
|
45
80
|
end
|
46
81
|
end
|
data/Vagrantfile
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
config.vm.forward_port 'http', 80, 8888
|
4
|
-
config.vm.forward_port 'melissa_data', 23456, 23457
|
1
|
+
require File.expand_path('lib/melissadata', File.dirname(__FILE__))
|
2
|
+
MelissaData::VagrantPlugin.load!
|
5
3
|
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
Vagrant::Config.run do |config|
|
5
|
+
config.vm.box = 'lucid64'
|
6
|
+
config.vm.provision :chef_solo do |chef|
|
7
|
+
chef.cookbooks_path = ['chef/cookbooks']
|
8
|
+
chef.add_recipe 'melissadata'
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
11
|
+
config.vm.forward_port 'melissadata', 1404, 14004
|
12
|
+
|
13
|
+
# config.vm.customize do |vm|
|
14
|
+
# vm.cpu_count = 2
|
15
|
+
# vm.memory_size = 1024
|
16
16
|
# end
|
17
17
|
end
|
data/bin/md_tcp_server
ADDED
data/bin/md_unix_server
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
Description
|
2
|
+
===========
|
3
|
+
|
4
|
+
Configures various APT components on Debian-like systems. Also includes a LWRP.
|
5
|
+
|
6
|
+
Recipes
|
7
|
+
=======
|
8
|
+
|
9
|
+
default
|
10
|
+
-------
|
11
|
+
The default recipe runs apt-get update during the Compile Phase of the Chef run to ensure that the system's package cache is updated with the latest. It is recommended that this recipe appear first in a node's run list (directly or through a role) to ensure that when installing packages, Chef will be able to download the latest version available on the remote APT repository.
|
12
|
+
|
13
|
+
This recipe also sets up a local cache directory for preseeding packages.
|
14
|
+
|
15
|
+
cacher
|
16
|
+
------
|
17
|
+
Installs the apt-cacher package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/report. The cacher recipe includes the `cacher-client` recipe, so it helps seed itself.
|
18
|
+
|
19
|
+
cacher-client
|
20
|
+
-------------
|
21
|
+
Configures the node to use the apt-cacher server as a client.
|
22
|
+
|
23
|
+
Resources/Providers
|
24
|
+
===================
|
25
|
+
|
26
|
+
This LWRP provides an easy way to manage additional APT repositories.
|
27
|
+
|
28
|
+
# Actions
|
29
|
+
|
30
|
+
- :add: creates a repository file and builds the repository listing
|
31
|
+
- :remove: removes the repository file
|
32
|
+
|
33
|
+
# Attribute Parameters
|
34
|
+
|
35
|
+
- repo_name: name attribute. The name of the channel to discover
|
36
|
+
- uri: the base of the Debian distribution
|
37
|
+
- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`
|
38
|
+
- components: package groupings..when it doubt use `main`
|
39
|
+
- deb_src: whether or not to add the repository as a source repo as well
|
40
|
+
- key_server: the GPG keyserver where the key for the repo should be retrieved
|
41
|
+
- key: if a `key_server` is provided, this is assumed to be the fingerprint, otherwise it is the URI to the GPG key for the repo
|
42
|
+
|
43
|
+
# Example
|
44
|
+
|
45
|
+
# add the Zenoss repo
|
46
|
+
apt_repository "zenoss" do
|
47
|
+
uri "http://dev.zenoss.org/deb"
|
48
|
+
components ["main","stable"]
|
49
|
+
action :add
|
50
|
+
end
|
51
|
+
|
52
|
+
# add the Nginx PPA; grab key from keyserver
|
53
|
+
apt_repository "nginx-php" do
|
54
|
+
uri "http://ppa.launchpad.net/nginx/php5/ubuntu"
|
55
|
+
distribution node['lsb']['codename']
|
56
|
+
components ["main"]
|
57
|
+
keyserver "keyserver.ubuntu.com"
|
58
|
+
key "C300EE8C"
|
59
|
+
action :add
|
60
|
+
end
|
61
|
+
|
62
|
+
# add the Cloudkick Repo
|
63
|
+
apt_repository "cloudkick" do
|
64
|
+
uri "http://packages.cloudkick.com/ubuntu"
|
65
|
+
distribution node['lsb']['codename']
|
66
|
+
components ["main"]
|
67
|
+
key "http://packages.cloudkick.com/cloudkick.packages.key"
|
68
|
+
action :add
|
69
|
+
end
|
70
|
+
|
71
|
+
# remove Zenoss repo
|
72
|
+
apt_repository "zenoss" do
|
73
|
+
action :remove
|
74
|
+
end
|
75
|
+
|
76
|
+
Usage
|
77
|
+
=====
|
78
|
+
|
79
|
+
Put `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:
|
80
|
+
|
81
|
+
template "/etc/apt/sources.list.d/my_apt_sources.list" do
|
82
|
+
notifies :run, resources(:execute => "apt-get update"), :immediately
|
83
|
+
end
|
84
|
+
|
85
|
+
The above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.
|
86
|
+
|
87
|
+
Put `recipe[apt::cacher]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.
|
88
|
+
|
89
|
+
License and Author
|
90
|
+
==================
|
91
|
+
|
92
|
+
Author:: Joshua Timberman (<joshua@opscode.com>)
|
93
|
+
Author:: Matt Ray (<matt@opscode.com>)
|
94
|
+
Author:: Seth Chisamore (<schisamo@opscode.com>)
|
95
|
+
|
96
|
+
Copyright 2009-2011 Opscode, Inc.
|
97
|
+
|
98
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
99
|
+
you may not use this file except in compliance with the License.
|
100
|
+
You may obtain a copy of the License at
|
101
|
+
|
102
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
103
|
+
|
104
|
+
Unless required by applicable law or agreed to in writing, software
|
105
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
106
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
107
|
+
See the License for the specific language governing permissions and
|
108
|
+
limitations under the License.
|
109
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# apt-cacher startup configuration file
|
2
|
+
|
3
|
+
# IMPORTANT: check the apt-cacher.conf file before using apt-cacher as daemon.
|
4
|
+
|
5
|
+
# set to 1 to start the daemon at boot time
|
6
|
+
AUTOSTART=1
|
7
|
+
|
8
|
+
# extra settings to override the ones in apt-cacher.conf
|
9
|
+
# EXTRAOPT=" daemon_port=3142 limit=30 "
|
@@ -0,0 +1,144 @@
|
|
1
|
+
# This file has been modified by ./apt-proxy-to-apt-cacher
|
2
|
+
# Some lines may have been appended at the bottom of this file
|
3
|
+
# This file has been modified by /usr/share/apt-cacher/apt-proxy-to-apt-cacher
|
4
|
+
# Some lines may have been appended at the bottom of this file
|
5
|
+
#################################################################
|
6
|
+
# This is the config file for apt-cacher. On most Debian systems
|
7
|
+
# you can safely leave the defaults alone.
|
8
|
+
#################################################################
|
9
|
+
|
10
|
+
# cache_dir is used to set the location of the local cache. This can
|
11
|
+
# become quite large, so make sure it is somewhere with plenty of space.
|
12
|
+
cache_dir=/var/cache/apt-cacher
|
13
|
+
|
14
|
+
# The email address of the administrator is displayed in the info page
|
15
|
+
# and traffic reports.
|
16
|
+
admin_email=root@localhost
|
17
|
+
|
18
|
+
# For the daemon startup settings please edit the file /etc/default/apt-cacher.
|
19
|
+
|
20
|
+
# Daemon port setting, only useful in stand-alone mode. You need to run the
|
21
|
+
# daemon as root to use privileged ports (<1024).
|
22
|
+
daemon_port = 3142
|
23
|
+
|
24
|
+
# optional settings, user and group to run the daemon as. Make sure they have
|
25
|
+
# sufficient permissions on the cache and log directories. Comment the settings
|
26
|
+
# to run apt-cacher as the native user.
|
27
|
+
group=www-data
|
28
|
+
user=www-data
|
29
|
+
|
30
|
+
# optional setting, binds the listening daemon to one specified IP. Use IP
|
31
|
+
# ranges for more advanced configuration, see below.
|
32
|
+
# daemon_addr=localhost
|
33
|
+
|
34
|
+
# If your apt-cacher machine is directly exposed to the Internet and you are
|
35
|
+
# worried about unauthorised machines fetching packages through it, you can
|
36
|
+
# specify a list of IPv4 addresses which are allowed to use it and another
|
37
|
+
# list of IPv4 addresses which aren't.
|
38
|
+
# Localhost (127.0.0.1) is always allowed. Other addresses must be matched
|
39
|
+
# by allowed_hosts and not by denied_hosts to be permitted to use the cache.
|
40
|
+
# Setting allowed_hosts to "*" means "allow all".
|
41
|
+
# Otherwise the format is a comma-separated list containing addresses,
|
42
|
+
# optionally with masks (like 10.0.0.0/22), or ranges of addresses (two
|
43
|
+
# addresses separated by a hyphen, no masks, like '192.168.0.3-192.168.0.56').
|
44
|
+
allowed_hosts=*
|
45
|
+
denied_hosts=
|
46
|
+
|
47
|
+
# And similiarly for IPv6 with allowed_hosts_6 and denied_hosts_6.
|
48
|
+
# Note that IPv4-mapped IPv6 addresses (::ffff:w.x.y.z) are truncated to
|
49
|
+
# w.x.y.z and are handled as IPv4.
|
50
|
+
allowed_hosts_6=fec0::/16
|
51
|
+
denied_hosts_6=
|
52
|
+
|
53
|
+
# This thing can be done by Apache but is much simplier here - limit access to
|
54
|
+
# Debian mirrors based on server names in the URLs
|
55
|
+
#allowed_locations=ftp.uni-kl.de,ftp.nerim.net,debian.tu-bs.de
|
56
|
+
|
57
|
+
# Apt-cacher can generate usage reports every 24 hours if you set this
|
58
|
+
# directive to 1. You can view the reports in a web browser by pointing
|
59
|
+
# to your cache machine with '/apt-cacher/report' on the end, like this:
|
60
|
+
# http://yourcache.example.com/apt-cacher/report
|
61
|
+
# Generating reports is very fast even with many thousands of logfile
|
62
|
+
# lines, so you can safely turn this on without creating much
|
63
|
+
# additional system load.
|
64
|
+
generate_reports=1
|
65
|
+
|
66
|
+
# Apt-cacher can clean up its cache directory every 24 hours if you set
|
67
|
+
# this directive to 1. Cleaning the cache can take some time to run
|
68
|
+
# (generally in the order of a few minutes) and removes all package
|
69
|
+
# files that are not mentioned in any existing 'Packages' lists. This
|
70
|
+
# has the effect of deleting packages that have been superseded by an
|
71
|
+
# updated 'Packages' list.
|
72
|
+
clean_cache=1
|
73
|
+
|
74
|
+
# The directory to use for apt-cacher access and error logs.
|
75
|
+
# The access log records every request in the format:
|
76
|
+
# date-time|client ip address|HIT/MISS/EXPIRED|object size|object name
|
77
|
+
# The error log is slightly more free-form, and is also used for debug
|
78
|
+
# messages if debug mode is turned on.
|
79
|
+
# Note that the old 'logfile' and 'errorfile' directives are
|
80
|
+
# deprecated: if you set them explicitly they will be honoured, but it's
|
81
|
+
# better to just get rid of them from old config files.
|
82
|
+
logdir=/var/log/apt-cacher
|
83
|
+
|
84
|
+
# apt-cacher can use different methods to decide whether package lists need to
|
85
|
+
# be updated,
|
86
|
+
# A) looking at the age of the cached files
|
87
|
+
# B) getting HTTP header from server and comparing that with cached data. This
|
88
|
+
# method is more reliable and avoids desynchronisation of data and index files
|
89
|
+
# but needs to transfer few bytes from the server every time somebody requests
|
90
|
+
# the files ("apt-get update")
|
91
|
+
# Set the following value to the maximum age (in hours) for method A or to 0
|
92
|
+
# for method B
|
93
|
+
expire_hours=0
|
94
|
+
|
95
|
+
# Apt-cacher can pass all its requests to an external http proxy like
|
96
|
+
# Squid, which could be very useful if you are using an ISP that blocks
|
97
|
+
# port 80 and requires all web traffic to go through its proxy. The
|
98
|
+
# format is 'hostname:port', eg: 'proxy.example.com:8080'.
|
99
|
+
http_proxy=proxy.example.com:8080
|
100
|
+
|
101
|
+
# Use of an external proxy can be turned on or off with this flag.
|
102
|
+
# Value should be either 0 (off) or 1 (on).
|
103
|
+
use_proxy=0
|
104
|
+
|
105
|
+
# External http proxy sometimes need authentication to get full access. The
|
106
|
+
# format is 'username:password'.
|
107
|
+
http_proxy_auth=proxyuser:proxypass
|
108
|
+
|
109
|
+
# Use of external proxy authentication can be turned on or off with this flag.
|
110
|
+
# Value should be either 0 (off) or 1 (on).
|
111
|
+
use_proxy_auth=0
|
112
|
+
|
113
|
+
# Rate limiting sets the maximum bandwidth in bytes per second to use
|
114
|
+
# for fetching packages. Syntax is fully defined in 'man wget'.
|
115
|
+
# Use 'k' or 'm' to use kilobits or megabits / second: eg, 'limit=25k'.
|
116
|
+
# Use 0 or a negative value for no rate limiting.
|
117
|
+
limit=0
|
118
|
+
|
119
|
+
# Debug mode makes apt-cacher spew a lot of extra debug junk to the
|
120
|
+
# error log (whose location is defined with the 'logdir' directive).
|
121
|
+
# Leave this off unless you need it, or your error log will get very
|
122
|
+
# big. Acceptable values are 0 or 1.
|
123
|
+
debug=0
|
124
|
+
|
125
|
+
# Adapt the line in the usage info web page to match your server configuration
|
126
|
+
# example_sources_line=deb http://<b>my.cacher.server:3142/</b>ftp.au.debian.org/debian unstable main contrib non-free
|
127
|
+
|
128
|
+
# Print a 410 (Gone) HTTP message with the specified text when accessed via
|
129
|
+
# CGI. Useful to tell users to adapt their sources.list files when the
|
130
|
+
# apt-cacher server is beeing relocated (via apt-get's error messages while
|
131
|
+
# running "update")
|
132
|
+
#cgi_advise_to_use = Please use http://cacheserver:3142/ as apt-cacher access URL
|
133
|
+
#cgi_advise_to_use = Server relocated. To change sources.list, run perl -pe "s,/apt-cacher\??,:3142," -i /etc/apt/sources.list
|
134
|
+
|
135
|
+
# Server mapping - this allows to hide real server names behind virtual paths
|
136
|
+
# that appear in the access URL. This method is known from apt-proxy. This is
|
137
|
+
# also the only method to use FTP access to the target hosts. The syntax is simple, the part of the beginning to replace, followed by a list of mirror urls, all space separated. Multiple profile are separated by semicolons
|
138
|
+
# path_map = debian ftp.uni-kl.de/pub/linux/debian ftp2.de.debian.org/debian ; ubuntu archive.ubuntu.com/ubuntu ; security security.debian.org/debian-security ftp2.de.debian.org/debian-security
|
139
|
+
# Note that you need to specify all target servers in the allowed_locations
|
140
|
+
# options if you make use of it. Also note that the paths should not overlap
|
141
|
+
# each other. FTP access method not supported yet, maybe in the future.
|
142
|
+
|
143
|
+
# extra setting from apt-proxy configuration
|
144
|
+
path_map = ubuntu us.archive.ubuntu.com/ubuntu ; ubuntu-security security.ubuntu.com/ubuntu ; debian debian.osuosl.org/debian/ ; security security.debian.org/debian-security
|