Code Monkey home page Code Monkey logo

geminabox's Introduction

Gem in a Box – Really simple rubygem hosting

Ruby Gem Version Code Climate

Geminabox lets you host your own gems, and push new gems to it just like with rubygems.org. The bundler dependencies API is supported out of the box. Authentication is left up to either the web server, or the Rack stack. For basic auth, try Rack::Auth.

screen shot

System Requirements

  • Ruby 2.3 through 3.1 (Ruby 2.7, 3.0, or 3.1 is highly recommended)
  • RubyGems 2.5 through 3.3 (2.5.2 or higher is highly recommended)

Use RubyGems the latest version (at least 2.5.2) for as an end-user full features like gem yank --host.

Server Setup

gem install geminabox

Create a config.ru as follows:

require "rubygems"
require "geminabox"

Geminabox.data = "/var/geminabox-data" # ... or wherever

# Use Rack::Protection to prevent XSS and CSRF vulnerability if your geminabox server is open public.
# Rack::Protection requires a session middleware, choose your favorite one such as Rack::Session::Memcache.
# This example uses Rack::Session::Pool for simplicity, but please note that:
# 1) Rack::Session::Pool is not available for multiprocess servers such as unicorn
# 2) Rack::Session::Pool causes memory leak (it does not expire stored `@pool` hash)
use Rack::Session::Pool, expire_after: 1000 # sec
use Rack::Protection

run Geminabox::Server

Start your gem server with 'rackup' to run WEBrick or hook up the config.ru as you normally would (passenger, thin, unicorn, whatever floats your boat).

RubyGems Proxy

Geminabox can be configured to pull gems, it does not currently have, from rubygems.org. To enable this mode you can either:

Set RUBYGEM_PROXY to true in the environment:

RUBYGEMS_PROXY=true rackup

Or in config.ru (before the run command), set:

Geminabox.rubygems_proxy = true

If you want Geminabox to carry on providing gems when rubygems.org is unavailable, add this to config.ru:

Geminabox.allow_remote_failure = true

HTTP adapter

Geminabox uses the HTTPClient gem to manage its connections to remote resources. The relationship is managed via Geminabox::HttpClientAdapter.

To configure options of HTTPClient, pass your own HTTPClient object in config.ru as:

# Geminabox.http_adapter = Geminabox::HttpClientAdapter.new # default
Geminabox.http_adapter.http_client = HTTPClient.new(ENV['http_proxy']).tap do |http_client|
  http_client.transparent_gzip_decompression = true
  http_client.keep_alive_timeout = 32 # sec
  http_client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
  http_client.send_timeout = 0
  http_client.receive_timeout = 0
end

If you would like to use an alternative HTTP gem, create your own adapter and specify it in config.ru:

Geminabox.http_adapter = YourHttpAdapter.new

It is recommend (but not essential) that your adapter inherits from HttpAdapter. The adapter will need to replace HttpAdapter's methods with those specific to the alternative HTTP gem. It should also be able to handle HTTP proxy settings.

Defining your own adapter also allows you to configure Geminabox to use the local systems SSL certificates.

TemplateFaradayAdapter is provided as an example of an alternative HTTPAdapter.

Hooks

You can add a hook (anything callable) which will be called when a gem is successfully received.

Geminabox.on_gem_received = Proc.new do |gem|
  puts "Gem received: #{gem.spec.name} #{gem.spec.version}"
end

Typically you might use this to push a notification to your team chat. Any exceptions which occur within the hook is silently ignored, so please ensure they are handled properly if this is not desirable.

Also, please note that this hook blocks POST /upload and POST /api/v1/gems APIs processing. Hook authors are responsible to perform any action non-blocking/async to avoid HTTP timeout.

Client Usage

Since version 0.10, Geminabox supports the standard gemcutter push API:

gem push pkg/my-awesome-gem-1.0.gem --host HOST

You can also use the gem plugin:

gem install geminabox

gem inabox pkg/my-awesome-gem-1.0.gem

And since version 1.2.0, Geminabox supports the standard gemcutter yank API:

gem yank my-awesome-gem -v 1.0 --host HOST

Configure Gem in a box (interactive prompt to specify where to upload to):

gem inabox -c

Change the host to upload to:

gem inabox -g HOST

Simples!

