landrush 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +12 -178
- data/.travis.yml +6 -1
- data/CHANGELOG.md +18 -1
- data/CONTRIBUTING.adoc +112 -0
- data/Gemfile +6 -9
- data/Guardfile +10 -0
- data/README.adoc +100 -0
- data/Rakefile +14 -2
- data/appveyor.yml +20 -0
- data/doc/Development.adoc +112 -0
- data/doc/ProxyMobile.adoc +66 -0
- data/doc/Troubleshooting.adoc +42 -0
- data/doc/Usage.adoc +271 -0
- data/features/commands.feature +35 -0
- data/features/dns_resolution.feature +6 -5
- data/features/{landrush-ip.feature → landrush_ip.feature} +0 -0
- data/features/step_definitions/landrush_custom_steps.rb +48 -0
- data/features/support/env.rb +25 -1
- data/landrush.gemspec +3 -3
- data/lib/landrush/action/common.rb +3 -11
- data/lib/landrush/action/install_prerequisites.rb +2 -3
- data/lib/landrush/action/redirect_dns.rb +1 -1
- data/lib/landrush/action/setup.rb +25 -30
- data/lib/landrush/action/teardown.rb +8 -11
- data/lib/landrush/cap/guest/all/read_host_visible_ip_address.rb +28 -4
- data/lib/landrush/cap/guest/linux/add_iptables_rule.rb +1 -1
- data/lib/landrush/cap/guest/linux/redirect_dns.rb +2 -2
- data/lib/landrush/cap/guest/suse/add_iptables_rule.rb +20 -0
- data/lib/landrush/cap/guest/suse/install_iptables.rb +14 -0
- data/lib/landrush/cap/guest/suse/iptables_installed.rb +11 -0
- data/lib/landrush/cap/host/suse/dnsmasq_installed.rb +11 -0
- data/lib/landrush/cap/host/suse/install_dnsmasq.rb +14 -0
- data/lib/landrush/cap/host/suse/restart_dnsmasq.rb +21 -0
- data/lib/landrush/cap/host/windows/configure_visibility_on_host.rb +1 -1
- data/lib/landrush/command.rb +42 -17
- data/lib/landrush/config.rb +29 -14
- data/lib/landrush/plugin.rb +30 -0
- data/lib/landrush/server.rb +96 -138
- data/lib/landrush/start_server.rb +11 -0
- data/lib/landrush/store.rb +6 -2
- data/lib/landrush/util/path.rb +32 -0
- data/lib/landrush/util/process_helper.rb +46 -0
- data/lib/landrush/util/retry.rb +2 -2
- data/lib/landrush/version.rb +1 -1
- data/test/landrush/action/setup_test.rb +19 -25
- data/test/landrush/action/teardown_test.rb +18 -15
- data/test/landrush/cap/guest/all/read_host_visible_ip_address_test.rb +35 -1
- data/test/landrush/cap/guest/linux/configured_dns_servers_test.rb +8 -8
- data/test/landrush/cap/guest/linux/redirect_dns_test.rb +4 -4
- data/test/landrush/config_test.rb +23 -2
- data/test/landrush/dependent_vms_test.rb +5 -5
- data/test/landrush/issues/255.rb +115 -0
- data/test/landrush/server_test.rb +22 -4
- data/test/landrush/store_test.rb +28 -13
- data/test/support/test_server_daemon.rb +2 -4
- data/test/test_helper.rb +37 -14
- metadata +30 -15
- data/CONTRIBUTING.md +0 -103
- data/NOTES.md +0 -28
- data/README.md +0 -406
- data/doc/proxy-mobile/README.md +0 -50
- data/features/step_definitions/dns.rb +0 -19
- data/features/step_definitions/ip.rb +0 -13
data/doc/proxy-mobile/README.md
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
# Resolve Landrush-entries on a mobile device
|
2
|
-
|
3
|
-
For your mobile phone to access VM-hosts two conditions need to be met:
|
4
|
-
- Your VM *needs to be accessible* from the network your phone's on (configure a [public network](http://docs.vagrantup.com/v2/networking/public_network.html)).
|
5
|
-
- The phone should query Landrush to resolve DNS entries.
|
6
|
-
|
7
|
-
Most smartphones allow you to configure a custom DNS server (instructions further below).
|
8
|
-
But unfortunately some don't allow you to configure a DNS server running on port 10053.
|
9
|
-
|
10
|
-
To work around that one can proxy queries to the default port 53 with a system-wide DNS server to Landrush.
|
11
|
-
|
12
|
-
## Proxy bind to your landrush server
|
13
|
-
The DNS-server `bind` can be installed with [homebrew](http://brew.sh/) on OS X.
|
14
|
-
|
15
|
-
In its configuration file forward all queries to your local Landrush and disable caching:
|
16
|
-
|
17
|
-
options {
|
18
|
-
directory "/usr/local/var/named";
|
19
|
-
|
20
|
-
forwarders {
|
21
|
-
127.0.0.1 port 10053;
|
22
|
-
};
|
23
|
-
|
24
|
-
max-cache-ttl 0;
|
25
|
-
max-ncache-ttl 0;
|
26
|
-
};
|
27
|
-
|
28
|
-
|
29
|
-
After restarting bind you should be able to resolve your VM's entries on your local default DNS server (port 53):
|
30
|
-
|
31
|
-
$ dig -p 53 @localhost myhost.vagrant.test
|
32
|
-
|
33
|
-
## Configure DNS server on your mobile phone
|
34
|
-
Set your bind server's IP address as the DNS server on your external device.
|
35
|
-
|
36
|
-
**How to set the DNS server on iOS:**
|
37
|
-
|
38
|
-
1. Open *Settings* > *Wi-Fi*
|
39
|
-
2. Tap the *i*-icon next to your network
|
40
|
-
3. Tap the *DNS*-row and edit the value
|
41
|
-
|
42
|
-
**How to set the DNS server on Android:**
|
43
|
-
|
44
|
-
1. Open *Settings* > *Wi-Fi*
|
45
|
-
2. Tap and hold your network, then chose *Modify network*
|
46
|
-
3. Check *Show advanced options*
|
47
|
-
4. Under *IP Settings* tap *DHCP / Static* and change the value to *Static*
|
48
|
-
5. Change the *DNS 1* value and tap *Save*
|
49
|
-
|
50
|
-
Or use the [Dns Changer](https://play.google.com/store/apps/details?id=net.emrekoc.dnschanger) application.
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'landrush/server'
|
2
|
-
|
3
|
-
Then(/^the hostname "([^"]+)" should resolve to "([^"]+)" on the internal DNS server$/) do |host, ip|
|
4
|
-
port = Landrush::Server.port
|
5
|
-
resolver = Resolv::DNS.new(:nameserver_port => [['localhost', port]], :search => ['local'], :ndots => 1)
|
6
|
-
ip_resolved = resolver.getaddress(host).to_s
|
7
|
-
expect(ip_resolved).to eq(ip)
|
8
|
-
end
|
9
|
-
|
10
|
-
Then(/^the hostname "([^"]+)" should resolve to "([^"]+)" on the host$/) do |host, ip|
|
11
|
-
addrinfo = Addrinfo.getaddrinfo(host, nil, Socket::AF_INET)
|
12
|
-
ip_resolved = addrinfo.first.ip_address
|
13
|
-
expect(ip_resolved).to eq(ip)
|
14
|
-
end
|
15
|
-
|
16
|
-
Then(/^the hostname "([^"]+)" should resolve to "([^"]+)" on the guest/) do |host, ip|
|
17
|
-
run("vagrant ssh -c \"dig +short '#{host}' A\"")
|
18
|
-
expect(last_command_started).to have_output(/^#{ip}$/)
|
19
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'landrush/server'
|
2
|
-
|
3
|
-
Then(/^the host visible IP address of the guest is the IP of interface "([^"]+)"/) do |interface|
|
4
|
-
cmd = "vagrant ssh -c \"ip addr list #{interface} | grep 'inet ' | cut -d' ' -f6| cut -d/ -f1\""
|
5
|
-
run(cmd)
|
6
|
-
expect(last_command_started).to have_output(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)
|
7
|
-
|
8
|
-
ip = last_command_started.output.split("\n").last
|
9
|
-
|
10
|
-
run('vagrant landrush list')
|
11
|
-
|
12
|
-
expect(last_command_started).to have_output(/#{ip}$/)
|
13
|
-
end
|