gemstash 2.3.2 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -36
  3. data/lib/gemstash/authorization.rb +5 -2
  4. data/lib/gemstash/cli/authorize.rb +42 -1
  5. data/lib/gemstash/cli.rb +4 -0
  6. data/lib/gemstash/db/authorization.rb +3 -3
  7. data/lib/gemstash/man/gemstash-authorize.1 +21 -33
  8. data/lib/gemstash/man/gemstash-authorize.1.txt +23 -15
  9. data/lib/gemstash/man/gemstash-configuration.5 +63 -118
  10. data/lib/gemstash/man/gemstash-configuration.5.txt +54 -54
  11. data/lib/gemstash/man/gemstash-customize.7 +60 -103
  12. data/lib/gemstash/man/gemstash-customize.7.txt +35 -35
  13. data/lib/gemstash/man/gemstash-debugging.7 +8 -27
  14. data/lib/gemstash/man/gemstash-debugging.7.txt +6 -6
  15. data/lib/gemstash/man/gemstash-deploy.7 +15 -39
  16. data/lib/gemstash/man/gemstash-deploy.7.txt +16 -16
  17. data/lib/gemstash/man/gemstash-mirror.7 +10 -31
  18. data/lib/gemstash/man/gemstash-mirror.7.txt +3 -3
  19. data/lib/gemstash/man/gemstash-multiple-sources.7 +72 -44
  20. data/lib/gemstash/man/gemstash-multiple-sources.7.txt +59 -11
  21. data/lib/gemstash/man/gemstash-private-gems.7 +51 -102
  22. data/lib/gemstash/man/gemstash-private-gems.7.txt +21 -21
  23. data/lib/gemstash/man/gemstash-readme.7 +29 -75
  24. data/lib/gemstash/man/gemstash-readme.7.txt +10 -10
  25. data/lib/gemstash/man/gemstash-setup.1 +13 -33
  26. data/lib/gemstash/man/gemstash-setup.1.txt +11 -11
  27. data/lib/gemstash/man/gemstash-start.1 +7 -25
  28. data/lib/gemstash/man/gemstash-start.1.txt +6 -6
  29. data/lib/gemstash/man/gemstash-status.1 +5 -23
  30. data/lib/gemstash/man/gemstash-status.1.txt +4 -4
  31. data/lib/gemstash/man/gemstash-stop.1 +5 -23
  32. data/lib/gemstash/man/gemstash-stop.1.txt +4 -4
  33. data/lib/gemstash/man/gemstash-version.1 +4 -24
  34. data/lib/gemstash/man/gemstash-version.1.txt +1 -1
  35. data/lib/gemstash/migrations/05_authorization_names.rb +10 -0
  36. data/lib/gemstash/upstream.rb +33 -2
  37. data/lib/gemstash/version.rb +1 -1
  38. metadata +18 -3
@@ -1,58 +1,38 @@
1
1
  <!-- Automatically generated by Pandoc -->
2
- .\" Automatically generated by Pandoc 3.1.6.2
2
+ .\" Automatically generated by Pandoc 3.1.8
3
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
4
  .TH "gemstash-setup" "1" "October 9, 2015" "" ""
19
- .hy
20
5
  .SH Name
21
- .PP
22
6
  gemstash-setup - Customize your Gemstash configuration interactively
23
7
  .SH Synopsis
24
- .PP
25
- \f[V]gemstash setup [--redo] [--debug] [--config-file FILE]\f[R]
8
+ \f[CR]gemstash setup [--redo] [--debug] [--config-file FILE]\f[R]
26
9
  .SH Description
27
- .PP
28
10
  Customize your Gemstash configuration interactively.
29
11
  This will save your config file, but only if a few checks pass after
30
12
  you\[cq]ve provided your answers.
31
13
  .SS Usage
32
14
  .IP
33
- .nf
34
- \f[C]
15
+ .EX
35
16
  gemstash setup
36
17
  gemstash setup --redo
37
18
  gemstash setup --config-file <file>
38
- \f[R]
39
- .fi
19
+ .EE
40
20
  .SH Options
41
21
  .IP \[bu] 2
