landrush 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +12 -178
  3. data/.travis.yml +6 -1
  4. data/CHANGELOG.md +18 -1
  5. data/CONTRIBUTING.adoc +112 -0
  6. data/Gemfile +6 -9
  7. data/Guardfile +10 -0
  8. data/README.adoc +100 -0
  9. data/Rakefile +14 -2
  10. data/appveyor.yml +20 -0
  11. data/doc/Development.adoc +112 -0
  12. data/doc/ProxyMobile.adoc +66 -0
  13. data/doc/Troubleshooting.adoc +42 -0
  14. data/doc/Usage.adoc +271 -0
  15. data/features/commands.feature +35 -0
  16. data/features/dns_resolution.feature +6 -5
  17. data/features/{landrush-ip.feature → landrush_ip.feature} +0 -0
  18. data/features/step_definitions/landrush_custom_steps.rb +48 -0
  19. data/features/support/env.rb +25 -1
  20. data/landrush.gemspec +3 -3
  21. data/lib/landrush/action/common.rb +3 -11
  22. data/lib/landrush/action/install_prerequisites.rb +2 -3
  23. data/lib/landrush/action/redirect_dns.rb +1 -1
  24. data/lib/landrush/action/setup.rb +25 -30
  25. data/lib/landrush/action/teardown.rb +8 -11
  26. data/lib/landrush/cap/guest/all/read_host_visible_ip_address.rb +28 -4
  27. data/lib/landrush/cap/guest/linux/add_iptables_rule.rb +1 -1
  28. data/lib/landrush/cap/guest/linux/redirect_dns.rb +2 -2
  29. data/lib/landrush/cap/guest/suse/add_iptables_rule.rb +20 -0
  30. data/lib/landrush/cap/guest/suse/install_iptables.rb +14 -0
  31. data/lib/landrush/cap/guest/suse/iptables_installed.rb +11 -0
  32. data/lib/landrush/cap/host/suse/dnsmasq_installed.rb +11 -0
  33. data/lib/landrush/cap/host/suse/install_dnsmasq.rb +14 -0
  34. data/lib/landrush/cap/host/suse/restart_dnsmasq.rb +21 -0
  35. data/lib/landrush/cap/host/windows/configure_visibility_on_host.rb +1 -1
  36. data/lib/landrush/command.rb +42 -17
  37. data/lib/landrush/config.rb +29 -14
  38. data/lib/landrush/plugin.rb +30 -0
  39. data/lib/landrush/server.rb +96 -138
  40. data/lib/landrush/start_server.rb +11 -0
  41. data/lib/landrush/store.rb +6 -2
  42. data/lib/landrush/util/path.rb +32 -0
  43. data/lib/landrush/util/process_helper.rb +46 -0
  44. data/lib/landrush/util/retry.rb +2 -2
  45. data/lib/landrush/version.rb +1 -1
  46. data/test/landrush/action/setup_test.rb +19 -25
  47. data/test/landrush/action/teardown_test.rb +18 -15
  48. data/test/landrush/cap/guest/all/read_host_visible_ip_address_test.rb +35 -1
  49. data/test/landrush/cap/guest/linux/configured_dns_servers_test.rb +8 -8
  50. data/test/landrush/cap/guest/linux/redirect_dns_test.rb +4 -4
  51. data/test/landrush/config_test.rb +23 -2
  52. data/test/landrush/dependent_vms_test.rb +5 -5
  53. data/test/landrush/issues/255.rb +115 -0
  54. data/test/landrush/server_test.rb +22 -4
  55. data/test/landrush/store_test.rb +28 -13
  56. data/test/support/test_server_daemon.rb +2 -4
  57. data/test/test_helper.rb +37 -14
  58. metadata +30 -15
  59. data/CONTRIBUTING.md +0 -103
  60. data/NOTES.md +0 -28
  61. data/README.md +0 -406
  62. data/doc/proxy-mobile/README.md +0 -50
  63. data/features/step_definitions/dns.rb +0 -19
  64. data/features/step_definitions/ip.rb +0 -13
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: landrush
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Hinze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-24 00:00:00.000000000 Z
11
+ date: 2016-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubydns
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.3
47
+ version: 0.2.5
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.2.3
54
+ version: 0.2.5
55
55
  description: |
