Coder Social home page Coder Social logo

pitweb's Introduction

pitweb

pitweb is a web frontend for git repositories written in python.

pitweb was created because I wasn't able to find any web interface suitable for deployment on my python hosting. pitweb is strongly inspired by cgit and gitweb.

License

pitweb is distributed under the GNU Lesser General Public License v3. The GNU Lesser General Public License v3 should be available at http://www.gnu.org/licenses/lgpl.html

Usage

pitweb is currently prepared to run under apache's mod_python module but is shouldn't be problem to run it as cgi script or anything else. Here will be described how to deploy pitweb under mod_python.

1. Apache configuration

Here is how should look configuration for virtual host. All directives should be self explanatory.

<VirtualHost *:80>
    ServerName pitweb.host.com

    DocumentRoot "/path/to/directory"

    <Directory "/path/to/directory">
        SetHandler mod_python
        PythonPath "['/path/to/pitweb'] + sys.path"
        PythonHandler index
        PythonDebug On

        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

2. mod_python dispatcher

In configuration above is defined that handler is located in index.py file (PythonHandler directive).

from mod_python import apache, util
import pitweb

def handler(req):
    parent_dir = '/path/to/dir/with/git/repositories'
    prj_list = pitweb.ProjectListDir(req, parent_dir)
    return prj_list.run()

3. Directories with git repositories

Last thing to do is correctly prepare directories with git repositories. Directory (defined in python script above in variable parent_dir) must contain git repositories created with --bare option (git --bare clone ...). Every git repository that also contains pitweb.py configuration file will be listed on pitweb projects page.

Template configuration file pitweb.py can be found in the pitweb source. All configuration options are described there.

pitweb's People

Contributors

danfis avatar

Stargazers

 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

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.