42
- \f[V]--redo\f[R]: Redo the configuration.
43
- This does nothing the first time \f[V]gemstash setup\f[R] is run.
44
- If you want to change your configuration using \f[V]gemstash setup\f[R]
22
+ \f[CR]--redo\f[R]: Redo the configuration.
23
+ This does nothing the first time \f[CR]gemstash setup\f[R] is run.
24
+ If you want to change your configuration using \f[CR]gemstash setup\f[R]
45
25
  after you\[cq]ve run it before, you must provide this option, otherwise
46
26
  Gemstash will simply indicate your setup is complete.
47
27
  .IP \[bu] 2
48
- \f[V]--debug\f[R]: Output additional information if one of the checks at
49
- the end of setup fails.
28
+ \f[CR]--debug\f[R]: Output additional information if one of the checks
29
+ at the end of setup fails.
50
30
  This will do nothing if all checks pass.
51
31
  .IP \[bu] 2
52
- \f[V]--config-file FILE\f[R]: Specify the config file to write to.
32
+ \f[CR]--config-file FILE\f[R]: Specify the config file to write to.
53
33
  Without this option, your configuration will be written to
54
- \f[V]\[ti]/.gemstash/config.yml\f[R].
34
+ \f[CR]\[ti]/.gemstash/config.yml\f[R].
55
35
  If you write to a custom location, you will need to pass the
56
- \f[V]--config-file\f[R] option to all Gemstash commands.
36
+ \f[CR]--config-file\f[R] option to all Gemstash commands.
57
37
  If you plan to use ERB in your config file, you might want to use
58
- \f[V]\[ti]/.gemstash/config.yml.erb\f[R].
38
+ \f[CR]\[ti]/.gemstash/config.yml.erb\f[R].
@@ -6,7 +6,7 @@
6
6
  gemstash-setup - Customize your Gemstash configuration interactively
7
7
 
8
8
  1mSynopsis0m
9
- 1mgemstash setup [--redo] [--debug] [--config-file FILE]0m
9
+ gemstash setup [--redo] [--debug] [--config-file FILE]
10
10
 
11
11
  1mDescription0m
12
12
  Customize your Gemstash configuration interactively. This will save
@@ -19,20 +19,20 @@
19
19
  gemstash setup --config-file <file>
20
20
 
21
21
  1mOptions0m
22
- o 1m--redo22m: Redo the configuration. This does nothing the first time
23
- 1mgemstash setup 22mis run. If you want to change your configuration us-
24
- ing 1mgemstash setup 22mafter you've run it before, you must provide this
22
+ o --redo: Redo the configuration. This does nothing the first time
23
+ gemstash setup is run. If you want to change your configuration us-
24
+ ing gemstash setup after you've run it before, you must provide this
25
25
  option, otherwise Gemstash will simply indicate your setup is com-
26
26
  plete.
27
27
 
28
- o 1m--debug22m: Output additional information if one of the checks at the
28
+ o --debug: Output additional information if one of the checks at the
29
29
  end of setup fails. This will do nothing if all checks pass.
30
30
 
31
- o 1m--config-file FILE22m: Specify the config file to write to. Without
32
- this option, your configuration will be written to 1m~/.gemstash/con-0m
33
- 1mfig.yml22m. If you write to a custom location, you will need to pass
34
- the 1m--config-file 22moption to all Gemstash commands. If you plan to
35
- use ERB in your config file, you might want to use 1m~/.gemstash/con-0m
36
- 1mfig.yml.erb22m.
31
+ o --config-file FILE: Specify the config file to write to. Without
32
+ this option, your configuration will be written to ~/.gemstash/con-
33
+ fig.yml. If you write to a custom location, you will need to pass
34
+ the --config-file option to all Gemstash commands. If you plan to
35
+ use ERB in your config file, you might want to use ~/.gemstash/con-
36
+ fig.yml.erb.
37
37
 
38
38
  October 9, 2015 4mgemstash-setup24m(1)
@@ -1,41 +1,23 @@
1
1
  <!-- Automatically generated by Pandoc -->
2
- .\" Automatically generated by Pandoc 3.1.6.2
2
+ .\" Automatically generated by Pandoc 3.1.8
3
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
4
  .TH "gemstash-start" "1" "October 9, 2015" "" ""
19
- .hy
20
5
  .SH Name
21
- .PP
22
6
  gemstash-start - Starts the Gemstash server
