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.
Files changed (50) 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/puma.rb +1 -0
  46. data/lib/gemstash/rack_env_rewriter.rb +3 -0
  47. data/lib/gemstash/upstream.rb +83 -6
  48. data/lib/gemstash/version.rb +1 -1
  49. data/lib/gemstash/web.rb +12 -0
  50. metadata +7 -7
@@ -1,31 +1,14 @@
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-private-gems" "7" "October 8, 2015" "" ""
18
- .hy
3
+ .TH "gemstash\-private\-gems" "7" "October 8, 2015" ""
19
4
  .SH Private Gems
20
- .PP
21
5
  Stashing private gems in your Gemstash server requires a bit of
22
6
  additional setup.
23
- If you haven\[cq]t read through the Quickstart Guide, you should do that
7
+ If you haven\(cqt read through the Quickstart Guide, you should do that
24
8
  first.
25
9
  By the end of this guide, you will be able to interact with your
26
10
  Gemstash server to store and retrieve your private gems.
27
11
  .SS Authorizing
28
- .PP
29
12
  \f[B]IMPORTANT NOTE:\f[R] Do not use the actual key value in this
30
13
  document, otherwise your Gemstash server will be vulnerable to anyone
31
14
  who wants to try to use the key against your server.
@@ -34,208 +17,176 @@ running the commands.
34
17
  .PP
35
18
  In order to push a gem to your Gemstash server, you need to first create
36
19
  an API key.
37
- Utilize the \f[V]gemstash authorize\f[R] command to create the API key:
20
+ Utilize the \f[CR]gemstash authorize\f[R] command to create the API key:
38
21
  .IP
39
- .nf
40
- \f[C]
22
+ .EX
41
23
  $ gemstash authorize
42
24
  Your new key is: e374e237fdf5fa5718d2a21bd63dc911
43
- \f[R]
44
- .fi
25
+ .EE
45
26
  .PP
46
- This new key can \f[V]push\f[R], \f[V]yank\f[R], and \f[V]fetch\f[R]
27
+ This new key can \f[CR]push\f[R], \f[CR]yank\f[R], and \f[CR]fetch\f[R]
47
28
  gems from your Gemstash server.
48
- Run \f[V]gemstash authorize\f[R] with just the permissions you want to
29
+ Run \f[CR]gemstash authorize\f[R] with just the permissions you want to
49
30
  limit what the key will be allowed to do.
50
31
  You can similarly update a specific key by providing it via the
51
- \f[V]--key\f[R] option:
32
+ \f[CR]\-\-key\f[R] option:
52
33
  .IP
53
- .nf
54
- \f[C]
55
- $ gemstash authorize push yank --key e374e237fdf5fa5718d2a21bd63dc911
56
- \f[R]
57
- .fi
34
+ .EX
35
+ $ gemstash authorize push yank \-\-key e374e237fdf5fa5718d2a21bd63dc911
36
+ .EE
58
37
  .PP
59
38
  When no permissions are provided (like the first example), the key will
60
39
  be authorized for all permissions.
61
40
  Leave the key authorized with everything if you want to use it to try
62
41
  all private gem interactions:
63
42
  .IP
64
- .nf
65
- \f[C]
66
- $ gemstash authorize --key e374e237fdf5fa5718d2a21bd63dc911
67
- \f[R]
68
- .fi
43
+ .EX
44
+ $ gemstash authorize \-\-key e374e237fdf5fa5718d2a21bd63dc911
45
+ .EE
69
46
  .PP
70
- With the key generated, you\[cq]ll need to tell Rubygems about your new
47
+ With the key generated, you\(cqll need to tell Rubygems about your new
71
48
  key.
72
- If you\[cq]ve pushed a gem to https://rubygems.org, then you will
73
- already have a credentials file to add the key to.
49
+ If you\(cqve pushed a gem to https://rubygems.org, then you will already
50
+ have a credentials file to add the key to.
74
51
  If not, run the following commands before modifying the credentials
75
52
  file:
76
53
  .IP
77
- .nf
78
- \f[C]
79
- $ mkdir -p \[ti]/.gem
80
- $ touch \[ti]/.gem/credentials
81
- $ chmod 0600 \[ti]/.gem/credentials
82
- \f[R]
83
- .fi
54
+ .EX
55
+ $ mkdir \-p \(ti/.gem
56
+ $ touch \(ti/.gem/credentials
57
+ $ chmod 0600 \(ti/.gem/credentials
58
+ .EE
84
59
  .PP
85
60
  Add your new key to credentials such that it looks something like this
86
61
  (but make sure not to remove any existing keys):
87
62
  .IP
88
- .nf
89
- \f[C]
90
- # \[ti]/.gem/credentials
91
- ---
92
- :test_key: e374e237fdf5fa5718d2a21bd63dc911
93
- \f[R]
94
- .fi
95
- .PP
96
- The name \f[V]test_key\f[R] can be anything you want, but you will need
63
+ .EX
64
+ \f[I]# \(ti/.gem/credentials\f[R]
65
+ \-\-\-
66
+ :test_key\f[B]:\f[R] e374e237fdf5fa5718d2a21bd63dc911
67
+ .EE
68
+ .PP
69
+ The name \f[CR]test_key\f[R] can be anything you want, but you will need
97
70
  to remember it and use it again later in this guide for the
98
- \f[V]--key\f[R] option.
71
+ \f[CR]\-\-key\f[R] option.
99
72
  .SS Creating a Test Gem
100
- .PP
101
- You\[cq]ll need a test gem before you can play with private gems on your
73
+ You\(cqll need a test gem before you can play with private gems on your
102
74
  Gemstash server.
103
75
  If you have a gem you can use, move along to the next section.
104
76
  You can start by instantiating a test gem via Bundler:
105
77
  .IP
106
- .nf
107
- \f[C]
108
- $ bundle gem private-example
109
- \f[R]
110
- .fi
78
+ .EX
79
+ $ bundle gem private\-example
80
+ .EE
111
81
  .PP
112
- You\[cq]ll need to add a summary and description to the new gem\[cq]s
82
+ You\(cqll need to add a summary and description to the new gem\(cqs
113
83
  gemspec file in order to successfully build it.
114
- Once you\[cq]ve built the gem, you will be ready to push the new gem.
84
+ Once you\(cqve built the gem, you will be ready to push the new gem.
115
85
  .IP
116
- .nf
117
- \f[C]
118
- $ cd private-example
86
+ .EX
87
+ $ cd private\-example
119
88
  $ rake build
120
- \f[R]
121
- .fi
89
+ .EE
122
90
  .PP
123
91
  You will now have a gem at
124
- \f[V]private-example/pkg/private-example-0.1.0.gem\f[R].
92
+ \f[CR]private\-example/pkg/private\-example\-0.1.0.gem\f[R].
125
93
  .SS Pushing
126
- .PP
127
- If your Gemstash server isn\[cq]t running, go ahead and start it:
94
+ If your Gemstash server isn\(cqt running, go ahead and start it:
128
95
  .IP
129
- .nf
130
- \f[C]
96
+ .EX
131
97
  $ gemstash start
132
- \f[R]
133
- .fi
98
+ .EE
134
99
  .PP
135
100
  Push your test gem using Rubygems:
136
101
  .IP
137
- .nf
138
- \f[C]
139
- $ gem push --key test_key --host http://localhost:9292/private pkg/private-example-0.1.0.gem
140
- \f[R]
141
- .fi
102
+ .EX
103
+ $ gem push \-\-key test_key \-\-host http://localhost:9292/private pkg/private\-example\-0.1.0.gem
104
+ .EE
142
105
  .PP
143
- The \f[V]/private\f[R] portion of the \f[V]--host\f[R] option tells
106
+ The \f[CR]/private\f[R] portion of the \f[CR]\-\-host\f[R] option tells
144
107
  Gemstash you are interacting with the private gems.
145
108
  Gemstash will not let you push, or yank from anything except
146
- \f[V]/private\f[R].
109
+ \f[CR]/private\f[R].
147
110
  .SS Bundling
148
- .PP
149
111
  Once your gem is pushed to your Gemstash server, you are ready to bundle
150
112
  it.
151
- Create a \f[V]Gemfile\f[R] and specify the gem.
113
+ Create a \f[CR]Gemfile\f[R] and specify the gem.
152
114
  You will probably want to wrap the private gem in a source block, and
153
115
  let the rest of Gemstash handle all other gems:
154
116
  .IP
155
- .nf
156
- \f[C]
157
- # ./Gemfile
158
- source \[dq]http://localhost:9292\[dq]
159
- gem \[dq]rubywarrior\[dq]
117
+ .EX
118
+ \f[I]# ./Gemfile\f[R]
119
+ source \(dqhttp://localhost:9292\(dq
120
+ gem \(dqrubywarrior\(dq
160
121
 
161
- source \[dq]http://localhost:9292/private\[dq] do
162
- gem \[dq]private-example\[dq]
163
- end
164
- \f[R]
165
- .fi
122
+ source \(dqhttp://localhost:9292/private\(dq \f[B]do\f[R]
123
+ gem \(dqprivate\-example\(dq
124
+ \f[B]end\f[R]
125
+ .EE
166
126
  .PP
167
- Notice that the Gemstash server points to \f[V]/private\f[R] again when
127
+ Notice that the Gemstash server points to \f[CR]/private\f[R] again when
168
128
  installing your private gem.
169
129
  Go ahead and bundle to install your new private gem:
170
130
  .IP
171
- .nf
172
- \f[C]
131
+ .EX
173
132
  $ bundle
174
- \f[R]
175
- .fi
133
+ .EE
176
134
  .SS Yanking
177
- .PP
178
135
  If you push a private gem by accident, you can yank the gem with
179
136
  Rubygems:
180
137
  .IP
181
- .nf
182
- \f[C]
183
- $ RUBYGEMS_HOST=http://localhost:9292/private gem yank --key test_key private-example --version 0.1.0
184
- \f[R]
185
- .fi
138
+ .EX
139
+ $ RUBYGEMS_HOST=http://localhost:9292/private gem yank \-\-key test_key private\-example \-\-version 0.1.0
140
+ .EE
186
141
  .PP
187
- Like with pushing, the \f[V]/private\f[R] portion of the host option
142
+ Like with pushing, the \f[CR]/private\f[R] portion of the host option
188
143
  tells Gemstash you are interacting with private gems.
189
- Gemstash will only let you yank from \f[V]/private\f[R].
190
- Unlike pushing, Rubygems doesn\[cq]t support \f[V]--host\f[R] for yank
191
- (yet), so you need to specify the host via the \f[V]RUBYGEMS_HOST\f[R]
144
+ Gemstash will only let you yank from \f[CR]/private\f[R].
145
+ Unlike pushing, Rubygems doesn\(cqt support \f[CR]\-\-host\f[R] for yank
146
+ (yet), so you need to specify the host via the \f[CR]RUBYGEMS_HOST\f[R]
192
147
  environment variable.
193
148
  .SS Protected Fetching
194
- .PP
195
149
  By default, private gems and specs can be accessed without
196
150
  authentication.
197
151
  .PP
198
152
  Private gems often require protected fetching.
199
153
  For backwards compatibility this is disabled by default, but can be
200
- enabled via \f[V]$ gemstash setup\f[R] command.
154
+ enabled via \f[CR]$ gemstash setup\f[R] command.
201
155
  .PP
202
156
  When protected fetching is enabled API keys with the permissions
203
- \f[V]all\f[R] or \f[V]fetch\f[R] can be used to download gems and specs.
157
+ \f[CR]all\f[R] or \f[CR]fetch\f[R] can be used to download gems and
158
+ specs.
204
159
  .PP
205
160
  On the Bundler side, there are a few ways to configure credentials for a
206
161
  given gem source:
207
162
  .PP
208
163
  Add credentials globally:
209
164
  .IP
210
- .nf
211
- \f[C]
212
- $ bundle config my-gemstash.dev api_key
213
- \f[R]
214
- .fi
165
+ .EX
166
+ $ bundle config my\-gemstash.dev api_key
167
+ .EE
215
168
  .PP
216
169
  Add credentials in Gemfile:
217
170
  .IP
218
- .nf
219
- \f[C]
220
- source \[dq]https://api_key\[at]my-gemstash.dev\[dq]
221
- \f[R]
222
- .fi
171
+ .EX
172
+ source \(dqhttps://api_key\(atmy\-gemstash.dev\(dq
173
+ .EE
223
174
  .PP
224
- However, it\[cq]s not a good practice to commit credentials to source
175
+ However, it\(cqs not a good practice to commit credentials to source
225
176
  control.
226
- A recommended solution is to use Bundler\[cq]s configuration
227
- keys (http://bundler.io/man/bundle-config.1.html#CONFIGURATION-KEYS),
228
- e.g.:
177
+ A recommended solution is to use Bundler\(cqs \c
178
+ .UR http://bundler.io/man/bundle-config.1.html#CONFIGURATION-KEYS
179
+ configuration keys
180
+ .UE \c
181
+ , e.g.:
229
182
  .IP
230
- .nf
231
- \f[C]
183
+ .EX
232
184
  $ export BUNDLE_MYGEMSTASH__DEV=api_key
233
- \f[R]
234
- .fi
185
+ .EE
235
186
  .PP
236
187
  Behind the scene, Bundler will pick up the ENV var according to the host
237
- name (e.g.\ mygemstash.dev) and add to \f[V]URI.userinfo\f[R] for making
238
- requests.
188
+ name (e.g.\ mygemstash.dev) and add to \f[CR]URI.userinfo\f[R] for
189
+ making requests.
239
190
  .PP
240
191
  The API key is treated as a HTTP Basic Auth username and any HTTP Basic
241
192
  password supplied will be ignored.
@@ -1,4 +1,4 @@
1
- 4mgemstash-private-gems24m(7) 4mgemstash-private-gems24m(7)
1
+ 4mgemstas...ate-gems24m(7) Miscellaneous Information Manual 4mgemstas...ate-gems24m(7)
2
2
 
3
3
  1mPrivate Gems0m
4
4
  Stashing private gems in your Gemstash server requires a bit of addi-
@@ -14,16 +14,16 @@
14
14
  use whatever key is generated from running the commands.
15
15
 
16
16
  In order to push a gem to your Gemstash server, you need to first cre-
17
- ate an API key. Utilize the 1mgemstash authorize 22mcommand to create the
17
+ ate an API key. Utilize the gemstash authorize command to create the
18
18
  API key:
19
19
 
20
20
  $ gemstash authorize
21
21
  Your new key is: e374e237fdf5fa5718d2a21bd63dc911
22
22
 
23
- This new key can 1mpush22m, 1myank22m, and 1mfetch 22mgems from your Gemstash server.
24
- Run 1mgemstash authorize 22mwith just the permissions you want to limit what
23
+ This new key can push, yank, and fetch gems from your Gemstash server.
24
+ Run gemstash authorize with just the permissions you want to limit what
25
25
  the key will be allowed to do. You can similarly update a specific key
26
- by providing it via the 1m--key 22moption:
26
+ by providing it via the --key option:
27
27
 
28
28
  $ gemstash authorize push yank --key e374e237fdf5fa5718d2a21bd63dc911
29
29
 
@@ -45,12 +45,12 @@
45
45
  Add your new key to credentials such that it looks something like this
46
46
  (but make sure not to remove any existing keys):
47
47
 
48
- # ~/.gem/credentials
48
+ 4m#24m 4m~/.gem/credentials0m
49
49
  ---
50
- :test_key: e374e237fdf5fa5718d2a21bd63dc911
50
+ :test_key1m: 22me374e237fdf5fa5718d2a21bd63dc911
51
51
 
52
- The name 1mtest_key 22mcan be anything you want, but you will need to remem-
53
- ber it and use it again later in this guide for the 1m--key 22moption.
52
+ The name test_key can be anything you want, but you will need to remem-
53
+ ber it and use it again later in this guide for the --key option.
54
54
 
55
55
  1mCreating a Test Gem0m
56
56
  You'll need a test gem before you can play with private gems on your
@@ -66,8 +66,8 @@
66
66
  $ cd private-example
67
67
  $ rake build
68
68
 
69
- You will now have a gem at 1mprivate-example/pkg/private-exam-0m
70
- 1mple-0.1.0.gem22m.
69
+ You will now have a gem at private-example/pkg/private-exam-
70
+ ple-0.1.0.gem.
71
71
 
72
72
  1mPushing0m
73
73
  If your Gemstash server isn't running, go ahead and start it:
@@ -78,25 +78,25 @@
78
78
 
79
79
  $ gem push --key test_key --host http://localhost:9292/private pkg/private-example-0.1.0.gem
80
80
 
81
- The 1m/private 22mportion of the 1m--host 22moption tells Gemstash you are inter-
81
+ The /private portion of the --host option tells Gemstash you are inter-
82
82
  acting with the private gems. Gemstash will not let you push, or yank
83
- from anything except 1m/private22m.
83
+ from anything except /private.
84
84
 
85
85
  1mBundling0m
86
86
  Once your gem is pushed to your Gemstash server, you are ready to bun-
87
- dle it. Create a 1mGemfile 22mand specify the gem. You will probably want
87
+ dle it. Create a Gemfile and specify the gem. You will probably want
88
88
  to wrap the private gem in a source block, and let the rest of Gemstash
89
89
  handle all other gems:
90
90
 
91
- # ./Gemfile
91
+ 4m#24m 4m./Gemfile0m
92
92
  source "http://localhost:9292"
93
93
  gem "rubywarrior"
94
94
 
95
- source "http://localhost:9292/private" do
95
+ source "http://localhost:9292/private" 1mdo0m
96
96
  gem "private-example"
97
- end
97
+ 1mend0m
98
98
 
99
- Notice that the Gemstash server points to 1m/private 22magain when in-
99
+ Notice that the Gemstash server points to /private again when in-
100
100
  stalling your private gem. Go ahead and bundle to install your new
101
101
  private gem:
102
102
 
@@ -108,22 +108,22 @@
108
108
 
109
109
  $ RUBYGEMS_HOST=http://localhost:9292/private gem yank --key test_key private-example --version 0.1.0
110
110
 
111
- Like with pushing, the 1m/private 22mportion of the host option tells Gem-
111
+ Like with pushing, the /private portion of the host option tells Gem-
112
112
  stash you are interacting with private gems. Gemstash will only let
113
- you yank from 1m/private22m. Unlike pushing, Rubygems doesn't support
114
- 1m--host 22mfor yank (yet), so you need to specify the host via the
115
- 1mRUBYGEMS_HOST 22menvironment variable.
113
+ you yank from /private. Unlike pushing, Rubygems doesn't support
114
+ --host for yank (yet), so you need to specify the host via the
115
+ RUBYGEMS_HOST environment variable.
116
116
 
117
117
  1mProtected Fetching0m
118
118
  By default, private gems and specs can be accessed without authentica-
119
119
  tion.
120
120
 
121
121
  Private gems often require protected fetching. For backwards compati-
122
- bility this is disabled by default, but can be enabled via 1m$ gemstash0m
123
- 1msetup 22mcommand.
122
+ bility this is disabled by default, but can be enabled via $ gemstash
123
+ setup command.
124
124
 
125
- When protected fetching is enabled API keys with the permissions 1mall 22mor
126
- 1mfetch 22mcan be used to download gems and specs.
125
+ When protected fetching is enabled API keys with the permissions all or
126
+ fetch can be used to download gems and specs.
127
127
 
128
128
  On the Bundler side, there are a few ways to configure credentials for
129
129
  a given gem source:
@@ -137,16 +137,16 @@
137
137
  source "https://api_key@my-gemstash.dev"
138
138
 
139
139
  However, it's not a good practice to commit credentials to source con-
140
- trol. A recommended solution is to use Bundler's configuration keys
141
- (http://bundler.io/man/bundle-config.1.html#CONFIGURATION-KEYS), e.g.:
140
+ trol. A recommended solution is to use Bundler's 8;;http://bundler.io/man/bundle-config.1.html#CONFIGURATION-KEYSconfiguration keys8;;,
141
+ e.g.:
142
142
 
143
143
  $ export BUNDLE_MYGEMSTASH__DEV=api_key
144
144
 
145
145
  Behind the scene, Bundler will pick up the ENV var according to the
146
- host name (e.g. mygemstash.dev) and add to 1mURI.userinfo 22mfor making re-
146
+ host name (e.g. mygemstash.dev) and add to URI.userinfo for making re-
147
147
  quests.
148
148
 
149
149
  The API key is treated as a HTTP Basic Auth username and any HTTP Basic
150
150
  password supplied will be ignored.
151
151
 
152
- October 8, 2015 4mgemstash-private-gems24m(7)
152
+ October 8, 2015 4mgemstas...ate-gems24m(7)