gemstash 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -32
- data/lib/gemstash/authorization.rb +5 -2
- data/lib/gemstash/cli/authorize.rb +42 -1
- data/lib/gemstash/cli.rb +4 -0
- data/lib/gemstash/db/authorization.rb +3 -3
- data/lib/gemstash/logging.rb +1 -0
- data/lib/gemstash/man/gemstash-authorize.1 +21 -33
- data/lib/gemstash/man/gemstash-authorize.1.txt +23 -15
- data/lib/gemstash/man/gemstash-configuration.5 +63 -118
- data/lib/gemstash/man/gemstash-configuration.5.txt +54 -54
- data/lib/gemstash/man/gemstash-customize.7 +60 -103
- data/lib/gemstash/man/gemstash-customize.7.txt +35 -35
- data/lib/gemstash/man/gemstash-debugging.7 +8 -27
- data/lib/gemstash/man/gemstash-debugging.7.txt +6 -6
- data/lib/gemstash/man/gemstash-deploy.7 +15 -39
- data/lib/gemstash/man/gemstash-deploy.7.txt +16 -16
- data/lib/gemstash/man/gemstash-mirror.7 +10 -31
- data/lib/gemstash/man/gemstash-mirror.7.txt +3 -3
- data/lib/gemstash/man/gemstash-multiple-sources.7 +17 -44
- data/lib/gemstash/man/gemstash-multiple-sources.7.txt +8 -8
- data/lib/gemstash/man/gemstash-private-gems.7 +51 -102
- data/lib/gemstash/man/gemstash-private-gems.7.txt +21 -21
- data/lib/gemstash/man/gemstash-readme.7 +29 -75
- data/lib/gemstash/man/gemstash-readme.7.txt +10 -10
- data/lib/gemstash/man/gemstash-setup.1 +13 -33
- data/lib/gemstash/man/gemstash-setup.1.txt +11 -11
- data/lib/gemstash/man/gemstash-start.1 +7 -25
- data/lib/gemstash/man/gemstash-start.1.txt +6 -6
- data/lib/gemstash/man/gemstash-status.1 +5 -23
- data/lib/gemstash/man/gemstash-status.1.txt +4 -4
- data/lib/gemstash/man/gemstash-stop.1 +5 -23
- data/lib/gemstash/man/gemstash-stop.1.txt +4 -4
- data/lib/gemstash/man/gemstash-version.1 +4 -24
- data/lib/gemstash/man/gemstash-version.1.txt +1 -1
- data/lib/gemstash/migrations/05_authorization_names.rb +10 -0
- data/lib/gemstash/version.rb +1 -1
- metadata +18 -3
@@ -1,34 +1,17 @@
|
|
1
1
|
<!-- Automatically generated by Pandoc -->
|
2
|
-
.\" Automatically generated by Pandoc 3.1.
|
2
|
+
.\" Automatically generated by Pandoc 3.1.8
|
3
3
|
.\"
|
4
|
-
.\" Define V font for inline verbatim, using C font in formats
|
5
|
-
.\" that render this, and otherwise B font.
|
6
|
-
.ie "\f[CB]x\f[]"x" \{\
|
7
|
-
. ftr V B
|
8
|
-
. ftr VI BI
|
9
|
-
. ftr VB B
|
10
|
-
. ftr VBI BI
|
11
|
-
.\}
|
12
|
-
.el \{\
|
13
|
-
. ftr V CR
|
14
|
-
. ftr VI CI
|
15
|
-
. ftr VB CB
|
16
|
-
. ftr VBI CBI
|
17
|
-
.\}
|
18
4
|
.TH "gemstash-customize" "7" "October 28, 2015" "" ""
|
19
|
-
.hy
|
20
5
|
.SH Customizing the Server
|
21
|
-
.PP
|
22
6
|
Although Gemstash is designed for as minimal setup as possible, there
|
23
7
|
may be times you will want to change some of the default configuration.
|
24
8
|
By the end of this guide, you will be able to customize some of the
|
25
9
|
Gemstash behavior, including where files are stored, what database
|
26
10
|
Gemstash uses, and how Gemstash caches certain requests.
|
27
11
|
.SS Setup
|
28
|
-
.PP
|
29
12
|
Several customizable options are available via an interactive Gemstash
|
30
13
|
command.
|
31
|
-
Run \f[
|
14
|
+
Run \f[CR]gemstash setup\f[R] and answer the questions it provides (a
|
32
15
|
blank answer will use the default value):
|
33
16
|
.RS
|
34
17
|
.PP
|
@@ -79,11 +62,11 @@ Once you\[cq]ve answered the questions, some checks will be made to
|
|
79
62
|
ensure the configuration will work.
|
80
63
|
For example, the database didn\[cq]t exist in the previous example, so
|
81
64
|
the command failed and the configuration wasn\[cq]t saved.
|
82
|
-
If the command passes, you may provide the \f[
|
65
|
+
If the command passes, you may provide the \f[CR]--redo\f[R] option to
|
83
66
|
force configuration to be redone:
|
84
67
|
.RS
|
85
68
|
.PP
|
86
|
-
\f[
|
69
|
+
\f[CR]$ gemstash setup --redo\f[R]
|
87
70
|
.PD 0
|
88
71
|
.P
|
89
72
|
.PD
|
@@ -122,46 +105,41 @@ You are all setup!
|
|
122
105
|
.RE
|
123
106
|
.PP
|
124
107
|
Once all checks have passed, Gemstash will store your answers in the
|
125
|
-
configuration file located at \f[
|
108
|
+
configuration file located at \f[CR]\[ti]/.gemstash/config.yml\f[R].
|
126
109
|
.SS Files
|
127
|
-
|
128
|
-
Storage in Gemstash defaults to \f[V]\[ti]/.gemstash\f[R] unless
|
110
|
+
Storage in Gemstash defaults to \f[CR]\[ti]/.gemstash\f[R] unless
|
129
111
|
otherwise specified.
|
130
|
-
You can change this in your config file via the \f[
|
112
|
+
You can change this in your config file via the \f[CR]:base_path\f[R]
|
131
113
|
key:
|
132
114
|
.IP
|
133
|
-
.
|
134
|
-
\f[C]
|
115
|
+
.EX
|
135
116
|
# \[ti]/.gemstash/config.yml
|
136
117
|
---
|
137
118
|
:base_path: \[dq]/var/gemstash\[dq]
|
138
|
-
|
139
|
-
.fi
|
119
|
+
.EE
|
140
120
|
.PP
|
141
|
-
When customizing the \f[
|
121
|
+
When customizing the \f[CR]base_path\f[R], the directory must exist,
|
142
122
|
otherwise Gemstash will fail to run.
|
143
|
-
Thus, if you want to use \f[
|
144
|
-
example, make sure to \f[
|
123
|
+
Thus, if you want to use \f[CR]/var/gemstash\f[R] like in the previous
|
124
|
+
example, make sure to \f[CR]mkdir /var/gemstash\f[R] and grant access to
|
145
125
|
the directory for the user you run Gemstash with.
|
146
126
|
.SS Database
|
147
|
-
|
148
|
-
The \f[V]:db_adapter\f[R] configuration key specifies what database you
|
127
|
+
The \f[CR]:db_adapter\f[R] configuration key specifies what database you
|
149
128
|
will be using.
|
150
|
-
The default \f[
|
151
|
-
\f[
|
152
|
-
file located within your \f[
|
153
|
-
The database file will always be named \f[
|
129
|
+
The default \f[CR]:db_adapter\f[R] is
|
130
|
+
\f[CR]sqlite3\f[R] (https://www.sqlite.org/), which will use a database
|
131
|
+
file located within your \f[CR]:base_path\f[R].
|
132
|
+
The database file will always be named \f[CR]gemstash.db\f[R].
|
154
133
|
.PP
|
155
|
-
You may also use \f[
|
156
|
-
\f[
|
157
|
-
\f[
|
158
|
-
for your \f[
|
134
|
+
You may also use \f[CR]postgres\f[R] (http://www.postgresql.org/),
|
135
|
+
\f[CR]mysql\f[R] (http://www.mysql.com/), or
|
136
|
+
\f[CR]mysql2\f[R] (http://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-mysql2)
|
137
|
+
for your \f[CR]:db_adapter\f[R].
|
159
138
|
When using any of these options, you need to specify the
|
160
|
-
\f[
|
161
|
-
Here is an example configuration to use the \f[
|
139
|
+
\f[CR]:db_url\f[R] to point to an existing database.
|
140
|
+
Here is an example configuration to use the \f[CR]postgres\f[R] adapter:
|
162
141
|
.IP
|
163
|
-
.
|
164
|
-
\f[C]
|
142
|
+
.EX
|
165
143
|
# \[ti]/.gemstash/config.yml
|
166
144
|
---
|
167
145
|
:db_adapter: postgres
|
@@ -170,57 +148,50 @@ Here is an example configuration to use the \f[V]postgres\f[R] adapter:
|
|
170
148
|
:connect_timeout: 10
|
171
149
|
:read_timeout: 5
|
172
150
|
:timeout: 30
|
173
|
-
|
174
|
-
.fi
|
151
|
+
.EE
|
175
152
|
.PP
|
176
153
|
Regardless of the adapter you choose, the database will automatically
|
177
154
|
migrate to your version of Gemstash whenever the database is needed.
|
178
155
|
You only need to ensure the database exists and Gemstash will do the
|
179
|
-
rest, except for \f[
|
156
|
+
rest, except for \f[CR]sqlite3\f[R] (for which Gemstash will also create
|
180
157
|
the database for you).
|
181
158
|
.SS Cache
|
182
|
-
.PP
|
183
159
|
Certain things (like dependencies) are cached in memory.
|
184
160
|
This avoids web calls to the gem source, and database calls for private
|
185
161
|
gems.
|
186
162
|
.IP
|
187
|
-
.
|
188
|
-
\f[C]
|
163
|
+
.EX
|
189
164
|
# \[ti]/.gemstash/config.yml
|
190
165
|
---
|
191
166
|
:cache_type: memory
|
192
167
|
:cache_max_size: 2000
|
193
|
-
|
194
|
-
.fi
|
168
|
+
.EE
|
195
169
|
.PP
|
196
|
-
This configuration uses the default \f[
|
197
|
-
increased the \f[
|
170
|
+
This configuration uses the default \f[CR]memory\f[R] cache, and has
|
171
|
+
increased the \f[CR]cache_max_size\f[R] setting from its default of 500
|
198
172
|
items.
|
199
173
|
.PP
|
200
174
|
The memory cache can optionally be swapped out with a
|
201
175
|
Memcached (http://memcached.org/) server (or cluster of servers).
|
202
176
|
.PP
|
203
|
-
To use Memcached, use the \f[
|
177
|
+
To use Memcached, use the \f[CR]memcached\f[R] \f[CR]:cache_type\f[R]
|
204
178
|
configuration.
|
205
179
|
.PP
|
206
180
|
Provide the servers as a comma-separated list to the
|
207
|
-
\f[
|
181
|
+
\f[CR]:memcached_servers\f[R] configuration key:
|
208
182
|
.IP
|
209
|
-
.
|
210
|
-
\f[C]
|
183
|
+
.EX
|
211
184
|
# \[ti]/.gemstash/config.yml
|
212
185
|
---
|
213
186
|
:cache_type: memcached
|
214
187
|
:memcached_servers: memcached1.local:11211,memcached2.local:11211
|
215
188
|
:cache_expiration: 1800
|
216
|
-
|
217
|
-
.fi
|
189
|
+
.EE
|
218
190
|
.PP
|
219
|
-
All caching expires in \f[
|
191
|
+
All caching expires in \f[CR]cache_expiration\f[R] number of seconds.
|
220
192
|
Default is 1800 seconds (30 minutes).
|
221
193
|
This option applies to all caching.
|
222
194
|
.SS Server
|
223
|
-
.PP
|
224
195
|
Gemstash uses Puma (http://puma.io/) and Rack (http://rack.github.io/)
|
225
196
|
as the server.
|
226
197
|
Alternate server configurations are not currently supported, but you can
|
@@ -232,85 +203,71 @@ for inspiration.
|
|
232
203
|
.PP
|
233
204
|
While the server is not customizable, the way Gemstash binds the port
|
234
205
|
can be changed.
|
235
|
-
To change the binding, update the \f[
|
206
|
+
To change the binding, update the \f[CR]:bind\f[R] configuration key:
|
236
207
|
.IP
|
237
|
-
.
|
238
|
-
\f[C]
|
208
|
+
.EX
|
239
209
|
# \[ti]/.gemstash/config.yml
|
240
210
|
---
|
241
211
|
:bind: tcp://0.0.0.0:4242
|
242
|
-
|
243
|
-
.fi
|
212
|
+
.EE
|
244
213
|
.PP
|
245
214
|
This maps directly to the Puma bind
|
246
215
|
flag (https://github.com/puma/puma#binding-tcp--sockets), and will
|
247
216
|
support anything valid for that flag.
|
248
217
|
.PP
|
249
218
|
The number of threads Puma uses is also customizable via the
|
250
|
-
\f[
|
251
|
-
The default is \f[
|
219
|
+
\f[CR]:puma_threads\f[R] configuration key.
|
220
|
+
The default is \f[CR]16\f[R].
|
252
221
|
.SS Protected Fetch
|
253
|
-
.PP
|
254
222
|
Gemstash by default allows unauthenticated access for private gems.
|
255
|
-
Authenticated access is available via the \f[
|
223
|
+
Authenticated access is available via the \f[CR]:protected_fetch\f[R]
|
256
224
|
configuration key.
|
257
225
|
.IP
|
258
|
-
.
|
259
|
-
\f[C]
|
226
|
+
.EX
|
260
227
|
# \[ti]/.gemstash/config.yml
|
261
228
|
---
|
262
229
|
:protected_fetch: true
|
263
|
-
|
264
|
-
.fi
|
230
|
+
.EE
|
265
231
|
.PP
|
266
232
|
More details on protected_fetch are here.
|
267
233
|
.SS Fetch Timeout
|
268
|
-
.PP
|
269
234
|
The default fetch timeout is 20 seconds.
|
270
|
-
Use the \f[
|
235
|
+
Use the \f[CR]:fetch_timeout\f[R] configuration key to change it.
|
271
236
|
.IP
|
272
|
-
.
|
273
|
-
\f[C]
|
237
|
+
.EX
|
274
238
|
---
|
275
239
|
:fetch_timeout: 20
|
276
|
-
|
277
|
-
.fi
|
240
|
+
.EE
|
278
241
|
.SS Config File Location
|
279
|
-
.PP
|
280
242
|
By default, configuration for Gemstash will be at
|
281
|
-
\f[
|
282
|
-
This can be changed by providing the \f[
|
243
|
+
\f[CR]\[ti]/.gemstash/config.yml\f[R].
|
244
|
+
This can be changed by providing the \f[CR]--config-file\f[R] option to
|
283
245
|
the various Gemstash commands:
|
284
246
|
.IP
|
285
|
-
.
|
286
|
-
\f[C]
|
247
|
+
.EX
|
287
248
|
$ gemstash setup --config-file ./gemstash-config.yml
|
288
249
|
$ gemstash authorize --config-file ./gemstash-config.yml
|
289
250
|
$ gemstash start --config-file ./gemstash-config.yml
|
290
251
|
$ gemstash stop --config-file ./gemstash-config.yml
|
291
252
|
$ gemstash status --config-file ./gemstash-config.yml
|
292
|
-
|
293
|
-
.fi
|
253
|
+
.EE
|
294
254
|
.PP
|
295
|
-
When providing \f[
|
296
|
-
provided file will be output to with the provided configuration.
|
255
|
+
When providing \f[CR]--config-file\f[R] to \f[CR]gemstash setup\f[R],
|
256
|
+
the provided file will be output to with the provided configuration.
|
297
257
|
\f[B]This will overwrite\f[R] any existing configuration.
|
298
|
-
If the file doesn\[cq]t exist when providing \f[
|
299
|
-
\f[
|
300
|
-
\f[
|
301
|
-
configuration will be used.
|
258
|
+
If the file doesn\[cq]t exist when providing \f[CR]--config-file\f[R] to
|
259
|
+
\f[CR]gemstash start\f[R], \f[CR]gemstash stop\f[R],
|
260
|
+
\f[CR]gemstash status\f[R], and \f[CR]gemstash authorize\f[R], the
|
261
|
+
default configuration will be used.
|
302
262
|
.SS ERB parsed config
|
303
|
-
.
|
304
|
-
You may also create a \f[V]\[ti]/.gemstash/config.yml.erb\f[R] file.
|
263
|
+
You may also create a \f[CR]\[ti]/.gemstash/config.yml.erb\f[R] file.
|
305
264
|
If present, this will be used instead of
|
306
|
-
\f[
|
265
|
+
\f[CR]\[ti]/.gemstash/config.yml\f[R].
|
307
266
|
For example, with this you can use environment variables in the config:
|
308
267
|
.IP
|
309
|
-
.
|
310
|
-
\f[C]
|
268
|
+
.EX
|
311
269
|
# \[ti]/.gemstash/config.yml.erb
|
312
270
|
---
|
313
271
|
:db_adapter: postgres
|
314
272
|
:db_url: <%= ENV[\[dq]DATABASE_URL\[dq]] %>
|
315
|
-
|
316
|
-
.fi
|
273
|
+
.EE
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
1mSetup0m
|
13
13
|
Several customizable options are available via an interactive Gemstash
|
14
|
-
command. Run
|
14
|
+
command. Run gemstash setup and answer the questions it provides (a
|
15
15
|
blank answer will use the default value):
|
16
16
|
|
17
17
|
$ gemstash setup
|
@@ -28,10 +28,10 @@
|
|
28
28
|
Once you've answered the questions, some checks will be made to ensure
|
29
29
|
the configuration will work. For example, the database didn't exist in
|
30
30
|
the previous example, so the command failed and the configuration
|
31
|
-
wasn't saved. If the command passes, you may provide the
|
31
|
+
wasn't saved. If the command passes, you may provide the --redo option
|
32
32
|
to force configuration to be redone:
|
33
33
|
|
34
|
-
|
34
|
+
$ gemstash setup --redo
|
35
35
|
Where should files go? [~/.gemstash]
|
36
36
|
Cache with what? [MEMORY, memcached] 1mmemcached0m
|
37
37
|
What is the comma separated Memcached servers? [local-
|
@@ -41,33 +41,33 @@
|
|
41
41
|
Checking that the database is available
|
42
42
|
You are all setup!
|
43
43
|
Once all checks have passed, Gemstash will store your answers in the
|
44
|
-
configuration file located at
|
44
|
+
configuration file located at ~/.gemstash/config.yml.
|
45
45
|
|
46
46
|
1mFiles0m
|
47
|
-
Storage in Gemstash defaults to
|
48
|
-
You can change this in your config file via the
|
47
|
+
Storage in Gemstash defaults to ~/.gemstash unless otherwise specified.
|
48
|
+
You can change this in your config file via the :base_path key:
|
49
49
|
|
50
50
|
# ~/.gemstash/config.yml
|
51
51
|
---
|
52
52
|
:base_path: "/var/gemstash"
|
53
53
|
|
54
|
-
When customizing the
|
55
|
-
Gemstash will fail to run. Thus, if you want to use
|
56
|
-
in the previous example, make sure to
|
54
|
+
When customizing the base_path, the directory must exist, otherwise
|
55
|
+
Gemstash will fail to run. Thus, if you want to use /var/gemstash like
|
56
|
+
in the previous example, make sure to mkdir /var/gemstash and grant ac-
|
57
57
|
cess to the directory for the user you run Gemstash with.
|
58
58
|
|
59
59
|
1mDatabase0m
|
60
|
-
The
|
61
|
-
using. The default
|
62
|
-
which will use a database file located within your
|
63
|
-
database file will always be named
|
60
|
+
The :db_adapter configuration key specifies what database you will be
|
61
|
+
using. The default :db_adapter is sqlite3 (https://www.sqlite.org/),
|
62
|
+
which will use a database file located within your :base_path. The
|
63
|
+
database file will always be named gemstash.db.
|
64
64
|
|
65
|
-
You may also use
|
66
|
-
(http://www.mysql.com/), or
|
65
|
+
You may also use postgres (http://www.postgresql.org/), mysql
|
66
|
+
(http://www.mysql.com/), or mysql2 (http://sequel.jeremye-
|
67
67
|
vans.net/rdoc/files/doc/opening_databases_rdoc.html#label-mysql2) for
|
68
|
-
your
|
69
|
-
the
|
70
|
-
figuration to use the
|
68
|
+
your :db_adapter. When using any of these options, you need to specify
|
69
|
+
the :db_url to point to an existing database. Here is an example con-
|
70
|
+
figuration to use the postgres adapter:
|
71
71
|
|
72
72
|
# ~/.gemstash/config.yml
|
73
73
|
---
|
@@ -81,7 +81,7 @@
|
|
81
81
|
Regardless of the adapter you choose, the database will automatically
|
82
82
|
migrate to your version of Gemstash whenever the database is needed.
|
83
83
|
You only need to ensure the database exists and Gemstash will do the
|
84
|
-
rest, except for
|
84
|
+
rest, except for sqlite3 (for which Gemstash will also create the data-
|
85
85
|
base for you).
|
86
86
|
|
87
87
|
1mCache0m
|
@@ -93,15 +93,15 @@
|
|
93
93
|
:cache_type: memory
|
94
94
|
:cache_max_size: 2000
|
95
95
|
|
96
|
-
This configuration uses the default
|
97
|
-
|
96
|
+
This configuration uses the default memory cache, and has increased the
|
97
|
+
cache_max_size setting from its default of 500 items.
|
98
98
|
|
99
99
|
The memory cache can optionally be swapped out with a Memcached
|
100
100
|
(http://memcached.org/) server (or cluster of servers).
|
101
101
|
|
102
|
-
To use Memcached, use the
|
102
|
+
To use Memcached, use the memcached :cache_type configuration.
|
103
103
|
|
104
|
-
Provide the servers as a comma-separated list to the
|
104
|
+
Provide the servers as a comma-separated list to the :memcached_servers
|
105
105
|
configuration key:
|
106
106
|
|
107
107
|
# ~/.gemstash/config.yml
|
@@ -110,7 +110,7 @@
|
|
110
110
|
:memcached_servers: memcached1.local:11211,memcached2.local:11211
|
111
111
|
:cache_expiration: 1800
|
112
112
|
|
113
|
-
All caching expires in
|
113
|
+
All caching expires in cache_expiration number of seconds. Default is
|
114
114
|
1800 seconds (30 minutes). This option applies to all caching.
|
115
115
|
|
116
116
|
1mServer0m
|
@@ -122,7 +122,7 @@
|
|
122
122
|
ter/lib/gemstash/config.ru) for inspiration.
|
123
123
|
|
124
124
|
While the server is not customizable, the way Gemstash binds the port
|
125
|
-
can be changed. To change the binding, update the
|
125
|
+
can be changed. To change the binding, update the :bind configuration
|
126
126
|
key:
|
127
127
|
|
128
128
|
# ~/.gemstash/config.yml
|
@@ -134,11 +134,11 @@
|
|
134
134
|
anything valid for that flag.
|
135
135
|
|
136
136
|
The number of threads Puma uses is also customizable via the
|
137
|
-
|
137
|
+
:puma_threads configuration key. The default is 16.
|
138
138
|
|
139
139
|
1mProtected Fetch0m
|
140
140
|
Gemstash by default allows unauthenticated access for private gems.
|
141
|
-
Authenticated access is available via the
|
141
|
+
Authenticated access is available via the :protected_fetch configura-
|
142
142
|
tion key.
|
143
143
|
|
144
144
|
# ~/.gemstash/config.yml
|
@@ -148,15 +148,15 @@
|
|
148
148
|
More details on protected_fetch are here.
|
149
149
|
|
150
150
|
1mFetch Timeout0m
|
151
|
-
The default fetch timeout is 20 seconds. Use the
|
151
|
+
The default fetch timeout is 20 seconds. Use the :fetch_timeout con-
|
152
152
|
figuration key to change it.
|
153
153
|
|
154
154
|
---
|
155
155
|
:fetch_timeout: 20
|
156
156
|
|
157
157
|
1mConfig File Location0m
|
158
|
-
By default, configuration for Gemstash will be at
|
159
|
-
|
158
|
+
By default, configuration for Gemstash will be at ~/.gemstash/con-
|
159
|
+
fig.yml. This can be changed by providing the --config-file option to
|
160
160
|
the various Gemstash commands:
|
161
161
|
|
162
162
|
$ gemstash setup --config-file ./gemstash-config.yml
|
@@ -165,15 +165,15 @@
|
|
165
165
|
$ gemstash stop --config-file ./gemstash-config.yml
|
166
166
|
$ gemstash status --config-file ./gemstash-config.yml
|
167
167
|
|
168
|
-
When providing
|
168
|
+
When providing --config-file to gemstash setup, the provided file will
|
169
169
|
be output to with the provided configuration. 1mThis will overwrite 22many
|
170
170
|
existing configuration. If the file doesn't exist when providing
|
171
|
-
|
172
|
-
|
171
|
+
--config-file to gemstash start, gemstash stop, gemstash status, and
|
172
|
+
gemstash authorize, the default configuration will be used.
|
173
173
|
|
174
174
|
1mERB parsed config0m
|
175
|
-
You may also create a
|
176
|
-
this will be used instead of
|
175
|
+
You may also create a ~/.gemstash/config.yml.erb file. If present,
|
176
|
+
this will be used instead of ~/.gemstash/config.yml. For example, with
|
177
177
|
this you can use environment variables in the config:
|
178
178
|
|
179
179
|
# ~/.gemstash/config.yml.erb
|
@@ -1,46 +1,27 @@
|
|
1
1
|
<!-- Automatically generated by Pandoc -->
|
2
|
-
.\" Automatically generated by Pandoc 3.1.
|
2
|
+
.\" Automatically generated by Pandoc 3.1.8
|
3
3
|
.\"
|
4
|
-
.\" Define V font for inline verbatim, using C font in formats
|
5
|
-
.\" that render this, and otherwise B font.
|
6
|
-
.ie "\f[CB]x\f[]"x" \{\
|
7
|
-
. ftr V B
|
8
|
-
. ftr VI BI
|
9
|
-
. ftr VB B
|
10
|
-
. ftr VBI BI
|
11
|
-
.\}
|
12
|
-
.el \{\
|
13
|
-
. ftr V CR
|
14
|
-
. ftr VI CI
|
15
|
-
. ftr VB CB
|
16
|
-
. ftr VBI CBI
|
17
|
-
.\}
|
18
4
|
.TH "gemstash-debugging" "7" "October 28, 2015" "" ""
|
19
|
-
.hy
|
20
5
|
.SH Debugging Gemstash
|
21
|
-
.PP
|
22
6
|
If you are finding Gemstash isn\[cq]t behaving as you would expect, you
|
23
7
|
might want to start by looking at the server log.
|
24
|
-
You can find the log at \f[
|
25
|
-
|
8
|
+
You can find the log at \f[CR]server.log\f[R] within your base
|
9
|
+
directory.
|
10
|
+
By default, this will be at \f[CR]\[ti]/.gemstash/server.log\f[R].
|
26
11
|
.PP
|
27
12
|
You might find it easier to view the log directly in your terminal.
|
28
13
|
If you run Gemstash in non-daemonized form, the log will be output
|
29
14
|
directly to standard out:
|
30
15
|
.IP
|
31
|
-
.
|
32
|
-
\f[C]
|
16
|
+
.EX
|
33
17
|
$ gemstash start --no-daemonize
|
34
|
-
|
35
|
-
.fi
|
18
|
+
.EE
|
36
19
|
.PP
|
37
20
|
You can also check the status of the server:
|
38
21
|
.IP
|
39
|
-
.
|
40
|
-
\f[C]
|
22
|
+
.EX
|
41
23
|
$ gemstash status
|
42
|
-
|
43
|
-
.fi
|
24
|
+
.EE
|
44
25
|
.PP
|
45
26
|
The server status is checked by passing through to
|
46
27
|
pumactl (https://github.com/puma/puma#pumactl).
|
@@ -5,12 +5,12 @@
|
|
5
5
|
1mDebugging Gemstash0m
|
6
6
|
If you are finding Gemstash isn't behaving as you would expect, you
|
7
7
|
might want to start by looking at the server log. You can find the log
|
8
|
-
at
|
9
|
-
|
8
|
+
at server.log within your base directory. By default, this will be at
|
9
|
+
~/.gemstash/server.log.
|
10
10
|
|
11
11
|
You might find it easier to view the log directly in your terminal. If
|
12
|
-
you
|
13
|
-
|
12
|
+
you run Gemstash in non-daemonized form, the log will be output di-
|
13
|
+
rectly to standard out:
|
14
14
|
|
15
15
|
$ gemstash start --no-daemonize
|
16
16
|
|
@@ -18,10 +18,10 @@
|
|
18
18
|
|
19
19
|
$ gemstash status
|
20
20
|
|
21
|
-
The
|
21
|
+
The server status is checked by passing through to pumactl
|
22
22
|
(https://github.com/puma/puma#pumactl).
|
23
23
|
|
24
|
-
If
|
24
|
+
If you find a bug, please don't hesitate to open a bug report
|
25
25
|
(https://github.com/rubygems/gemstash#contributing)!
|
26
26
|
|
27
27
|
October 28, 2015 4mgemstash-debugging24m(7)
|
@@ -1,40 +1,22 @@
|
|
1
1
|
<!-- Automatically generated by Pandoc -->
|
2
|
-
.\" Automatically generated by Pandoc 3.1.
|
2
|
+
.\" Automatically generated by Pandoc 3.1.8
|
3
3
|
.\"
|
4
|
-
.\" Define V font for inline verbatim, using C font in formats
|
5
|
-
.\" that render this, and otherwise B font.
|
6
|
-
.ie "\f[CB]x\f[]"x" \{\
|
7
|
-
. ftr V B
|
8
|
-
. ftr VI BI
|
9
|
-
. ftr VB B
|
10
|
-
. ftr VBI BI
|
11
|
-
.\}
|
12
|
-
.el \{\
|
13
|
-
. ftr V CR
|
14
|
-
. ftr VI CI
|
15
|
-
. ftr VB CB
|
16
|
-
. ftr VBI CBI
|
17
|
-
.\}
|
18
4
|
.TH "gemstash-deploy" "7" "October 25, 2015" "" ""
|
19
|
-
.hy
|
20
5
|
.SH Deploying Gemstash
|
21
|
-
.PP
|
22
6
|
Bundler is here for the rescue to keep Gemstash up to date!
|
23
|
-
Create a \f[
|
7
|
+
Create a \f[CR]Gemfile\f[R] pointing to Gemstash:
|
24
8
|
.IP
|
25
|
-
.
|
26
|
-
\f[C]
|
9
|
+
.EX
|
27
10
|
# ./Gemfile
|
28
11
|
source \[dq]https://rubygems.org\[dq]
|
29
12
|
gem \[dq]gemstash\[dq]
|
30
|
-
|
31
|
-
.fi
|
13
|
+
.EE
|
32
14
|
.PP
|
33
|
-
Then \f[
|
34
|
-
When you are ready to upgrade, simply \f[
|
35
|
-
You may need to run \f[
|
36
|
-
Alternatively, you can \f[
|
37
|
-
\f[
|
15
|
+
Then \f[CR]bundle\f[R] to create your \f[CR]Gemfile.lock\f[R].
|
16
|
+
When you are ready to upgrade, simply \f[CR]bundle update\f[R].
|
17
|
+
You may need to run \f[CR]gemstash\f[R] via \f[CR]bundle exec\f[R].
|
18
|
+
Alternatively, you can \f[CR]gem uninstall gemstash\f[R] and
|
19
|
+
\f[CR]gem install gemstash\f[R] when you want to upgrade.
|
38
20
|
.PP
|
39
21
|
Gemstash will automatically run any necessary migrations, so updating
|
40
22
|
the gem is all that needs to be done.
|
@@ -42,25 +24,21 @@ the gem is all that needs to be done.
|
|
42
24
|
It is probably wise to stop Gemstash before upgrading, then starting
|
43
25
|
again once you are done:
|
44
26
|
.IP
|
45
|
-
.
|
46
|
-
\f[C]
|
27
|
+
.EX
|
47
28
|
$ bundle exec gemstash stop
|
48
29
|
$ bundle update
|
49
30
|
$ bundle exec gemstash start
|
50
|
-
|
51
|
-
.fi
|
31
|
+
.EE
|
52
32
|
.SS Monitoring
|
53
|
-
.PP
|
54
33
|
Health monitoring is built in to Gemstash using the
|
55
34
|
server_health_check-rack (https://github.com/on-site/server_health_check-rack)
|
56
35
|
gem.
|
57
|
-
If you request \f[
|
36
|
+
If you request \f[CR]/health\f[R] from your Gemstash instance, you will
|
58
37
|
get a JSON response along with an HTTP status code indicating success or
|
59
38
|
failure.
|
60
39
|
The JSON response will look something like this for a success case:
|
61
40
|
.IP
|
62
|
-
.
|
63
|
-
\f[C]
|
41
|
+
.EX
|
64
42
|
{
|
65
43
|
\[dq]status\[dq]: {
|
66
44
|
\[dq]heartbeat\[dq]: \[dq]OK\[dq],
|
@@ -70,18 +48,16 @@ The JSON response will look something like this for a success case:
|
|
70
48
|
\[dq]db_write\[dq]: \[dq]OK\[dq]
|
71
49
|
}
|
72
50
|
}
|
73
|
-
|
74
|
-
.fi
|
51
|
+
.EE
|
75
52
|
.PP
|
76
53
|
This request will test storage and database access and report on the
|
77
54
|
result.
|
78
55
|
Each key in the status can be requested alone to just report on that
|
79
56
|
status.
|
80
57
|
For example, if you would like a health check that doesn\[cq]t interact
|
81
|
-
with storage or the database, you can use \f[
|
58
|
+
with storage or the database, you can use \f[CR]/health/heartbeat\f[R]
|
82
59
|
which will always respond with a success while your Gemstash server is
|
83
60
|
running.
|
84
61
|
.SS Downgrading
|
85
|
-
.PP
|
86
62
|
It is not recommended to go backwards in Gemstash versions.
|
87
63
|
Migrations may have run that could leave the database in a bad state.
|