From 5839f74850bd4d569972b0356ff41a653ea2d49f Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 27 Mar 2015 00:43:39 -0400 Subject: [PATCH] Update for new uWSGI stuff. --- .lighttpd.conf | 8 -------- README.md | 17 +++++++---------- app.fcgi => app.py | 5 ++--- 3 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 .lighttpd.conf rename app.fcgi => app.py (97%) diff --git a/.lighttpd.conf b/.lighttpd.conf deleted file mode 100644 index 6f96aa5..0000000 --- a/.lighttpd.conf +++ /dev/null @@ -1,8 +0,0 @@ -fastcgi.server += ( "/copyvios" => - (( - "socket" => "/tmp/copyvios-fcgi.sock", - "bin-path" => "/data/project/copyvios/git/copyvios/app.fcgi", - "check-local" => "disable", - "max-procs" => 1, - )) -) diff --git a/README.md b/README.md index 189d88a..7d7992d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ Dependencies * [earwigbot](https://github.com/earwig/earwigbot) >= 0.1 * [flask](http://flask.pocoo.org/) >= 0.10.1 * [flask-mako](https://pythonhosted.org/Flask-Mako/) >= 0.3 -* [flup](http://trac.saddi.com/flup) >= 1.0.3 * [mako](http://www.makotemplates.org/) >= 0.7.2 * [mwparserfromhell](https://github.com/earwig/mwparserfromhell) >= 0.3 * [oursql](http://packages.python.org/oursql/) >= 0.9.3.1 @@ -22,8 +21,12 @@ Dependencies Running ======= -- Install all dependencies listed above. You might want to use a - [virtualenv](http://virtualenv.readthedocs.org/). +- If using Tool Labs, you should clone the repository to `~/www/python/src`, or + otherwise symlink it to that directory. A + [virtualenv](http://virtualenv.readthedocs.org/) should be created at + `~/www/python/venv`. + +- Install all dependencies listed above. - Create an SQL database with the `cache` and `cache_data` tables defined by [earwigbot-plugins](https://github.com/earwig/earwigbot-plugins/blob/develop/tasks/schema/afc_copyvios.sql). @@ -39,12 +42,6 @@ Running If additional arguments are needed by `oursql.connect()`, like usernames or passwords, they should be added to the `_copyviosSQL` section. -- Copy `.lighttpd.conf` to the relevant location (on Tool Labs, this is in the - root of the project's home directory) and adjust its contents as necessary. - - Run `./build.py` to minify JS and CSS files. -- Adjust the hashbang in `app.fcgi` to point to the correct Python interpreter - or virtual environment. - -- Start lighttpd (on Tool Labs, `webservice start`). +- Start the web server (on Tool Labs, `webservice2 uwsgi-python start`). diff --git a/app.fcgi b/app.py similarity index 97% rename from app.fcgi rename to app.py index d3d1912..e0c52dc 100755 --- a/app.fcgi +++ b/app.py @@ -1,4 +1,4 @@ -#! /data/project/copyvios/env/bin/python +#! /usr/bin/env python # -*- coding: utf-8 -*- from functools import wraps @@ -12,7 +12,6 @@ from earwigbot.bot import Bot from earwigbot.wiki.copyvios import globalize from flask import Flask, g, make_response, request from flask.ext.mako import MakoTemplates, render_template, TemplateError -from flup.server.fcgi import WSGIServer from copyvios.api import format_api_error, handle_api_request from copyvios.checker import do_check @@ -125,4 +124,4 @@ def api_json(): return resp if __name__ == '__main__': - WSGIServer(app).run() + app.run()