Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Rubygems proxy offline support #158

Closed
ahto opened this Issue · 7 comments

2 participants

@ahto

Do you think it fits your plans for geminabox to support use case where always up connection to rubygems.org was not needed for installing gems.

I have horrible hacks in place that mirrors the entire rubygems.org and it of course breaks constantly when rubygems updates anything. but when it works it is great. I use it like this:

Every morning I download new gems and gemspec files.
Then rest of the day bundle install and bundle update are super fast.
I dont really need the latest gems every time, what ever is in the cache is totally fine.

Is this something you would like to have or do i stick with my hacks which are at https://github.com/ahto/rubygems-mirror-command/tree/get_it_running

@reggieb
Owner

Have you tried the proxy mode? In proxy mode, geminabox will grab gems from rubygems.org and store them locally. Then if rubygems.org is inaccessible, you'll be able to retrieve gems you've retrieved previously. You just won't be able to pull new gems.

@ahto

Yeah I tried already. If i shutdown the internet i get this backtrace when running bundle install.

SocketError - getaddrinfo: Name or service not known (https://bundler.rubygems.org:443):
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:803:in `initialize'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:803:in `new'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:803:in `create_socket'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:752:in `block in connect'
    /home/zizzler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/timeout.rb:82:in `block in timeout'
    /home/zizzler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/timeout.rb:70:in `catch'
    /home/zizzler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/timeout.rb:70:in `timeout'
    /home/zizzler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/timeout.rb:111:in `timeout'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:751:in `connect'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:609:in `query'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:164:in `query'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient.rb:1083:in `do_get_block'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient.rb:887:in `block in do_request'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient.rb:981:in `protect_keep_alive_disconnected'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient.rb:886:in `do_request'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient.rb:959:in `follow_redirect'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/httpclient-2.3.4.1/lib/httpclient.rb:594:in `get_content'
    (eval):4:in `get_content'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/geminabox-0.12.3/lib/geminabox/rubygems_dependency.rb:16:in `for'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/geminabox-0.12.3/lib/geminabox/server.rb:232:in `remote_gem_list'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/geminabox-0.12.3/lib/geminabox/server.rb:236:in `combined_gem_list'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/geminabox-0.12.3/lib/geminabox/server.rb:220:in `gem_list'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/geminabox-0.12.3/lib/geminabox/server.rb:91:in `block in <class:Server>'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1593:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1593:in `block in compile!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:in `[]'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:in `block (3 levels) in route!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:976:in `route_eval'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:957:in `block (2 levels) in route!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:997:in `block in process_route'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:995:in `catch'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:995:in `process_route'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:955:in `block in route!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:954:in `each'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:954:in `route!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1067:in `block in dispatch!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `block in invoke'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `catch'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `invoke'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1064:in `dispatch!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:in `block in call!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `block in invoke'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `catch'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `invoke'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:in `call!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:877:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:936:in `forward'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1010:in `route_missing'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:971:in `route!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:967:in `route!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1067:in `block in dispatch!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `block in invoke'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `catch'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `invoke'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1064:in `dispatch!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:in `block in call!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `block in invoke'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `catch'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in `invoke'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:in `call!'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:877:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/xss_header.rb:18:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/path_traversal.rb:16:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/json_csrf.rb:18:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/frame_options.rb:31:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/show_exceptions.rb:21:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:180:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:2004:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/xss_header.rb:18:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/path_traversal.rb:16:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/json_csrf.rb:18:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-protection-1.5.2/lib/rack/protection/frame_options.rb:31:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/show_exceptions.rb:21:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:180:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:2004:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1469:in `block in call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1778:in `synchronize'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:1469:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/lint.rb:49:in `_call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/lint.rb:37:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/showexceptions.rb:24:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/sinatra-1.4.4/lib/sinatra/base.rb:217:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/chunked.rb:43:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
    /home/zizzler/.rvm/gems/ruby-2.1.0@geminabox_mirror/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /home/zizzler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
    /home/zizzler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
    /home/zizzler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
@reggieb
Owner

That's a bug. Geminabox should be able to handle that condition more robustly I think.

@reggieb
Owner

I've just made this modification #164

@ahto can you try the version of geminabox at https://github.com/reggieb/geminabox/tree/master and see if that fixes your problem.

@reggieb
Owner

I've just released 0.12.4. It includes an option to fix this problem by adding the following to the config.ru:

Geminabox.allow_remote_failure = true
@reggieb reggieb closed this
@ahto

yes thank you. this works for me.

@reggieb
Owner

Splendid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.