56
56
  Forget about IPs in Vagrant - Automated DNS for your VMs
57
57
 
@@ -74,25 +74,29 @@ files:
74
74
  - ".rubocop_todo.yml"
75
75
  - ".travis.yml"
76
76
  - CHANGELOG.md
77
- - CONTRIBUTING.md
77
+ - CONTRIBUTING.adoc
78
78
  - Gemfile
79
+ - Guardfile
79
80
  - LICENSE.txt
80
- - NOTES.md
81
- - README.md
81
+ - README.adoc
82
82
  - Rakefile
83
+ - appveyor.yml
84
+ - doc/Development.adoc
85
+ - doc/ProxyMobile.adoc
86
+ - doc/Troubleshooting.adoc
87
+ - doc/Usage.adoc
83
88
  - doc/img/advanced-tcp-properties.png
84
89
  - doc/img/network-connections.png
85
90
  - doc/img/osx.png
86
91
  - doc/img/ubuntu.png
87
92
  - doc/img/vbox.png
88
- - doc/proxy-mobile/README.md
89
93
  - doc/support/seqdiag.fontmap
90
94
  - doc/vagrant_dns_without_landrush.diag
91
95
  - doc/vagrant_dns_without_landrush.svg
96
+ - features/commands.feature
92
97
  - features/dns_resolution.feature
93
- - features/landrush-ip.feature
94
- - features/step_definitions/dns.rb
95
- - features/step_definitions/ip.rb
98
+ - features/landrush_ip.feature
99
+ - features/step_definitions/landrush_custom_steps.rb
96
100
  - features/support/env.rb
97
101
  - landrush.gemspec
98
102
  - lib/landrush.rb
@@ -109,6 +113,9 @@ files:
109
113
  - lib/landrush/cap/guest/linux/redirect_dns.rb
110
114
  - lib/landrush/cap/guest/redhat/install_iptables.rb
111
115
  - lib/landrush/cap/guest/redhat/iptables_installed.rb
116
+ - lib/landrush/cap/guest/suse/add_iptables_rule.rb
117
+ - lib/landrush/cap/guest/suse/install_iptables.rb
118
+ - lib/landrush/cap/guest/suse/iptables_installed.rb
112
119
  - lib/landrush/cap/host/darwin/configure_visibility_on_host.rb
113
120
  - lib/landrush/cap/host/debian/dnsmasq_installed.rb
114
121
  - lib/landrush/cap/host/debian/host.rb
@@ -119,6 +126,9 @@ files:
119
126
  - lib/landrush/cap/host/redhat/dnsmasq_installed.rb
120
127
  - lib/landrush/cap/host/redhat/install_dnsmasq.rb
121
128
  - lib/landrush/cap/host/redhat/restart_dnsmasq.rb
129
+ - lib/landrush/cap/host/suse/dnsmasq_installed.rb
130
+ - lib/landrush/cap/host/suse/install_dnsmasq.rb
131
+ - lib/landrush/cap/host/suse/restart_dnsmasq.rb
122
132
  - lib/landrush/cap/host/ubuntu/host.rb
123
133
  - lib/landrush/cap/host/windows/configure_visibility_on_host.rb
124
134
  - lib/landrush/command.rb
@@ -126,7 +136,10 @@ files:
126
136
  - lib/landrush/dependent_vms.rb
127
137
  - lib/landrush/plugin.rb
128
138
  - lib/landrush/server.rb
139
+ - lib/landrush/start_server.rb
129
140
  - lib/landrush/store.rb
141
+ - lib/landrush/util/path.rb
142
+ - lib/landrush/util/process_helper.rb
130
143
  - lib/landrush/util/retry.rb
131
144
  - lib/landrush/version.rb
132
145
  - test/landrush/action/setup_test.rb
@@ -139,6 +152,7 @@ files:
139
152
  - test/landrush/cap/host/windows/configure_visibility_on_host_test.rb
140
153
  - test/landrush/config_test.rb
141
154
  - test/landrush/dependent_vms_test.rb
155
+ - test/landrush/issues/255.rb
142
156
  - test/landrush/server_test.rb
143
157
  - test/landrush/store_test.rb
144
158
  - test/landrush/util/rety_test.rb
