public
Description: Bigger. Better. Awesome. "Fork" of Gitorious
Homepage:
Clone URL: git://github.com/radar/scoot.git
git (author)
Tue May 05 03:10:53 -0700 2009
commit  6fdda2864ef476d22231aed89866cd1120cf2b04
tree    ba47a960ff4648c0dee1ec5c33ba64295c740a20
parent  31f631e43302bdf34a788501ebd0ac89b7feaa22
scoot /
name age message
file .gitignore Mon Jan 05 00:31:19 -0800 2009 Added tmp/repos/* to .gitignore [js]
file AUTHORS Mon Jan 12 02:07:54 -0800 2009 rename RepositoryController#new/create to #clon... [js]
file HACKING Tue Aug 12 01:37:22 -0700 2008 HACKING: Add PostgreSQL tips and mention more r... [davvid]
file LICENSE Thu Apr 10 00:23:11 -0700 2008 Moving to the GNU Affero General Public License [js]
file README Sat Jan 10 17:20:17 -0800 2009 Fix some of the documented prereqs [billm]
file Rakefile Tue Aug 14 12:40:17 -0700 2007 initial commit [js]
file TODO.txt Tue Jun 10 09:00:28 -0700 2008 Changing password with a openid enabled account... [js]
directory app/ Mon May 04 17:15:22 -0700 2009 Fix link wordings for repositories [git]
directory bin/ Thu Jan 08 02:25:35 -0800 2009 Added bin/gts-whats-new to see what all the clo... [js]
directory config/ Tue May 05 02:53:33 -0700 2009 MUNCHIES [git]
directory data/ Sat May 02 21:56:08 -0700 2009 Some major progress to making everything Github... [git]
directory db/ Tue May 05 03:10:53 -0700 2009 Remove rails, add schema [git]
directory doc/ Sun Jan 11 21:04:28 -0800 2009 Added -64 flag to install-ubuntu.sh for allowin... [fcoury]
directory features/ Sat May 02 19:54:31 -0700 2009 Devoid of debug information! Yay. [git]
directory lib/ Sun May 03 04:43:59 -0700 2009 Getting rid of projects... lots of cool stuff :) [git]
directory log/ Fri May 01 23:58:15 -0700 2009 Much more progress, somehow rails is not instal... [git]
file previous_failures.txt Tue Aug 14 14:51:28 -0700 2007 added spec dirs +files [js]
directory public/ Sat May 02 22:26:10 -0700 2009 Got a file listing, no idea (yet) how to get th... [git]
directory script/ Sat May 02 21:56:08 -0700 2009 Some major progress to making everything Github... [git]
directory spec/ Sat May 02 19:54:31 -0700 2009 Devoid of debug information! Yay. [git]
directory stories/ Sat Nov 17 15:21:31 -0800 2007 updated support files [js]
file tasks.log Fri May 01 22:11:25 -0700 2009 yay it works! Don't bother using a worker since... [git]
directory tmp/ Sun Apr 27 14:12:41 -0700 2008 Simplify a few repository pages, and use a cust... [js]
directory vendor/ Tue May 05 03:10:53 -0700 2009 Remove rails, add schema [git]
README
Gitorious.org
=========================

Contributing
-------------
Please see HACKING


License
-------------
Please see the LICENSE file


Further documentation
---------------------
Also see the files in the doc/ folder, they contain further detailed information
about setting up the application for specific linux distributions such as 
CenOS and Ubuntu/Debian


===========================================================================

Installation to a production environment -- a partial walkthrough.

===========================================================================

=== Make ready

You may want to make separate directories, away from everything, to hold the
site code and the git repository respectively.  In production, you'll be setting
up a special user account too, but don't worry about that yet.

For this intro we're going to use, as examples,

* /www/gitorious           -- directory for the website code
* /gitorious/repositories  -- root directory for the git repositories
* a MySQL database on localhost at port 3306 with a _mysql_ user 'gitorious'
* eventually, a system account named 'gitslave'

All of these can be adjusted to suit: specifically, dirs within your home
directory are fine, and (though MySQL has the best development coverage), the
website code should be free of mysql-isms/quirks.

=== Dependencies

First, install each of these Libraries/applications:

* Git                   (http://git-scm.org)
* Oniguruma C library   (http://www.geocities.jp/kosako3/oniguruma/)
* Sphinx                (http://sphinxsearch.com/)
* MySQL                 (or whatever)
* ImageMagick           (need version >= 6.3.0)
* libyadis-ruby
* aspell (optional)

Next, get the gitorious code itself:

  # mkdir /www/gitorious
  # cd    /www/gitorious
  # git clone git://gitorious.org/gitorious/repositories/mainline.git gitorious

Install each of these Ruby libraries/bindings/gems:

* mysql
* RedCloth      (http://redcloth.org/)
* mime-types    (http://rubyforge.org/projects/mime-types)
* oniguruma     (http://rubyforge.org/projects/oniguruma)
* textpow       (http://rubyforge.org/projects/textpow)
* chronic       (http://rubyforge.org/projects/chronic)
* rmagick       (http://rubyforge.org/projects/rmagick)
* geoip
* ultrasphinx
* rmagick       (in ubuntu I had to sudo apt-get install librmagick-ruby librmagick-ruby-doc)
* ruby-openid   
* ruby-iconv

  # gem install mysql RedCloth mime-types oniguruma textpow \
      chronic rmagick geoip ultrasphinx ruby-openid 

=== Database

First we need a database.  Use the mysql command line app, or phpMyAdmin, or
whatever to create first a user.  Referring to
http://www-css.fnal.gov/dsg/external/freeware/mysqlAdmin.html:

  # mysql -p  -u root -h localhost
  CREATE USER 'git'@'localhost' IDENTIFIED BY 'awesome_password';
  GRANT ALL PRIVILEGES ON `git\_%` . * TO 'git'@'localhost';
  FLUSH PRIVILEGES;
  CREATE DATABASE `git_dev`  DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
  CREATE DATABASE `git_test` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
  CREATE DATABASE `git_prod` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

If you haven't set a password for the root user, now's a good time for that, too.

---

Edit database.yml to reflect your local database connection.  This is a standard
Ruby on Rails config file, not specific to gitorious -- if you have questions
here they're answered on the web, or consult the rails IRC channel.  (One hint:
NO TABS AT ALL in a .yml file.)  Our example:

development: 
  adapter:      mysql
  username:     git
  password:     awesome_password
  host:         localhost
  database:     git_dev

# The 'test' database will be erased and re-generated from your development
# database when you run 'rake'.  Must be different than the others!!
test:
  adapter:      mysql
  username:     git
  password:     awesome_password
  host:         localhost
  database:     git_test

production:
  adapter:      mysql
  username:     git
  password:     awesome_password
  host:         localhost
  database:     git_prod

---

Use rake to create the databases, migrate each, and run the tests:

rake db:create:all
for RAILS_ENV in development test production ; do
  rake db:migrate
done
rake test

FTW!

=== Gitorious config
  
* Copy the config/gitorious.sample.yml file to config/gitorious.yml

* Create a directory to hold project files
 
  # sudo mkdir  /gitorious/repositories
  
* Make a long, complicated string. You can run "apg -m 64", or if you lack 'apg'
    `dd if=/dev/random count=1 | md5sum` ,
  and put that on the 'cookie_secret' line (replacing the 'ssssht').

* Here's an example gitorious.yml (omitting comments) for local testing:

  cookie_secret: 26ee61bc4d6aa9870ab48d118a55e6ebcd11011dd6b61aa33536c024853c48d4e7c3d672aa57859
  repository_base_path:         "/gitorious/repositories"
  extra_html_head_data:
  system_message:
  gitorious_client_port:        3000
  gitorious_client_host:        localhost
  gitorious_host:               localhost       # gitorious.org
  gitorious_user:               gitslave
  

=== Get Sphinx going
for RAILS_ENV in development test production ; do
  RAILS_ENV=$RAILS_ENV rake ultrasphinx:configure
  RAILS_ENV=$RAILS_ENV rake ultrasphinx:index
done
RAILS_ENV=production rake ultrasphinx:daemon:start &

=== Tweak environment

* In environment.rb, uncomment config.action_controller.session -- choose a new
  session key string and generate your own secret key using something like
    (uptime; date) |sha1sum

* If you haven't set up your mailer, production mode will fail on login. Set
    config.action_mailer.delivery_method = :test
  for immediate gratification.

  
=== Run the server

From the gitorious directory,

# ./script/server

# RAILS_ENV=production ./script/server

It should start up on port 3000, listening only to local connections.  Ue "ssh
-L 3000:127.0.0.1:3000 -N you@yourbox.com" for testing.

You can now visit the site, sign up with your OpenID, put in your ssh key, and
poke around!  Once you get bored, make a test repository, wonder why nothing is
there yet, and then....

=== Hand-start the task_performer 

Key adoption, repo generation and other tasks are handled by the
'task_performer' script, which must be run periodically or on demand.
Run the script/task_performer and let it create the repository for you.

  # ./script/task_performer

   
4. Get your git on!

Push something to that repository (cd to a git repository with commits and do
"git push path/to/the/bare/repository/you/just/created master").  The actual
(bare) repos live in repository_base_path/#{project.slug}/#{repository.name}.git
Ex: the fubar project's mainline fork sits in a directory called
  
    /gitorious/repositories/fubar/mainline/fubar.git

This will be a 'bare' git repo -- you won't see files in it.

=== Button up

* In production, you'll want to have a limited-privileges user to run the git
  processes, just as you do for your webserver

* Make the tree invisible to any other non-root user; make the tree read-only by
  that user; but grant write access to the /tmp and /public/cache directories.

* Consider setting up the standard (lighttpd|nginx|apache) frontend <=> mongrel
  backend if you see traffic.


=== More Help

* Consult the mailinglist (http://groups.google.com/group/gitorious) or drop in
  by #gitorious on irc.freenode.net if you have questions.

=== Gotchas

Gitorious will add a 'forced command' to your ~/.ssh/authorized_keys file for
the target host: if you start finding ssh oddities suspect this first.  Don't
log out until you've ensured you can still log in remotely.