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
@@ -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