Command Line Help

Usage: gem inabox GEM [options]

  Options:
    -c, --configure                  Configure GemInABox
    -g, --host HOST                  Host to upload to.
    -o, --overwrite                  Overwrite Gem.


  Common Options:
    -h, --help                       Get help on this command
    -V, --[no-]verbose               Set the verbose level of output
    -q, --quiet                      Silence commands
        --config-file FILE           Use this config file instead of default
        --backtrace                  Show stack backtrace on errors
        --debug                      Turn on Ruby debugging


  Arguments:
    GEM       built gem to push up

  Summary:
    Push a gem up to your GemInABox

  Description:
    Push a gem up to your GemInABox

Docker

Using Gem in a Box is really simple with the Dockerfile. Move this Dockerfile into a directory that you want to use for your server.

That directory only needs to contain:

config.ru (explained above)
Gemfile
Gemfile.lock

Your Gemfile only needs:

source 'https://rubygems.org'

gem 'geminabox'

From there

docker build -t geminabox .
docker run -d -p 9292:9292 geminabox:latest

Your server should now be running!

Running the tests

Running rake will run the complete test suite.

The test suite uses minitest-reporters with the default reporter. To get more detailed test output, use rake MINITEST_REPORTER=SpecReporter. With this setting, output of the Geminabox server that is started for integration tests is sent to stdout as well.

Licence

MIT_LICENSE

ChangeLog

CHANGELOG.md

geminabox's People

Contributors

ahorek avatar akzhan avatar bmaland avatar challengee avatar clowder avatar dependabot[bot] avatar evgeni avatar fornellas avatar georgebrock avatar jballanc avatar jfoy avatar jlecour avatar jordimassaguerpla avatar jubishop avatar krororo avatar natebird avatar nevesenin avatar perfectlynormal avatar pipt avatar pocke avatar reggieb avatar rikas avatar rojotek avatar skaes avatar sonots avatar squarebracket avatar sue445 avatar tmaier avatar tnir avatar tomlea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geminabox's Issues

Rubygems API

Hi,

any plans to support the Rubygems API that Bundler 1.1 will take advantage of?

Thanks!

Large files cause a problem with indexing...

How to reproduce:

  1. Create a new geminabox instance.
  2. Put several large (~20 mb) gems in it.
  3. Run /reindex
  4. Wait for a long time (30-40 seconds)

What I expect:

It should take less than a second.

Notes:

I can reproduce with some proprietary indexes. Running gem generate_index is nearly instantaneous. But /reindex is painfully slow and causes problems with uploading and deleting gems.

I suspect that geminbox is opening the gems and reading through the whole file for some reason. I notice in the logs, that the output from generate_index doesn't show up till very late... So I suspect geminabox is doing something before running the generate_index that is causing the slowup.

This is with geminabox 0.10.1 and rubygems 1.8.24

Updating Gems Is Extremely Slow

Hi Tom,

We've been using Geminabox at my company for awhile now, and first and for most thanks for putting this out there. It has been incredibly helpful.

Our issue however is that gems seem to not appear to be properly indexed upon loading them with the gem inabox command. They show up on the page, and they even show up when one does gem search $NAME --source=http://private.server --both.

However, gem install $NAME always fails unless we hit the reindex URL on the private server. However over time that indexing has become slower and slower, to the point where we can't increase the timeout anymore on the request to allow it to succeed (it's currently at 2 minutes).

I tried setting incremental updates to true to see if that would help. Our config.ru looks like this:

require "rubygems"
require "geminabox"

Geminabox.data = "/var/www/geminabox/data" # …or wherever
Geminabox.configure do |config|
  config.set(:incremental_updates, true)
end

run Geminabox

But it seems to not help at all. Any ideas as to what could be wrong? We are currently hosting 789 gems on our gem server.

404 to get /quick/Marshal.4.8/xxxx-0.4.2.gemspec.rz

I failed to install any gem in the geminabox, and I find gem to request /quick/Marshal.4.8/xxxx-0.4.2.gemspec.rz and geminabox return 404, and I can not find quick directory in the Geminabox.data directory. Any plan to fix this problem.

Add a mechanism for updating the index.

It would be nice to have a way to rebuild the index for when you manually remove or add a gem or to just fix problems.

A command line tool or a URL that could be visited would be great.