@@ -167,15 +181,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
181
  version: '0'
168
182
  requirements: []
169
183
  rubyforge_project:
170
- rubygems_version: 2.5.1
184
+ rubygems_version: 2.4.8
171
185
  signing_key:
172
186
  specification_version: 4
173
187
  summary: a vagrant plugin providing consistent DNS visible on host and guests
174
188
  test_files:
189
+ - features/commands.feature
175
190
  - features/dns_resolution.feature
176
- - features/landrush-ip.feature
177
- - features/step_definitions/dns.rb
178
- - features/step_definitions/ip.rb
191
+ - features/landrush_ip.feature
192
+ - features/step_definitions/landrush_custom_steps.rb
179
193
  - features/support/env.rb
180
194
  - test/landrush/action/setup_test.rb
181
195
  - test/landrush/action/teardown_test.rb
@@ -187,6 +201,7 @@ test_files:
187
201
  - test/landrush/cap/host/windows/configure_visibility_on_host_test.rb
188
202
  - test/landrush/config_test.rb
189
203
  - test/landrush/dependent_vms_test.rb
204
+ - test/landrush/issues/255.rb
190
205
  - test/landrush/server_test.rb
191
206
  - test/landrush/store_test.rb
192
207
  - test/landrush/util/rety_test.rb
