gemstash 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -0
  3. data/lib/gemstash/cache.rb +37 -0
  4. data/lib/gemstash/cli/authorize.rb +2 -2
  5. data/lib/gemstash/cli/setup.rb +11 -3
  6. data/lib/gemstash/configuration.rb +1 -1
  7. data/lib/gemstash/dependencies.rb +2 -2
  8. data/lib/gemstash/env.rb +2 -0
  9. data/lib/gemstash/gem_fetcher.rb +2 -2
  10. data/lib/gemstash/gem_pusher.rb +2 -2
  11. data/lib/gemstash/gem_source/private_source.rb +3 -3
  12. data/lib/gemstash/gem_source.rb +2 -2
  13. data/lib/gemstash/http_client.rb +8 -3
  14. data/lib/gemstash/logging.rb +1 -1
  15. data/lib/gemstash/man/gemstash-authorize.1.txt +0 -45
  16. data/lib/gemstash/man/gemstash-configuration.5.txt +0 -209
  17. data/lib/gemstash/man/gemstash-customize.7.txt +0 -186
  18. data/lib/gemstash/man/gemstash-debugging.7.txt +0 -28
  19. data/lib/gemstash/man/gemstash-deploy.7.txt +0 -58
  20. data/lib/gemstash/man/gemstash-mirror.7.txt +0 -32
  21. data/lib/gemstash/man/gemstash-multiple-sources.7.txt +0 -70
  22. data/lib/gemstash/man/gemstash-private-gems.7.txt +0 -155
  23. data/lib/gemstash/man/gemstash-readme.7.txt +0 -181
  24. data/lib/gemstash/man/gemstash-setup.1.txt +0 -39
  25. data/lib/gemstash/man/gemstash-start.1.txt +0 -25
  26. data/lib/gemstash/man/gemstash-status.1.txt +0 -21
  27. data/lib/gemstash/man/gemstash-stop.1.txt +0 -21
  28. data/lib/gemstash/man/gemstash-version.1.txt +0 -20
  29. data/lib/gemstash/storage.rb +5 -4
  30. data/lib/gemstash/upstream.rb +6 -5
  31. data/lib/gemstash/version.rb +2 -2
  32. data/lib/gemstash/web.rb +6 -4
  33. data/lib/gemstash.rb +1 -1
  34. metadata +31 -171
  35. data/lib/gemstash/man/gemstash-authorize.1 +0 -51
  36. data/lib/gemstash/man/gemstash-configuration.5 +0 -229
  37. data/lib/gemstash/man/gemstash-customize.7 +0 -301
  38. data/lib/gemstash/man/gemstash-debugging.7 +0 -34
  39. data/lib/gemstash/man/gemstash-deploy.7 +0 -72
  40. data/lib/gemstash/man/gemstash-mirror.7 +0 -40
  41. data/lib/gemstash/man/gemstash-multiple-sources.7 +0 -89
  42. data/lib/gemstash/man/gemstash-private-gems.7 +0 -227
  43. data/lib/gemstash/man/gemstash-readme.7 +0 -233
  44. data/lib/gemstash/man/gemstash-setup.1 +0 -43
  45. data/lib/gemstash/man/gemstash-start.1 +0 -26
  46. data/lib/gemstash/man/gemstash-status.1 +0 -20
  47. data/lib/gemstash/man/gemstash-stop.1 +0 -20
  48. data/lib/gemstash/man/gemstash-version.1 +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aaf9ebeef139205ff90579ee16b1cd307bc3669164704163bb9503b656532eb2
4
- data.tar.gz: 7188adfcdde048e812747afc26e915efae2d502c305da21e6f692132d01a8028
3
+ metadata.gz: 41416a39e4dabbc11e7f8f1ad812dc34ffce3fbfa47c6f997feec01c083bf483
4
+ data.tar.gz: c274c1eac63e99d2001f946b117c020dd1fe5c25bdcaf1c31dd28e0668603b2d
5
5
  SHA512:
6
- metadata.gz: 4a4326563fe277ae496e087a5e941d9f829cde351c1c1d92021061e4796cb612f081a73acece2e250a0220a660b631017a4372b401afbb30b4cfe4b95ac6618e
7
- data.tar.gz: ff3b604ca9d7280b2ca0b72fa98c605e1b998eb3fcf9aa5801b6854c970c3d9c8f5d5c33732eb619bd8106dc86c27ee2ac6823cc2b14f2a2f8a7d44eb1383cae
6
+ metadata.gz: 94941045dd2f8232b5c55a79e775df4e89243d62ce88f22bd737d9dda3bf718a9d30b184b790677beba415c98243b3190c362cab800333993e6d89677592d398
7
+ data.tar.gz: 3f771fae6b0a388dd730978ec0721c83514d3479fd30f9211def6d7bad2ce5f9a83239bbfde091b450f32c053d0f763799e61aa9a9f95b947802dc2c1533275a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,60 @@
1
+ ## 2.1.0 (2020-02-26)
2
+
3
+ ### Bugfixes
4
+
5
+ - Shebang should be the first thing in the file ([#222](https://github.com/rubygems/gemstash/pull/222), [@bronzdoc](https://github.com/bronzdoc))
6
+
7
+ ### Changes
8
+
9
+ - Update rack-test requirement from ~> 0.6 to ~> 1.1 ([#199](https://github.com/rubygems/gemstash/pull/199), [@dependabot](https://github.com/dependabot))
10
+ - Update rake requirement from ~> 10.0 to ~> 12.3 ([#200](https://github.com/rubygems/gemstash/pull/200), [@dependabot](https://github.com/dependabot))
11
+ - CI matrix: Drop 2.0, 2.1, 2.2 ([#201](https://github.com/rubygems/gemstash/pull/201), [@olleolleolle](https://github.com/olleolleolle))
12
+ - Update rubocop version and update files to be inline with new cops ([#202](https://github.com/rubygems/gemstash/pull/202), [@bronzdoc](https://github.com/bronzdoc))
13
+ - Update rubocop requirement from = 0.60.0 to = 0.61.0 ([#208](https://github.com/rubygems/gemstash/pull/208), [@dependabot](https://github.com/dependabot))
14
+ - Update rubocop requirement from = 0.61.0 to = 0.61.1 ([#209](https://github.com/rubygems/gemstash/pull/209), [@dependabot](https://github.com/dependabot))
15
+ - Avoid Rubocop warnings ([#210](https://github.com/rubygems/gemstash/pull/210), [@olleolleolle](https://github.com/olleolleolle))
16
+ - RSpec: config.disable_monkey_patching! ([#211](https://github.com/rubygems/gemstash/pull/211), [@olleolleolle](https://github.com/olleolleolle))
17
+ - Travis: update JRuby to 9.2.5.0 ([#212](https://github.com/rubygems/gemstash/pull/212), [@olleolleolle](https://github.com/olleolleolle))
18
+ - Update rubocop requirement from = 0.61.1 to = 0.62.0 ([#213](https://github.com/rubygems/gemstash/pull/213), [@dependabot](https://github.com/dependabot))
19
+ - Update rubocop requirement from = 0.62.0 to = 0.63.0 ([#215](https://github.com/rubygems/gemstash/pull/215), [@dependabot](https://github.com/dependabot))
20
+ - gemspec: Allow Bundler 2 ([#217](https://github.com/rubygems/gemstash/pull/217), [@olleolleolle](https://github.com/olleolleolle))
21
+ - Update rubocop requirement from = 0.63.0 to = 0.63.1 ([#218](https://github.com/rubygems/gemstash/pull/218), [@dependabot](https://github.com/dependabot))
22
+ - Update rubocop requirement from = 0.63.1 to = 0.64.0 ([#220](https://github.com/rubygems/gemstash/pull/220), [@dependabot](https://github.com/dependabot))
23
+ - CI: matrix updates - update JRuby, add 2.6.1 ([#221](https://github.com/rubygems/gemstash/pull/221), [@olleolleolle](https://github.com/olleolleolle))
24
+ - Add a failing Aruba-based RSpec test for the CLI client output ([#223](https://github.com/rubygems/gemstash/pull/223), [@olleolleolle](https://github.com/olleolleolle))
25
+ - Update rubocop requirement from = 0.64.0 to = 0.65.0 ([#224](https://github.com/rubygems/gemstash/pull/224), [@dependabot](https://github.com/dependabot))
26
+ - CI: use 2.5.5, 2.6.2 ([#225](https://github.com/rubygems/gemstash/pull/225), [@olleolleolle](https://github.com/olleolleolle))
27
+ - Update rubocop requirement from = 0.65.0 to = 0.66.0 ([#226](https://github.com/rubygems/gemstash/pull/226), [@dependabot](https://github.com/dependabot), [@olleolleolle](https://github.com/olleolleolle), [@bronzdoc](https://github.com/bronzdoc))
28
+ - CI: Use 2.4.6 ([#228](https://github.com/rubygems/gemstash/pull/228), [@olleolleolle](https://github.com/olleolleolle))
29
+ - Update rubocop requirement from = 0.66.0 to = 0.67.1 ([#229](https://github.com/rubygems/gemstash/pull/229), [@dependabot](https://github.com/dependabot), [@olleolleolle](https://github.com/olleolleolle))
30
+ - CI: Drop 2.3.8 ([#230](https://github.com/rubygems/gemstash/pull/230), [@olleolleolle](https://github.com/olleolleolle))
31
+ - Update rubocop requirement from = 0.67.1 to = 0.67.2 ([#231](https://github.com/rubygems/gemstash/pull/231), [@dependabot](https://github.com/dependabot))
32
+ - CI: Use JRuby 9.2.7.0 ([#232](https://github.com/rubygems/gemstash/pull/232), [@olleolleolle](https://github.com/olleolleolle))
33
+ - Update rubocop requirement from = 0.67.2 to = 0.68.0 ([#233](https://github.com/rubygems/gemstash/pull/233), [@dependabot](https://github.com/dependabot), [@olleolleolle](https://github.com/olleolleolle))
34
+ - Update rubocop requirement from = 0.68.1 to = 0.69.0 ([#234](https://github.com/rubygems/gemstash/pull/234), [@dependabot](https://github.com/dependabot))
35
+ - Update rubocop requirement from = 0.69.0 to = 0.70.0 ([#235](https://github.com/rubygems/gemstash/pull/235), [@dependabot](https://github.com/dependabot))
36
+ - Set Travis badge to /rubygems user ([#236](https://github.com/rubygems/gemstash/pull/236), [@olleolleolle](https://github.com/olleolleolle))
37
+ - Fix broken links ([#240](https://github.com/rubygems/gemstash/pull/240), [@Aliciawyse](https://github.com/Aliciawyse))
38
+ - Fix various rubocop/codeclimate issues ([#241](https://github.com/rubygems/gemstash/pull/241), [@tchia04](https://github.com/tchia04))
39
+ - Fix some broken links in readme ([#243](https://github.com/rubygems/gemstash/pull/243), [@Aliciawyse](https://github.com/Aliciawyse))
40
+ - Improve webspec tests ([#244](https://github.com/rubygems/gemstash/pull/244), [@Aliciawyse](https://github.com/Aliciawyse))
41
+ - CI: Use jruby-9.2.8.0 ([#245](https://github.com/rubygems/gemstash/pull/245), [@olleolleolle](https://github.com/olleolleolle))
42
+ - CI: Use ruby 2.4.7, 2.5.6, 2.6.4 ([#246](https://github.com/rubygems/gemstash/pull/246), [@olleolleolle](https://github.com/olleolleolle))
43
+ - Add puma server pidfile configuration option ([#248](https://github.com/rubygems/gemstash/pull/248), [@krists](https://github.com/krists))
44
+ - CI: Use jruby-9.2.9.0 ([#249](https://github.com/rubygems/gemstash/pull/249), [@olleolleolle](https://github.com/olleolleolle))
45
+ - Officially drop support for older rubies ([#250](https://github.com/rubygems/gemstash/pull/250), [@deivid-rodriguez](https://github.com/deivid-rodriguez))
46
+ - Add config to ignore Gemfile source ([#253](https://github.com/rubygems/gemstash/pull/253), [@zpdcodes](https://github.com/zpdcodes))
47
+ - Update Puma gem ([#255](https://github.com/rubygems/gemstash/pull/255), [@bronzdoc](https://github.com/bronzdoc))
48
+ - Spec failures might be due to a bundler version ([#256](https://github.com/rubygems/gemstash/pull/256), [@bronzdoc](https://github.com/bronzdoc))
49
+ - Update spec homepage ([#257](https://github.com/rubygems/gemstash/pull/257), [@bronzdoc](https://github.com/bronzdoc))
50
+ - Update README.md links ([#258](https://github.com/rubygems/gemstash/pull/258), [@bronzdoc](https://github.com/bronzdoc))
51
+ - Add PR template ([#259](https://github.com/rubygems/gemstash/pull/259), [@bronzdoc](https://github.com/bronzdoc))
52
+ - Update docs ([#260](https://github.com/rubygems/gemstash/pull/260), [@bronzdoc](https://github.com/bronzdoc))
53
+
54
+ ### Features
55
+
56
+ - Add configuration options cache_expiration, cache_max_size ([#207](https://github.com/rubygems/gemstash/pull/207), [@optix2000](https://github.com/optix2000), [@olleolleolle](https://github.com/olleolleolle))
57
+
1
58
  ## 2.0.0 (2018-11-18)
2
59
 
3
60
  ### Changes
@@ -79,4 +79,41 @@ module Gemstash
79
79
  @cache[key] = value
80
80
  end
81
81
  end
82
+
83
+ # Wrapper around the redis-rb gem to behave like a dalli Memcached client.
84
+ class RedisClient
85
+ extend Forwardable
86
+
87
+ def_delegator :@cache, :del, :delete
88
+
89
+ def initialize(redis_servers)
90
+ require "redis"
91
+ @cache = ::Redis.new(:url => redis_servers)
92
+ end
93
+
94
+ def alive!
95
+ @cache.ping == "PONG"
96
+ end
97
+
98
+ def get(key)
99
+ val = @cache.get(key)
100
+ YAML.load(val) unless val.nil?
101
+ end
102
+
103
+ def get_multi(keys)
104
+ @cache.mget(*keys).each do |k, v|
105
+ next if v.nil?
106
+
107
+ yield(k, YAML.load(v))
108
+ end
109
+ end
110
+
111
+ def set(key, value, expiry)
112
+ @cache.set(key, YAML.dump(value), :ex => expiry)
113
+ end
114
+
115
+ def flush
116
+ @cache.flushdb
117
+ end
118
+ end
82
119
  end
@@ -30,7 +30,7 @@ module Gemstash
30
30
  raise Gemstash::CLI::Error.new(@cli, "To remove individual permissions, you do not need --remove
31
31
  Instead just authorize with the new set of permissions")
32
32
  end
33
- Gemstash::Authorization.remove(auth_key(false))
33
+ Gemstash::Authorization.remove(auth_key(allow_generate: false))
34
34
  end
35
35
 
36
36
  def save_authorization
@@ -46,7 +46,7 @@ Instead just authorize with the new set of permissions")
46
46
  Gemstash::Authorization.authorize(auth_key, permissions)
47
47
  end
48
48
 
49
- def auth_key(allow_generate = true)
49
+ def auth_key(allow_generate: true)
50
50
  if @cli.options[:key]
51
51
  @cli.options[:key]
52
52
  elsif allow_generate
@@ -76,8 +76,9 @@ module Gemstash
76
76
 
77
77
  def ask_cache
78
78
  say_current_config(:cache_type, "Current cache")
79
- @config[:cache_type] = ask_with_default("Cache with what?", %w[memory memcached], "memory")
79
+ @config[:cache_type] = ask_with_default("Cache with what?", %w[memory memcached redis], "memory")
80
80
  ask_memcached_details if @config[:cache_type] == "memcached"
81
+ ask_redis_details if @config[:cache_type] == "redis"
81
82
  end
82
83
 
83
84
  def ask_memcached_details
@@ -87,6 +88,13 @@ module Gemstash
87
88
  @config[:memcached_servers] = servers
88
89
  end
89
90
 
91
+ def ask_redis_details
92
+ say_current_config(:redis_servers, "Current Redis servers")
93
+ servers = @cli.ask "What is the comma-separated list of Redis servers? [localhost:6379]"
94
+ servers = "localhost:6379" if servers.empty?
95
+ @config[:redis_servers] = servers
96
+ end
97
+
90
98
  def ask_database
91
99
  say_current_config(:db_adapter, "Current database adapter")
92
100
  @config[:db_adapter] = ask_with_default("What database adapter?", %w[sqlite3 postgres mysql mysql2], "sqlite3")
@@ -181,9 +189,9 @@ module Gemstash
181
189
  gemstash_env.reset
182
190
  end
183
191
 
184
- def try(thing)
192
+ def try(thing, &block)
185
193
  @cli.say "Checking that the #{thing} is available"
186
- with_new_config { yield }
194
+ with_new_config(&block)
187
195
  rescue StandardError => e
188
196
  say_error "Error checking #{thing}", e
189
197
  raise Gemstash::CLI::Error.new(@cli, "The #{thing} is not available")
@@ -4,7 +4,7 @@ require "yaml"
4
4
  require "erb"
5
5
 
6
6
  module Gemstash
7
- #:nodoc:
7
+ # :nodoc:
8
8
  class Configuration
9
9
  DEFAULTS = {
10
10
  cache_type: "memory",
@@ -4,7 +4,7 @@ require "cgi"
4
4
  require "set"
5
5
 
6
6
  module Gemstash
7
- #:nodoc:
7
+ # :nodoc:
8
8
  class Dependencies
9
9
  def self.for_private
10
10
  new(scope: "private", db_model: Gemstash::DB::Dependency)
@@ -24,7 +24,7 @@ module Gemstash
24
24
  Fetcher.new(gems, @scope, @http_client, @db_model).fetch
25
25
  end
26
26
 
27
- #:nodoc:
27
+ # :nodoc:
28
28
  class Fetcher
29
29
  include Gemstash::Env::Helper
30
30
  include Gemstash::Logging
data/lib/gemstash/env.rb CHANGED
@@ -170,6 +170,8 @@ module Gemstash
170
170
  Gemstash::LruReduxClient.new
171
171
  when "memcached"
172
172
  Dalli::Client.new(config[:memcached_servers])
173
+ when "redis"
174
+ Gemstash::RedisClient.new(config[:redis_servers])
173
175
  else
174
176
  raise "Invalid cache client: '#{config[:cache_type]}'"
175
177
  end
@@ -4,11 +4,11 @@ require "gemstash"
4
4
  require "set"
5
5
 
6
6
  module Gemstash
7
- #:nodoc:
7
+ # :nodoc:
8
8
  class GemFetcher
9
9
  def initialize(http_client)
10
10
  @http_client = http_client
11
- @valid_headers = Set.new(["etag", "content-type", "content-length", "last-modified"])
11
+ @valid_headers = Set.new(%w[etag content-type content-length last-modified])
12
12
  end
13
13
 
14
14
  def fetch(gem_id, type, &block)
@@ -4,7 +4,7 @@ require "gemstash"
4
4
  require "rubygems/package"
5
5
  require "stringio"
6
6
 
7
- #:nodoc:
7
+ # :nodoc:
8
8
  module Gemstash
9
9
  # Class that supports pushing a new gem to the private repository of gems.
10
10
  class GemPusher
@@ -127,6 +127,6 @@ module Gemstash
127
127
  end
128
128
  end
129
129
 
130
- GemPusher.send(:include, LegacyRubyGemsSupport)
130
+ GemPusher.include LegacyRubyGemsSupport
131
131
  end
132
132
  end
@@ -47,7 +47,7 @@ module Gemstash
47
47
  end
48
48
 
49
49
  def serve_versions
50
- halt 403, "Not yet supported"
50
+ halt 404, "Not yet supported"
51
51
  end
52
52
 
53
53
  def serve_info(name)
@@ -57,7 +57,7 @@ module Gemstash
57
57
  def serve_marshal(id)
58
58
  authorization.protect(self) do
59
59
  auth.check("fetch") if gemstash_env.config[:protected_fetch]
60
- gem_full_name = id.sub(/\.gemspec\.rz\z/, "")
60
+ gem_full_name = id.delete_suffix(".gemspec.rz")
61
61
  gem = fetch_gem(gem_full_name)
62
62
  halt 404 unless gem.exist?(:spec)
63
63
  content_type "application/octet-stream"
@@ -72,7 +72,7 @@ module Gemstash
72
72
  def serve_gem(id)
73
73
  authorization.protect(self) do
74
74
  auth.check("fetch") if gemstash_env.config[:protected_fetch]
75
- gem_full_name = id.sub(/\.gem\z/, "")
75
+ gem_full_name = id.delete_suffix(".gem")
76
76
  gem = fetch_gem(gem_full_name)
77
77
  content_type "application/octet-stream"
78
78
  gem.content(:gem)
@@ -4,7 +4,7 @@ require "gemstash"
4
4
  require "forwardable"
5
5
 
6
6
  module Gemstash
7
- #:nodoc:
7
+ # :nodoc:
8
8
  module GemSource
9
9
  autoload :DependencyCaching, "gemstash/gem_source/dependency_caching"
10
10
  autoload :PrivateSource, "gemstash/gem_source/private_source"
@@ -29,7 +29,7 @@ module Gemstash
29
29
  include Gemstash::Logging
30
30
 
31
31
  def_delegators :@app, :cache_control, :content_type, :env, :halt,
32
- :headers, :http_client_for, :params, :redirect, :request
32
+ :headers, :http_client_for, :params, :redirect, :request
33
33
 
34
34
  def initialize(app)
35
35
  @app = app
@@ -5,7 +5,7 @@ require "faraday"
5
5
  require "faraday_middleware"
6
6
 
7
7
  module Gemstash
8
- #:nodoc:
8
+ # :nodoc:
9
9
  class WebError < StandardError
10
10
  attr_reader :code
11
11
 
@@ -15,14 +15,14 @@ module Gemstash
15
15
  end
16
16
  end
17
17
 
18
- #:nodoc:
18
+ # :nodoc:
19
19
  class ConnectionError < WebError
20
20
  def initialize(message)
21
21
  super(message, 502) # Bad Gateway
22
22
  end
23
23
  end
24
24
 
25
- #:nodoc:
25
+ # :nodoc:
26
26
  class HTTPClient
27
27
  extend Gemstash::Env::Helper
28
28
  include Gemstash::Logging
@@ -35,12 +35,17 @@ module Gemstash
35
35
  config.adapter :net_http
36
36
  config.options.timeout = gemstash_env.config[:fetch_timeout]
37
37
  end
38
+
39
+ client.basic_auth(upstream.user, upstream.password) if upstream.auth?
40
+
38
41
  user_agent = "#{upstream.user_agent} " unless upstream.user_agent.to_s.empty?
39
42
  user_agent = user_agent.to_s + DEFAULT_USER_AGENT
40
43
 
41
44
  new(client, user_agent: user_agent)
42
45
  end
43
46
 
47
+ attr_reader :client
48
+
44
49
  def initialize(client = nil, user_agent: nil)
45
50
  @client = client
46
51
  @user_agent = user_agent || DEFAULT_USER_AGENT
@@ -4,7 +4,7 @@ require "logger"
4
4
  require "puma/events"
5
5
 
6
6
  module Gemstash
7
- #:nodoc:
7
+ # :nodoc:
8
8
  module Logging
9
9
  LEVELS = {
10
10
  debug: Logger::DEBUG,
@@ -1,46 +1 @@
1
- gemstash-authorize(1) gemstash-authorize(1)
2
1
 
3
-
4
-
5
- 1mNAME0m
6
- gemstash-authorize - Adds or removes authorization to interact with
7
- privately stored gems
8
-
9
- 1mSYNOPSIS0m
10
- gemstash authorize [permissions] [--remove] [--key SECURE_KEY] [--con-
11
- fig-file FILE]
12
-
13
- 1mDESCRIPTION0m
14
- Adds or removes authorization to interact with privately stored gems.
15
-
16
- Any arguments will be used as specific permissions. Valid permissions
17
- include push, yank, and fetch. If no permissions are provided, then
18
- all permissions will be granted (including any that may be added in fu-
19
- ture versions of Gemstash).
20
-
21
- 1mUSAGE0m
22
- gemstash authorize
23
- gemstash authorize push yank
24
- gemstash authorize yank --key <secure-key>
25
- gemstash authorize --remove --key <secure-key>
26
-
27
- 1mOPTIONS0m
28
- o --config-file FILE: Specify the config file to use. If you aren't
29
- using the default config file at ~/.gemstash/config.yml or ~/.gem-
30
- stash/config.yml.erb (gemstash help customize.7), then you must spec-
31
- ify the config file via this option.
32
-
33
- o --key SECURE_KEY: Specify the API key to affect. This should be the
34
- actual key value, not a name. This option is required when using
35
- --remove but is optional otherwise. If adding an authorization, us-
36
- ing this will either create or update the permissions for the speci-
37
- fied API key. If missing, a new API key will always be generated.
38
- Note that a key can only have a maximum length of 255 chars.
39
-
40
- o --remove: Remove an authorization rather than add or update one.
41
- When removing, permission values are not allowed. The --key <se-
42
- cure-key> option is required.
43
-
44
-
45
-
46
- October 9, 2015 gemstash-authorize(1)
@@ -1,210 +1 @@
1
- gemstash-configuration(5) gemstash-configuration(5)
2
1
 
3
-
4
-
5
- 1mNAME0m
6
- gemstash-configuration
7
-
8
- 1mSYNOPSIS0m
9
- # ~/.gemstash/config.yml
10
- ---
11
- :base_path: "/var/gemstash"
12
- :cache_type: memcached
13
- :memcached_servers: localhost:11211
14
- :db_adapter: postgres
15
- :db_url: postgres:///gemstash
16
- :db_connection_options:
17
- :test: true
18
- :pool_timeout: 2
19
- :rubygems_url: https://my.gem-source.local
20
- :ignore_gemfile_source: false
21
- :puma_threads: 32
22
- :bind: tcp://0.0.0.0:4242
23
- :protected_fetch: true
24
- :fetch_timeout: 10
25
- :log_file: gemstash.log
26
-
27
- 1mBASE PATH0m
28
- :base_path
29
-
30
- Specifies where to store local files like the server log, cached gem
31
- files, and the database (when using SQLite). If the default is being
32
- used, the directory will be created if it does not exist. Any other
33
- directory needs to be created ahead of time and be writable to the Gem-
34
- stash server process. Specifying the :base_path via gemstash setup
35
- (gemstash help setup.1) will create the directory for you.
36
-
37
- 1mDEFAULT VALUE0m
38
- ~/.gemstash
39
-
40
- 1mVALID VALUES0m
41
- Any valid path
42
-
43
- 1mCACHE TYPE0m
44
- :cache_type
45
-
46
- Specifies how to cache values other than gem files (such as gem depen-
47
- dencies). memory will use an in memory cache while memcached will
48
- point to 1 or more Memcached servers. Use the :memcached_servers con-
49
- figuration key for specifying where the Memcached server(s) are.
50
-
51
- 1mDEFAULT VALUE0m
52
- memory
53
-
54
- 1mVALID VALUES0m
55
- memory, memcached
56
-
57
- 1mMEMCACHED SERVERS0m
58
- :memcached_servers
59
-
60
- Specifies the Memcached servers to connect to when using memcached for
61
- the :cache_type. Only used when memcached is used for :cache_type.
62
-
63
- 1mDEFAULT VALUE0m
64
- localhost:11211
65
-
66
- 1mVALID VALUES0m
67
- A comma delimited list of Memcached servers
68
-
69
- 1mDB ADAPTER0m
70
- :db_adapter
71
-
72
- Specifies what database adapter to use. When sqlite3 is used, the
73
- database will be located at gemstash.db within the directory specified
74
- by :base_path. The database will automatically be created when using
75
- sqlite3. When postgres, mysql, or mysql2 is used, the database to con-
76
- nect to must be specified in the :db_url configuration key. The data-
77
- base must already be created when using anything other than sqlite3.
78
-
79
- 1mDEFAULT VALUE0m
80
- sqlite3
81
-
82
- 1mVALID VALUES0m
83
- sqlite3, postgres, mysql, mysql2
84
-
85
- 1mDB URL0m
86
- :db_url
87
-
88
- Specifies the database to connect to when using postgres, mysql, or
89
- mysql2 for the :db_adapter. Only used when the :db_adapter is not
90
- sqlite3.
91
-
92
- 1mDEFAULT VALUE0m
93
- None
94
-
95
- 1mVALID VALUES0m
96
- A valid database URL for the Sequel gem (http://sequel.jeremye-
97
- vans.net/)
98
-
99
- 1mDB CONNECTION OPTIONS0m
100
- :db_connection_options
101
-
102
- Specifies additional Sequel.connect options to use. Note that any op-
103
- tions here are merged in with the default options, so you need not
104
- specify the max_connections if you customize this option.
105
-
106
- 1mDEFAULT VALUE0m
107
- { max_connections: 1 } for sqlite3 adapter, { max_connections: con-
108
- fig[:puma_threads] + 1 } for any other adapter.
109
-
110
- 1mVALID VALUES0m
111
- A valid connection options Hash for the Sequel.connect (http://se-
112
- quel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-
113
- General+connection+options) method.
114
-
115
- 1mRUBYGEMS URL0m
116
- :rubygems_url
117
-
118
- Specifies the default gem source URL. When any API endpoint is called
119
- without a /private or /upstream/<url> prefix, this URL will be used to
120
- fetch the result. This value can be safely changed even if there are
121
- already gems stashed for the previous value.
122
-
123
- 1mDEFAULT VALUE0m
124
- https://rubygems.org
125
-
126
- 1mVALID VALUES0m
127
- A valid gem source URL
128
-
129
- 1mIGNORE GEMFILE SOURCE0m
130
- :ignore_gemfile_source
131
-
132
- Ignore the source specified in Gemfile and always use :rubygems_url as
133
- gems upstream.
134
-
135
- 1mDEFAULT VALUE0m
136
- false
137
-
138
- 1mVALID VALUES0m
139
- Boolean: true or false
140
-
141
- 1mPUMA THREADS0m
142
- :puma_threads
143
-
144
- Specifies the number of threads used for the Gemstash server.
145
-
146
- 1mDEFAULT VALUE0m
147
- 16
148
-
149
- 1mVALID VALUES0m
150
- Integer value with a minimum of 1
151
-
152
- 1mBIND ADDRESS0m
153
- :bind
154
-
155
- Specifies the binding used to start the Gemstash server. Keep in mind
156
- the user starting Gemstash needs to have access to bind in this manner.
157
- For example, if you use a port below 1024, you will need to run Gem-
158
- stash as the root user.
159
-
160
- 1mDEFAULT VALUE0m
161
- tcp://0.0.0.0:9292
162
-
163
- 1mVALID VALUES0m
164
- Any valid binding that is supported by Puma
165
- (https://github.com/puma/puma#binding-tcp--sockets)
166
-
167
- 1mPROTECTED FETCH0m
168
- :protected_fetch
169
-
170
- Tells Gemstash to authenticate via an API key before allowing the
171
- fetching of private gems and specs. The default behavior is to allow
172
- unauthenticated download of private gems and specs.
173
-
174
- 1mDEFAULT VALUE0m
175
- false
176
-
177
- 1mVALID VALUES0m
178
- Boolean values true or false
179
-
180
- 1mFETCH TIMEOUT0m
181
- :fetch_timeout
182
-
183
- The timeout setting for fetching gems. Fetching gems over a slow con-
184
- nection may cause timeout errors. If you experience timeout errors,
185
- you may want to increase this value. The default is 20 seconds.
186
-
187
- 1mDEFAULT VALUE0m
188
- 20
189
-
190
- 1mVALID VALUES0m
191
- Integer value with a minimum of 1
192
-
193
- 1mLOG FILE0m
194
- :log_file
195
-
196
- Indicates the name of the file to use for logging. The file will be
197
- placed in the base path (gemstash help configuration.5).
198
-
199
- 1mDEFAULT VALUE0m
200
- server.log
201
-
202
- 1mVALID VALUES0m
203
- Any valid file name, or :stdout to log to $stdout
204
-
205
- 4mNote:24m 4mUsing24m 4m:stdout24m 4mfor24m 4mthe24m 4m:log_file24m 4mrequires24m 4mrunning24m 4mwith24m 4m--no-daemo-0m
206
- 4mnize24m 4m(gemstash24m 4mhelp24m 4mstart.1).0m
207
-
208
-
209
-
210
- October 13, 2015 gemstash-configuration(5)