23
7
  .SH Synopsis
24
- .PP
25
- \f[V]gemstash start [--no-daemonize] [--config-file FILE]\f[R]
8
+ \f[CR]gemstash start [--no-daemonize] [--config-file FILE]\f[R]
26
9
  .SH Description
27
- .PP
28
10
  Starts the Gemstash server.
29
11
  .SH Options
30
12
  .IP \[bu] 2
31
- \f[V]--config-file FILE\f[R]: Specify the config file to use.
13
+ \f[CR]--config-file FILE\f[R]: Specify the config file to use.
32
14
  If you aren\[cq]t using the default config file at
33
- \f[V]\[ti]/.gemstash/config.yml\f[R] or
34
- \f[V]\[ti]/.gemstash/config.yml.erb\f[R], then you must specify the
15
+ \f[CR]\[ti]/.gemstash/config.yml\f[R] or
16
+ \f[CR]\[ti]/.gemstash/config.yml.erb\f[R], then you must specify the
35
17
  config file via this option.
36
18
  .IP \[bu] 2
37
- \f[V]--no-daemonize\f[R]: The Gemstash server daemonizes itself by
19
+ \f[CR]--no-daemonize\f[R]: The Gemstash server daemonizes itself by
38
20
  default.
39
- Provide this option to instead run the server until \f[V]Ctrl-C\f[R] is
21
+ Provide this option to instead run the server until \f[CR]Ctrl-C\f[R] is
40
22
  typed.
41
23
  When not daemonized, the log will be output to standard out.
@@ -6,19 +6,19 @@
6
6
  gemstash-start - Starts the Gemstash server
7
7
 
8
8
  1mSynopsis0m
9
- 1mgemstash start [--no-daemonize] [--config-file FILE]0m
9
+ gemstash start [--no-daemonize] [--config-file FILE]
10
10
 
11
11
  1mDescription0m
12
12
  Starts the Gemstash server.
13
13
 
14
14
  1mOptions0m
15
- o 1m--config-file FILE22m: Specify the config file to use. If you aren't
16
- using the default config file at 1m~/.gemstash/config.yml 22mor 1m~/.gem-0m
17
- 1mstash/config.yml.erb22m, then you must specify the config file via this
15
+ o --config-file FILE: Specify the config file to use. If you aren't
16
+ using the default config file at ~/.gemstash/config.yml or ~/.gem-
17
+ stash/config.yml.erb, then you must specify the config file via this
18
18
  option.
19
19
 
20
- o 1m--no-daemonize22m: The Gemstash server daemonizes itself by default.
21
- Provide this option to instead run the server until 1mCtrl-C 22mis typed.
20
+ o --no-daemonize: The Gemstash server daemonizes itself by default.
21
+ Provide this option to instead run the server until Ctrl-C is typed.
22
22
  When not daemonized, the log will be output to standard out.
23
23
 
24
24
  October 9, 2015 4mgemstash-start24m(1)
@@ -1,35 +1,17 @@
1
1
  <!-- Automatically generated by Pandoc -->
2
- .\" Automatically generated by Pandoc 3.1.6.2
2
+ .\" Automatically generated by Pandoc 3.1.8
3
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
4
  .TH "gemstash-status" "1" "October 28, 2015" "" ""
19
- .hy
20
5
  .SH Name
21
- .PP
22
6
  gemstash-status - Checks status of the Gemstash server
23
7
  .SH Synopsis
24
- .PP
25
- \f[V]gemstash status [--config-file FILE]\f[R]
8
+ \f[CR]gemstash status [--config-file FILE]\f[R]
26
9
  .SH Description
27
- .PP
28
10
  Checks status of the Gemstash server.
29
11
  .SH Options
30
12
  .IP \[bu] 2
31
- \f[V]--config-file FILE\f[R]: Specify the config file to use.
13
+ \f[CR]--config-file FILE\f[R]: Specify the config file to use.
32
14
  If you aren\[cq]t using the default config file at
33
- \f[V]\[ti]/.gemstash/config.yml\f[R] or
34
- \f[V]\[ti]/.gemstash/config.yml.erb\f[R], then you must specify the
15
+ \f[CR]\[ti]/.gemstash/config.yml\f[R] or
16
+ \f[CR]\[ti]/.gemstash/config.yml.erb\f[R], then you must specify the
35
17
  config file via this option.