Prerelease Gems

The installation command on the web interface for prerelease gems doesn't include the --prerelease flag.

Gem pushing is vulnerable.

For the same reasons than rubygems.org, Geminabox is vulnerable because rubygems is vulnerable in in the first place.

I haven't see anything moving here. This is a kind reminder.

FREQ: Store/unpack gem info so 'gem server' can serve their RDoc

I'm involved with a gem server for internal gems, and GemInABox rocks for uploading and serving them. However, we'd also like to have an associated server for their documentation. gem server can do that, but not with the information GiaB currently puts on the filesystem. It would be nice if GiaB's on-disk repo was usable by gem server.

Handle large repositories better

Uploads to boxes with a large number of gems (200 or more) take ages while the rebuild happens.

Possible Solutions:

  • Incremental updates (more code ∴ bugs, will probably have to write our own indexer).
  • Background updates (UX issues: "Push, then pull fails, them pull passes")

Publishing a gem using `gem inabox` raises 'SystemCallError' on JRuby/Windows

I'm trying to push my gem to a local server, and I get the following error:

C:\dev\repos\gems\my-gem> gem inabox .\pkg\my-gem-0.1.0.gem --verbose --backtrace
Pushing my-gem-0.1.0.gem to http://localhost:9292/...
ERROR:  While executing gem ... (SystemCallError)
    Unknown error - Unknown Error (20047) - -1
        org/jruby/RubyFile.java:1834:in `size'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient/http.rb:592:in `add'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient/http.rb:652:in `build_query_multipart_str'
        org/jruby/RubyHash.java:1186:in `each'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient/http.rb:623:in `build_query_multipart_str'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient/http.rb:535:in `set_content'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient/http.rb:447:in `init_request'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient/http.rb:705:in `new_request'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient.rb:997:in `create_request'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient.rb:866:in `do_request'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient.rb:756:in `request'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/httpclient-2.2.4/lib/httpclient.rb:666:in `post'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/geminabox-0.6.1/lib/geminabox_client.rb:28:in `push'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/geminabox-0.6.1/lib/rubygems/commands/inabox_command.rb:54:in `send_gems'
        org/jruby/RubyArray.java:1615:in `each'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/geminabox-0.6.1/lib/rubygems/commands/inabox_command.rb:51:in `send_gems'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/gems/1.8/gems/geminabox-0.6.1/lib/rubygems/commands/inabox_command.rb:45:in `execute'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/site_ruby/1.8/rubygems/command.rb:278:in `invoke'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:147:in `process_args'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:117:in `run'
        C:/dev/torquebox/torquebox-2.x/jruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:65:in `run'
        C:\dev\torquebox\torquebox-2.x\jruby\bin\gem:21:in `(root)'

I using jruby 1.6.7 (ruby-1.9.2-p312) on Windows 7.

*** LOCAL GEMS ***

blankslate (2.1.2.4)
bouncy-castle-java (1.5.0146.1)
builder (3.0.0)
bundler (1.1.3)
clj (0.0.5.6)
geminabox (0.6.1)
httpclient (2.2.4)
jruby-openssl (0.7.6.1)
jruby-win32ole (0.8.5)
rack (1.4.1)
rack-protection (1.2.0)
rake (0.8.7)
sinatra (1.3.2)
sources (0.0.1)
thor (0.14.6)
tilt (1.3.3)
torquebox (2.0.0)
torquebox-cache (2.0.0 java)
torquebox-capistrano-support (2.0.0)
torquebox-configure (2.0.0 java)
torquebox-core (2.0.0 java)
torquebox-messaging (2.0.0 java)
torquebox-naming (2.0.0 java)
torquebox-no-op (2.0.0)
torquebox-rake-support (2.0.0)
torquebox-security (2.0.0 java)
torquebox-stomp (2.0.0)
torquebox-transactions (2.0.0)
torquebox-web (2.0.0 java)

Any ideas how I might fix or work-around this?

pushing gem fails if there are redirects

We moved our gem server from http://example.com/gems/ to https://gems.example.com/ and setup 301 redirects to so that old gem setups would continue to work.

However, doing gem inabox foobar-1.2.3.gem fails because it won't follow the 301 redirect from http://example.com/gems/ to https://gems.example.com/.

