Git Product home page Git Product logo

holzofen's Introduction

Installation

Use git to clone this repository:

$ git clone https://github.com/bennullgraham/Holzofen.git

Requirements

You will need Python 2.7 and pip. At the time of writing, the latest pip could be installed by:

$ wget http://pypi.python.org/packages/source/p/pip/pip-0.7.2.tar.gz
$ tar xzf pip-0.7.2.tar.gz
$ cd pip-0.7.2
$ python setup.py install

Then,

$ pip install -r requirements.txt

MongoDB is also a requirement. See the Quickstart Guide for installation instructions (pretty minimal). Holzofen will look for Mongo running on the default port, so after an apt-get install ... or equivalent, you are good to go.

Running

Holzofen relies on gevent as a WSGI server, but it isn't listed in the requirements file because it requires python libraries to build. Either figure out how to install gevent, or enable debug mode by creating the following in the root directory of the git clone:

# local-config.py
DEBUG = True

Start up Holzofen with the following:

$ python Holzofen.py

... then browse to http://localhost:5001

Tests

Run python setup.py test yourself, or see results on Travis: Build Status

Deployment

Clone the project and change into the root dir. Fabric is used to bootstrap and deploy to hosts. Bootstrapping will mess with your /var/www/Holzofen and /var/backups/Holzofen dirs, install mongo, some build dependencies of gevent, python distribute and pip. Bootstrapping only need occur once.

Deploying will install Holzofen into a virtualenv along with its dependencies. This can be executed again to update Holzofen.

$ fab -H user@hostname bootstrap
$ fab -H user@hostname pack deploy

Holzofen.py is in the PATH of this virtualenv, running which will begin serving on port 5001 (by default).

Supervisor

Install Supervisor and add the following stanza to its config. Then, supervisorctl start holzofen. This will make sure the Holzofen process stays alive.

[program:holzofen]
environment=PATH="/var/www/Holzofen/env/bin"
command=Holzofen.py

Webserver

Following is a basic example of an nginx config for Holzofen. The X-Pizza-Slices-Remaining header should be tweaked to suit the local environment.

server {
    listen localhost:80;

    server_name holzofen.bgraham.com.au;

    root /var/www/Holzofen;

    add_header              X-Content-Type-Options nosniff;
    add_header              X-Frame-Options SAMEORIGIN;
    add_header              X-Pizza-Slices-Remaining 3;

    # static files
    location ~ ^/static/(.*)$ {
            alias /var/www/Holzofen/static/$1;
            autoindex off;
            expires max;
    }

    # proxy to python app
    location / {
            proxy_set_header "Host" $host;
            proxy_set_header "X-Forwarded-For" $proxy_add_x_forwarded_for;
            proxy_pass      http://localhost:5001/;
    }

    # documentation
    location ~ ^/docs/(.*)$ {
            alias /var/www/Holzofen/docs/$1;
            autoindex off;
    }
}

holzofen's People

Contributors

bennullgraham avatar

Watchers

 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.