capricorn 2.0.8 → 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/erlang/lib/capricorn/ebin/capricorn.app +2 -1
- data/erlang/lib/capricorn/include/capricorn.hrl +1 -0
- data/erlang/lib/capricorn/src/cap_cluster_gems.erl +6 -1
- data/erlang/lib/capricorn/src/cap_console_dispatcher.erl +214 -0
- data/erlang/lib/capricorn/src/cap_machine_apps.erl +25 -1
- data/erlang/lib/capricorn/src/cap_sup.erl +14 -0
- data/erlang/lib/ejson/Makefile +24 -0
- data/erlang/lib/ejson/ebin/ejson.app +9 -0
- data/erlang/lib/ejson/include/ejson.hrl +40 -0
- data/erlang/lib/ejson/rebar.config +3 -0
- data/erlang/lib/ejson/src/ejson.erl +22 -0
- data/erlang/lib/ejson/src/ejson_decode.erl +337 -0
- data/erlang/lib/ejson/src/ejson_encode.erl +124 -0
- data/erlang/lib/ejson/test/arrays.escript +47 -0
- data/erlang/lib/ejson/test/compound.escript +56 -0
- data/erlang/lib/ejson/test/literals.escript +30 -0
- data/erlang/lib/ejson/test/numbers.escript +70 -0
- data/erlang/lib/ejson/test/objects.escript +51 -0
- data/erlang/lib/ejson/test/strings.escript +49 -0
- data/erlang/lib/ejson/test/timing.escript +43 -0
- data/erlang/lib/ejson/test/timing.json +382 -0
- data/erlang/lib/ejson/vendor/mochijson2.erl +621 -0
- data/erlang/lib/ejson/vendor/rfc4627.erl +625 -0
- data/erlang/lib/misultin/LICENSE.txt +41 -0
- data/erlang/lib/misultin/Makefile +26 -0
- data/erlang/lib/misultin/README.txt +120 -0
- data/erlang/lib/misultin/ebin/misultin.app +9 -0
- data/erlang/lib/misultin/examples/misultin_compress.erl +43 -0
- data/erlang/lib/misultin/examples/misultin_echo.erl +58 -0
- data/erlang/lib/misultin/examples/misultin_file.erl +43 -0
- data/erlang/lib/misultin/examples/misultin_gen_server.erl +158 -0
- data/erlang/lib/misultin/examples/misultin_get_variable.erl +55 -0
- data/erlang/lib/misultin/examples/misultin_hello_world.erl +43 -0
- data/erlang/lib/misultin/examples/misultin_rest.erl +68 -0
- data/erlang/lib/misultin/examples/misultin_ssl.erl +51 -0
- data/erlang/lib/misultin/examples/misultin_stream.erl +55 -0
- data/erlang/lib/misultin/examples/misultin_websocket_event_example.erl +103 -0
- data/erlang/lib/misultin/examples/misultin_websocket_example.erl +95 -0
- data/erlang/lib/misultin/include/misultin.hrl +95 -0
- data/erlang/lib/misultin/make.bat +55 -0
- data/erlang/lib/misultin/priv/README.txt +12 -0
- data/erlang/lib/misultin/priv/test_certificate.pem +21 -0
- data/erlang/lib/misultin/priv/test_privkey.pem +18 -0
- data/erlang/lib/misultin/rebar.config +3 -0
- data/erlang/lib/misultin/src/misultin.app.src +9 -0
- data/erlang/lib/misultin/src/misultin.erl +338 -0
- data/erlang/lib/misultin/src/misultin_http.erl +488 -0
- data/erlang/lib/misultin/src/misultin_req.erl +280 -0
- data/erlang/lib/misultin/src/misultin_socket.erl +193 -0
- data/erlang/lib/misultin/src/misultin_utility.erl +357 -0
- data/erlang/lib/misultin/src/misultin_websocket.erl +252 -0
- data/erlang/lib/misultin/src/misultin_ws.erl +78 -0
- data/erlang/rebar.config +2 -0
- data/erlang/rel/overlay/etc/capricorn/app.config +4 -0
- data/erlang/rel/reltool.config +5 -0
- data/lib/capricorn/recipes/apache-debian.rb +1 -1
- data/lib/capricorn/recipes/centos-plesk.rb +1 -1
- data/lib/capricorn/recipes/debian-plesk95.rb +1 -2
- data/lib/capricorn/recipes/macports.rb +1 -1
- data/lib/capricorn/version.rb +1 -1
- metadata +51 -4
@@ -0,0 +1,78 @@
|
|
1
|
+
% ==========================================================================================================
|
2
|
+
% MISULTIN - Websocket Request
|
3
|
+
%
|
4
|
+
% >-|-|-(°>
|
5
|
+
%
|
6
|
+
% Copyright (C) 2010, Roberto Ostinelli <roberto@ostinelli.net>.
|
7
|
+
% All rights reserved.
|
8
|
+
%
|
9
|
+
% BSD License
|
10
|
+
%
|
11
|
+
% Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
12
|
+
% that the following conditions are met:
|
13
|
+
%
|
14
|
+
% * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
15
|
+
% following disclaimer.
|
16
|
+
% * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
17
|
+
% the following disclaimer in the documentation and/or other materials provided with the distribution.
|
18
|
+
% * Neither the name of the authors nor the names of its contributors may be used to endorse or promote
|
19
|
+
% products derived from this software without specific prior written permission.
|
20
|
+
%
|
21
|
+
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
22
|
+
% WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
23
|
+
% PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
24
|
+
% ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
25
|
+
% TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
26
|
+
% HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
27
|
+
% NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28
|
+
% POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
% ==========================================================================================================
|
30
|
+
-module(misultin_ws, [Ws, SocketPid]).
|
31
|
+
-vsn("0.6.1").
|
32
|
+
|
33
|
+
% API
|
34
|
+
-export([raw/0, get/1, send/1]).
|
35
|
+
|
36
|
+
% includes
|
37
|
+
-include("../include/misultin.hrl").
|
38
|
+
|
39
|
+
|
40
|
+
% ============================ \/ API ======================================================================
|
41
|
+
|
42
|
+
% Description: Returns raw websocket content.
|
43
|
+
raw() ->
|
44
|
+
Ws.
|
45
|
+
|
46
|
+
% Description: Get websocket info.
|
47
|
+
get(socket) ->
|
48
|
+
Ws#ws.socket;
|
49
|
+
get(socket_mode) ->
|
50
|
+
Ws#req.socket_mode;
|
51
|
+
get(peer_addr) ->
|
52
|
+
Ws#ws.peer_addr;
|
53
|
+
get(peer_port) ->
|
54
|
+
Ws#ws.peer_port;
|
55
|
+
get(peer_cert) ->
|
56
|
+
Ws#ws.peer_cert;
|
57
|
+
get(vsn) ->
|
58
|
+
Ws#ws.vsn;
|
59
|
+
get(origin) ->
|
60
|
+
Ws#ws.origin;
|
61
|
+
get(host) ->
|
62
|
+
Ws#ws.host;
|
63
|
+
get(path) ->
|
64
|
+
Ws#ws.path;
|
65
|
+
get(headers) ->
|
66
|
+
Ws#ws.headers.
|
67
|
+
|
68
|
+
% send data
|
69
|
+
send(Data) ->
|
70
|
+
SocketPid ! {send, Data}.
|
71
|
+
|
72
|
+
% ============================ /\ API ======================================================================
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
% ============================ \/ INTERNAL FUNCTIONS =======================================================
|
77
|
+
|
78
|
+
% ============================ /\ INTERNAL FUNCTIONS =======================================================
|
data/erlang/rebar.config
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
{cluster, [
|
6
6
|
{database, "var/run/capricorn-cluster"},
|
7
|
+
|
8
|
+
{console_port, 8756},
|
7
9
|
|
8
10
|
{api, [
|
9
11
|
% {stats, cap_service_stats}
|
@@ -21,6 +23,8 @@
|
|
21
23
|
{machine, [
|
22
24
|
% location of the cluster node
|
23
25
|
{cluster, 'cluster@127.0.0.1'},
|
26
|
+
|
27
|
+
{console_port, 8757},
|
24
28
|
|
25
29
|
% path to gem repo
|
26
30
|
{gems_path, "/opt/local/lib/ruby/gems/1.8"},
|
data/erlang/rel/reltool.config
CHANGED
@@ -5,10 +5,13 @@
|
|
5
5
|
stdlib,
|
6
6
|
sasl,
|
7
7
|
inets,
|
8
|
+
|
8
9
|
bert,
|
9
10
|
bertio,
|
10
11
|
bertrpc,
|
11
12
|
emq,
|
13
|
+
ejson,
|
14
|
+
misultin,
|
12
15
|
capricorn,
|
13
16
|
|
14
17
|
reltool,
|
@@ -23,6 +26,8 @@
|
|
23
26
|
{app, bertio, [{incl_cond, include}]},
|
24
27
|
{app, bertrpc, [{incl_cond, include}]},
|
25
28
|
{app, emq, [{incl_cond, include}]},
|
29
|
+
{app, ejson, [{incl_cond, include}]},
|
30
|
+
{app, misultin, [{incl_cond, include}]},
|
26
31
|
{app, capricorn, [{incl_cond, include}]},
|
27
32
|
{app, sasl, [{incl_cond, include}]},
|
28
33
|
{app, reltool, [{incl_cond, include}]},
|
@@ -21,7 +21,7 @@ has_db = application_root['shared/settings/database.yml'].exists?
|
|
21
21
|
if application_root['host/'].exists?
|
22
22
|
application_root.bash %{ mv host host-#{Time.now.strftime('%Y%m%d%H%M%S')} }
|
23
23
|
end
|
24
|
-
application_root.bash %{ milkshake create
|
24
|
+
application_root.bash %{ milkshake create:host "host" --git-data --shared-data "shared" }
|
25
25
|
|
26
26
|
unless has_db
|
27
27
|
###############################################################################
|
@@ -78,7 +78,7 @@ has_db = application_root['shared/settings/database.yml'].exists?
|
|
78
78
|
if application_root['host/'].exists?
|
79
79
|
application_root.bash %{ mv host host-#{Time.now.strftime('%Y%m%d%H%M%S')} }
|
80
80
|
end
|
81
|
-
application_root.bash %{ milkshake create
|
81
|
+
application_root.bash %{ milkshake create:host "host" --git-data --shared-data "shared" }
|
82
82
|
|
83
83
|
unless has_db
|
84
84
|
###############################################################################
|
@@ -79,7 +79,7 @@ has_db = application_root['shared/settings/database.yml'].exists?
|
|
79
79
|
if application_root['host/'].exists?
|
80
80
|
application_root.bash %{ mv host host-#{Time.now.strftime('%Y%m%d%H%M%S')} }
|
81
81
|
end
|
82
|
-
application_root.bash %{ milkshake create
|
82
|
+
application_root.bash %{ milkshake create:host "host" --git-data --shared-data "shared" }
|
83
83
|
|
84
84
|
unless has_db
|
85
85
|
###############################################################################
|
@@ -103,7 +103,6 @@ unless has_db
|
|
103
103
|
password: #{db_pswd}
|
104
104
|
host: localhost
|
105
105
|
encoding: utf8
|
106
|
-
socket: /var/lib/mysql/mysql.sock
|
107
106
|
|
108
107
|
development:
|
109
108
|
<<: *default
|
@@ -13,7 +13,7 @@ application_root = capricorn_root[application[:id]+'/'].create
|
|
13
13
|
if application_root['host/'].exists?
|
14
14
|
application_root.bash %{ rm -rf host }
|
15
15
|
end
|
16
|
-
application_root.bash %{ milkshake create
|
16
|
+
application_root.bash %{ milkshake create:host "host" --git-data --shared-data "shared" }
|
17
17
|
capricorn_root.bash %{ chown -R #{username}:staff "#{application_root.full_path}" }
|
18
18
|
|
19
19
|
# create the vhost
|
data/lib/capricorn/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capricorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 9
|
10
|
+
version: 2.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Simon Menke
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-09-24 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -169,6 +169,7 @@ files:
|
|
169
169
|
- erlang/lib/capricorn/src/cap_cluster.erl
|
170
170
|
- erlang/lib/capricorn/src/cap_cluster_gems.erl
|
171
171
|
- erlang/lib/capricorn/src/cap_config.erl
|
172
|
+
- erlang/lib/capricorn/src/cap_console_dispatcher.erl
|
172
173
|
- erlang/lib/capricorn/src/cap_dets_updater.erl
|
173
174
|
- erlang/lib/capricorn/src/cap_event_sup.erl
|
174
175
|
- erlang/lib/capricorn/src/cap_events.erl
|
@@ -189,6 +190,23 @@ files:
|
|
189
190
|
- erlang/lib/capricorn/src/cap_util.erl
|
190
191
|
- erlang/lib/capricorn/src/capricorn.erl
|
191
192
|
- erlang/lib/capricorn/src/capricorn_app.erl
|
193
|
+
- erlang/lib/ejson/ebin/ejson.app
|
194
|
+
- erlang/lib/ejson/include/ejson.hrl
|
195
|
+
- erlang/lib/ejson/Makefile
|
196
|
+
- erlang/lib/ejson/rebar.config
|
197
|
+
- erlang/lib/ejson/src/ejson.erl
|
198
|
+
- erlang/lib/ejson/src/ejson_decode.erl
|
199
|
+
- erlang/lib/ejson/src/ejson_encode.erl
|
200
|
+
- erlang/lib/ejson/test/arrays.escript
|
201
|
+
- erlang/lib/ejson/test/compound.escript
|
202
|
+
- erlang/lib/ejson/test/literals.escript
|
203
|
+
- erlang/lib/ejson/test/numbers.escript
|
204
|
+
- erlang/lib/ejson/test/objects.escript
|
205
|
+
- erlang/lib/ejson/test/strings.escript
|
206
|
+
- erlang/lib/ejson/test/timing.escript
|
207
|
+
- erlang/lib/ejson/test/timing.json
|
208
|
+
- erlang/lib/ejson/vendor/mochijson2.erl
|
209
|
+
- erlang/lib/ejson/vendor/rfc4627.erl
|
192
210
|
- erlang/lib/emq/ebin/emq.app
|
193
211
|
- erlang/lib/emq/src/emq.erl
|
194
212
|
- erlang/lib/emq/src/emq_app.erl
|
@@ -196,6 +214,35 @@ files:
|
|
196
214
|
- erlang/lib/emq/src/emq_queue.erl
|
197
215
|
- erlang/lib/emq/src/emq_status.erl
|
198
216
|
- erlang/lib/emq/src/emq_sup.erl
|
217
|
+
- erlang/lib/misultin/ebin/misultin.app
|
218
|
+
- erlang/lib/misultin/examples/misultin_compress.erl
|
219
|
+
- erlang/lib/misultin/examples/misultin_echo.erl
|
220
|
+
- erlang/lib/misultin/examples/misultin_file.erl
|
221
|
+
- erlang/lib/misultin/examples/misultin_gen_server.erl
|
222
|
+
- erlang/lib/misultin/examples/misultin_get_variable.erl
|
223
|
+
- erlang/lib/misultin/examples/misultin_hello_world.erl
|
224
|
+
- erlang/lib/misultin/examples/misultin_rest.erl
|
225
|
+
- erlang/lib/misultin/examples/misultin_ssl.erl
|
226
|
+
- erlang/lib/misultin/examples/misultin_stream.erl
|
227
|
+
- erlang/lib/misultin/examples/misultin_websocket_event_example.erl
|
228
|
+
- erlang/lib/misultin/examples/misultin_websocket_example.erl
|
229
|
+
- erlang/lib/misultin/include/misultin.hrl
|
230
|
+
- erlang/lib/misultin/LICENSE.txt
|
231
|
+
- erlang/lib/misultin/make.bat
|
232
|
+
- erlang/lib/misultin/Makefile
|
233
|
+
- erlang/lib/misultin/priv/README.txt
|
234
|
+
- erlang/lib/misultin/priv/test_certificate.pem
|
235
|
+
- erlang/lib/misultin/priv/test_privkey.pem
|
236
|
+
- erlang/lib/misultin/README.txt
|
237
|
+
- erlang/lib/misultin/rebar.config
|
238
|
+
- erlang/lib/misultin/src/misultin.app.src
|
239
|
+
- erlang/lib/misultin/src/misultin.erl
|
240
|
+
- erlang/lib/misultin/src/misultin_http.erl
|
241
|
+
- erlang/lib/misultin/src/misultin_req.erl
|
242
|
+
- erlang/lib/misultin/src/misultin_socket.erl
|
243
|
+
- erlang/lib/misultin/src/misultin_utility.erl
|
244
|
+
- erlang/lib/misultin/src/misultin_websocket.erl
|
245
|
+
- erlang/lib/misultin/src/misultin_ws.erl
|
199
246
|
- erlang/rebar
|
200
247
|
- erlang/rebar.config
|
201
248
|
- erlang/rel/overlay/bin/capricornd
|