gemstash 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/gemstash/cli.rb +46 -0
- data/lib/gemstash/cli/setup.rb +1 -1
- data/lib/gemstash/env.rb +5 -0
- data/lib/gemstash/man/gemstash-authorize.1 +50 -0
- data/lib/gemstash/man/gemstash-authorize.1.txt +45 -0
- data/lib/gemstash/man/gemstash-configuration.5 +133 -0
- data/lib/gemstash/man/gemstash-configuration.5.txt +121 -0
- data/lib/gemstash/man/gemstash-customize.7 +224 -0
- data/lib/gemstash/man/gemstash-customize.7.txt +137 -0
- data/lib/gemstash/man/gemstash-debugging.7 +34 -0
- data/lib/gemstash/man/gemstash-debugging.7.txt +29 -0
- data/lib/gemstash/man/gemstash-deploy.7 +40 -0
- data/lib/gemstash/man/gemstash-deploy.7.txt +34 -0
- data/lib/gemstash/man/gemstash-mirror.7 +40 -0
- data/lib/gemstash/man/gemstash-mirror.7.txt +33 -0
- data/lib/gemstash/man/gemstash-multiple-sources.7 +89 -0
- data/lib/gemstash/man/gemstash-multiple-sources.7.txt +71 -0
- data/lib/gemstash/man/gemstash-private-gems.7 +195 -0
- data/lib/gemstash/man/gemstash-private-gems.7.txt +133 -0
- data/lib/gemstash/man/gemstash-readme.7 +204 -0
- data/lib/gemstash/man/gemstash-readme.7.txt +160 -0
- data/lib/gemstash/man/gemstash-setup.1 +41 -0
- data/lib/gemstash/man/gemstash-setup.1.txt +38 -0
- data/lib/gemstash/man/gemstash-start.1 +25 -0
- data/lib/gemstash/man/gemstash-start.1.txt +25 -0
- data/lib/gemstash/man/gemstash-status.1 +19 -0
- data/lib/gemstash/man/gemstash-status.1.txt +21 -0
- data/lib/gemstash/man/gemstash-stop.1 +19 -0
- data/lib/gemstash/man/gemstash-stop.1.txt +21 -0
- data/lib/gemstash/man/gemstash-version.1 +22 -0
- data/lib/gemstash/man/gemstash-version.1.txt +21 -0
- data/lib/gemstash/storage.rb +7 -4
- data/lib/gemstash/version.rb +1 -1
- metadata +79 -48
- data/Gemfile +0 -4
- data/README.md +0 -161
- data/Rakefile +0 -25
- data/bin/console +0 -14
- data/bin/gemstash +0 -3
- data/bin/setup +0 -5
- data/docs/config.md +0 -136
- data/docs/debug.md +0 -24
- data/docs/deploy.md +0 -30
- data/docs/mirror.md +0 -30
- data/docs/multiple_sources.md +0 -68
- data/docs/private_gems.md +0 -140
- data/docs/reference.md +0 -323
- data/gemstash.gemspec +0 -49
- data/gemstash.png +0 -0
- data/rake/changelog.citrus +0 -157
- data/rake/changelog.rb +0 -201
- data/rake/table_of_contents.rb +0 -36
data/docs/private_gems.md
DELETED
@@ -1,140 +0,0 @@
|
|
1
|
-
# Private Gems
|
2
|
-
|
3
|
-
Stashing private gems in your Gemstash server requires a bit of additional
|
4
|
-
setup. If you haven't read through the [Quickstart
|
5
|
-
Guide](../README.md#quickstart-guide), you should do that first. By the end of
|
6
|
-
this guide, you will be able to interact with your Gemstash server to store and
|
7
|
-
retrieve your private gems.
|
8
|
-
|
9
|
-
## Authorizing
|
10
|
-
|
11
|
-
**IMPORTANT NOTE:** Do not use the actual key value in this document, otherwise
|
12
|
-
your Gemstash server will be vulnerable to anyone who wants to try to use the
|
13
|
-
key against your server. Instead of the key value here, use whatever key is
|
14
|
-
generated from running the commands.
|
15
|
-
|
16
|
-
In order to push a gem to your Gemstash server, you need to first create an API
|
17
|
-
key. Utilize the `gemstash authorize` command to create the API key:
|
18
|
-
```
|
19
|
-
$ gemstash authorize
|
20
|
-
Your new key is: e374e237fdf5fa5718d2a21bd63dc911
|
21
|
-
```
|
22
|
-
|
23
|
-
This new key can `push`, `yank`, and `unyank` gems from your Gemstash server.
|
24
|
-
Run `gemstash authorize` with just the permissions you want to limit what the
|
25
|
-
key will be allowed to do. You can similarly update a specific key by providing
|
26
|
-
it via the `--key` option:
|
27
|
-
```
|
28
|
-
$ gemstash authorize push yank --key e374e237fdf5fa5718d2a21bd63dc911
|
29
|
-
```
|
30
|
-
|
31
|
-
When no permissions are provided (like the first example), the key will be
|
32
|
-
authorized for all permissions. Leave the key authorized with everything if you
|
33
|
-
want to use it to try all private gem interactions:
|
34
|
-
```
|
35
|
-
$ gemstash authorize --key e374e237fdf5fa5718d2a21bd63dc911
|
36
|
-
```
|
37
|
-
|
38
|
-
With the key generated, you'll need to tell Rubygems about your new key. If
|
39
|
-
you've pushed a gem to https://rubygems.org, then you will already have a
|
40
|
-
credentials file to add the key to. If not, run the following commands before
|
41
|
-
modifying the credentials file:
|
42
|
-
```
|
43
|
-
$ mkdir -p ~/.gem
|
44
|
-
$ touch ~/.gem/credentials
|
45
|
-
$ chmod 0600 ~/.gem/credentials
|
46
|
-
```
|
47
|
-
|
48
|
-
Add your new key to credentials such that it looks something like this (but make
|
49
|
-
sure not to remove any existing keys):
|
50
|
-
```yaml
|
51
|
-
# ~/.gem/credentials
|
52
|
-
---
|
53
|
-
:test_key: e374e237fdf5fa5718d2a21bd63dc911
|
54
|
-
```
|
55
|
-
|
56
|
-
The name `test_key` can be anything you want, but you will need to remember it
|
57
|
-
and use it again later in this guide for the `--key` option.
|
58
|
-
|
59
|
-
## Creating a Test Gem
|
60
|
-
|
61
|
-
You'll need a test gem before you can play with private gems on your Gemstash
|
62
|
-
server. If you have a gem you can use, move along to the next section. You can
|
63
|
-
start by instantiating a test gem via Bundler:
|
64
|
-
```
|
65
|
-
$ bundle gem private-example
|
66
|
-
```
|
67
|
-
|
68
|
-
You'll need to add a summary and description to the new gem's gemspec file in
|
69
|
-
order to successfully build it. Once you've built the gem, you will be ready to
|
70
|
-
push the new gem.
|
71
|
-
```
|
72
|
-
$ cd private-example
|
73
|
-
$ rake build
|
74
|
-
```
|
75
|
-
|
76
|
-
You will now have a gem at `private-example/pkg/private-example-0.1.0.gem`.
|
77
|
-
|
78
|
-
## Pushing
|
79
|
-
|
80
|
-
If your Gemstash server isn't running, go ahead and start it:
|
81
|
-
```
|
82
|
-
$ gemstash start
|
83
|
-
```
|
84
|
-
|
85
|
-
Push your test gem using Rubygems:
|
86
|
-
```
|
87
|
-
$ gem push --key test_key --host http://localhost:9292/private pkg/private-example-0.1.0.gem
|
88
|
-
```
|
89
|
-
|
90
|
-
The `/private` portion of the `--host` option tells Gemstash you are interacting
|
91
|
-
with the private gems. Gemstash will not let you push, yank, or unyank from
|
92
|
-
anything except `/private`.
|
93
|
-
|
94
|
-
## Bundling
|
95
|
-
|
96
|
-
Once your gem is pushed to your Gemstash server, you are ready to bundle it.
|
97
|
-
Create a `Gemfile` and specify the gem. You will probably want to wrap the
|
98
|
-
private gem in a source block, and let the rest of Gemstash handle all other
|
99
|
-
gems:
|
100
|
-
```ruby
|
101
|
-
# ./Gemfile
|
102
|
-
source "http://localhost:9292"
|
103
|
-
gem "rubywarrior"
|
104
|
-
|
105
|
-
source "http://localhost:9292/private" do
|
106
|
-
gem "private-example"
|
107
|
-
end
|
108
|
-
```
|
109
|
-
|
110
|
-
Notice that the Gemstash server points to `/private` again when installing your
|
111
|
-
private gem. Go ahead and bundle to install your new private gem:
|
112
|
-
```
|
113
|
-
$ bundle
|
114
|
-
```
|
115
|
-
|
116
|
-
## Yanking
|
117
|
-
|
118
|
-
If you push a private gem by accident, you can yank the gem with Rubygems:
|
119
|
-
```
|
120
|
-
$ RUBYGEMS_HOST=http://localhost:9292/private gem yank --key test_key private-example --version 0.1.0
|
121
|
-
```
|
122
|
-
|
123
|
-
Like with pushing, the `/private` portion of the host option tells Gemstash you
|
124
|
-
are interacting with private gems. Gemstash will only let you yank from
|
125
|
-
`/private`. Unlike pushing, Rubygems doesn't support `--host` for yank and
|
126
|
-
unyank (yet), so you need to specify the host via the `RUBYGEMS_HOST`
|
127
|
-
environment variable.
|
128
|
-
|
129
|
-
## Unyanking
|
130
|
-
|
131
|
-
If you yank a private gem by accident, you can unyank the gem with Rubygems:
|
132
|
-
```
|
133
|
-
$ RUBYGEMS_HOST=http://localhost:9292/private gem yank --key test_key private-example --version 0.1.0 --undo
|
134
|
-
```
|
135
|
-
|
136
|
-
Like with pushing and yanking, the `/private` portion of the host option tells
|
137
|
-
Gemstash you are interacting with private gems. Gemstash will only let you
|
138
|
-
unyank from `/private`. Unlike pushing, Rubygems doesn't support `--host` for
|
139
|
-
unyank and yank (yet), so you need to specify the host via the `RUBYGEMS_HOST`
|
140
|
-
environment variable.
|
data/docs/reference.md
DELETED
@@ -1,323 +0,0 @@
|
|
1
|
-
|
2
|
-
Table of Contents
|
3
|
-
=================
|
4
|
-
|
5
|
-
* [Reference](#reference)
|
6
|
-
* [Configuration](#configuration)
|
7
|
-
* [:base_path](#base_path)
|
8
|
-
* [:cache_type](#cache_type)
|
9
|
-
* [:memcached_servers](#memcached_servers)
|
10
|
-
* [:db_adapter](#db_adapter)
|
11
|
-
* [:db_url](#db_url)
|
12
|
-
* [:rubygems_url](#rubygems_url)
|
13
|
-
* [:bind](#bind)
|
14
|
-
* [Authorize](#authorize)
|
15
|
-
* [Usage](#usage)
|
16
|
-
* [Arguments](#arguments)
|
17
|
-
* [Options](#options)
|
18
|
-
* [--config-file](#--config-file)
|
19
|
-
* [--key](#--key)
|
20
|
-
* [--remove](#--remove)
|
21
|
-
* [Start](#start)
|
22
|
-
* [Usage](#usage-1)
|
23
|
-
* [Options](#options-1)
|
24
|
-
* [--config-file](#--config-file-1)
|
25
|
-
* [--no-daemonize](#--no-daemonize)
|
26
|
-
* [Stop](#stop)
|
27
|
-
* [Usage](#usage-2)
|
28
|
-
* [Options](#options-2)
|
29
|
-
* [--config-file](#--config-file-2)
|
30
|
-
* [Status](#status)
|
31
|
-
* [Usage](#usage-3)
|
32
|
-
* [Options](#options-3)
|
33
|
-
* [--config-file](#--config-file-3)
|
34
|
-
* [Setup](#setup)
|
35
|
-
* [Usage](#usage-4)
|
36
|
-
* [Options](#options-4)
|
37
|
-
* [--redo](#--redo)
|
38
|
-
* [--debug](#--debug)
|
39
|
-
* [--config-file](#--config-file-4)
|
40
|
-
* [Version](#version)
|
41
|
-
* [Usage](#usage-5)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
---
|
46
|
-
|
47
|
-
# Reference
|
48
|
-
|
49
|
-
## Configuration
|
50
|
-
|
51
|
-
**Example:**
|
52
|
-
```yaml
|
53
|
-
# ~/.gemstash/config.yml
|
54
|
-
---
|
55
|
-
:base_path: "/var/gemstash"
|
56
|
-
:cache_type: memcached
|
57
|
-
:memcached_servers: localhost:11211
|
58
|
-
:db_adapter: postgres
|
59
|
-
:db_url: postgres:///gemstash
|
60
|
-
:rubygems_url: https://my.gem-source.local
|
61
|
-
:bind: tcp://0.0.0.0:4242
|
62
|
-
```
|
63
|
-
|
64
|
-
### :base_path
|
65
|
-
|
66
|
-
**Default value:** `~/.gemstash`
|
67
|
-
|
68
|
-
**Valid values:** Any valid path
|
69
|
-
|
70
|
-
**Description**<br />
|
71
|
-
Specifies where to store local files like the server log, cached gem files, and
|
72
|
-
the database (when using SQLite). If the default is being used, the directory
|
73
|
-
will be created if it does not exist. Any other directory needs to be created
|
74
|
-
ahead of time and be writable to the Gemstash server process. Specifying the
|
75
|
-
`:base_path` via [`gemstash setup`](reference.md#setup) will create the
|
76
|
-
directory for you.
|
77
|
-
|
78
|
-
### :cache_type
|
79
|
-
|
80
|
-
**Default value:** `memory`
|
81
|
-
|
82
|
-
**Valid values:** `memory`, `memcached`
|
83
|
-
|
84
|
-
**Description**<br />
|
85
|
-
Specifies how to cache values other than gem files (such as gem dependencies).
|
86
|
-
`memory` will use an in memory cache while `memcached` will point to 1 or more
|
87
|
-
Memcached servers. Use the `:memcached_servers` configuration key for specifying
|
88
|
-
where the Memcached server(s) are.
|
89
|
-
|
90
|
-
### :memcached_servers
|
91
|
-
|
92
|
-
**Default value:** `localhost:11211`
|
93
|
-
|
94
|
-
**Valid values:** A comma delimited list of Memcached servers
|
95
|
-
|
96
|
-
**Description**<br />
|
97
|
-
Specifies the Memcached servers to connect to when using `memcached` for the
|
98
|
-
`:cache_type`. Only used when `memcached` is used for `:cache_type`.
|
99
|
-
|
100
|
-
### :db_adapter
|
101
|
-
|
102
|
-
**Default value:** `sqlite3`
|
103
|
-
|
104
|
-
**Valid values:** `sqlite3`, `postgres`
|
105
|
-
|
106
|
-
**Description**<br />
|
107
|
-
Specifies what database adapter to use. When `sqlite3` is used, the database
|
108
|
-
will be located at `gemstash.db` within the directory specified by `:base_path`.
|
109
|
-
The database will automatically be created when using `sqlite3`. When `postgres`
|
110
|
-
is used, the database to connect to must be specified in the `:db_url`
|
111
|
-
configuration key. The database must already be created when using `postgres`.
|
112
|
-
|
113
|
-
### :db_url
|
114
|
-
|
115
|
-
**Default value:** None
|
116
|
-
|
117
|
-
**Valid values:** A valid database URL for the [Sequel
|
118
|
-
gem](http://sequel.jeremyevans.net/)
|
119
|
-
|
120
|
-
**Description**<br />
|
121
|
-
Specifies the database to connect to when using `postgres` for the
|
122
|
-
`:db_adapter`. Only used when `postgres` is used for `:db_adapter`.
|
123
|
-
|
124
|
-
### :rubygems_url
|
125
|
-
|
126
|
-
**Default value:** `https://rubygems.org`
|
127
|
-
|
128
|
-
**Valid values:** A valid gem source URL
|
129
|
-
|
130
|
-
**Description**<br />
|
131
|
-
Specifies the default gem source URL. When any API endpoint is called without a
|
132
|
-
`/private` or `/upstream/<url>` prefix, this URL will be used to fetch the
|
133
|
-
result. This value can be safely changed even if there are already gems stashed
|
134
|
-
for the previous value.
|
135
|
-
|
136
|
-
### :bind
|
137
|
-
|
138
|
-
**Default value:** `tcp://0.0.0.0:9292`
|
139
|
-
|
140
|
-
**Valid values:** Any valid binding that [is supported by
|
141
|
-
Puma](https://github.com/puma/puma#binding-tcp--sockets)
|
142
|
-
|
143
|
-
**Description**<br />
|
144
|
-
Specifies the binding used to start the Gemstash server. Keep in mind the user
|
145
|
-
starting Gemstash needs to have access to bind in this manner. For example, if
|
146
|
-
you use a port below 1024, you will need to run Gemstash as the root user.
|
147
|
-
|
148
|
-
## Authorize
|
149
|
-
|
150
|
-
Adds or removes authorization to interact with privately stored gems.
|
151
|
-
|
152
|
-
### Usage
|
153
|
-
|
154
|
-
```
|
155
|
-
gemstash authorize
|
156
|
-
gemstash authorize push yank
|
157
|
-
gemstash authorize yank unyank --key <secure-key>
|
158
|
-
gemstash authorize --remove --key <secure-key>
|
159
|
-
```
|
160
|
-
|
161
|
-
### Arguments
|
162
|
-
|
163
|
-
Any arguments will be used as specific permissions. Valid permissions include
|
164
|
-
`push`, `yank`, and `unyank`. If no permissions are provided, then all
|
165
|
-
permissions will be granted (including any that may be added in future versions
|
166
|
-
of Gemstash).
|
167
|
-
|
168
|
-
### Options
|
169
|
-
|
170
|
-
#### --config-file
|
171
|
-
|
172
|
-
**Usage:** `--config-file <file>`
|
173
|
-
|
174
|
-
**Description**<br />
|
175
|
-
Specify the config file to use. If you aren't using the default config file at
|
176
|
-
`~/.gemstash/config.yml`, then you must specify the config file via this option.
|
177
|
-
|
178
|
-
#### --key
|
179
|
-
|
180
|
-
**Usage:** `--key <secure-key>`
|
181
|
-
|
182
|
-
**Description**<br />
|
183
|
-
Specify the API key to affect. This should be the actual key value, not a name.
|
184
|
-
This option is required when using `--remove` but is optional otherwise. If
|
185
|
-
adding an authorization, using this will either create or update the permissions
|
186
|
-
for the specified API key. If missing, a new API key will always be generated.
|
187
|
-
Note that a key can only have a maximum length of 255 chars.
|
188
|
-
|
189
|
-
#### --remove
|
190
|
-
|
191
|
-
**Usage:** `--remove`
|
192
|
-
|
193
|
-
**Description**<br />
|
194
|
-
Remove an authorization rather than add or update one. When removing, permission
|
195
|
-
values are not allowed. The `--key <secure-key>` option is required.
|
196
|
-
|
197
|
-
## Start
|
198
|
-
|
199
|
-
Starts the Gemstash server.
|
200
|
-
|
201
|
-
### Usage
|
202
|
-
|
203
|
-
```
|
204
|
-
gemstash start
|
205
|
-
gemstash start --no-daemonize
|
206
|
-
```
|
207
|
-
|
208
|
-
### Options
|
209
|
-
|
210
|
-
#### --config-file
|
211
|
-
|
212
|
-
**Usage:** `--config-file <file>`
|
213
|
-
|
214
|
-
**Description**<br />
|
215
|
-
Specify the config file to use. If you aren't using the default config file at
|
216
|
-
`~/.gemstash/config.yml`, then you must specify the config file via this option.
|
217
|
-
|
218
|
-
#### --no-daemonize
|
219
|
-
|
220
|
-
**Usage:** `--no-daemonize`
|
221
|
-
|
222
|
-
**Description**<br />
|
223
|
-
The Gemstash server daemonizes itself by default. Provide this option to instead
|
224
|
-
run the server until `Ctrl-C` is typed. When not daemonized, the log will be
|
225
|
-
output to standard out.
|
226
|
-
|
227
|
-
## Stop
|
228
|
-
|
229
|
-
Stops the Gemstash server.
|
230
|
-
|
231
|
-
### Usage
|
232
|
-
|
233
|
-
```
|
234
|
-
gemstash stop
|
235
|
-
```
|
236
|
-
|
237
|
-
### Options
|
238
|
-
|
239
|
-
#### --config-file
|
240
|
-
|
241
|
-
**Usage:** `--config-file <file>`
|
242
|
-
|
243
|
-
**Description**<br />
|
244
|
-
Specify the config file to use. If you aren't using the default config file at
|
245
|
-
`~/.gemstash/config.yml`, then you must specify the config file via this option.
|
246
|
-
|
247
|
-
## Status
|
248
|
-
|
249
|
-
Checks status of the Gemstash server.
|
250
|
-
|
251
|
-
### Usage
|
252
|
-
|
253
|
-
```
|
254
|
-
gemstash status
|
255
|
-
```
|
256
|
-
|
257
|
-
### Options
|
258
|
-
|
259
|
-
#### --config-file
|
260
|
-
|
261
|
-
**Usage:** `--config-file <file>`
|
262
|
-
|
263
|
-
**Description**<br />
|
264
|
-
Specify the config file to use. If you aren't using the default config file at
|
265
|
-
`~/.gemstash/config.yml`, then you must specify the config file via this option.
|
266
|
-
|
267
|
-
## Setup
|
268
|
-
|
269
|
-
Customize your Gemstash configuration interactively. This will save your config
|
270
|
-
file, but only if a few checks pass after you've provided your answers.
|
271
|
-
|
272
|
-
### Usage
|
273
|
-
|
274
|
-
```
|
275
|
-
gemstash setup
|
276
|
-
gemstash setup --redo
|
277
|
-
gemstash setup --config-file <file>
|
278
|
-
```
|
279
|
-
|
280
|
-
### Options
|
281
|
-
|
282
|
-
#### --redo
|
283
|
-
|
284
|
-
**Usage:** `--redo`
|
285
|
-
|
286
|
-
**Description**<br />
|
287
|
-
Redo the configuration. This does nothing the first time `gemstash setup` is
|
288
|
-
run. If you want to change your configuration using `gemstash setup` after
|
289
|
-
you've run it before, you must provide this option, otherwise Gemstash will
|
290
|
-
simply indicate your setup is complete.
|
291
|
-
|
292
|
-
#### --debug
|
293
|
-
|
294
|
-
**Usage:** `--debug`
|
295
|
-
|
296
|
-
**Description**<br />
|
297
|
-
Output additional information if one of the checks at the end of setup fails.
|
298
|
-
This will do nothing if all checks pass.
|
299
|
-
|
300
|
-
#### --config-file
|
301
|
-
|
302
|
-
**Usage:** `--config-file <file>`
|
303
|
-
|
304
|
-
**Description**<br />
|
305
|
-
Specify the config file to write to. Without this option, your configuration
|
306
|
-
will be written to `~/.gemstash/config.yml`. If you write to a custom location,
|
307
|
-
you will need to pass the `--config-file` option to all Gemstash commands.
|
308
|
-
|
309
|
-
## Version
|
310
|
-
|
311
|
-
Show what version of Gemstash you are using.
|
312
|
-
|
313
|
-
### Usage
|
314
|
-
|
315
|
-
```
|
316
|
-
gemstash version
|
317
|
-
gemstash --version
|
318
|
-
gemstash -v
|
319
|
-
```
|
320
|
-
|
321
|
-
---
|
322
|
-
|
323
|
-
Table of contents thanks to [gh-md-toc](https://github.com/ekalinin/github-markdown-toc).
|