2019-09-18 01:01:34 +00:00
|
|
|
require 'geminabox'
|
|
|
|
require 'rack/session/redis'
|
2019-09-18 13:19:36 +00:00
|
|
|
require 'securerandom'
|
2019-09-18 01:01:34 +00:00
|
|
|
|
|
|
|
Geminabox.data = '/srv/http'
|
|
|
|
Geminabox.rubygems_proxy = true
|
|
|
|
Geminabox.allow_remote_failure = true
|
|
|
|
|
2019-09-18 13:19:36 +00:00
|
|
|
use Rack::Auth::Basic, 'Gems' do |username, password|
|
|
|
|
username == ENV.fetch('HTTP_BASIC_USER', SecureRandom.hex) &&
|
|
|
|
password == ENV.fetch('HTTP_BASIC_PASSWORD', SecureRandom.hex)
|
|
|
|
end
|
|
|
|
|
2019-09-18 01:01:34 +00:00
|
|
|
use Rack::Session::Redis, redis_server: 'redis://redis:6379/2'
|
|
|
|
use Rack::Protection
|
|
|
|
|
|
|
|
run Geminabox::Server
|