gemstash 2.8.1 → 2.9.0
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/authorization.rb +0 -2
- data/lib/gemstash/cache.rb +5 -4
- data/lib/gemstash/cli/base.rb +9 -2
- data/lib/gemstash/cli/setup.rb +1 -1
- data/lib/gemstash/cli/start.rb +4 -0
- data/lib/gemstash/configuration.rb +71 -1
- data/lib/gemstash/db/upstream.rb +30 -2
- data/lib/gemstash/dependencies.rb +28 -5
- data/lib/gemstash/env.rb +4 -2
- data/lib/gemstash/gem_fetcher.rb +1 -2
- data/lib/gemstash/gem_pusher.rb +24 -20
- data/lib/gemstash/gem_source/private_source.rb +22 -6
- data/lib/gemstash/gem_source/upstream_source.rb +129 -34
- data/lib/gemstash/http_client.rb +167 -8
- data/lib/gemstash/logging.rb +3 -1
- data/lib/gemstash/man/gemstash-authorize.1 +29 -48
- data/lib/gemstash/man/gemstash-authorize.1.txt +14 -14
- data/lib/gemstash/man/gemstash-configuration.5 +231 -154
- data/lib/gemstash/man/gemstash-configuration.5.txt +208 -93
- data/lib/gemstash/man/gemstash-customize.7 +150 -168
- data/lib/gemstash/man/gemstash-customize.7.txt +80 -86
- data/lib/gemstash/man/gemstash-debugging.7 +20 -33
- data/lib/gemstash/man/gemstash-debugging.7.txt +5 -7
- data/lib/gemstash/man/gemstash-deploy.7 +31 -53
- data/lib/gemstash/man/gemstash-deploy.7.txt +17 -18
- data/lib/gemstash/man/gemstash-mirror.7 +24 -37
- data/lib/gemstash/man/gemstash-mirror.7.txt +14 -9
- data/lib/gemstash/man/gemstash-multiple-sources.7 +105 -110
- data/lib/gemstash/man/gemstash-multiple-sources.7.txt +62 -41
- data/lib/gemstash/man/gemstash-private-gems.7 +87 -136
- data/lib/gemstash/man/gemstash-private-gems.7.txt +30 -30
- data/lib/gemstash/man/gemstash-readme.7 +105 -127
- data/lib/gemstash/man/gemstash-readme.7.txt +43 -49
- data/lib/gemstash/man/gemstash-setup.1 +22 -42
- data/lib/gemstash/man/gemstash-setup.1.txt +12 -12
- data/lib/gemstash/man/gemstash-start.1 +9 -27
- data/lib/gemstash/man/gemstash-start.1.txt +5 -5
- data/lib/gemstash/man/gemstash-status.1 +9 -27
- data/lib/gemstash/man/gemstash-status.1.txt +5 -5
- data/lib/gemstash/man/gemstash-stop.1 +9 -27
- data/lib/gemstash/man/gemstash-stop.1.txt +5 -5
- data/lib/gemstash/man/gemstash-version.1 +8 -28
- data/lib/gemstash/man/gemstash-version.1.txt +2 -2
- data/lib/gemstash/puma.rb +1 -0
- data/lib/gemstash/rack_env_rewriter.rb +3 -0
- data/lib/gemstash/upstream.rb +83 -6
- data/lib/gemstash/version.rb +1 -1
- data/lib/gemstash/web.rb +12 -0
- metadata +7 -7
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
.\" Automatically generated by Pandoc 3.
|
|
1
|
+
.\" Automatically generated by Pandoc 3.7.0.2
|
|
2
2
|
.\"
|
|
3
|
-
|
|
4
|
-
.\" that render this, and otherwise B font.
|
|
5
|
-
.ie "\f[CB]x\f[]"x" \{\
|
|
6
|
-
. ftr V B
|
|
7
|
-
. ftr VI BI
|
|
8
|
-
. ftr VB B
|
|
9
|
-
. ftr VBI BI
|
|
10
|
-
.\}
|
|
11
|
-
.el \{\
|
|
12
|
-
. ftr V CR
|
|
13
|
-
. ftr VI CI
|
|
14
|
-
. ftr VB CB
|
|
15
|
-
. ftr VBI CBI
|
|
16
|
-
.\}
|
|
17
|
-
.TH "gemstash-customize" "7" "October 28, 2015" "" ""
|
|
18
|
-
.hy
|
|
3
|
+
.TH "gemstash\-customize" "7" "October 28, 2015" ""
|
|
19
4
|
.SH Customizing the Server
|
|
20
|
-
.PP
|
|
21
5
|
Although Gemstash is designed for as minimal setup as possible, there
|
|
22
6
|
may be times you will want to change some of the default configuration.
|
|
23
7
|
By the end of this guide, you will be able to customize some of the
|
|
24
8
|
Gemstash behavior, including where files are stored, what database
|
|
25
9
|
Gemstash uses, and how Gemstash caches certain requests.
|
|
26
10
|
.SS Setup
|
|
27
|
-
.PP
|
|
28
11
|
Several customizable options are available via an interactive Gemstash
|
|
29
12
|
command.
|
|
30
|
-
Run \f[
|
|
13
|
+
Run \f[CR]gemstash setup\f[R] and answer the questions it provides (a
|
|
31
14
|
blank answer will use the default value):
|
|
32
15
|
.RS
|
|
33
16
|
.PP
|
|
@@ -36,7 +19,7 @@ $ gemstash setup
|
|
|
36
19
|
.P
|
|
37
20
|
.PD
|
|
38
21
|
Where should files go?
|
|
39
|
-
[\
|
|
22
|
+
[\(ti/.gemstash]
|
|
40
23
|
.PD 0
|
|
41
24
|
.P
|
|
42
25
|
.PD
|
|
@@ -74,20 +57,20 @@ The database is not available
|
|
|
74
57
|
.PD
|
|
75
58
|
.RE
|
|
76
59
|
.PP
|
|
77
|
-
Once you\
|
|
60
|
+
Once you\(cqve answered the questions, some checks will be made to
|
|
78
61
|
ensure the configuration will work.
|
|
79
|
-
For example, the database didn\
|
|
80
|
-
the command failed and the configuration wasn\
|
|
81
|
-
If the command passes, you may provide the \f[
|
|
62
|
+
For example, the database didn\(cqt exist in the previous example, so
|
|
63
|
+
the command failed and the configuration wasn\(cqt saved.
|
|
64
|
+
If the command passes, you may provide the \f[CR]\-\-redo\f[R] option to
|
|
82
65
|
force configuration to be redone:
|
|
83
66
|
.RS
|
|
84
67
|
.PP
|
|
85
|
-
\f[
|
|
68
|
+
\f[CR]$ gemstash setup \-\-redo\f[R]
|
|
86
69
|
.PD 0
|
|
87
70
|
.P
|
|
88
71
|
.PD
|
|
89
72
|
Where should files go?
|
|
90
|
-
[\
|
|
73
|
+
[\(ti/.gemstash]
|
|
91
74
|
.PD 0
|
|
92
75
|
.P
|
|
93
76
|
.PD
|
|
@@ -121,206 +104,205 @@ You are all setup!
|
|
|
121
104
|
.RE
|
|
122
105
|
.PP
|
|
123
106
|
Once all checks have passed, Gemstash will store your answers in the
|
|
124
|
-
configuration file located at \f[
|
|
107
|
+
configuration file located at \f[CR]\(ti/.gemstash/config.yml\f[R].
|
|
125
108
|
.SS Files
|
|
126
|
-
|
|
127
|
-
Storage in Gemstash defaults to \f[V]\[ti]/.gemstash\f[R] unless
|
|
109
|
+
Storage in Gemstash defaults to \f[CR]\(ti/.gemstash\f[R] unless
|
|
128
110
|
otherwise specified.
|
|
129
|
-
You can change this in your config file via the \f[
|
|
111
|
+
You can change this in your config file via the \f[CR]:base_path\f[R]
|
|
130
112
|
key:
|
|
131
113
|
.IP
|
|
132
|
-
.
|
|
133
|
-
\f[
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
\f[R]
|
|
138
|
-
.fi
|
|
114
|
+
.EX
|
|
115
|
+
\f[I]# \(ti/.gemstash/config.yml\f[R]
|
|
116
|
+
\-\-\-
|
|
117
|
+
:base_path\f[B]:\f[R] \(dq/var/gemstash\(dq
|
|
118
|
+
.EE
|
|
139
119
|
.PP
|
|
140
|
-
When customizing the \f[
|
|
120
|
+
When customizing the \f[CR]base_path\f[R], the directory must exist,
|
|
141
121
|
otherwise Gemstash will fail to run.
|
|
142
|
-
Thus, if you want to use \f[
|
|
143
|
-
example, make sure to \f[
|
|
122
|
+
Thus, if you want to use \f[CR]/var/gemstash\f[R] like in the previous
|
|
123
|
+
example, make sure to \f[CR]mkdir /var/gemstash\f[R] and grant access to
|
|
144
124
|
the directory for the user you run Gemstash with.
|
|
145
125
|
.SS Database
|
|
146
|
-
|
|
147
|
-
The \f[V]:db_adapter\f[R] configuration key specifies what database you
|
|
126
|
+
The \f[CR]:db_adapter\f[R] configuration key specifies what database you
|
|
148
127
|
will be using.
|
|
149
|
-
The default \f[
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
128
|
+
The default \f[CR]:db_adapter\f[R] is \c
|
|
129
|
+
.UR https://www.sqlite.org/
|
|
130
|
+
\f[CR]sqlite3\f[R]
|
|
131
|
+
.UE \c
|
|
132
|
+
, which will use a database file located within your
|
|
133
|
+
\f[CR]:base_path\f[R].
|
|
134
|
+
The database file will always be named \f[CR]gemstash.db\f[R].
|
|
153
135
|
.PP
|
|
154
|
-
You may also use \
|
|
155
|
-
|
|
156
|
-
\f[
|
|
157
|
-
|
|
136
|
+
You may also use \c
|
|
137
|
+
.UR http://www.postgresql.org/
|
|
138
|
+
\f[CR]postgres\f[R]
|
|
139
|
+
.UE \c
|
|
140
|
+
, \c
|
|
141
|
+
.UR http://www.mysql.com/
|
|
142
|
+
\f[CR]mysql\f[R]
|
|
143
|
+
.UE \c
|
|
144
|
+
, or \c
|
|
145
|
+
.UR http://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-mysql2
|
|
146
|
+
\f[CR]mysql2\f[R]
|
|
147
|
+
.UE \c
|
|
148
|
+
\ for your \f[CR]:db_adapter\f[R].
|
|
158
149
|
When using any of these options, you need to specify the
|
|
159
|
-
\f[
|
|
160
|
-
Here is an example configuration to use the \f[
|
|
150
|
+
\f[CR]:db_url\f[R] to point to an existing database.
|
|
151
|
+
Here is an example configuration to use the \f[CR]postgres\f[R] adapter:
|
|
161
152
|
.IP
|
|
162
|
-
.
|
|
163
|
-
\f[
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
:
|
|
167
|
-
:
|
|
168
|
-
:
|
|
169
|
-
:
|
|
170
|
-
:
|
|
171
|
-
|
|
172
|
-
\f[R]
|
|
173
|
-
.fi
|
|
153
|
+
.EX
|
|
154
|
+
\f[I]# \(ti/.gemstash/config.yml\f[R]
|
|
155
|
+
\-\-\-
|
|
156
|
+
:db_adapter\f[B]:\f[R] postgres
|
|
157
|
+
:db_url\f[B]:\f[R] postgres:///gemstash
|
|
158
|
+
:db_connection_options\f[B]:\f[R]\f[I] # Sequel.connect options\f[R]
|
|
159
|
+
:connect_timeout\f[B]:\f[R] 10
|
|
160
|
+
:read_timeout\f[B]:\f[R] 5
|
|
161
|
+
:timeout\f[B]:\f[R] 30
|
|
162
|
+
.EE
|
|
174
163
|
.PP
|
|
175
164
|
Regardless of the adapter you choose, the database will automatically
|
|
176
165
|
migrate to your version of Gemstash whenever the database is needed.
|
|
177
166
|
You only need to ensure the database exists and Gemstash will do the
|
|
178
|
-
rest, except for \f[
|
|
167
|
+
rest, except for \f[CR]sqlite3\f[R] (for which Gemstash will also create
|
|
179
168
|
the database for you).
|
|
180
169
|
.SS Cache
|
|
181
|
-
.PP
|
|
182
170
|
Certain things (like dependencies) are cached in memory.
|
|
183
171
|
This avoids web calls to the gem source, and database calls for private
|
|
184
172
|
gems.
|
|
185
173
|
.IP
|
|
186
|
-
.
|
|
187
|
-
\f[
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
:
|
|
191
|
-
|
|
192
|
-
\f[R]
|
|
193
|
-
.fi
|
|
174
|
+
.EX
|
|
175
|
+
\f[I]# \(ti/.gemstash/config.yml\f[R]
|
|
176
|
+
\-\-\-
|
|
177
|
+
:cache_type\f[B]:\f[R] memory
|
|
178
|
+
:cache_max_size\f[B]:\f[R] 2000
|
|
179
|
+
.EE
|
|
194
180
|
.PP
|
|
195
|
-
This configuration uses the default \f[
|
|
196
|
-
increased the \f[
|
|
181
|
+
This configuration uses the default \f[CR]memory\f[R] cache, and has
|
|
182
|
+
increased the \f[CR]cache_max_size\f[R] setting from its default of 500
|
|
197
183
|
items.
|
|
198
184
|
.PP
|
|
199
|
-
The memory cache can optionally be swapped out with a
|
|
200
|
-
|
|
185
|
+
The memory cache can optionally be swapped out with a \c
|
|
186
|
+
.UR http://memcached.org/
|
|
187
|
+
Memcached
|
|
188
|
+
.UE \c
|
|
189
|
+
\ server (or cluster of servers).
|
|
201
190
|
.PP
|
|
202
|
-
To use Memcached, use the \f[
|
|
191
|
+
To use Memcached, use the \f[CR]memcached\f[R] \f[CR]:cache_type\f[R]
|
|
203
192
|
configuration.
|
|
204
193
|
.PP
|
|
205
|
-
Provide the servers as a comma
|
|
206
|
-
\f[
|
|
194
|
+
Provide the servers as a comma\-separated list to the
|
|
195
|
+
\f[CR]:memcached_servers\f[R] configuration key:
|
|
207
196
|
.IP
|
|
208
|
-
.
|
|
209
|
-
\f[
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
:
|
|
213
|
-
:
|
|
214
|
-
|
|
215
|
-
\f[R]
|
|
216
|
-
.fi
|
|
197
|
+
.EX
|
|
198
|
+
\f[I]# \(ti/.gemstash/config.yml\f[R]
|
|
199
|
+
\-\-\-
|
|
200
|
+
:cache_type\f[B]:\f[R] memcached
|
|
201
|
+
:memcached_servers\f[B]:\f[R] memcached1.local:11211,memcached2.local:11211
|
|
202
|
+
:cache_expiration\f[B]:\f[R] 1800
|
|
203
|
+
.EE
|
|
217
204
|
.PP
|
|
218
|
-
All caching expires in \f[
|
|
205
|
+
All caching expires in \f[CR]cache_expiration\f[R] number of seconds.
|
|
219
206
|
Default is 1800 seconds (30 minutes).
|
|
220
207
|
This option applies to all caching.
|
|
221
208
|
.SS Server
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
209
|
+
Gemstash uses \c
|
|
210
|
+
.UR http://puma.io/
|
|
211
|
+
Puma
|
|
212
|
+
.UE \c
|
|
213
|
+
\ and \c
|
|
214
|
+
.UR http://rack.github.io/
|
|
215
|
+
Rack
|
|
216
|
+
.UE \c
|
|
217
|
+
\ as the server.
|
|
225
218
|
Alternate server configurations are not currently supported, but you can
|
|
226
|
-
take a look at the
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
219
|
+
take a look at the \c
|
|
220
|
+
.UR https://github.com/rubygems/gemstash/blob/master/lib/gemstash/puma.rb
|
|
221
|
+
Puma configuration
|
|
222
|
+
.UE \c
|
|
223
|
+
\ and the \c
|
|
224
|
+
.UR https://github.com/rubygems/gemstash/blob/master/lib/gemstash/config.ru
|
|
225
|
+
rackup file
|
|
226
|
+
.UE \c
|
|
227
|
+
\ for inspiration.
|
|
231
228
|
.PP
|
|
232
229
|
While the server is not customizable, the way Gemstash binds the port
|
|
233
230
|
can be changed.
|
|
234
|
-
To change the binding, update the \f[
|
|
231
|
+
To change the binding, update the \f[CR]:bind\f[R] configuration key:
|
|
235
232
|
.IP
|
|
236
|
-
.
|
|
237
|
-
\f[
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
\f[R]
|
|
242
|
-
.fi
|
|
233
|
+
.EX
|
|
234
|
+
\f[I]# \(ti/.gemstash/config.yml\f[R]
|
|
235
|
+
\-\-\-
|
|
236
|
+
:bind\f[B]:\f[R] tcp://0.0.0.0:4242
|
|
237
|
+
.EE
|
|
243
238
|
.PP
|
|
244
|
-
This maps directly to the
|
|
245
|
-
|
|
246
|
-
|
|
239
|
+
This maps directly to the \c
|
|
240
|
+
.UR https://github.com/puma/puma#binding-tcp--sockets
|
|
241
|
+
Puma bind flag
|
|
242
|
+
.UE \c
|
|
243
|
+
, and will support anything valid for that flag.
|
|
247
244
|
.PP
|
|
248
245
|
The number of threads Puma uses is also customizable via the
|
|
249
|
-
\f[
|
|
250
|
-
The default is \f[
|
|
246
|
+
\f[CR]:puma_threads\f[R] configuration key.
|
|
247
|
+
The default is \f[CR]16\f[R].
|
|
251
248
|
.SS Protected Fetch
|
|
252
|
-
.PP
|
|
253
249
|
Gemstash by default allows unauthenticated access for private gems.
|
|
254
|
-
Authenticated access is available via the \f[
|
|
250
|
+
Authenticated access is available via the \f[CR]:protected_fetch\f[R]
|
|
255
251
|
configuration key.
|
|
256
252
|
.IP
|
|
257
|
-
.
|
|
258
|
-
\f[
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
\f[R]
|
|
263
|
-
.fi
|
|
253
|
+
.EX
|
|
254
|
+
\f[I]# \(ti/.gemstash/config.yml\f[R]
|
|
255
|
+
\-\-\-
|
|
256
|
+
:protected_fetch\f[B]:\f[R] true
|
|
257
|
+
.EE
|
|
264
258
|
.PP
|
|
265
259
|
More details on protected_fetch are here.
|
|
266
260
|
.SS Fetch Timeout
|
|
267
|
-
.PP
|
|
268
261
|
The default fetch timeout is 20 seconds.
|
|
269
|
-
Use the \f[
|
|
262
|
+
Use the \f[CR]:fetch_timeout\f[R] configuration key to change it.
|
|
270
263
|
.IP
|
|
271
|
-
.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
\f[R]
|
|
276
|
-
.fi
|
|
264
|
+
.EX
|
|
265
|
+
\-\-\-
|
|
266
|
+
:fetch_timeout\f[B]:\f[R] 20
|
|
267
|
+
.EE
|
|
277
268
|
.SS Open Timeout
|
|
278
|
-
.PP
|
|
279
269
|
The default connection open timeout is 2 seconds.
|
|
280
|
-
Use the \f[
|
|
270
|
+
Use the \f[CR]:open_timeout\f[R] configuration key to change it.
|
|
281
271
|
.IP
|
|
282
|
-
.
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
\f[R]
|
|
287
|
-
.fi
|
|
272
|
+
.EX
|
|
273
|
+
\-\-\-
|
|
274
|
+
:open_timeout\f[B]:\f[R] 2
|
|
275
|
+
.EE
|
|
288
276
|
.SS Config File Location
|
|
289
|
-
.PP
|
|
290
277
|
By default, configuration for Gemstash will be at
|
|
291
|
-
\f[
|
|
292
|
-
This can be changed by providing the \f[
|
|
293
|
-
the various Gemstash commands:
|
|
278
|
+
\f[CR]\(ti/.gemstash/config.yml\f[R].
|
|
279
|
+
This can be changed by providing the \f[CR]\-\-config\-file\f[R] option
|
|
280
|
+
to the various Gemstash commands:
|
|
294
281
|
.IP
|
|
295
|
-
.
|
|
296
|
-
|
|
297
|
-
$ gemstash
|
|
298
|
-
$ gemstash
|
|
299
|
-
$ gemstash
|
|
300
|
-
$ gemstash
|
|
301
|
-
|
|
302
|
-
\f[R]
|
|
303
|
-
.fi
|
|
282
|
+
.EX
|
|
283
|
+
$ gemstash setup \-\-config\-file ./gemstash\-config.yml
|
|
284
|
+
$ gemstash authorize \-\-config\-file ./gemstash\-config.yml
|
|
285
|
+
$ gemstash start \-\-config\-file ./gemstash\-config.yml
|
|
286
|
+
$ gemstash stop \-\-config\-file ./gemstash\-config.yml
|
|
287
|
+
$ gemstash status \-\-config\-file ./gemstash\-config.yml
|
|
288
|
+
.EE
|
|
304
289
|
.PP
|
|
305
|
-
When providing \f[
|
|
306
|
-
provided file will be output to with the provided configuration.
|
|
290
|
+
When providing \f[CR]\-\-config\-file\f[R] to \f[CR]gemstash setup\f[R],
|
|
291
|
+
the provided file will be output to with the provided configuration.
|
|
307
292
|
\f[B]This will overwrite\f[R] any existing configuration.
|
|
308
|
-
If the file doesn\
|
|
309
|
-
\f[
|
|
310
|
-
\f[
|
|
311
|
-
configuration will be used.
|
|
293
|
+
If the file doesn\(cqt exist when providing \f[CR]\-\-config\-file\f[R]
|
|
294
|
+
to \f[CR]gemstash start\f[R], \f[CR]gemstash stop\f[R],
|
|
295
|
+
\f[CR]gemstash status\f[R], and \f[CR]gemstash authorize\f[R], the
|
|
296
|
+
default configuration will be used.
|
|
312
297
|
.SS ERB parsed config
|
|
313
|
-
.
|
|
314
|
-
You may also create a \f[V]\[ti]/.gemstash/config.yml.erb\f[R] file.
|
|
298
|
+
You may also create a \f[CR]\(ti/.gemstash/config.yml.erb\f[R] file.
|
|
315
299
|
If present, this will be used instead of
|
|
316
|
-
\f[
|
|
300
|
+
\f[CR]\(ti/.gemstash/config.yml\f[R].
|
|
317
301
|
For example, with this you can use environment variables in the config:
|
|
318
302
|
.IP
|
|
319
|
-
.
|
|
320
|
-
\f[
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
:
|
|
324
|
-
|
|
325
|
-
\f[R]
|
|
326
|
-
.fi
|
|
303
|
+
.EX
|
|
304
|
+
\f[I]# \(ti/.gemstash/config.yml.erb\f[R]
|
|
305
|
+
\-\-\-
|
|
306
|
+
:db_adapter\f[B]:\f[R] postgres
|
|
307
|
+
:db_url\f[B]: \f[R]<%= ENV\f[B][\f[R]\(dqDATABASE_URL\(dq\f[B]]\f[R] %>
|
|
308
|
+
.EE
|