sheepsafe 0.2.8 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/lib/sheepsafe/controller.rb +4 -4
- data/lib/sheepsafe.rb +1 -1
- data/sheepsafe.gemspec +2 -2
- data/spec/sheepsafe_spec.rb +3 -1
- metadata +5 -5
data/History.txt
CHANGED
data/lib/sheepsafe/controller.rb
CHANGED
@@ -40,12 +40,13 @@ module Sheepsafe
|
|
40
40
|
return
|
41
41
|
end
|
42
42
|
|
43
|
+
# Always recycle the proxy server on network changes
|
44
|
+
bring_socks_proxy 'down'
|
43
45
|
if network_up?
|
44
46
|
if network_changed?
|
45
47
|
if switch_to_trusted?
|
46
48
|
notify_ok "Switching to #{@config.trusted_location} location"
|
47
49
|
system "scselect #{@config.trusted_location}"
|
48
|
-
bring_socks_proxy 'down'
|
49
50
|
elsif switch_to_untrusted?
|
50
51
|
notified = false
|
51
52
|
loop do
|
@@ -63,8 +64,7 @@ module Sheepsafe
|
|
63
64
|
@config.last_network = @network
|
64
65
|
@config.write
|
65
66
|
elsif !@network.trustworthy?
|
66
|
-
|
67
|
-
bring_socks_proxy 'restart'
|
67
|
+
bring_socks_proxy 'up'
|
68
68
|
end
|
69
69
|
else
|
70
70
|
log("AirPort is off")
|
@@ -102,7 +102,7 @@ module Sheepsafe
|
|
102
102
|
Process.kill("TERM", pid)
|
103
103
|
exit 0
|
104
104
|
end
|
105
|
-
sleep
|
105
|
+
sleep 5 # wait a bit before starting proxy
|
106
106
|
exit_count = 0
|
107
107
|
ssh_command = "ssh #{@config.ssh_args}"
|
108
108
|
loop do
|
data/lib/sheepsafe.rb
CHANGED
data/sheepsafe.gemspec
CHANGED
data/spec/sheepsafe_spec.rb
CHANGED
@@ -58,7 +58,8 @@ describe Sheepsafe::Controller do
|
|
58
58
|
|
59
59
|
it "recycles the proxy server process when on the untrusted network" do
|
60
60
|
network.stub :trustworthy? => false
|
61
|
-
controller.should_receive(:bring_socks_proxy).with('
|
61
|
+
controller.should_receive(:bring_socks_proxy).with('down')
|
62
|
+
controller.should_receive(:bring_socks_proxy).with('up')
|
62
63
|
controller.run
|
63
64
|
end
|
64
65
|
end
|
@@ -97,6 +98,7 @@ describe Sheepsafe::Controller do
|
|
97
98
|
controller.should_receive(:switch_to_untrusted?).and_return true
|
98
99
|
controller.should_receive(:open).and_return("596")
|
99
100
|
controller.should_receive(:system).with("scselect untrusted_location")
|
101
|
+
controller.should_receive(:bring_socks_proxy).with('down')
|
100
102
|
controller.should_receive(:bring_socks_proxy).with('up')
|
101
103
|
controller.run
|
102
104
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sheepsafe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nick Sieger
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-14 00:00:00 -05:00
|
19
19
|
default_executable: sheepsafe
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|