@@ -6,15 +6,15 @@
6
6
  gemstash-status - Checks status of the Gemstash server
7
7
 
8
8
  1mSynopsis0m
9
- 1mgemstash status [--config-file FILE]0m
9
+ gemstash status [--config-file FILE]
10
10
 
11
11
  1mDescription0m
12
12
  Checks status of the Gemstash server.
13
13
 
14
14
  1mOptions0m
15
- o 1m--config-file FILE22m: Specify the config file to use. If you aren't
16
- using the default config file at 1m~/.gemstash/config.yml 22mor 1m~/.gem-0m
17
- 1mstash/config.yml.erb22m, then you must specify the config file via this
15
+ o --config-file FILE: Specify the config file to use. If you aren't
16
+ using the default config file at ~/.gemstash/config.yml or ~/.gem-
17
+ stash/config.yml.erb, then you must specify the config file via this
18
18
  option.
19
19
 
20
20
  October 28, 2015 4mgemstash-status24m(1)
@@ -1,35 +1,17 @@
1
1
  <!-- Automatically generated by Pandoc -->
2
- .\" Automatically generated by Pandoc 3.1.6.2
2
+ .\" Automatically generated by Pandoc 3.1.8
3
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
4
  .TH "gemstash-stop" "1" "October 9, 2015" "" ""
19
- .hy
20
5
  .SH Name
21
- .PP
22
6
  gemstash-stop - Stops the Gemstash server
23
7
  .SH Synopsis
24
- .PP
25
- \f[V]gemstash stop [--config-file FILE]\f[R]
8
+ \f[CR]gemstash stop [--config-file FILE]\f[R]
26
9
  .SH Description
27
- .PP
28
10
  Stops the Gemstash server.
29
11
  .SH Options
30
12
  .IP \[bu] 2
31
- \f[V]--config-file FILE\f[R]: Specify the config file to use.
13
+ \f[CR]--config-file FILE\f[R]: Specify the config file to use.
32
14
  If you aren\[cq]t using the default config file at
33
- \f[V]\[ti]/.gemstash/config.yml\f[R] or
34
- \f[V]\[ti]/.gemstash/config.yml.erb\f[R], then you must specify the
15
+ \f[CR]\[ti]/.gemstash/config.yml\f[R] or
16
+ \f[CR]\[ti]/.gemstash/config.yml.erb\f[R], then you must specify the
35
17
  config file via this option.
@@ -6,15 +6,15 @@
6
6
  gemstash-stop - Stops the Gemstash server
7
7
 
8
8
  1mSynopsis0m
9
- 1mgemstash stop [--config-file FILE]0m
9
+ gemstash stop [--config-file FILE]
10
10
 
11
11
  1mDescription0m
12
12
  Stops the Gemstash server.
13
13
 
14
14
  1mOptions0m
15
- o 1m--config-file FILE22m: Specify the config file to use. If you aren't
16
- using the default config file at 1m~/.gemstash/config.yml 22mor 1m~/.gem-0m
17
- 1mstash/config.yml.erb22m, then you must specify the config file via this
15
+ o --config-file FILE: Specify the config file to use. If you aren't
16
+ using the default config file at ~/.gemstash/config.yml or ~/.gem-
17
+ stash/config.yml.erb, then you must specify the config file via this
18
18
  option.
19
19
 
20
20
  October 9, 2015 4mgemstash-stop24m(1)
@@ -1,37 +1,17 @@
1
1
  <!-- Automatically generated by Pandoc -->
2
- .\" Automatically generated by Pandoc 3.1.6.2
2
+ .\" Automatically generated by Pandoc 3.1.8
3
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
4
  .TH "gemstash-version" "1" "December 14, 2015" "" ""
19
- .hy
20
5
  .SH Name
21
- .PP
22
6
  gemstash-version - Show what version of Gemstash you are using
23
7
  .SH Synopsis
24
- .PP
25
- \f[V]gemstash version\f[R]
8
+ \f[CR]gemstash version\f[R]
26
9
  .SH Description
27
- .PP
28
10
  Show what version of Gemstash you are using.
29
11
  .SS Usage
30
12
  .IP