@@ -1,103 +0,0 @@
1
- # Contributing to Landrush
2
-
3
- <!-- MarkdownTOC -->
4
-
5
- - [Working on an issue](#working-on-an-issue)
6
- - [Merging pull requests](#merging-pull-requests)
7
- - [Releasing](#releasing)
8
- - [Maintainers](#maintainers)
9
-
10
- <!-- /MarkdownTOC -->
11
-
12
-
13
- The following is a set of guidelines for contributing to Landrush.
14
- These are just guidelines. Please use your best judgment and feel free
15
- to propose changes to this document in a pull request.
16
-
17
- At this point, this document is not complete, but as decisions are made
18
- they will be added to this document.
19
-
20
- <a name="working-on-an-issue"></a>
21
- ## Working on an issue
22
-
23
- * All changes should have a matching issue in the GitHub [issue
24
- tracker](https://github.com/vagrant-landrush/landrush/issues). If
25
- there is not one, create one.
26
- * Prepend each commit of a proposed change with the GitHub issue number,
27
- eg `Issue #xyz Fixing foo in bar`
28
- * All changes should be applied to master via [pull
29
- requests](https://help.github.com/articles/using-pull-requests/)
30
- (even from maintainers).
31
- * All changes should include documentation updates.
32
- * Small changes need only 1 ACK while larger changes need 2 ACKs from
33
- maintainers before they will be merged. If the author of the pull
34
- request is a maintainer, the submission is considered 1 of the
35
- 2 ACKs. Therefore pull requests from maintainers only require one
36
- additional ACK.
37
-
38
- By "2 ACKs" we mean that 2 maintainers must acknowledge
39
- that the change is a good one. The 2nd person to ACK the pull
40
- request should merge the pull request with a comment including their
41
- agreement. We default to moving forward and using revert if needed.
42
-
43
- <a name="merging-pull-requests"></a>
44
- ## Merging pull requests
45
-
46
- 1. The merging committer should merge the pull request as follows. Avoid
47
- using the GitHub web UI. Instead, perform merges using the `git`
48
- command line. This avoids merge commits and keeps a linear commit
49
- history. The commands below demonstrated the suggested process.
50
-
51
- ```
52
- # Create a local branch for the pull request
53
- $ git checkout -b <branch-name> master
54
-
55
- # Pull the changes
56
- $ git pull <remote> <branch-name>
57
-
58
- # If necessary rebase changes on master to ensure we have a fast
59
- # forward. Also resolve any conflicts
60
- $ git rebase -i master
61
-
62
- # Merge changes into master
63
- $ git checkout master
64
- $ git merge <branch-name>
65
-
66
- # Update changelog in the unreleased section. Commit!
67
-
68
- # Push to origin
69
- $ git push origin master
70
- ```
71
-
72
- <a name="releasing"></a>
73
- ## Releasing
74
-
75
- Prerequisites:
76
-
77
- * Push access to the `landrush` GitHub repository
78
- * Owner of the `landrush` gem Rubygems
79
-
80
- Steps:
81
-
82
- 1. Update `lib/landrush/version.rb` with the new version number.
83
- 1. Update the `CHANGELOG.md` header with the new version number and
84
- current date.
85
- 1. Make a release commit:
86
- `git add lib/landrush/version.rb CHANGELOG.md; git commit -m 'cut vX.Y.Z'`
87
- 1. Make a release tag: `git tag -m vX.Y.Z vX.Y.Z`
88
- 1. Push the release commit: `git push origin master; git push origin master --tags`
89
- 1. Build the release: `rake build`
90
- 1. Push the newly built gem: `gem push pkg/landrush-X.Y.Z.gem`
91
- 1. Update the CHANGELOG to add an "Unreleased" section, commit as
92
- "clean up after vX.Y.Z".
93
-
94
- <a name="maintainers"></a>
95
- ## Maintainers
96
-
97
- * Brian Exelbierd (@bexelbie)
98
- * Eric Sorenson (@ahpook)
99
- * Florian Holzhauer (@fh)
100
- * Hardy Ferentschik (@hferentschik)
101
- * Josef Strzibny (@strzibny)
102
- * Paul Hinze (@phinze)
103
- * Reto Kaiser (@njam)
data/NOTES.md DELETED
@@ -1,28 +0,0 @@
1
- # Committer Meeting Notes
2
-
3
- * 3 March 2016 @ 1700 UTC
4
-
5
- Committers met and made some plans. Attendance: @phinze, @njam, @bexelbie (others regrets)
6
-
7
- 1. PR Process
8
-
9
- * Small issues need 1 ACK
10
- * Larger issues need 2 ACKs
11
- * Default towards action - and go with reverts as needed
12
-
13
- 2. Issue Review: Reto will triage and label
14
-
15
-
16
- 3. Release plans (see README.md)
17
-
18
- 4. Additional Contributor to be invited (Hardy Ferentschik @hferentschik)
19
-
20
- 5. Move landrush up into a Github Org - Paul will do this.
21
-
22
- 6. Next meeting to be in about 3 weeks - bex to organize
23
-
24
- Not landrush related, but Vagrant + Puppet libraries need some help with maintenance
25
-
26
- * https://github.com/rodjek/librarian-puppet
27
- * https://github.com/mhahn/vagrant-librarian-puppet
28
- * Interested, reach out to Reto (@njam, reto@retokaiser.com)
data/README.md DELETED
@@ -1,406 +0,0 @@
1
- # Landrush: DNS for Vagrant [![Build Status](https://travis-ci.org/vagrant-landrush/landrush.png)](https://travis-ci.org/vagrant-landrush/landrush)
2
-
3
- Landrush is a simple cross-platform DNS for Vagrant VMs that is visible on both,
4
- the guest and the host.
5
-
6
- It spins up a small DNS server and redirects DNS traffic from your
7
- VMs to use it, automatically registering/unregistering IP addresses of guests
8
- as they come up and go down.
9
-
10
- **Note**: Windows support is currently considered experimental. If you having
11
- problems using Landrush on Windows please let us know.
12
-
13
- <!-- MarkdownTOC -->
14
-
15
- - [Installation](#installation)
16
- - [Usage](#usage)
17
- - [Getting started](#getting-started)
18
- - [Dynamic entries](#dynamic-entries)
19
- - [Static entries](#static-entries)
20
- - [Wildcard Subdomains](#wildcard-subdomains)
21
- - [Unmatched Queries](#unmatched-queries)
22
- - [Visibility on the Guest](#visibility-on-the-guest)
23
- - [Visibility on the Host](#visibility-on-the-host)
24
- - [OS X](#os-x)
25
- - [Linux](#linux)
26
- - [Windows](#windows)
27
- - [Other Devices \(phone\)](#other-devices-phone)
28
- - [Additional CLI commands](#additional-cli-commands)
29
- - [Miscellaneous Tricks and Tips](#miscellaneous-tricks-and-tips)
30
- - [How to avoid providing sudo password on OS X](#how-to-avoid-providing-sudo-password-on-os-x)
31
- - [Guest is unable to access the Internet](#guest-is-unable-to-access-the-internet)
32
- - [Development](#development)
33
- - [Help Out!](#help-out)
34
-
35
- <!-- /MarkdownTOC -->
36
-
37
- <a name="installation"></a>
38
- ## Installation
39
-
40
- Install under Vagrant (1.1 or later):
41
-
42
- $ vagrant plugin install landrush
43
-
44
- <a name="usage"></a>
45
- ## Usage
46
-
47
- <a name="getting-started"></a>
48
- ### Getting started
49
-
50
- 1. Enable the plugin in your `Vagrantfile`:
51
-
52
- config.landrush.enabled = true
53
-
54
- 1. Bring up a machine.
55
-
56
- $ vagrant up
57
-
58
- 1. You are able to get your VM's hostname resolved on your host:
59
-
60
- $ dig -p 10053 @localhost myhost.vagrant.test
61
-
62
- 1. If you shut down your guest, the entries associated with it will be removed.
63
-
64
- Landrush retrieves your VM's hostname from either the vagrant config
65
- or it uses the system's actual hostname by running the `hostname` command.
66
- A default of "guest-vm" is assumed if hostname is otherwise not available.
67
-
68
- A Landrush example configuration could look like this:
69
-
70
- Vagrant.configure("2") do |config|
71
- config.vm.box = "hashicorp/precise64"
72
-
73
- config.landrush.enabled = true
74
-
75
- config.vm.hostname = "myhost.vagrant.test"
76
-
77
- config.landrush.host 'static1.example.com', '1.2.3.4'
78
- config.landrush.host 'static2.example.com', '2.3.4.5'
79
- end
80
-
81
- <a name="dynamic-entries"></a>
82
- ### Dynamic entries
83
-
84
- Every time a VM is started, its IP address is automatically detected and a DNS record is created
85
- that maps the hostname to its IP. The detection works by listing all configured interfaces of the
86
- guest using [landrush-ip](https://rubygems.org/gems/landrush-ip/versions/0.2.3), picking the last
87
- valid IP found, while ignoring any excluded interfaces.
88
-
89
- Excluded interfaces are an array of regular expressions; the value shown here is the default used
90
- when no explicit value for `config.landrush.host_interface_excludes` is specified in your
91
- `Vagrantfile`:
92
-
93
- config.landrush.host_interface_excludes = [/lo[0-9]*/, /docker[0-9]+/, /tun[0-9]+/]
94
-
95
- If Landrush fails to detect the correct IP address (or none at all), you can extend this exclusion
96
- range to exclude more interfaces.
97
-
98
- If you need or want to select an interface explicitly and you know its name, you can also tell
99
- Landrush to grab that interface's IP address explicitly:
100
-
101
- config.landrush.host_interface = 'eth0'
102
-
103
- Do note that, if you specify an interface explicitly, it will have priority over
104
- `config.landrush.host_interface_excludes`. In other words, if `config.landrush.host_interface_excludes`
105
- is set to `[/eth[0-9]*/]`, but `config.landrush.host_interface` is set to `eth0` and `eth0` exists
106
- as an interface, the IP address of `eth0` is returned. The interface setting takes precedence over
107
- the exclude setting. If the interface does not exist, the regular heuristics will apply and Landrush
108
- will pick the last non-excluded IP found.
109
-
110
- If all else fails, you can override it entirely:
111
-
112
- config.landrush.host_ip_address = '1.2.3.4'
113
-
114
- This setting will override both the exclude and interface settings completely.
115
-
116
- If you are using a multi-machine `Vagrantfile`, configure this inside each of your `config.vm.define`
117
- sections.
118
-
119
- <a name="static-entries"></a>
120
- ### Static entries
121
-
122
- You can add static host entries to the DNS server in your `Vagrantfile` like so:
123
-
124
- config.landrush.host 'myhost.example.com', '1.2.3.4'
125
-
126
- This is great for overriding production services for nodes you might be testing locally. For example,
127
- perhaps you might want to override the hostname of your puppetmaster to point to a local vagrant box
128
- instead.
129
-
130
- <a name="wildcard-subdomains"></a>
131
- ### Wildcard Subdomains
132
-
133
- For your convenience, any subdomain of a DNS entry known to landrush will resolve to the same IP
134
- address as the entry. For example: given `myhost.vagrant.test -> 1.2.3.4`, both
135
- `foo.myhost.vagrant.test` and `bar.myhost.vagrant.test` will also resolve to `1.2.3.4`.
136
-
137
- If you would like to configure your guests to be accessible from the host as subdomains of something
138
- other than the default `vagrant.test`, you can use the `config.landrush.tld` option in your
139
- Vagrantfile like so:
140
-
141
- config.landrush.tld = 'vm'
142
-
143
- Note that from the __host__, you will only be able to access subdomains of your configured TLD by
144
- default- so wildcard subdomains only apply to that space. For the __guest__, wildcard subdomains
145
- work for anything.
146
-
147
- <a name="unmatched-queries"></a>
148
- ### Unmatched Queries
149
-
150
- Any DNS queries that do not match any of Landrush'es configuration data, will be passed
151
- through to an upstream DNS server. Per default Landrush uses Google's DNS server with the
152
- IP _8.8.8.8_.
153
-
154
- If you would like to configure your own upstream servers, add upstream entries to your
155
- `Vagrantfile` like so:
156
-
157
- config.landrush.upstream '10.1.1.10'
158
- # Set the port to 1001
159
- config.landrush.upstream '10.1.2.10', 1001
160
- # If your upstream is TCP only for some strange reason
161
- config.landrush.upstream '10.1.3.10', 1001, :tcp
162
-
163
- <a name="visibility-on-the-guest"></a>
164
- ### Visibility on the Guest
165
-
166
- Linux guests should automatically have their DNS traffic redirected via `iptables` rules to the
167
- Landrush DNS server. File an issue if this does not work for you.
168
-
169
- To disable this functionality:
170
-
171
- config.landrush.guest_redirect_dns = false
172
-
173
- You may want to do this if you are already proxying all your DNS requests through your host
174
- (e.g. using VirtualBox's natdnshostresolver1 option) and you
175
- have DNS servers that you can easily set as upstreams in the daemon (e.g. DNS requests that go
176
- through the host's VPN connection).
177
-
178
- <a name="visibility-on-the-host"></a>
179
- ### Visibility on the Host
180
-
181
- Visibility on the host means that the hostname of the VMs can be resolved on the host's DNS system.
182
- Landrush will attempt an automatic configuration of the host, but depending on the OS, manual
183
- configuration might be required as well.
184
-
185
- To disable this functionality:
186
-
187
- config.landrush.host_redirect_dns = false
188
-
189
- <a name="os-x"></a>
190
- #### OS X
191
-
192
- If you're on an OS X host, we use a nice trick to unobtrusively add a secondary DNS server only for
193
- specific domains. Landrush adds automatically during startup a file into `/etc/resolver`
194
- that points lookups for hostnames ending in your `config.landrush.tld` domain to its DNS server.
195
- (Check out `man 5 resolver` on your Mac OS X host for more information on this file's syntax.)
196
-
197
- <a name="linux"></a>
198
- #### Linux
199
-
200
- Landrush tries to achieve the same behavior on Linux hosts using
201
- `dnsmasq`. For some Linux distributions this happens automatically (you might
202
- have to provide your _sudo_ password). If Landrush does not know how to install and
203
- start `dnsmasq` on your favorite Linux distribution, you can adjust the following
204
- example from Ubuntu:
205
-
206
- sudo apt-get install -y resolvconf dnsmasq
207
- sudo sh -c 'echo "server=/vagrant.test/127.0.0.1#10053" > /etc/dnsmasq.d/vagrant-landrush'
208
- sudo service dnsmasq restart
209
-
210
- If you use a TLD other than the default `vagrant.test`, replace the TLD in the above instructions
211
- accordingly. Please be aware that anything ending in '.local' as TLD will not work because the
212
- `avahi` daemon reserves this TLD for its own uses.
213
-
214
- <a name="windows"></a>
215
- #### Windows
216
-
217
- On Windows a secondary DNS server can be configured via the properties of the
218
- network adapter used by the VM. Landrush will attempt to configure the adapter automatically
219
- during startup. If this fails, please follow the manual setup instructions below.
220
-
221
- It is recommended to use an elevated command prompt (command prompt with full administrator
222
- permissions), since admin privileges are needed to make the required changes. Landrush will
223
- try to elevate your prompt automatically, but this requires to spawn additional processes which in
224
- turn loose some potentially important log messages.
225
-
226
- In the following section manual network configuration is described using Windows 10 and
227
- VirtualBox.
228
-
229
- When running VirtualBox on Windows in combination with Landrush the Network
230
- Connections (`Control Panel\Network and Internet\Network Connections`) looks
231
- somewhat like this after a successful `vagrant up`:
232
-
233
- ![Network Connections](doc/img/network-connections.png "Network Connections")
234
-
235
- There will be at least one VirtualBox network adapter. There might be multiple
236
- depending on your configuration (number of networks configured) and how many VMs
237
- you have running, but you just need to modify one.
238
-
239
- In a first step you need to identify the VirtualBox network adapter used for the
240
- private network of your VM. Landrush requires a private network adapter to work
241
- and will create one in case you are not explicitly configuring one in your
242
- `Vagrantfile`.
243
-
244
- To quickly view the settings of each network adapter you can run the following
245
- command in a shell:
246
-
247
- netsh interface ip show config
248
-
249
- The output should look something like that:
250
-
251
- Configuration for interface "Ethernet0"
252
- DHCP enabled: Yes
253
- IP Address: 172.16.74.143
254
- Subnet Prefix: 172.16.74.0/24 (mask 255.255.255.0)
255
- Default Gateway: 172.16.74.2
256
- Gateway Metric: 0
257
- InterfaceMetric: 10
258
- DNS servers configured through DHCP: 172.16.74.2
259
- Register with which suffix: Primary only
260
- WINS servers configured through DHCP: 172.16.74.2
261
-
262
- Configuration for interface "VirtualBox Host-Only Network"
263
- DHCP enabled: No
264
- IP Address: 10.1.2.1
265
- Subnet Prefix: 10.1.2.0/24 (mask 255.255.255.0)
266
- InterfaceMetric: 10
267
- Statically Configured DNS Servers: None
268
- Register with which suffix: Primary only
269
- Statically Configured WINS Servers: None
270
-
271
-
272
- In our case we are interested in the `VirtualBox Host-Only Network` which
273
- has in this example the private network IP 10.1.2.1. If you don't have a static
274
- private network IP configured and you cannot determine the right adapter via
275
- the `netsh` output, ssh into the VM (`vagrant ssh`) and run `ifconfig` to view
276
- the network configuration of the VM.
277
-
278
- Once you identified the right network adapter run the following as Administrator
279
- (using the network adapter name of the adapter with the determined private
280
- network IP):
281
-
282
- netsh interface ipv4 add dnsserver "VirtualBox Host-Only Network" address=127.0.0.1 index=1
283
-
284
- This should be enough for Windows 10. On other Windows versions, you might have to
285
- also add your TLD to the DNS suffix list on the DNS Advanced TCP/IP Settings tab:
286
-
287
- ![Advanced TCP/IP Settings](doc/img/advanced-tcp-properties.png "Advanced TCP/IP Settings")
288
-
289
- <a name="other-devices-phone"></a>
290
- #### Other Devices (phone)
291
-
292
- You might want to resolve Landrush's DNS-entries on *additional* computing devices, like a mobile phone.
293
-
294
- Please refer to [/doc/proxy-mobile](/doc/proxy-mobile) for instructions.
295
-
296
- <a name="additional-cli-commands"></a>
297
- ### Additional CLI commands
298
-
299
- Check out `vagrant landrush` for additional commands to monitor the DNS server daemon.
300
-
301
-
302
- <a name="miscellaneous-tricks-and-tips"></a>
303
- ## Miscellaneous Tricks and Tips
304
-
305
- <a name="how-to-avoid-providing-sudo-password-on-os-x"></a>
306
- ### How to avoid providing sudo password on OS X
307
-
308
- When using Landrush on OS X, Landrush will try to create a file in `/etc/resolver` to make the guest
309
- VM visible via DNS on the host (see [OS X](#os-x) in the [visibility on host](#visibility-on-the-host)
310
- section). To create this file sudo permissions are needed and Landrush will ask you for your sudo
311
- password. This can be avoided by adding the following entries to the bottom of the sudoer
312
- configuration. Make sure to edit your `/etc/sudoers` configuration via `sudo visudo`:
313
-
314
- # Begin Landrush config
315
- Cmnd_Alias VAGRANT_LANDRUSH_HOST_MKDIR = /bin/mkdir /etc/resolver/*
316
- Cmnd_Alias VAGRANT_LANDRUSH_HOST_CP = /bin/cp /*/vagrant_landrush_host_config* /etc/resolver/*
317
- Cmnd_Alias VAGRANT_LANDRUSH_HOST_CHMOD = /bin/chmod 644 /etc/resolver/*
318
- %admin ALL=(ALL) NOPASSWD: VAGRANT_LANDRUSH_HOST_MKDIR, VAGRANT_LANDRUSH_HOST_CP, VAGRANT_LANDRUSH_HOST_CHMOD
319
- # End Landrush config
320
-
321
- <a name="guest-is-unable-to-access-the-internet"></a>
322
- ### Guest is unable to access the Internet
323
-
324
- In some network configuration the access to outside DNS servers is restricted
325
- (firewalls, VPN, etc). Since unmatched DNS queries are per default passed through to
326
- Google's DNS servers, this can lead to the fact that the guest cannot access anything
327
- in the outside world.
328
- If you are having problem with the guest's DNS, verify that you can access Google's
329
- DNS server under _8.8.8.8_. If it does not work, you will need to set a custom
330
- upstream DNS server. Check your network configuration on the host or ask your network
331
- administrator about the right DNS server address to use. You can set the custom
332
- DNS server via the _config.landrush.upstream_ option (see section about
333
- [unmatched queries](#unmatched-queries)).
334
-
335
- <a name="development"></a>
336
- ## Development
337
-
338
- The following should get you started to develop on the Landrush code base. As a prerequisite you
339
- will need a Ruby 2.0 environment. We recommend to use [RVM](https://rvm.io/) to create an isolated
340
- development environment. On Windows the [RubyInstaller for Windows](http://rubyinstaller.org/) is
341
- probably the easiest way to get started. In this case you will need the
342
- [DevKit](http://rubyinstaller.org/add-ons/devkit/) as well.
343
-
344
- Once you have a working Ruby environment it is time to
345
- [fork](https://help.github.com/articles/fork-a-repo/) the repository
346
- (refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide for more info].
347
-
348
- The following are the most important commands you will need for development:
349
-
350
- * Install [Bundler](http://bundler.io/):
351
-
352
- $ gem install bundler
353
-
354
- * Install dependencies:
355
-
356
- $ bundle install
357
-
358
- * Get a list of all available build tasks:
359
-
360
- $ bundle exec rake -T
361
-
362
- * Run the test suite:
363
-
364
- $ bundle exec rake test
365
-
366
- * Run a single test file:
367
-
368
- $ bundle exec rake test TEST=<path to test file>
369
-
370
- * Run cucumber/aruba acceptance tests:
371
-
372
- $ bundle exec rake features
373
-
374
- Note, that the acceptance tests currently only work out of the box on OS X.
375
- On Linux one has to manually configure the host visibility for the TLD
376
- _landrush-acceptance-test_. See for [Linux](#linux). On Windows the acceptance
377
- tests won't work due to a current bug in [Aruba](https://github.com/cucumber/aruba/issues/387).
378
-
379
- * Run a single cucumber/aruba acceptance tests:
380
-
381
- $ bundle exec rake features FEATURE=features/<feature-filename>.feature
382
-
383
- * Build the Landrush gem:
384
-
385
- $ bundle exec rake install
386
-
387
- * Clean all generated files:
388
-
389
- $ bundle exec rake clean clobber
390
-
391
- * Deploy to RubyGems:
392
-
393
- $ bundle exec rake release
394
-
395
- * Run the vagrant binary with the Landrush plugin loaded from your local source code:
396
-
397
- bundle exec vagrant landrush <command>
398
-
399
- <a name="help-out"></a>
400
- ## Help Out!
401
-
402
- This project could use your feedback and help! Please don't hesitate to open issues or submit pull
403
- requests. NO HESITATION IS ALLOWED. NONE WHATSOEVER. See [CONTRIBUTING.md](CONTRIBUTING.md) for
404
- more details.
405
-
406
- The Maintainers try to meet periodically. [Notes](NOTES.md) are available.