Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

The KnightOS online package repository. This contains both the API and the HTML frontend.

API documentation


Running the site

Quick overview:

  1. Install Python 3, node.js, virtualenv, PostgreSQL
  2. Set up aforementioned things
  3. Clone the repository
  4. Activate the virtualenv
  5. Install pip requirements
  6. Install coffeescript
  7. Configure the site
  8. SQL
  9. Site configuration

Install the dependencies

You'll need these things:

  • Python 3
  • Node.js
  • virtualenv
  • PostgreSQL

Use the packages your OS provides, or build them from source.

Set up services

Do a quick sanity check on all of those things.

$ python3 --version
  Python 3.4.1
$ node --version
$ npm --version
$ pip --version
  pip 1.5.6 from /usr/lib/python3.4/site-packages (python 3.4)
$ virtualenv --version
$ psql --version
  psql (PostgreSQL) 9.3.4

YMMV if you use versions that differ from these.

I'll leave you to set up PostgreSQL however you please. Prepare a connection string that looks like this when you're done:


The connection string I use on localhost is this:


We need to be able to create/alter/insert/update/delete in the database you give it.

Clone the repository

Find a place you want the code to live.

$ git clone git://
$ cd

Activate virtualenv

$ virtualenv --no-site-packages .
$ source bin/activate

If you're like me and are on a system where python3 is not the name of your Python executable, use --python=somethingelse to fix that.

pip requirements

$ pip install -r requirements.txt


# npm install coffee-script
$ coffee # Sanity check, press ^D to exit

Configure the site

$ cp alembic.ini.example alembic.ini
$ cp config.ini.example config.ini

Edit config.ini and alembic.ini to your liking.

Site Configuration

What you do from here depends on your site-specific configuration. If you just want to run the site for development, you can source the virtualenv and run


To run it in production, you probably want to use gunicorn behind an nginx proxy. There's a sample nginx config in the configs/ directory here, but you'll probably want to tweak it to suit your needs. Here's how you can run gunicorn, put this in your init scripts:

/path/to/ app:app -b

The -b parameter specifies an endpoint to use. You probably want to bind this to localhost and proxy through from nginx. I'd also suggest blocking the port you choose from external access. It's not that gunicorn is bad, it's just that nginx is better.

When running in a production enviornment, run python at least once and then read the SQL stuff below before you let it go for good.

SQL Stuff

We use alembic for schema migrations between versions. The first time you run the application, the schema will be created. However, you need to tell alembic about it. Run the application at least once, then:

$ cd /path/to/
$ source bin/activate
$ python
>>> from alembic.config import Config
>>> from alembic import command
>>> alembic_cfg = Config("alembic.ini")
>>> command.stamp(alembic_cfg, "head")
>>> exit()

Congrats, you've got a schema in place. Run alembic upgrade head after pulling the code to update your schema to the latest version. Do this before you restart the site.

Help, Bugs, Feedback

If you need help with KnightOS, want to keep up with progress, chat with developers, or ask any other questions about KnightOS, you can hang out in the IRC channel: #knightos on

To report bugs, please create a GitHub issue or contact us on IRC.

If you'd like to contribute to the project, please see the contribution guidelines.


Online package repository software




No releases published


No packages published
You can’t perform that action at this time.