31
- .nf
32
- \f[C]
13
+ .EX
33
14
  gemstash version
34
15
  gemstash --version
35
16
  gemstash -v
36
- \f[R]
37
- .fi
17
+ .EE
@@ -6,7 +6,7 @@
6
6
  gemstash-version - Show what version of Gemstash you are using
7
7
 
8
8
  1mSynopsis0m
9
- 1mgemstash version0m
9
+ gemstash version
10
10
 
11
11
  1mDescription0m
12
12
  Show what version of Gemstash you are using.
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ change do
5
+ alter_table :authorizations do
6
+ add_column :name, String, :size => 191
7
+ add_index [:name], :unique => true
8
+ end
9
+ end
10
+ end
@@ -11,10 +11,12 @@ module Gemstash
11
11
 
12
12
  attr_reader :user_agent, :uri
13
13
 
14
- def_delegators :@uri, :scheme, :host, :user, :password, :to_s
14
+ def_delegators :@uri, :scheme, :host, :to_s
15
15
 
16
16
  def initialize(upstream, user_agent: nil)
17
- @uri = URI(CGI.unescape(upstream.to_s))
17
+ url = CGI.unescape(upstream.to_s)
18
+ url = "https://#{url}" unless %r{^https?://}.match?(url)
19
+ @uri = URI(url)
18
20
  @user_agent = user_agent
19
21
  raise "URL '#{@uri}' is not valid!" unless @uri.to_s&.match?(URI::DEFAULT_PARSER.make_regexp)
20
22
  end
@@ -40,12 +42,41 @@ module Gemstash
40
42
  @host_id ||= "#{host}_#{hash}"
41
43
  end
42
44
 
45
+ def user
46
+ env_auth_user || @uri.user
47
+ end
48
+
49
+ def password
50
+ env_auth_pass || @uri.password
51
+ end
52
+
43
53
  private
44
54
 
45
55
  def hash
46
56
  Digest::MD5.hexdigest(to_s)
47
57
  end
48
58
 
59
+ def env_auth_user
60
+ return unless env_auth
61
+
62
+ env_auth.split(":", 2).first
63
+ end
64
+
65
+ def env_auth_pass
66
+ return unless env_auth
67
+ return unless env_auth.include?(":")
68
+
69
+ env_auth.split(":", 2).last
70
+ end
71
+
72
+ def env_auth
73
+ @env_auth ||= ENV["GEMSTASH_#{host_for_env}"]
74
+ end
75
+
76
+ def host_for_env
77
+ host.upcase.gsub(".", "__").gsub("-", "___")
78
+ end
79
+
49
80
  # :nodoc:
50
81
  class GemName
51
82
  def initialize(upstream, gem_name)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # :nodoc:
4
4
  module Gemstash
5
- VERSION = "2.3.2"
5
+ VERSION = "2.5.0"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemstash
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Arko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-14 00:00:00.000000000 Z
11
+ date: 2023-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -174,6 +174,20 @@ dependencies:
174
174
  - - "<"
175
175
  - !ruby/object:Gem::Version
176
176
  version: '4.0'
177
+ - !ruby/object:Gem::Dependency
178
+ name: terminal-table
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: '3.0'
184
+ type: :runtime
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - "~>"
189
+ - !ruby/object:Gem::Version
190
+ version: '3.0'
177
191
  - !ruby/object:Gem::Dependency
178
192
  name: thor
179
193
  requirement: !ruby/object:Gem::Requirement
@@ -281,6 +295,7 @@ files:
281
295
  - lib/gemstash/migrations/02_authorizations.rb
282
296
  - lib/gemstash/migrations/03_cached_gems.rb
283
297
  - lib/gemstash/migrations/04_health_tests.rb
298
+ - lib/gemstash/migrations/05_authorization_names.rb
284
299
  - lib/gemstash/puma.rb
285
300
  - lib/gemstash/rack_env_rewriter.rb
286
301
  - lib/gemstash/specs_builder.rb
@@ -307,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
322
  - !ruby/object:Gem::Version
308
323
  version: '0'
309
324
  requirements: []
310
- rubygems_version: 3.4.14
325
+ rubygems_version: 3.5.0.dev
311
326
  signing_key:
312
327
  specification_version: 4
313
328
  summary: A place to stash gems you'll need