zimbra_intercepting_proxy 0.0.5 → 0.0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -0
- data/examples/monit_port_9072 +5 -0
- data/examples/monit_port_9080 +5 -0
- data/examples/zip_9072 +91 -0
- data/examples/zip_9080 +91 -0
- data/lib/zimbra_intercepting_proxy/version.rb +1 -1
- data/zimbra_intercepting_proxy.gemspec +8 -8
- metadata +42 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4dab756c5749832365c107c823527b66a59942f
|
4
|
+
data.tar.gz: fc62eba55d85e69649074997d344ffaf0a171c94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f70cc8b43c52aaa134795463506dd0befc6399d91d9391ce4465c28977a238cd3b47895b7aca9bb4235e9b7ed4113f91cf7c47b638da8557c242eeedfa46aa8
|
7
|
+
data.tar.gz: 17799246af63d35a07ef92dd6b9734ffc5898c291569f91ec64ff460d23c6ab48fa54f145b627b1c7c08c4ed5b74079f9ed628a67061b1a4b195ea04a6bf3280
|
data/README.md
CHANGED
@@ -51,6 +51,17 @@ It's recommended to install it on the same Zimbra Proxy server. All you need to
|
|
51
51
|
$ gem install zimbra_intercepting_proxy
|
52
52
|
```
|
53
53
|
|
54
|
+
### Zimbra Mailbox IP Whitelist
|
55
|
+
|
56
|
+
Since version 8, Zimbra has a DDoS protection system that blocks IP's address with many failed login connections. It's adviced by the [Zimbra Docs](https://wiki.zimbra.com/wiki/DoSFilter) to Whitelist the IP's address that you trust.
|
57
|
+
|
58
|
+
You have to do this on the `NEW_MAILBOX` to whitelist connections from the IP from where you are migrating
|
59
|
+
|
60
|
+
```bash
|
61
|
+
$ zmprov mcf +zimbraHttpThrottleSafeIPs NEW_MAILBOX_IP
|
62
|
+
$ zmmailboxdctl restart
|
63
|
+
```
|
64
|
+
|
54
65
|
### Zimbra Proxy Modification
|
55
66
|
|
56
67
|
**Important Note**
|
@@ -144,6 +155,25 @@ If you have an error in your file, `ZIP` will return the on memory Map, this way
|
|
144
155
|
ERROR Yaml File: (./test/fixtures/users.yml): could not find expected ':' while scanning a simple key at line 7
|
145
156
|
```
|
146
157
|
|
158
|
+
## Init scripts
|
159
|
+
|
160
|
+
In the `examples` directory you have the following files:
|
161
|
+
|
162
|
+
* `zip_9072`, to start the server on port 9072
|
163
|
+
* `zip_9080`, you know
|
164
|
+
|
165
|
+
Copy both files to the `/etc/init.d/` directory and then enable the services like this:
|
166
|
+
|
167
|
+
```bash
|
168
|
+
$ chkconfig --add zip_9072
|
169
|
+
$ chkconfig --add zip_9080
|
170
|
+
```
|
171
|
+
|
172
|
+
### Monit
|
173
|
+
It may be posible that `ZIP` crash for some reason, it's a new software after all. To reduce the down time we recomend to use [Monit](http://mmonit.com/monit/) to monitor and restart the `ZIP` in case of trouble.
|
174
|
+
|
175
|
+
Check the examples directory for config files.
|
176
|
+
|
147
177
|
## Thanks
|
148
178
|
|
149
179
|
* To the Zimbra folks for a great product, and
|
data/examples/zip_9072
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
### BEGIN INIT INFO
|
3
|
+
# Provides:
|
4
|
+
# Default-Start: 2 3 4 5
|
5
|
+
# Default-Stop: 0 1 6
|
6
|
+
# Short-Description: Start daemon at boot time
|
7
|
+
# Description: Enable service provided by daemon.
|
8
|
+
### END INIT INFO
|
9
|
+
|
10
|
+
dir=""
|
11
|
+
user=""
|
12
|
+
cmd="/usr/local/rbenv/shims/zimbra_intercepting_proxy -d ind.cl -f /opt/zimbra_preauth_router/users.yml -o 10.0.1.54 --newmailbox=190.196.215.125 -b 9072 --newmailboxlocalip=192.168.0. "
|
13
|
+
|
14
|
+
name=`basename $0`
|
15
|
+
pid_file="/var/run/$name.pid"
|
16
|
+
stdout_log="/var/log/$name.log"
|
17
|
+
stderr_log="/var/log/$name.err"
|
18
|
+
|
19
|
+
get_pid() {
|
20
|
+
cat "$pid_file"
|
21
|
+
}
|
22
|
+
|
23
|
+
is_running() {
|
24
|
+
[ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
|
25
|
+
}
|
26
|
+
|
27
|
+
case "$1" in
|
28
|
+
start)
|
29
|
+
if is_running; then
|
30
|
+
echo "Already started"
|
31
|
+
else
|
32
|
+
echo "Starting $name"
|
33
|
+
$cmd >> "$stdout_log" 2>> "$stderr_log" &
|
34
|
+
echo $! > "$pid_file"
|
35
|
+
if ! is_running; then
|
36
|
+
echo "Unable to start, see $stdout_log and $stderr_log"
|
37
|
+
exit 1
|
38
|
+
fi
|
39
|
+
fi
|
40
|
+
;;
|
41
|
+
stop)
|
42
|
+
if is_running; then
|
43
|
+
echo -n "Stopping $name.."
|
44
|
+
kill `get_pid`
|
45
|
+
for i in {1..10}
|
46
|
+
do
|
47
|
+
if ! is_running; then
|
48
|
+
break
|
49
|
+
fi
|
50
|
+
|
51
|
+
echo -n "."
|
52
|
+
sleep 1
|
53
|
+
done
|
54
|
+
echo
|
55
|
+
|
56
|
+
if is_running; then
|
57
|
+
echo "Not stopped; may still be shutting down or shutdown may have failed"
|
58
|
+
exit 1
|
59
|
+
else
|
60
|
+
echo "Stopped"
|
61
|
+
if [ -f "$pid_file" ]; then
|
62
|
+
rm "$pid_file"
|
63
|
+
fi
|
64
|
+
fi
|
65
|
+
else
|
66
|
+
echo "Not running"
|
67
|
+
fi
|
68
|
+
;;
|
69
|
+
restart)
|
70
|
+
$0 stop
|
71
|
+
if is_running; then
|
72
|
+
echo "Unable to stop, will not attempt to start"
|
73
|
+
exit 1
|
74
|
+
fi
|
75
|
+
$0 start
|
76
|
+
;;
|
77
|
+
status)
|
78
|
+
if is_running; then
|
79
|
+
echo "Running"
|
80
|
+
else
|
81
|
+
echo "Stopped"
|
82
|
+
exit 1
|
83
|
+
fi
|
84
|
+
;;
|
85
|
+
*)
|
86
|
+
echo "Usage: $0 {start|stop|restart|status}"
|
87
|
+
exit 1
|
88
|
+
;;
|
89
|
+
esac
|
90
|
+
|
91
|
+
exit 0
|
data/examples/zip_9080
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
### BEGIN INIT INFO
|
3
|
+
# Provides:
|
4
|
+
# Default-Start: 2 3 4 5
|
5
|
+
# Default-Stop: 0 1 6
|
6
|
+
# Short-Description: Start daemon at boot time
|
7
|
+
# Description: Enable service provided by daemon.
|
8
|
+
### END INIT INFO
|
9
|
+
|
10
|
+
dir=""
|
11
|
+
user=""
|
12
|
+
cmd="/usr/local/rbenv/shims/zimbra_intercepting_proxy zimbra_intercepting_proxy -d ind.cl -f /opt/zimbra_preauth_router/users.yml -o poseidon.ind.cl --newmailbox=190.196.215.125 -b 9080 --newmailboxlocalip=192.168.0. "
|
13
|
+
|
14
|
+
name=`basename $0`
|
15
|
+
pid_file="/var/run/$name.pid"
|
16
|
+
stdout_log="/var/log/$name.log"
|
17
|
+
stderr_log="/var/log/$name.err"
|
18
|
+
|
19
|
+
get_pid() {
|
20
|
+
cat "$pid_file"
|
21
|
+
}
|
22
|
+
|
23
|
+
is_running() {
|
24
|
+
[ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
|
25
|
+
}
|
26
|
+
|
27
|
+
case "$1" in
|
28
|
+
start)
|
29
|
+
if is_running; then
|
30
|
+
echo "Already started"
|
31
|
+
else
|
32
|
+
echo "Starting $name"
|
33
|
+
$cmd >> "$stdout_log" 2>> "$stderr_log" &
|
34
|
+
echo $! > "$pid_file"
|
35
|
+
if ! is_running; then
|
36
|
+
echo "Unable to start, see $stdout_log and $stderr_log"
|
37
|
+
exit 1
|
38
|
+
fi
|
39
|
+
fi
|
40
|
+
;;
|
41
|
+
stop)
|
42
|
+
if is_running; then
|
43
|
+
echo -n "Stopping $name.."
|
44
|
+
kill `get_pid`
|
45
|
+
for i in {1..10}
|
46
|
+
do
|
47
|
+
if ! is_running; then
|
48
|
+
break
|
49
|
+
fi
|
50
|
+
|
51
|
+
echo -n "."
|
52
|
+
sleep 1
|
53
|
+
done
|
54
|
+
echo
|
55
|
+
|
56
|
+
if is_running; then
|
57
|
+
echo "Not stopped; may still be shutting down or shutdown may have failed"
|
58
|
+
exit 1
|
59
|
+
else
|
60
|
+
echo "Stopped"
|
61
|
+
if [ -f "$pid_file" ]; then
|
62
|
+
rm "$pid_file"
|
63
|
+
fi
|
64
|
+
fi
|
65
|
+
else
|
66
|
+
echo "Not running"
|
67
|
+
fi
|
68
|
+
;;
|
69
|
+
restart)
|
70
|
+
$0 stop
|
71
|
+
if is_running; then
|
72
|
+
echo "Unable to stop, will not attempt to start"
|
73
|
+
exit 1
|
74
|
+
fi
|
75
|
+
$0 start
|
76
|
+
;;
|
77
|
+
status)
|
78
|
+
if is_running; then
|
79
|
+
echo "Running"
|
80
|
+
else
|
81
|
+
echo "Stopped"
|
82
|
+
exit 1
|
83
|
+
fi
|
84
|
+
;;
|
85
|
+
*)
|
86
|
+
echo "Usage: $0 {start|stop|restart|status}"
|
87
|
+
exit 1
|
88
|
+
;;
|
89
|
+
esac
|
90
|
+
|
91
|
+
exit 0
|
@@ -18,15 +18,15 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency 'em-proxy'
|
22
|
-
spec.add_dependency 'thor'
|
23
|
-
spec.add_dependency 'uuid'
|
24
|
-
spec.add_dependency 'http_parser.rb'
|
25
|
-
spec.add_dependency 'addressable'
|
26
|
-
spec.add_dependency 'xml-simple'
|
21
|
+
spec.add_dependency 'em-proxy', "~> 0.1.8"
|
22
|
+
spec.add_dependency 'thor', "~> 0.19"
|
23
|
+
spec.add_dependency 'uuid', "~> 2.3"
|
24
|
+
spec.add_dependency 'http_parser.rb', "~> 0.6"
|
25
|
+
spec.add_dependency 'addressable', "~> 2.3"
|
26
|
+
spec.add_dependency 'xml-simple', "~> 1.1"
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
27
28
|
|
28
|
-
|
29
|
-
spec.add_development_dependency "bundler", "~> 1.6"
|
29
|
+
|
30
30
|
spec.add_development_dependency "rake"
|
31
31
|
spec.add_development_dependency "minitest-reporters"
|
32
32
|
end
|
metadata
CHANGED
@@ -1,139 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zimbra_intercepting_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.5
|
4
|
+
version: 0.0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patricio Bruna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-proxy
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.1.8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.1.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '0.19'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '0.19'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: uuid
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.3'
|
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: '
|
54
|
+
version: '2.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: http_parser.rb
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.6'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.6'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: addressable
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.3'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: xml-simple
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '1.1'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '1.1'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
103
|
+
version: '1.9'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
110
|
+
version: '1.9'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: minitest-reporters
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
description: A HTTP intercepting Proxy for the Zimbra Proxy
|
@@ -144,12 +144,16 @@ executables:
|
|
144
144
|
extensions: []
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
|
-
-
|
147
|
+
- .gitignore
|
148
148
|
- Gemfile
|
149
149
|
- LICENSE.txt
|
150
150
|
- README.md
|
151
151
|
- Rakefile
|
152
152
|
- bin/zimbra_intercepting_proxy
|
153
|
+
- examples/monit_port_9072
|
154
|
+
- examples/monit_port_9080
|
155
|
+
- examples/zip_9072
|
156
|
+
- examples/zip_9080
|
153
157
|
- lib/zimbra_intercepting_proxy.rb
|
154
158
|
- lib/zimbra_intercepting_proxy/backend.rb
|
155
159
|
- lib/zimbra_intercepting_proxy/config.rb
|
@@ -180,17 +184,17 @@ require_paths:
|
|
180
184
|
- lib
|
181
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
182
186
|
requirements:
|
183
|
-
- -
|
187
|
+
- - '>='
|
184
188
|
- !ruby/object:Gem::Version
|
185
189
|
version: '0'
|
186
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
191
|
requirements:
|
188
|
-
- -
|
192
|
+
- - '>='
|
189
193
|
- !ruby/object:Gem::Version
|
190
194
|
version: '0'
|
191
195
|
requirements: []
|
192
196
|
rubyforge_project:
|
193
|
-
rubygems_version: 2.
|
197
|
+
rubygems_version: 2.4.6
|
194
198
|
signing_key:
|
195
199
|
specification_version: 4
|
196
200
|
summary: A HTTP intercepting Proxy for the Zimbra Proxy
|