This is only of interest to you if you want to hack on the Clojars source code (send me a pull request with your patches) or if you want to try to run your own copy (for example inside a company).
Create an initial sqlite database:
mkdir data; sqlite3 data/db < clojars.sql
Run the webapp:
lein run 8080 8701
Now try hitting
http://localhost:8080/in your web browser.
If you'd like to run it out of an editor/IDE environment you can
probably eval a call to the
-main function in
- Install VirtualBox 4.
- Install Vagrant by running: gem install vagrant. You may need to install rubygems first.
- Run vagrant up and wait, it'll take a while.
Once the virtual machine is up and running you can access the web app at
localhost:8088. To ssh into it you can just run
vagrant ssh. To push new jars, ssh is forwarded from the local port 2222 so
the command is:
scp -P 2222 foobar-0.0.1.jar pom.xml clojars@localhost:. You can also ssh
directly to port 2222 to the vagrant user,
ssh -p 2222 vagrant:localhost,
with the password "vagrant".
When something goes wrong, inside the virtual machine, you can find the logs in
If you'd like to hack on the UI or search it might be useful to have production-like metadata. I've put up a production database dump (with password hashes and email addresses stripped of course) which you can use like this:
wget http://meshy.org/~ato/clojars-test-data.sql.gz rm data/db zcat clojars-test-data.sql.gz | sqlite3 data/db
If you want all the actual jar files as well you can grab them via rsync.
The SSH integration is kind of a hack and needs improvement. Currently it uses Nailgun but the current setup has threading problems due to the way it does IO.
clojars.scp implements the SCP protocol
and acts as a Nailgun "nail" so it can be called from the
command-line. Clojars writes an SSH
with a line for each user's public key setting the login command to
ng --nailgun-port 8700 clojars.scp USERNAME.
To set it up:
Install the Nailgun
ngC program. Just unpack the Nailgun source and run
makethen copy the
ngexecutable somewhere like
Create a "clojars" unix account with a disabled password.
Disable password authentication for that user by adding this to
Match User clojars PasswordAuthentication no
Symlink in the auth_keys file the webapp generates:
cd /home/clojars mkdir .ssh cd .ssh ln -s ...../clojars-web/data/authorized_keys authorized_keys