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