meroku 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -5
- data/bin/meroku +1 -1
- data/circle.yml +23 -0
- data/frontend/Gemfile +5 -2
- data/frontend/Gemfile.lock +5 -2
- data/frontend/app/controllers/application_controller.rb +1 -0
- data/frontend/app/controllers/apps_controller.rb +46 -48
- data/frontend/app/controllers/publickeys_controller.rb +45 -46
- data/frontend/app/controllers/users/registrations_controller.rb +0 -15
- data/frontend/app/controllers/users/sessions_controller.rb +12 -3
- data/frontend/app/lib/cmd.rb +11 -0
- data/frontend/app/models/app.rb +18 -11
- data/frontend/app/models/publickey.rb +1 -1
- data/frontend/app/models/user.rb +5 -4
- data/frontend/app/policies/application_policy.rb +53 -0
- data/frontend/app/policies/publickey_policy.rb +7 -0
- data/frontend/app/serializable/serializable_user.rb +2 -1
- data/frontend/app/views/layouts/application.html.erb +1 -1
- data/frontend/config/database.yml +72 -10
- data/frontend/config/routes.rb +6 -14
- data/frontend/db/migrate/20171028150506_add_apisecret_to_users.rb +6 -0
- data/frontend/etc_nginx_sites-enabled_default +1 -1
- data/frontend/public/Meroku.html +140 -0
- data/frontend/public/Meroku/Api.html +129 -0
- data/frontend/public/Meroku/Api/Request.html +221 -0
- data/frontend/public/Meroku/Aws.html +212 -0
- data/frontend/public/Meroku/Aws/Ec2.html +477 -0
- data/frontend/public/Meroku/CLI.html +784 -0
- data/frontend/public/Meroku/CLI/AdminUser.html +192 -0
- data/frontend/public/Meroku/CLI/Help.html +224 -0
- data/frontend/public/Meroku/CLI/Secrets.html +191 -0
- data/frontend/public/Meroku/CLI/Session.html +460 -0
- data/frontend/public/Meroku/CLI/User.html +182 -0
- data/frontend/public/Meroku/Extensions.html +405 -0
- data/frontend/public/Meroku/Infrastructure.html +279 -0
- data/frontend/public/Meroku/Infrastructure/Node.html +785 -0
- data/frontend/public/Meroku/Infrastructure/Server.html +373 -0
- data/frontend/public/Meroku/Node.html +845 -0
- data/frontend/public/Meroku/Tunnel.html +701 -0
- data/frontend/public/Meroku/Tunnelable.html +243 -0
- data/frontend/public/_index.html +273 -0
- data/frontend/public/class_list.html +51 -0
- data/frontend/public/css/common.css +1 -0
- data/frontend/public/css/full_list.css +58 -0
- data/frontend/public/css/style.css +492 -0
- data/frontend/public/file.README.html +181 -0
- data/frontend/public/file_list.html +56 -0
- data/frontend/public/frames.html +17 -0
- data/frontend/public/index.html +181 -0
- data/frontend/public/js/app.js +248 -0
- data/frontend/public/js/full_list.js +216 -0
- data/frontend/public/js/jquery.js +4 -0
- data/frontend/public/method_list.html +395 -0
- data/frontend/public/robots.txt +2 -1
- data/frontend/public/top-level-namespace.html +110 -0
- data/frontend/test/policies/publickey_policy_test.rb +19 -0
- data/lib/meroku.rb +9 -7
- data/lib/meroku/api.rb +8 -0
- data/lib/meroku/api/request.rb +17 -0
- data/lib/meroku/aws.rb +14 -0
- data/lib/meroku/aws/ec2.rb +59 -0
- data/lib/meroku/cli.rb +80 -81
- data/lib/meroku/cli/help.rb +27 -0
- data/lib/meroku/cli/secrets.rb +13 -0
- data/lib/meroku/cli/session.rb +32 -51
- data/lib/meroku/extensions.rb +32 -0
- data/lib/meroku/infrastructure.rb +14 -17
- data/lib/meroku/infrastructure/server.rb +20 -0
- data/lib/meroku/node.rb +113 -0
- data/lib/meroku/tunnelable.rb +31 -0
- data/lib/meroku/version.rb +1 -1
- data/modified-cedar-14.sh +0 -4
- metadata +50 -9
- data/frontend/app/controllers/pages_controller.rb +0 -4
- data/frontend/app/views/pages/landing.html.erb +0 -2
- data/frontend/db/migrate/20171025193627_add_token_to_users.rb +0 -5
- data/lib/meroku/cli/admin_user.rb +0 -20
- data/lib/meroku/cli/user.rb +0 -14
- data/lib/meroku/infrastructure/node.rb +0 -102
- data/lib/meroku/tunnel.rb +0 -56
@@ -0,0 +1,373 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Meroku::Infrastructure::Server
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Meroku::Infrastructure::Server";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (S)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Meroku.html" title="Meroku (module)">Meroku</a></span></span> » <span class='title'><span class='object_link'><a href="../Infrastructure.html" title="Meroku::Infrastructure (module)">Infrastructure</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Server</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Meroku::Infrastructure::Server
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Meroku::Infrastructure::Server</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<dl>
|
91
|
+
<dt>Includes:</dt>
|
92
|
+
<dd><span class='object_link'><a href="../Aws/Ec2.html" title="Meroku::Aws::Ec2 (module)">Aws::Ec2</a></span></dd>
|
93
|
+
</dl>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dl>
|
101
|
+
<dt>Defined in:</dt>
|
102
|
+
<dd>lib/meroku/infrastructure/server.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
108
|
+
<div class="discussion">
|
109
|
+
|
110
|
+
<p>A server hosts the api (called during signup, login, etc) and atm also
|
111
|
+
hosts end users applications</p>
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="tags">
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
124
|
+
<ul class="summary">
|
125
|
+
|
126
|
+
<li class="public ">
|
127
|
+
<span class="summary_signature">
|
128
|
+
|
129
|
+
<a href="#instance_id-instance_method" title="#instance_id (instance method)">#<strong>instance_id</strong> ⇒ Object </a>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
</span>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
<span class="note title readonly">readonly</span>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<span class="summary_desc"><div class='inline'>
|
149
|
+
<p>Returns the value of attribute instance_id.</p>
|
150
|
+
</div></span>
|
151
|
+
|
152
|
+
</li>
|
153
|
+
|
154
|
+
|
155
|
+
</ul>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<h2>
|
162
|
+
Instance Method Summary
|
163
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
164
|
+
</h2>
|
165
|
+
|
166
|
+
<ul class="summary">
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(instance_id) ⇒ Server </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
<span class="note title constructor">constructor</span>
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<span class="summary_desc"><div class='inline'>
|
188
|
+
<p>A new instance of Server.</p>
|
189
|
+
</div></span>
|
190
|
+
|
191
|
+
</li>
|
192
|
+
|
193
|
+
|
194
|
+
<li class="public ">
|
195
|
+
<span class="summary_signature">
|
196
|
+
|
197
|
+
<a href="#shutdown-instance_method" title="#shutdown (instance method)">#<strong>shutdown</strong> ⇒ Object </a>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
</span>
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
212
|
+
|
213
|
+
</li>
|
214
|
+
|
215
|
+
|
216
|
+
</ul>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Aws/Ec2.html" title="Meroku::Aws::Ec2 (module)">Aws::Ec2</a></span></h3>
|
229
|
+
<p class="inherited"><span class='object_link'><a href="../Aws/Ec2.html#associate_address-class_method" title="Meroku::Aws::Ec2.associate_address (method)">associate_address</a></span>, <span class='object_link'><a href="../Aws/Ec2.html#ec2_client-instance_method" title="Meroku::Aws::Ec2#ec2_client (method)">#ec2_client</a></span>, <span class='object_link'><a href="../Aws/Ec2.html#ec2_client-class_method" title="Meroku::Aws::Ec2.ec2_client (method)">ec2_client</a></span>, <span class='object_link'><a href="../Aws/Ec2.html#make_instance-instance_method" title="Meroku::Aws::Ec2#make_instance (method)">#make_instance</a></span>, <span class='object_link'><a href="../Aws/Ec2.html#tag-instance_method" title="Meroku::Aws::Ec2#tag (method)">#tag</a></span></p>
|
230
|
+
<div id="constructor_details" class="method_details_list">
|
231
|
+
<h2>Constructor Details</h2>
|
232
|
+
|
233
|
+
<div class="method_details first">
|
234
|
+
<h3 class="signature first" id="initialize-instance_method">
|
235
|
+
|
236
|
+
#<strong>initialize</strong>(instance_id) ⇒ <tt><span class='object_link'><a href="" title="Meroku::Infrastructure::Server (class)">Server</a></span></tt>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
</h3><div class="docstring">
|
243
|
+
<div class="discussion">
|
244
|
+
|
245
|
+
<p>Returns a new instance of Server</p>
|
246
|
+
|
247
|
+
|
248
|
+
</div>
|
249
|
+
</div>
|
250
|
+
<div class="tags">
|
251
|
+
|
252
|
+
|
253
|
+
</div><table class="source_code">
|
254
|
+
<tr>
|
255
|
+
<td>
|
256
|
+
<pre class="lines">
|
257
|
+
|
258
|
+
|
259
|
+
10
|
260
|
+
11
|
261
|
+
12</pre>
|
262
|
+
</td>
|
263
|
+
<td>
|
264
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/infrastructure/server.rb', line 10</span>
|
265
|
+
|
266
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_instance_id'>instance_id</span><span class='rparen'>)</span>
|
267
|
+
<span class='ivar'>@instance_id</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_id'>instance_id</span>
|
268
|
+
<span class='kw'>end</span></pre>
|
269
|
+
</td>
|
270
|
+
</tr>
|
271
|
+
</table>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
</div>
|
275
|
+
|
276
|
+
<div id="instance_attr_details" class="attr_details">
|
277
|
+
<h2>Instance Attribute Details</h2>
|
278
|
+
|
279
|
+
|
280
|
+
<span id=""></span>
|
281
|
+
<div class="method_details first">
|
282
|
+
<h3 class="signature first" id="instance_id-instance_method">
|
283
|
+
|
284
|
+
#<strong>instance_id</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
</h3><div class="docstring">
|
291
|
+
<div class="discussion">
|
292
|
+
|
293
|
+
<p>Returns the value of attribute instance_id</p>
|
294
|
+
|
295
|
+
|
296
|
+
</div>
|
297
|
+
</div>
|
298
|
+
<div class="tags">
|
299
|
+
|
300
|
+
|
301
|
+
</div><table class="source_code">
|
302
|
+
<tr>
|
303
|
+
<td>
|
304
|
+
<pre class="lines">
|
305
|
+
|
306
|
+
|
307
|
+
8
|
308
|
+
9
|
309
|
+
10</pre>
|
310
|
+
</td>
|
311
|
+
<td>
|
312
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/infrastructure/server.rb', line 8</span>
|
313
|
+
|
314
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_instance_id'>instance_id</span>
|
315
|
+
<span class='ivar'>@instance_id</span>
|
316
|
+
<span class='kw'>end</span></pre>
|
317
|
+
</td>
|
318
|
+
</tr>
|
319
|
+
</table>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
</div>
|
323
|
+
|
324
|
+
|
325
|
+
<div id="instance_method_details" class="method_details_list">
|
326
|
+
<h2>Instance Method Details</h2>
|
327
|
+
|
328
|
+
|
329
|
+
<div class="method_details first">
|
330
|
+
<h3 class="signature first" id="shutdown-instance_method">
|
331
|
+
|
332
|
+
#<strong>shutdown</strong> ⇒ <tt>Object</tt>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
</h3><table class="source_code">
|
339
|
+
<tr>
|
340
|
+
<td>
|
341
|
+
<pre class="lines">
|
342
|
+
|
343
|
+
|
344
|
+
14
|
345
|
+
15
|
346
|
+
16
|
347
|
+
17</pre>
|
348
|
+
</td>
|
349
|
+
<td>
|
350
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/infrastructure/server.rb', line 14</span>
|
351
|
+
|
352
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_shutdown'>shutdown</span>
|
353
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Will terminate </span><span class='embexpr_beg'>#{</span><span class='ivar'>@instance_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
354
|
+
<span class='id identifier rubyid_ec2_client'>ec2_client</span><span class='period'>.</span><span class='id identifier rubyid_terminate_instances'>terminate_instances</span><span class='lparen'>(</span><span class='label'>instance_ids:</span> <span class='lbracket'>[</span><span class='ivar'>@instance_id</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
355
|
+
<span class='kw'>end</span></pre>
|
356
|
+
</td>
|
357
|
+
</tr>
|
358
|
+
</table>
|
359
|
+
</div>
|
360
|
+
|
361
|
+
</div>
|
362
|
+
|
363
|
+
</div>
|
364
|
+
|
365
|
+
<div id="footer">
|
366
|
+
Generated on Tue Oct 31 19:39:54 2017 by
|
367
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
368
|
+
0.9.9 (ruby-2.4.2).
|
369
|
+
</div>
|
370
|
+
|
371
|
+
</div>
|
372
|
+
</body>
|
373
|
+
</html>
|
@@ -0,0 +1,845 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Meroku::Node
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Meroku::Node";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (N)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Node</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Meroku::Node
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Meroku::Node</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<dl>
|
91
|
+
<dt>Includes:</dt>
|
92
|
+
<dd><span class='object_link'><a href="Aws/Ec2.html" title="Meroku::Aws::Ec2 (module)">Aws::Ec2</a></span>, <span class='object_link'><a href="Tunnelable.html" title="Meroku::Tunnelable (module)">Tunnelable</a></span></dd>
|
93
|
+
</dl>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dl>
|
101
|
+
<dt>Defined in:</dt>
|
102
|
+
<dd>lib/meroku/node.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
108
|
+
<div class="discussion">
|
109
|
+
|
110
|
+
<p>At the moment we run on one ec2 node This class represents that node</p>
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
<div class="tags">
|
116
|
+
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<h2>
|
127
|
+
Instance Method Summary
|
128
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
129
|
+
</h2>
|
130
|
+
|
131
|
+
<ul class="summary">
|
132
|
+
|
133
|
+
<li class="public ">
|
134
|
+
<span class="summary_signature">
|
135
|
+
|
136
|
+
<a href="#add_sources-instance_method" title="#add_sources (instance method)">#<strong>add_sources</strong> ⇒ Object </a>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
</span>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
151
|
+
|
152
|
+
</li>
|
153
|
+
|
154
|
+
|
155
|
+
<li class="public ">
|
156
|
+
<span class="summary_signature">
|
157
|
+
|
158
|
+
<a href="#associate_address-instance_method" title="#associate_address (instance method)">#<strong>associate_address</strong> ⇒ Object </a>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
</span>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
173
|
+
|
174
|
+
</li>
|
175
|
+
|
176
|
+
|
177
|
+
<li class="public ">
|
178
|
+
<span class="summary_signature">
|
179
|
+
|
180
|
+
<a href="#configure_keys-instance_method" title="#configure_keys (instance method)">#<strong>configure_keys</strong> ⇒ Object </a>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
</span>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
195
|
+
|
196
|
+
</li>
|
197
|
+
|
198
|
+
|
199
|
+
<li class="public ">
|
200
|
+
<span class="summary_signature">
|
201
|
+
|
202
|
+
<a href="#database_inits-instance_method" title="#database_inits (instance method)">#<strong>database_inits</strong> ⇒ Object </a>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
</span>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
217
|
+
|
218
|
+
</li>
|
219
|
+
|
220
|
+
|
221
|
+
<li class="public ">
|
222
|
+
<span class="summary_signature">
|
223
|
+
|
224
|
+
<a href="#git_clone-instance_method" title="#git_clone (instance method)">#<strong>git_clone</strong> ⇒ Object </a>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
</span>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
239
|
+
|
240
|
+
</li>
|
241
|
+
|
242
|
+
|
243
|
+
<li class="public ">
|
244
|
+
<span class="summary_signature">
|
245
|
+
|
246
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Node </a>
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</span>
|
251
|
+
|
252
|
+
|
253
|
+
<span class="note title constructor">constructor</span>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
<span class="summary_desc"><div class='inline'>
|
263
|
+
<p>A new instance of Node.</p>
|
264
|
+
</div></span>
|
265
|
+
|
266
|
+
</li>
|
267
|
+
|
268
|
+
|
269
|
+
<li class="public ">
|
270
|
+
<span class="summary_signature">
|
271
|
+
|
272
|
+
<a href="#install_packages-instance_method" title="#install_packages (instance method)">#<strong>install_packages</strong> ⇒ Object </a>
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
</span>
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
287
|
+
|
288
|
+
</li>
|
289
|
+
|
290
|
+
|
291
|
+
<li class="public ">
|
292
|
+
<span class="summary_signature">
|
293
|
+
|
294
|
+
<a href="#nginx_configs-instance_method" title="#nginx_configs (instance method)">#<strong>nginx_configs</strong> ⇒ Object </a>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
309
|
+
|
310
|
+
</li>
|
311
|
+
|
312
|
+
|
313
|
+
<li class="public ">
|
314
|
+
<span class="summary_signature">
|
315
|
+
|
316
|
+
<a href="#start_rails-instance_method" title="#start_rails (instance method)">#<strong>start_rails</strong> ⇒ Object </a>
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
</span>
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
331
|
+
|
332
|
+
</li>
|
333
|
+
|
334
|
+
|
335
|
+
<li class="public ">
|
336
|
+
<span class="summary_signature">
|
337
|
+
|
338
|
+
<a href="#ubuntu_updates-instance_method" title="#ubuntu_updates (instance method)">#<strong>ubuntu_updates</strong> ⇒ Object </a>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
</span>
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
353
|
+
|
354
|
+
</li>
|
355
|
+
|
356
|
+
|
357
|
+
</ul>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Tunnelable.html" title="Meroku::Tunnelable (module)">Tunnelable</a></span></h3>
|
370
|
+
<p class="inherited"><span class='object_link'><a href="Tunnelable.html#tunnel_run-instance_method" title="Meroku::Tunnelable#tunnel_run (method)">#tunnel_run</a></span></p>
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Aws/Ec2.html" title="Meroku::Aws::Ec2 (module)">Aws::Ec2</a></span></h3>
|
381
|
+
<p class="inherited"><span class='object_link'><a href="Aws/Ec2.html#associate_address-class_method" title="Meroku::Aws::Ec2.associate_address (method)">associate_address</a></span>, <span class='object_link'><a href="Aws/Ec2.html#ec2_client-instance_method" title="Meroku::Aws::Ec2#ec2_client (method)">#ec2_client</a></span>, <span class='object_link'><a href="Aws/Ec2.html#ec2_client-class_method" title="Meroku::Aws::Ec2.ec2_client (method)">ec2_client</a></span>, <span class='object_link'><a href="Aws/Ec2.html#make_instance-instance_method" title="Meroku::Aws::Ec2#make_instance (method)">#make_instance</a></span>, <span class='object_link'><a href="Aws/Ec2.html#tag-instance_method" title="Meroku::Aws::Ec2#tag (method)">#tag</a></span></p>
|
382
|
+
<div id="constructor_details" class="method_details_list">
|
383
|
+
<h2>Constructor Details</h2>
|
384
|
+
|
385
|
+
<div class="method_details first">
|
386
|
+
<h3 class="signature first" id="initialize-instance_method">
|
387
|
+
|
388
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Meroku::Node (class)">Node</a></span></tt>
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
</h3><div class="docstring">
|
395
|
+
<div class="discussion">
|
396
|
+
|
397
|
+
<p>Returns a new instance of Node</p>
|
398
|
+
|
399
|
+
|
400
|
+
</div>
|
401
|
+
</div>
|
402
|
+
<div class="tags">
|
403
|
+
|
404
|
+
|
405
|
+
</div><table class="source_code">
|
406
|
+
<tr>
|
407
|
+
<td>
|
408
|
+
<pre class="lines">
|
409
|
+
|
410
|
+
|
411
|
+
8
|
412
|
+
9
|
413
|
+
10
|
414
|
+
11
|
415
|
+
12
|
416
|
+
13
|
417
|
+
14
|
418
|
+
15
|
419
|
+
16
|
420
|
+
17
|
421
|
+
18</pre>
|
422
|
+
</td>
|
423
|
+
<td>
|
424
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 8</span>
|
425
|
+
|
426
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
427
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>run_instances()</span><span class='tstring_end'>"</span></span>
|
428
|
+
<span class='ivar'>@instance</span> <span class='op'>=</span> <span class='id identifier rubyid_make_instance'>make_instance</span>
|
429
|
+
<span class='ivar'>@tunnel_ip</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html" title="Meroku::Aws (module)">Aws</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html#IP-constant" title="Meroku::Aws::IP (constant)">IP</a></span></span>
|
430
|
+
<span class='ivar'>@tunnel_username</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ubuntu</span><span class='tstring_end'>"</span></span>
|
431
|
+
<span class='ivar'>@tunnel_password</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>password</span><span class='tstring_end'>"</span></span>
|
432
|
+
<span class='ivar'>@tunnel_key_name</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html" title="Meroku::Aws (module)">Aws</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html#KEY_NAME-constant" title="Meroku::Aws::KEY_NAME (constant)">KEY_NAME</a></span></span>
|
433
|
+
<span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sleep </span><span class='tstring_end'>"</span></span>
|
434
|
+
<span class='int'>30</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_print'>print</span> <span class='id identifier rubyid_sleep'>sleep</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
435
|
+
<span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
436
|
+
<span class='kw'>end</span></pre>
|
437
|
+
</td>
|
438
|
+
</tr>
|
439
|
+
</table>
|
440
|
+
</div>
|
441
|
+
|
442
|
+
</div>
|
443
|
+
|
444
|
+
|
445
|
+
<div id="instance_method_details" class="method_details_list">
|
446
|
+
<h2>Instance Method Details</h2>
|
447
|
+
|
448
|
+
|
449
|
+
<div class="method_details first">
|
450
|
+
<h3 class="signature first" id="add_sources-instance_method">
|
451
|
+
|
452
|
+
#<strong>add_sources</strong> ⇒ <tt>Object</tt>
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
</h3><table class="source_code">
|
459
|
+
<tr>
|
460
|
+
<td>
|
461
|
+
<pre class="lines">
|
462
|
+
|
463
|
+
|
464
|
+
39
|
465
|
+
40
|
466
|
+
41
|
467
|
+
42
|
468
|
+
43
|
469
|
+
44
|
470
|
+
45
|
471
|
+
46
|
472
|
+
47
|
473
|
+
48
|
474
|
+
49
|
475
|
+
50</pre>
|
476
|
+
</td>
|
477
|
+
<td>
|
478
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 39</span>
|
479
|
+
|
480
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_sources'>add_sources</span>
|
481
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='heredoc_beg'><<~HEREDOC</span>
|
482
|
+
<span class='tstring_content'> echo "Dpkg::Use-Pty "0";" | sudo tee /etc/apt/apt.conf.d/00usepty
|
483
|
+
</span><span class='tstring_content'> sudo apt-add-repository ppa:brightbox/ruby-ng --yes 2>/dev/null >/dev/null
|
484
|
+
</span><span class='tstring_content'> echo "deb http://archive.ubuntu.com/ubuntu/ trusty main universe" | sudo tee -a /etc/apt/sources.list
|
485
|
+
</span><span class='tstring_content'> echo "deb http://archive.ubuntu.com/ubuntu/ trusty-security main universe" | sudo tee -a /etc/apt/sources.list
|
486
|
+
</span><span class='tstring_content'> echo "deb http://archive.ubuntu.com/ubuntu/ trusty-updates main universe" | sudo tee -a /etc/apt/sources.list
|
487
|
+
</span><span class='tstring_content'> echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee -a /etc/apt/sources.list
|
488
|
+
</span><span class='heredoc_end'> HEREDOC
|
489
|
+
</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span> <span class='id identifier rubyid_tunnel_run'>tunnel_run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
490
|
+
<span class='kw'>self</span>
|
491
|
+
<span class='kw'>end</span></pre>
|
492
|
+
</td>
|
493
|
+
</tr>
|
494
|
+
</table>
|
495
|
+
</div>
|
496
|
+
|
497
|
+
<div class="method_details ">
|
498
|
+
<h3 class="signature " id="associate_address-instance_method">
|
499
|
+
|
500
|
+
#<strong>associate_address</strong> ⇒ <tt>Object</tt>
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
</h3><table class="source_code">
|
507
|
+
<tr>
|
508
|
+
<td>
|
509
|
+
<pre class="lines">
|
510
|
+
|
511
|
+
|
512
|
+
20
|
513
|
+
21
|
514
|
+
22
|
515
|
+
23
|
516
|
+
24</pre>
|
517
|
+
</td>
|
518
|
+
<td>
|
519
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 20</span>
|
520
|
+
|
521
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_associate_address'>associate_address</span>
|
522
|
+
<span class='id identifier rubyid_ip'>ip</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>eipalloc-139f7823</span><span class='tstring_end'>"</span></span>
|
523
|
+
<span class='const'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html" title="Meroku::Aws (module)">Aws</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws/Ec2.html" title="Meroku::Aws::Ec2 (module)">Ec2</a></span></span><span class='period'>.</span><span class='id identifier rubyid_associate_address'><span class='object_link'><a href="Aws/Ec2.html#associate_address-class_method" title="Meroku::Aws::Ec2.associate_address (method)">associate_address</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_ip'>ip</span><span class='comma'>,</span> <span class='ivar'>@instance</span><span class='period'>.</span><span class='id identifier rubyid_instance_id'>instance_id</span><span class='rparen'>)</span>
|
524
|
+
<span class='kw'>self</span>
|
525
|
+
<span class='kw'>end</span></pre>
|
526
|
+
</td>
|
527
|
+
</tr>
|
528
|
+
</table>
|
529
|
+
</div>
|
530
|
+
|
531
|
+
<div class="method_details ">
|
532
|
+
<h3 class="signature " id="configure_keys-instance_method">
|
533
|
+
|
534
|
+
#<strong>configure_keys</strong> ⇒ <tt>Object</tt>
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
</h3><table class="source_code">
|
541
|
+
<tr>
|
542
|
+
<td>
|
543
|
+
<pre class="lines">
|
544
|
+
|
545
|
+
|
546
|
+
26
|
547
|
+
27
|
548
|
+
28
|
549
|
+
29
|
550
|
+
30
|
551
|
+
31
|
552
|
+
32
|
553
|
+
33
|
554
|
+
34
|
555
|
+
35
|
556
|
+
36
|
557
|
+
37</pre>
|
558
|
+
</td>
|
559
|
+
<td>
|
560
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 26</span>
|
561
|
+
|
562
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_configure_keys'>configure_keys</span>
|
563
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='heredoc_beg'><<~HEREDOC</span>
|
564
|
+
<span class='tstring_content'> mkdir /home/ubuntu/.meroku
|
565
|
+
</span><span class='tstring_content'> sudo curl -s -o /etc/ssh/ssh_host_ecdsa_key </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html" title="Meroku::Aws (module)">Aws</a></span></span><span class='period'>.</span><span class='id identifier rubyid_bucket_url'><span class='object_link'><a href="Aws.html#bucket_url-class_method" title="Meroku::Aws.bucket_url (method)">bucket_url</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/ssh_host_ecdsa_key
|
566
|
+
</span><span class='tstring_content'> sudo curl -s -o /etc/ssh/ssh_host_ecdsa_key.pub </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html" title="Meroku::Aws (module)">Aws</a></span></span><span class='period'>.</span><span class='id identifier rubyid_bucket_url'><span class='object_link'><a href="Aws.html#bucket_url-class_method" title="Meroku::Aws.bucket_url (method)">bucket_url</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/ssh_host_ecdsa_key.pub
|
567
|
+
</span><span class='tstring_content'> curl -s -o /home/ubuntu/.meroku/letsencrypt_fullchain.pem </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html" title="Meroku::Aws (module)">Aws</a></span></span><span class='period'>.</span><span class='id identifier rubyid_bucket_url'><span class='object_link'><a href="Aws.html#bucket_url-class_method" title="Meroku::Aws.bucket_url (method)">bucket_url</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/letsencrypt_fullchain.pem
|
568
|
+
</span><span class='tstring_content'> curl -s -o /home/ubuntu/.meroku/letsencrypt_privkey.pem </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Aws.html" title="Meroku::Aws (module)">Aws</a></span></span><span class='period'>.</span><span class='id identifier rubyid_bucket_url'><span class='object_link'><a href="Aws.html#bucket_url-class_method" title="Meroku::Aws.bucket_url (method)">bucket_url</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/letsencrypt_privkey.pem
|
569
|
+
</span><span class='tstring_content'> curl -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
570
|
+
</span><span class='heredoc_end'> HEREDOC
|
571
|
+
</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span> <span class='id identifier rubyid_tunnel_run'>tunnel_run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
572
|
+
<span class='kw'>self</span>
|
573
|
+
<span class='kw'>end</span></pre>
|
574
|
+
</td>
|
575
|
+
</tr>
|
576
|
+
</table>
|
577
|
+
</div>
|
578
|
+
|
579
|
+
<div class="method_details ">
|
580
|
+
<h3 class="signature " id="database_inits-instance_method">
|
581
|
+
|
582
|
+
#<strong>database_inits</strong> ⇒ <tt>Object</tt>
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
</h3><table class="source_code">
|
589
|
+
<tr>
|
590
|
+
<td>
|
591
|
+
<pre class="lines">
|
592
|
+
|
593
|
+
|
594
|
+
69
|
595
|
+
70
|
596
|
+
71
|
597
|
+
72
|
598
|
+
73
|
599
|
+
74
|
600
|
+
75
|
601
|
+
76
|
602
|
+
77
|
603
|
+
78
|
604
|
+
79</pre>
|
605
|
+
</td>
|
606
|
+
<td>
|
607
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 69</span>
|
608
|
+
|
609
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_database_inits'>database_inits</span>
|
610
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='heredoc_beg'><<~HEREDOC</span>
|
611
|
+
<span class='tstring_content'> sudo -u postgres createuser -e meroku
|
612
|
+
</span><span class='tstring_content'> sudo -u postgres createdb meroku
|
613
|
+
</span><span class='tstring_content'> sudo -u postgres psql -c "ALTER ROLE meroku WITH PASSWORD '</span><span class='embexpr_beg'>#{</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SECRET</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'>';"
|
614
|
+
</span><span class='tstring_content'> sudo perl -pi -e "s#local.*all.*all.*peer#local all all md5#" /etc/postgresql/9.6/main/pg_hba.conf
|
615
|
+
</span><span class='tstring_content'> sudo service postgresql restart
|
616
|
+
</span><span class='heredoc_end'> HEREDOC
|
617
|
+
</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span> <span class='id identifier rubyid_tunnel_run'>tunnel_run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
618
|
+
<span class='kw'>self</span>
|
619
|
+
<span class='kw'>end</span></pre>
|
620
|
+
</td>
|
621
|
+
</tr>
|
622
|
+
</table>
|
623
|
+
</div>
|
624
|
+
|
625
|
+
<div class="method_details ">
|
626
|
+
<h3 class="signature " id="git_clone-instance_method">
|
627
|
+
|
628
|
+
#<strong>git_clone</strong> ⇒ <tt>Object</tt>
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
</h3><table class="source_code">
|
635
|
+
<tr>
|
636
|
+
<td>
|
637
|
+
<pre class="lines">
|
638
|
+
|
639
|
+
|
640
|
+
81
|
641
|
+
82
|
642
|
+
83
|
643
|
+
84
|
644
|
+
85
|
645
|
+
86
|
646
|
+
87</pre>
|
647
|
+
</td>
|
648
|
+
<td>
|
649
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 81</span>
|
650
|
+
|
651
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_git_clone'>git_clone</span>
|
652
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='heredoc_beg'><<~HEREDOC</span>
|
653
|
+
<span class='tstring_content'> cd ~; git clone https://github.com/oystersauce8/meroku;
|
654
|
+
</span><span class='heredoc_end'> HEREDOC
|
655
|
+
</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span> <span class='id identifier rubyid_tunnel_run'>tunnel_run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
656
|
+
<span class='kw'>self</span>
|
657
|
+
<span class='kw'>end</span></pre>
|
658
|
+
</td>
|
659
|
+
</tr>
|
660
|
+
</table>
|
661
|
+
</div>
|
662
|
+
|
663
|
+
<div class="method_details ">
|
664
|
+
<h3 class="signature " id="install_packages-instance_method">
|
665
|
+
|
666
|
+
#<strong>install_packages</strong> ⇒ <tt>Object</tt>
|
667
|
+
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
</h3><table class="source_code">
|
673
|
+
<tr>
|
674
|
+
<td>
|
675
|
+
<pre class="lines">
|
676
|
+
|
677
|
+
|
678
|
+
61
|
679
|
+
62
|
680
|
+
63
|
681
|
+
64
|
682
|
+
65
|
683
|
+
66
|
684
|
+
67</pre>
|
685
|
+
</td>
|
686
|
+
<td>
|
687
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 61</span>
|
688
|
+
|
689
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_install_packages'>install_packages</span>
|
690
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='heredoc_beg'><<~HEREDOC</span>
|
691
|
+
<span class='tstring_content'> DEBIAN_PRIORITY=critical DEBIAN_FRONTEND=noninteractive sudo apt-get install -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" autoconf bind9-host bison build-essential coreutils curl daemontools dnsutils ed git imagemagick iputils-tracepath language-pack-en libbz2-dev libcurl4-openssl-dev libev-dev libevent-dev libglib2.0-dev libjpeg-dev libmagickwand-dev libmysqlclient-dev libncurses5-dev librdkafka-dev libreadline6-dev libssl-dev libuv-dev libxml2-dev libxslt-dev netcat-openbsd openjdk-7-jdk openjdk-7-jre-headless openssh-client openssh-server python python-dev socat stunnel syslinux tar telnet zip zlib1g-dev ruby2.4 ruby2.4-dev nginx libsqlite3-dev nodejs libpq-dev postgresql-9.6 2>/dev/null >/dev/null
|
692
|
+
</span><span class='heredoc_end'> HEREDOC
|
693
|
+
</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span> <span class='id identifier rubyid_tunnel_run'>tunnel_run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
694
|
+
<span class='kw'>self</span>
|
695
|
+
<span class='kw'>end</span></pre>
|
696
|
+
</td>
|
697
|
+
</tr>
|
698
|
+
</table>
|
699
|
+
</div>
|
700
|
+
|
701
|
+
<div class="method_details ">
|
702
|
+
<h3 class="signature " id="nginx_configs-instance_method">
|
703
|
+
|
704
|
+
#<strong>nginx_configs</strong> ⇒ <tt>Object</tt>
|
705
|
+
|
706
|
+
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
</h3><table class="source_code">
|
711
|
+
<tr>
|
712
|
+
<td>
|
713
|
+
<pre class="lines">
|
714
|
+
|
715
|
+
|
716
|
+
89
|
717
|
+
90
|
718
|
+
91
|
719
|
+
92
|
720
|
+
93
|
721
|
+
94
|
722
|
+
95
|
723
|
+
96
|
724
|
+
97
|
725
|
+
98
|
726
|
+
99</pre>
|
727
|
+
</td>
|
728
|
+
<td>
|
729
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 89</span>
|
730
|
+
|
731
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_nginx_configs'>nginx_configs</span>
|
732
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='heredoc_beg'><<~HEREDOC</span>
|
733
|
+
<span class='tstring_content'> sudo rm -f /etc/nginx/sites-enabled/* /etc/nginx/sites-available/*
|
734
|
+
</span><span class='tstring_content'> sudo cp ~/meroku/frontend/etc_nginx_sites-enabled_default /etc/nginx/sites-enabled/default
|
735
|
+
</span><span class='tstring_content'> sudo mkdir /sharedro && sudo chmod 777 /sharedro
|
736
|
+
</span><span class='tstring_content'> sudo cp /home/ubuntu/meroku/frontend/etc_nginx_sites-enabled_template /sharedro
|
737
|
+
</span><span class='tstring_content'> sudo chmod a+r /sharedro/etc_nginx_sites-enabled_template
|
738
|
+
</span><span class='heredoc_end'> HEREDOC
|
739
|
+
</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span> <span class='id identifier rubyid_tunnel_run'>tunnel_run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
740
|
+
<span class='kw'>self</span>
|
741
|
+
<span class='kw'>end</span></pre>
|
742
|
+
</td>
|
743
|
+
</tr>
|
744
|
+
</table>
|
745
|
+
</div>
|
746
|
+
|
747
|
+
<div class="method_details ">
|
748
|
+
<h3 class="signature " id="start_rails-instance_method">
|
749
|
+
|
750
|
+
#<strong>start_rails</strong> ⇒ <tt>Object</tt>
|
751
|
+
|
752
|
+
|
753
|
+
|
754
|
+
|
755
|
+
|
756
|
+
</h3><table class="source_code">
|
757
|
+
<tr>
|
758
|
+
<td>
|
759
|
+
<pre class="lines">
|
760
|
+
|
761
|
+
|
762
|
+
101
|
763
|
+
102
|
764
|
+
103
|
765
|
+
104
|
766
|
+
105
|
767
|
+
106
|
768
|
+
107
|
769
|
+
108
|
770
|
+
109
|
771
|
+
110
|
772
|
+
111</pre>
|
773
|
+
</td>
|
774
|
+
<td>
|
775
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 101</span>
|
776
|
+
|
777
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_start_rails'>start_rails</span>
|
778
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='heredoc_beg'><<~HEREDOC</span>
|
779
|
+
<span class='tstring_content'> cd ~/meroku/frontend; sudo gem install bundler; bundle;
|
780
|
+
</span><span class='tstring_content'> cd ~/meroku/frontend; SECRET=</span><span class='embexpr_beg'>#{</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SECRET</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> RAILS_ENV=production bundle exec rails assets:precompile
|
781
|
+
</span><span class='tstring_content'> cd ~/meroku/frontend; SECRET=</span><span class='embexpr_beg'>#{</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SECRET</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> RAILS_ENV=production bundle exec rake db:migrate
|
782
|
+
</span><span class='tstring_content'> cd ~/meroku/frontend; SECRET=</span><span class='embexpr_beg'>#{</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SECRET</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> bundle exec puma -d -b unix:///home/ubuntu/meroku.sock
|
783
|
+
</span><span class='tstring_content'> sudo /usr/sbin/nginx -s reload
|
784
|
+
</span><span class='heredoc_end'> HEREDOC
|
785
|
+
</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span> <span class='id identifier rubyid_tunnel_run'>tunnel_run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
786
|
+
<span class='kw'>self</span>
|
787
|
+
<span class='kw'>end</span></pre>
|
788
|
+
</td>
|
789
|
+
</tr>
|
790
|
+
</table>
|
791
|
+
</div>
|
792
|
+
|
793
|
+
<div class="method_details ">
|
794
|
+
<h3 class="signature " id="ubuntu_updates-instance_method">
|
795
|
+
|
796
|
+
#<strong>ubuntu_updates</strong> ⇒ <tt>Object</tt>
|
797
|
+
|
798
|
+
|
799
|
+
|
800
|
+
|
801
|
+
|
802
|
+
</h3><table class="source_code">
|
803
|
+
<tr>
|
804
|
+
<td>
|
805
|
+
<pre class="lines">
|
806
|
+
|
807
|
+
|
808
|
+
52
|
809
|
+
53
|
810
|
+
54
|
811
|
+
55
|
812
|
+
56
|
813
|
+
57
|
814
|
+
58
|
815
|
+
59</pre>
|
816
|
+
</td>
|
817
|
+
<td>
|
818
|
+
<pre class="code"><span class="info file"># File 'lib/meroku/node.rb', line 52</span>
|
819
|
+
|
820
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ubuntu_updates'>ubuntu_updates</span>
|
821
|
+
<span class='id identifier rubyid_str'>str</span> <span class='op'>=</span> <span class='heredoc_beg'><<~HEREDOC</span>
|
822
|
+
<span class='tstring_content'> DEBIAN_FRONTEND=noninteractive sudo apt-get update -qq
|
823
|
+
</span><span class='tstring_content'> DEBIAN_FRONTEND=noninteractive sudo apt-get upgrade -yqq --force-yes 2>/dev/null >/dev/null
|
824
|
+
</span><span class='heredoc_end'> HEREDOC
|
825
|
+
</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_cmd'>cmd</span><span class='op'>|</span> <span class='id identifier rubyid_tunnel_run'>tunnel_run</span><span class='lparen'>(</span><span class='id identifier rubyid_cmd'>cmd</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
826
|
+
<span class='kw'>self</span>
|
827
|
+
<span class='kw'>end</span></pre>
|
828
|
+
</td>
|
829
|
+
</tr>
|
830
|
+
</table>
|
831
|
+
</div>
|
832
|
+
|
833
|
+
</div>
|
834
|
+
|
835
|
+
</div>
|
836
|
+
|
837
|
+
<div id="footer">
|
838
|
+
Generated on Tue Oct 31 19:39:54 2017 by
|
839
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
840
|
+
0.9.9 (ruby-2.4.2).
|
841
|
+
</div>
|
842
|
+
|
843
|
+
</div>
|
844
|
+
</body>
|
845
|
+
</html>
|