gemstash 2.8.2 → 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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gemstash/authorization.rb +0 -2
  3. data/lib/gemstash/cache.rb +5 -4
  4. data/lib/gemstash/cli/base.rb +9 -2
  5. data/lib/gemstash/cli/setup.rb +1 -1
  6. data/lib/gemstash/cli/start.rb +4 -0
  7. data/lib/gemstash/configuration.rb +71 -1
  8. data/lib/gemstash/db/upstream.rb +30 -2
  9. data/lib/gemstash/dependencies.rb +28 -5
  10. data/lib/gemstash/env.rb +4 -2
  11. data/lib/gemstash/gem_fetcher.rb +1 -2
  12. data/lib/gemstash/gem_pusher.rb +24 -20
  13. data/lib/gemstash/gem_source/private_source.rb +22 -6
  14. data/lib/gemstash/gem_source/upstream_source.rb +129 -34
  15. data/lib/gemstash/http_client.rb +167 -8
  16. data/lib/gemstash/logging.rb +3 -1
  17. data/lib/gemstash/man/gemstash-authorize.1 +29 -48
  18. data/lib/gemstash/man/gemstash-authorize.1.txt +14 -14
  19. data/lib/gemstash/man/gemstash-configuration.5 +231 -154
  20. data/lib/gemstash/man/gemstash-configuration.5.txt +208 -93
  21. data/lib/gemstash/man/gemstash-customize.7 +150 -168
  22. data/lib/gemstash/man/gemstash-customize.7.txt +80 -86
  23. data/lib/gemstash/man/gemstash-debugging.7 +20 -33
  24. data/lib/gemstash/man/gemstash-debugging.7.txt +5 -7
  25. data/lib/gemstash/man/gemstash-deploy.7 +31 -53
  26. data/lib/gemstash/man/gemstash-deploy.7.txt +17 -18
  27. data/lib/gemstash/man/gemstash-mirror.7 +24 -37
  28. data/lib/gemstash/man/gemstash-mirror.7.txt +14 -9
  29. data/lib/gemstash/man/gemstash-multiple-sources.7 +105 -110
  30. data/lib/gemstash/man/gemstash-multiple-sources.7.txt +62 -41
  31. data/lib/gemstash/man/gemstash-private-gems.7 +87 -136
  32. data/lib/gemstash/man/gemstash-private-gems.7.txt +30 -30
  33. data/lib/gemstash/man/gemstash-readme.7 +105 -127
  34. data/lib/gemstash/man/gemstash-readme.7.txt +43 -49
  35. data/lib/gemstash/man/gemstash-setup.1 +22 -42
  36. data/lib/gemstash/man/gemstash-setup.1.txt +12 -12
  37. data/lib/gemstash/man/gemstash-start.1 +9 -27
  38. data/lib/gemstash/man/gemstash-start.1.txt +5 -5
  39. data/lib/gemstash/man/gemstash-status.1 +9 -27
  40. data/lib/gemstash/man/gemstash-status.1.txt +5 -5
  41. data/lib/gemstash/man/gemstash-stop.1 +9 -27
  42. data/lib/gemstash/man/gemstash-stop.1.txt +5 -5
  43. data/lib/gemstash/man/gemstash-version.1 +8 -28
  44. data/lib/gemstash/man/gemstash-version.1.txt +2 -2
  45. data/lib/gemstash/rack_env_rewriter.rb +3 -0
  46. data/lib/gemstash/upstream.rb +83 -6
  47. data/lib/gemstash/version.rb +1 -1
  48. data/lib/gemstash/web.rb +12 -0
  49. metadata +7 -7
@@ -1,33 +1,16 @@
1
- .\" Automatically generated by Pandoc 3.1.3
1
+ .\" Automatically generated by Pandoc 3.7.0.2
2
2
  .\"
