gemstash-configuration
# ~/.gemstash/config.yml
---
:base_path: "/var/gemstash"
:cache_type: memcached
:memcached_servers: localhost:11211
:db_adapter: postgres
:db_url: postgres:///gemstash
:db_connection_options:
:test: true
:pool_timeout: 2
:rubygems_url: https://my.gem-source.local
:puma_threads: 32
:bind: tcp://0.0.0.0:4242
:protected_fetch: true
:fetch_timeout: 10
:log_file: gemstash.log
:base_path
Specifies where to store local files like the server log, cached gem files, and the database (when using SQLite). If the default is being used, the directory will be created if it does not exist. Any other directory needs to be created ahead of time and be writable to the Gemstash server process. Specifying the :base_path
via gemstash setup
will create the directory for you.
~/.gemstash
Any valid path
:cache_type
Specifies how to cache values other than gem files (such as gem dependencies). memory
will use an in memory cache while memcached
will point to 1 or more Memcached servers. Use the :memcached_servers
configuration key for specifying where the Memcached server(s) are.
memory
memory
, memcached
:memcached_servers
Specifies the Memcached servers to connect to when using memcached
for the :cache_type
. Only used when memcached
is used for :cache_type
.
localhost:11211
A comma delimited list of Memcached servers
:db_adapter
Specifies what database adapter to use. When sqlite3
is used, the database will be located at gemstash.db
within the directory specified by :base_path
. The database will automatically be created when using sqlite3
. When postgres
, mysql
, or mysql2
is used, the database to connect to must be specified in the :db_url
configuration key. The database must already be created when using anything other than sqlite3
.
sqlite3
sqlite3
, postgres
, mysql
, mysql2
:db_url
Specifies the database to connect to when using postgres
, mysql
, or mysql2
for the :db_adapter
. Only used when the :db_adapter
is not sqlite3
.
None
A valid database URL for the Sequel gem
:db_connection_options
Specifies additional Sequel.connect
options to use. Note that any options here are merged in with the default options, so you need not specify the max_connections
if you customize this option.
{ max_connections: 1 }
for sqlite3
adapter, { max_connections: config[:puma_threads] + 1 }
for any other adapter.
A valid connection options Hash for the Sequel.connect method.
:rubygems_url
Specifies the default gem source URL. When any API endpoint is called without a /private
or /upstream/<url>
prefix, this URL will be used to fetch the result. This value can be safely changed even if there are already gems stashed for the previous value.
https://rubygems.org
A valid gem source URL
:puma_threads
Specifies the number of threads used for the Gemstash server.
16
Integer value with a minimum of 1
:bind
Specifies the binding used to start the Gemstash server. Keep in mind the user starting Gemstash needs to have access to bind in this manner. For example, if you use a port below 1024, you will need to run Gemstash as the root user.
tcp://0.0.0.0:9292
Any valid binding that is supported by Puma
:protected_fetch
Tells Gemstash to authenticate via an API key before allowing the fetching of private gems and specs. The default behavior is to allow unauthenticated download of private gems and specs.
false
Boolean values true
or false
:fetch_timeout
The timeout setting for fetching gems. Fetching gems over a slow connection may cause timeout errors. If you experience timeout errors, you may want to increase this value. The default is 20
seconds.
20
Integer value with a minimum of 1
:log_file
Indicates the name of the file to use for logging. The file will be placed in the base path.
server.log
Any valid file name, or :stdout
to log to $stdout
Note: Using :stdout
for the :log_file
requires running with --no-daemonize
.