I expected it to work, like gem pull continued to work with the old URL.

I'm using version 0.8.0

Docu: add explanation about gems storage directory

Took me about 10 minutes to figure on my own so to save the pain to other people:

If you define your gems directory as:
Geminabox.data = "/var/geminabox"

Run the following:
mkdir -p /var/geminabox/gems
chown a+rw /var/geminabox/gems -R

Other than that.... freakingly amazingly useful project... thanks a lot for making this :)
I am adding a post to my blog about this to try to spread the word

Can't download or delete Java gem

This looks like it may have the same root as #16.

I cannot download, delete or gem install a JRuby gem I have uploaded to geminabox.

The problem appears to be that the files are stored as geminabox/data/gems/my_gem-0.0.1.gem not geminabox/data/gems/my_gem-0.0.1-java.gem, as renaming them fixes the issue.

geminabox silently ignores gems with 'weird' characters in list of authors

Cloned a git repository (https://github.com/rodrigob/swf_fu) and built the gem, pushing it to my geminabox installation. The upload succeeded, but the gem never showed up in the listings, and was not installable from this source.

Saw that it was uploaded correctly, and present in my datadir. Worked fine with another, so figured it had to be this particular gem. When inspecting the gemspec, I saw that it had listed the authors as s.authors = ["Marc-Andr\303\251 Lafortune", "Marcus Wyatt", "Rodrigo Benenson"]. Removed the \303\251 and replaced with "normal" characters, and all was well.

Running Ruby 1.9.2-p290 and geminabox 0.3.0 (I think, at least that's what gem list tells me)

Allow Pushing of Multiple Gems at Once

I would like to be able to push multiple gems to inabox in one command:
gem inabox *.gem

Pull request to come, re-jiggering inabox command to call get_all_gem_names when multiple gems are passed in.

Error 400 on pusing gem on local server

I have installed geminabox latest version and ran the config.ru file and started the server.
server is running on http://localhost:9292. When i am hitting http://localhost:9292 in IE, it is updating on command prompt where server is running with 200 code.

But when i try to use command-
C:\MyGems\rica-master>gem inabox ./rica-0.0.1.gem
Pushing rica-0.0.1.gem to http://localhost:9292/...
ERROR: Error (400 received)

I am using "USe automatic configuration script" and HTTP_PROXY variable is set to company provided address.
Please help me with solution.

ERROR: Could not find valid gem...

I have a straight forward local install to play with (via thin, and a simple local thin start). I have the geminabox web site running at localhost:3000.

I use gem inabox pkg/spiffygem-0.1.0.gem and there are no errors during the push.

I can see that everything seems to be in order in the geminabox/data folder, and the web site shows the gem.

I have done gem sources -a http://localhost:3000/

Whether I just gem install xxxx or use the --source option, I get the error that the gem cannot be found.

Is it a valid gem, you ask? Well, I have already built the gem and installed it via the local build process, and it works just fine, AFAICT the gems themselves are valid in that they work in my applications.

What should I be checking?

BTW -- not cleaar to me at all what the Upload on the site is for. Upload what?

atom feed is broken

Visiting /atom.xml shows the Sinatra 500 screen with an error of "undefined method `size' for nil:NilClass" and a stack trace pointing to line 10 of atom.erb. Perusal of the code suggests that this is pretty fundamentally broken:

@gems.each do |name, versions|
  # call versions.size
end

...but since @gems.each falls through to calling each on an array, the second parameter is nil, and so versions.size (and other calls to methods on versions) all asplode.

Has the atom functionality been abandoned? Am I misreading or misconfiguring something somehow? I'd be willing to re-implement the atom feed if that would be helpful; I just want to check that I'm not duplicating somebody else's efforts or misconfiguring something first.

Does not work with Ruby 1.8.7

The Ruby 1.8.7 Tempfile constructor has this signature:

def initialize(basename, tmpdir=Dir::tmpdir)

Geminabox however calls it like this (in incoming_gem.rb, line 8):

@tempfile = Tempfile.new("gem", :encoding => 'binary')

The options argument here is not present in Ruby 1.8.7 (http://www.ruby-doc.org/stdlib-1.8.7/libdoc/tempfile/rdoc/Tempfile.html#method-c-new), though it is in 1.9 (http://www.ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html#method-c-new), and so this leads to this error:

RuntimeError - cannot generate tempfile `':
    /opt/vagrant_ruby/lib/ruby/1.8/tempfile.rb:52:in `initialize'
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/geminabox-0.10.0/lib/geminabox/incoming_gem.rb:8:in `new'
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/geminabox-0.10.0/lib/geminabox/incoming_gem.rb:8:in `initialize'
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/geminabox-0.10.0/lib/geminabox.rb:105:in `new'
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/geminabox-0.10.0/lib/geminabox.rb:105:in `POST /upload'
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:1264:in `call'

Gem gets uploaded without a spec

We have an internal gem that, when uploaded, doesn't create a spec under $DATA_DIRECTORY/quick/Marshal.4.8/

The .gem file does exist under $DATA_DIRECTORY/gems/ and in $DATA_DIRECTORY/latest_specs.4.8, however.

As a result, requesting the index of the geminabox server throws a undefined dependencies for nil error because getting the spec returns nil for this gem.

Any thoughts on why the spec is not getting uploaded?

The gem url should honour the path as well as the host.

I've setup geminabox to respond on a subpath, http://host/gems/, I needed an extra Rack layer to do this and my reverse proxy is mapping onto the service.
This works fine with gem, but the gem plugin for uploading breaks since it is uploading to http://host/upload, throwing away the path element.

I believe it should be ok to keep the path element since the gem command can handle it for downloading.

Does not work with bigger gems because of timeout

Unfortunately, geminabox upload does not work if you've got a normal connection and bigger gems:

ERROR:  While executing gem ... (HTTPClient::SendTimeoutError)
    execution expired```

I did a local fix in geminabox_client:

@http_client.receive_timeout = 600
@http_client.send_timeout = 600

Could you set a higher timeout with the next release aswell?

License?

Any specific license attached to this?

Uploading platform-specific gems fails (Java in this situation)

When I upload a gem from my /pkg directory, if the gem is named rb-gsms-0.1.0.gem, things work great. If, however, I specify in my rb-gsms.gemspec that the platform is java, it will create a different .gem file, namely rb-gsms-0.1.0-java.gem, and I get a funny exception:

    Errno::ENOENT - No such file or directory - ./quick/Marshal.4.8/rb-gsms-0.1.1.gemspec.rz:
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox.rb:87:in `read'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox.rb:87:in `spec_for'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/../views/index.erb:20:in `block in evaluate_source'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox/gem_version_collection.rb:23:in `each'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox/gem_version_collection.rb:23:in `each'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/../views/index.erb:8:in `evaluate_source'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:251:in `instance_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:251:in `evaluate_source'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:186:in `cached_evaluate'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:169:in `evaluate'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:118:in `render'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:567:in `render'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:459:in `erb'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox.rb:23:in `block in <class:Geminabox>'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1165:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1165:in `block in compile!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:738:in `instance_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:738:in `route_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:722:in `block (2 levels) in route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:772:in `block in process_route'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:769:in `catch'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:769:in `process_route'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:721:in `block in route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:720:in `each'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:720:in `route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:857:in `dispatch!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:648:in `block in call!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `instance_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `block in invoke'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `catch'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `invoke'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:648:in `call!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:633:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:703:in `forward'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:786:in `route_missing'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:733:in `route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:729:in `route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:857:in `dispatch!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:648:in `block in call!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `instance_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `block in invoke'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `catch'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `invoke'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:648:in `call!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:633:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/showexceptions.rb:21:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/showexceptions.rb:21:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/methodoverride.rb:24:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1284:in `block in call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1315:in `synchronize'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1284:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:48:in `_call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:36:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/showexceptions.rb:24:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/commonlogger.rb:18:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/content_length.rb:13:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in `service'
     C:/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
     C:/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
     C:/Ruby192/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
    Errno::ENOENT - No such file or directory - ./quick/Marshal.4.8/rb-gsms-0.1.1.gemspec.rz:
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox.rb:87:in `read'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox.rb:87:in `spec_for'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/../views/index.erb:20:in `block in evaluate_source'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox/gem_version_collection.rb:23:in `each'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox/gem_version_collection.rb:23:in `each'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/../views/index.erb:8:in `evaluate_source'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:251:in `instance_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:251:in `evaluate_source'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:186:in `cached_evaluate'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:169:in `evaluate'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/tilt-1.2.2/lib/tilt.rb:118:in `render'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:567:in `render'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:459:in `erb'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/geminabox-0.2.14/lib/geminabox.rb:23:in `block in <class:Geminabox>'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1165:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1165:in `block in compile!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:738:in `instance_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:738:in `route_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:722:in `block (2 levels) in route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:772:in `block in process_route'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:769:in `catch'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:769:in `process_route'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:721:in `block in route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:720:in `each'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:720:in `route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:857:in `dispatch!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:648:in `block in call!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `instance_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `block in invoke'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `catch'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `invoke'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:648:in `call!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:633:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:703:in `forward'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:786:in `route_missing'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:733:in `route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:729:in `route!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:857:in `dispatch!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:648:in `block in call!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `instance_eval'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `block in invoke'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `catch'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:822:in `invoke'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:648:in `call!'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:633:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/showexceptions.rb:21:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/showexceptions.rb:21:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/methodoverride.rb:24:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1284:in `block in call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1315:in `synchronize'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/sinatra-1.2.3/lib/sinatra/base.rb:1284:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:48:in `_call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:36:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/showexceptions.rb:24:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/commonlogger.rb:18:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/content_length.rb:13:in `call'
     C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in `service'
     C:/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
     C:/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
     C:/Ruby192/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

If I go into the quick/Marshal.4.8 folder, I find that I have a rb-gsms-0.1.1-java.gemspec.rz, where it assumes the missing -java part.

Undefined method `url` for `Geminabox`

views/index.erb line #3 has a url() method evidently that isn't defined. Any ideas?

I'm running ruby 1.9.3 on Ubuntu with RVM, get the same error whether I do a simple rackup in the project folder, or configured via passenger & then view the apache error logs.

I'm not familiar with Sinatra to know if that's where this function should come from.

Getting 500 - Internal Server Error

Doing this:

gem inabox pkg/debug_me-0.3.0.gem --host http://c2c245alp-s030:9292
Pushing debug_me-0.3.0.gem to http://c2c245alp-s030:9292/upload...
ERROR: While executing gem ... (Net::HTTPFatalError)
500 "Internal Server Error"

Started up like this:

rackup --port 9292 --server thin --daemonize --pid /root/geminabox/geminabox.pid /root/geminabox/config.ru

config.ru looks like this:

require "geminabox"

Geminabox.data = "/repos/gems" # The location of the C2C gem repo data
run Geminabox

0.3.0 - 500 when uploading existing gem

If I upload an existing gem the app 500's with

NameError - uninitialized constant Geminabox::Digest:
 /usr/lib/rvm/gems/ruby-1.9.2-p180@geminabox/gems/geminabox-0.3.0/lib/geminabox.rb:63:in `block in <class:Geminabox>'
 /usr/lib/rvm/gems/ruby-1.9.2-p180@geminabox/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152:in `call'
 /usr/lib/rvm/gems/ruby-1.9.2-p180@geminabox/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152:in `block in compile!'

adding

require 'digest'

to lib/geminabox.rb seems to fix it.

invalid byte sequence in US-ASCII

Found that running this under ruby 1.9.2p0 throws an error from the index view on line 29.

– <%= spec.authors.map do |author|

It doesn't seem to like the double dash that trails from the author span. I removed it and it seems to work great now. I would submit a patch but this seems easier for a current commiter to change.

This was done building from a downloaded version of master since it appears the version on github and that posted to rubygems.org is off.

Build Rdoc

Can gem-in-a-box generate the rdoc like gem server does?

Ignoring Geminabox.data path

After I upload a gem, the gem index is being updated to include system gems while ignoring the gems I have uploaded. I can confirm that the gems exist in the Geminabox.data path after I upload them and if i run "gem generate_index -d /path/to/gems" using the same path I have set in Geminabox.data, the gem index is properly updated with the gems I have uploaded.

Where is the host config stored?

When first prompted to enter a host, I entered 127.0.0.1 -- now trying use inabox generates an error:

Pushing my.1-0-0.gem to 127.0.0.1...
ERROR: While executing gem ... (NoMethodError)
undefined method `+' for nil:NilClass

I can't figure out how to update the host name to something else.

Unable to push gem with command line

Hello,

I successfully installed geminabox and started my server as specified at http://guides.rubygems.org/run-your-own-gem-server/

I am able to push gems using the web view, but not using the command line. Here is the result received :

$ gem inabox hola_nico-0.0.1.gem 
Pushing hola_nico-0.0.1.gem to http://localhost:9292...
<HTML>
<HEAD><TITLE>Redirection</TITLE></HEAD>
<BODY><H1>Redirect</H1></BODY>
$

gem inabox command not working with https host.

I tried to use the inabox command to push a gem to a secured gem server and it didn't work. I think the problem comes from the fact that the :use_ssl flag is not set when the HTTP::start method is called.

No gems shown in the index

ruby-1.9.1
geminabox 0.8.0
Windows Server 2008 R2 SP1 (64bit)

After installing the geminabox server it is starting OK, presents an index page but every time a new gem is uploaded (either through the upload button or through gem inabox command) the indexing seems to fail with the following error:

ERROR: Unable to process ./data/gems/bundler-1.2.2.gem
no metadata found in ./data/gems/bundler-1.2.2.gem (Gem::Package::FormatError)

The same happens for any gem I tried. The index page does not list any installed gems (from the spec I suspect it should). However, gem install does seem to work for some of the gems.

Proxy and cache rubygems

This is a pretty massive feature request but in light of recent events I think it would be very useful.

Basically make geminabox download and cache any gems that it needs to to satisfy requests made of it.

The scenario is that Company A can have its own geminabox server and all application gemfiles use ONLY that server as a source.

Any time a bundle command is issued bundler tries to download the gems from geminabox, if geminabox does not currently have that gem then it downloads from rubygems and adds it to its inventory as well as sending it on to bundler.

This has a few advantages.

  • Geminabox becomes the de facto gem server for the company
  • Geminabox contains both public and company private gems in one location
  • Should anything happen to rubygems that takes it offline the local geminabox server can still server requests for gems it has already cached so deploys should be unaffected.

Naturally this cache may take up quite a bit of space so this feature should be optional (default off)

302 redirect breaks bash scripts

Hi,

I've automated my gem building in a bash script.
At the beginning, I do "set -e" to break the script if any command returns with an error code.

Geminabox returns an error when it receives a non200 http status code, and when I push a gem I get a 302.
https://github.com/cwninja/geminabox/blob/master/lib/geminabox_client.rb#L32-L36

Is it normal that I get a 302 instead of a 200 ? if so, why is considered a reason to terminate the interaction with a 1 error code ?

Thanks.

Client only gem

would be good if there was a version that only added the gem inabox command, rather than all the other server-y bits. That way I can install geminabox in my global gemset (rvm) without worrying about version conflicts (rack etc).

Not compatible with bundler 1.1.3

Geminabox doesn't seem to work with the current version of bundler.

I've added my gem server into my Gemfile, something along the lines of:

source 'http://mygems:9292'
gem 'thing'

but when I run bundle install, I get the following error message:

$ bundle install
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://mygems:9292/.
Fetching full source index from http://mygems:9292/
Bundler::HTTPError

Running bundle install with DEBUG=true, gives this:

Fetching full source index from http://mygems:9292/
Fetching from: http://mygems:9292/quick/Marshal.4.8/thing-1.0.0.gemspec.rz
HTTP Error
Bundler::HTTPError
.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:154:in `fetch'
.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:56:in `fetch_spec'
...

Am I doing something wrong, or is this a genuine issue? Is there any way I can work around it?
Thanks.

Release a new version

There hasn't been a version bump in months, even though there appear to be many small fixes since v0.6.1. Can you bump the version and release to RubyGems?

In particular, the insecure content warning appears to be fixed in master, but is still in v0.6.1 (i.e. loading Google Web Fonts over http generates warnings when serving the site over SSL).

Upgrade from 0.3 to 0.10 breaks the public folder

Hi,

I've been using Geminabox 0.3, with this :

/var/www/geminabox/config.ru :

require "rubygems"
require "geminabox"

Geminabox.data = "/var/www/geminabox/data"

run Geminabox

After the 0.10 upgrade, what is in the public folder of the gem is not picked up => 404

Do I need to copy the public folder's content over?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.