Giter Site home page Giter Site logo

hardikus / clojars-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clojars/clojars-web

0.0 2.0 0.0 1.07 MB

A community repository for open-source Clojure libraries

Home Page: http://clojars.org/

License: Eclipse Public License 1.0

Clojure 94.83% CSS 4.53% HTML 0.64%

clojars-web's Introduction

Clojars web interface

This is the source code for the Clojars jar repository webapp.

If you're looking for user documentation, try the wiki. There is a also a FAQ.

See NEWS.md for recent user-facing changes.

Contributing

Please report bugs or problems with the repository on the bug tracker.

Design discussions occur on the clojars-maintainers list and the #leiningen channel on irc.freenode.org.

If you'd like contribute a change please send a GitHub pull request for a topic branch. Feel free to open a pull request early with a "not ready for merging" note or ask on the mailing list or IRC to get feedback from other contributors.

We try to make releases fairly soon after merging contributions, but post to the mailing list if it's been a week or two and you'd like something pushed to the production website.

Running the webapp

There are several ways to run Clojars depending on what you intend to do with it. Regardless of how you run it, you first need to do some setup:

  1. Install Leiningen

    • Mac OS X Homebrew: brew install leiningen
  2. Install SQLite3

    • Debian: apt-get install sqlite3
    • Mac OS X Homebrew: brew install sqlite
  3. Run the DB migrations: lein migrate

To run the application using Leinigen 2:

  1. Run the webapp: lein run (see --help for options)

  2. Now try hitting localhost:8080 in your web browser.

To build a standalone jar for deploying to a server:

  1. Compile with: lein uberjar

  2. Run the webapp: java -jar target/clojars-web-*-standalone.jar

To run the application in auto-reload mode, from the console:

  1. Run lein ring server

and that's it, it should automatically open a browser in localhost:3000.

If you'd like to run it out of an editor/IDE environment you can probably eval a call to the -main function in src/clojars/main.clj.

Configuration

All options are available as command-line switches. Additionally some can be set using environment variables. See lein run -h for the full list.

Options may be read from a file using the -f switch, setting the CONFIG_FILE environment variable or by putting a file named config.clj on the classpath. The config file should be a bare Clojure map:

{:db {:classname "org.sqlite.JDBC"
      :subprotocol "sqlite"
      :subname "data/dev_db"}
 :key-file "data/dev_authorized_keys"
 :repo "data/dev_repo"
 :bcrypt-work-factor 12
 :mail {:hostname "localhost"
        :from "[email protected]"
        :ssl false}}

The classpath option can be used with Leiningen 2 profiles. When running out of a source checkout using lein run the configuration will be read from dev-resources/config.clj. When running automated tests with lein test then test-resources/config.clj is used.

Test data

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
mkdir -p data
rm -f data/dev_db
gunzip -c clojars-test-data.sql.gz | sqlite3 data/dev_db

After this you should still run lein migrate to update the db schema to the latest version.

If you want all the actual jar files as well you can grab them via rsync.

SSH integration

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.

Basically 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 authorized_keys file 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:

  1. Install the Nailgun ng C program. Just unpack the Nailgun source and run make then copy the ng executable somewhere like /usr/local/bin

  2. Create a "clojars" unix account with a disabled password.

  3. Disable password authentication for that user by adding this to /etc/ssh/sshd_config:

     Match User clojars
     PasswordAuthentication no
    
  4. Symlink in the authorized_keys file the webapp generates:

     cd /home/clojars
     mkdir .ssh
     cd .ssh
     ln -s ...../clojars-web/data/authorized_keys authorized_keys
    
  5. When running the webapp enable the nailgun server: --nailgun-port 8700

License

Copyright © 2009-2012 Alex Osborne, Phil Hagelberg, Nelson Morris and contributors.

Distributed under the Eclipse Public License, the same as Clojure. See the file COPYING.

clojars-web's People

Contributors

alexander-yakushev avatar ato avatar cldwalker avatar dakrone avatar deraen avatar devn avatar firthh avatar hiredman avatar hlship avatar losingkeys avatar lrenn avatar paulbellamy avatar pupeno avatar scottjad avatar stackoverflow avatar technomancy avatar tobias avatar vbauer avatar whostolebenfrog avatar wiseman avatar wstrinz avatar xeqi avatar

Watchers

 avatar  avatar

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.