Create Private Gem Server using geminabox

A sinatra based gem hosting app, with client side gem push style functionality. Really simple rubygem hosting. 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.

FEATURES:

  • upload a gems via command line.
  • via web interface
  • replace a gems
  • delete a gems
  • install gems like any other source
  • list the available gems.

 

gem in a box

To get started, Create Private Gem Server using geminabox :

Install Gem

#yum install gem

When you install RubyGems, it adds the gem server command to your system. This is the fastestway to start hosting gems. Just run the command: #gem server

#gem install geminabox

Make a data directory for storing gems:

#mkdir data

Create a config.ru as follows:

require "rubygems"
require "geminabox"
Geminabox.data = "/date" # …or wherever run Geminabox
run Geminabox::Server

And finally, hook up the config.ru as you normally would (passenger, thin, unicorn, whatever floats you boat).

#rackup

Now you can push gems using the gem inabox command.

There is a web interface available on http://localhost:9292 as well.

 

In order to access it globally. You should configure with apache or nginx proxy.

here is the example for apache config.

vi /etc/httpd/conf/httpd.conf

ProxyRequests Off
ProxyPass / http://localhost:9292/
ProxyPassReverse / http://localhost:9292/

 

Gem CLIENT USAGE

If you did not need any credentials to get to this page

gem sources -a http://gems.localhost/

If you needed some credentials to get to this page

gem sources -a http://username:[email protected]/

Then run the following commands.

gem install geminabox
gem inabox [gemfile]

 

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

 

Disable delete option in GUI

 

Login your geminabox installed server and change the following ruby file.

 

#cd /usr/local/share/gems/gems/geminabox-0.12.4/lib/
#vi geminabox.rb

change the following option under set_defaults function allow_delete to false instead of true.

allow_delete:         false,