3
- .\" Define V font for inline verbatim, using C font in formats
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[V]gemstash setup\f[R] and answer the questions it provides (a
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
- [\[ti]/.gemstash]
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\[cq]ve answered the questions, some checks will be made to
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\[cq]t exist in the previous example, so
80
- the command failed and the configuration wasn\[cq]t saved.
81
- If the command passes, you may provide the \f[V]--redo\f[R] option to
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[V]$ gemstash setup --redo\f[R]
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
- [\[ti]/.gemstash]
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[V]\[ti]/.gemstash/config.yml\f[R].
107
+ configuration file located at \f[CR]\(ti/.gemstash/config.yml\f[R].
125
108
  .SS Files
126
- .PP
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[V]:base_path\f[R]
111
+ You can change this in your config file via the \f[CR]:base_path\f[R]
130
112
  key:
131
113
  .IP
132
- .nf
133
- \f[C]
134
- # \[ti]/.gemstash/config.yml
135
- ---
136
- :base_path: \[dq]/var/gemstash\[dq]
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[V]base_path\f[R], the directory must exist,
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[V]/var/gemstash\f[R] like in the previous
143
- example, make sure to \f[V]mkdir /var/gemstash\f[R] and grant access to
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
- .PP
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[V]:db_adapter\f[R] is
150
- \f[V]sqlite3\f[R] (https://www.sqlite.org/), which will use a database
151
- file located within your \f[V]:base_path\f[R].
152
- The database file will always be named \f[V]gemstash.db\f[R].
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 \f[V]postgres\f[R] (http://www.postgresql.org/),
155
- \f[V]mysql\f[R] (http://www.mysql.com/), or
156
- \f[V]mysql2\f[R] (http://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-mysql2)
157
- for your \f[V]:db_adapter\f[R].
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[V]:db_url\f[R] to point to an existing database.
160
- Here is an example configuration to use the \f[V]postgres\f[R] adapter:
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
- .nf
163
- \f[C]
164
- # \[ti]/.gemstash/config.yml
165
- ---
166
- :db_adapter: postgres
167
- :db_url: postgres:///gemstash
168
- :db_connection_options: # Sequel.connect options
169
- :connect_timeout: 10
170
- :read_timeout: 5
171
- :timeout: 30
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[V]sqlite3\f[R] (for which Gemstash will also create
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
- .nf
187
- \f[C]
188
- # \[ti]/.gemstash/config.yml
189
- ---
190
- :cache_type: memory
191
- :cache_max_size: 2000
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[V]memory\f[R] cache, and has
196
- increased the \f[V]cache_max_size\f[R] setting from its default of 500
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
- Memcached (http://memcached.org/) server (or cluster of servers).
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[V]memcached\f[R] \f[V]:cache_type\f[R]
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-separated list to the
206
- \f[V]:memcached_servers\f[R] configuration key:
194
+ Provide the servers as a comma\-separated list to the
195
+ \f[CR]:memcached_servers\f[R] configuration key:
207
196
  .IP
208
- .nf
209
- \f[C]
210
- # \[ti]/.gemstash/config.yml
211
- ---
212
- :cache_type: memcached
213
- :memcached_servers: memcached1.local:11211,memcached2.local:11211
214
- :cache_expiration: 1800
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[V]cache_expiration\f[R] number of seconds.
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
- .PP
223
- Gemstash uses Puma (http://puma.io/) and Rack (http://rack.github.io/)
224
- as the server.
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 Puma
227
- configuration (https://github.com/rubygems/gemstash/blob/master/lib/gemstash/puma.rb)
228
- and the rackup
229
- file (https://github.com/rubygems/gemstash/blob/master/lib/gemstash/config.ru)
230
- for inspiration.
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[V]:bind\f[R] configuration key:
231
+ To change the binding, update the \f[CR]:bind\f[R] configuration key:
235
232
  .IP
236
- .nf
237
- \f[C]
238
- # \[ti]/.gemstash/config.yml
239
- ---
240
- :bind: tcp://0.0.0.0:4242
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 Puma bind
245
- flag (https://github.com/puma/puma#binding-tcp--sockets), and will
246
- support anything valid for that flag.
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[V]:puma_threads\f[R] configuration key.
250
- The default is \f[V]16\f[R].
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[V]:protected_fetch\f[R]
250
+ Authenticated access is available via the \f[CR]:protected_fetch\f[R]
255
251
  configuration key.
256
252
  .IP
257
- .nf
258
- \f[C]
259
- # \[ti]/.gemstash/config.yml
260
- ---
261
- :protected_fetch: true
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[V]:fetch_timeout\f[R] configuration key to change it.
262
+ Use the \f[CR]:fetch_timeout\f[R] configuration key to change it.
270
263
  .IP
271
- .nf
272
- \f[C]
273
- ---
274
- :fetch_timeout: 20
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[V]:open_timeout\f[R] configuration key to change it.
270
+ Use the \f[CR]:open_timeout\f[R] configuration key to change it.
281
271
  .IP
282
- .nf
283
- \f[C]
284
- ---
285
- :open_timeout: 2
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[V]\[ti]/.gemstash/config.yml\f[R].
292
- This can be changed by providing the \f[V]--config-file\f[R] option to
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
- .nf
296
- \f[C]
297
- $ gemstash setup --config-file ./gemstash-config.yml
298
- $ gemstash authorize --config-file ./gemstash-config.yml
299
- $ gemstash start --config-file ./gemstash-config.yml
300
- $ gemstash stop --config-file ./gemstash-config.yml
301
- $ gemstash status --config-file ./gemstash-config.yml
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[V]--config-file\f[R] to \f[V]gemstash setup\f[R], the
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\[cq]t exist when providing \f[V]--config-file\f[R] to
309
- \f[V]gemstash start\f[R], \f[V]gemstash stop\f[R],
310
- \f[V]gemstash status\f[R], and \f[V]gemstash authorize\f[R], the default
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
- .PP
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[V]\[ti]/.gemstash/config.yml\f[R].
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
- .nf
320
- \f[C]
321
- # \[ti]/.gemstash/config.yml.erb
322
- ---
323
- :db_adapter: postgres
324
- :db_url: <%= ENV[\[dq]DATABASE_URL\[dq]] %>
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