Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

lae/wagnaria

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
web
 
 
 
 
 
 
 
 
 
 

README

Wagnaria is a WSGI application built on the Bottle python web framework, using MongoDB (and pymongo) as its datastore backend.

Requirements

Wagnaria uses wsgiref by default, but you may want to substitute a different server for production. It's been developed with gunicorn in mind, behind a nginx proxy.

Configuration

Copy config.yaml.example to config.yaml, and modify keys as needed.

Any keys added to bottle_run will be dynamically read by the application, so you can also specify additional parameters for bottle.run() if you'd like (e.g. server: cherrypy).

The defaults (if you don't copy the example over) are to start the application on localhost, port 9002, in debug mode. The application also connects to the wagnaria MongoDB on localhost:27017. For more information, see bottle.run().

Starting the application

Standalone, which I use for debugging:

$PATH_TO/wagnaria.py

As for Gunicorn, I use a socket and 4 workers:

gunicorn wagnaria:app --bind unix:/tmp/gunicorn-wagnaria.sock -w 4

And bind it to nginx, using SSL:

upstream wagnaria {
	server unix:/tmp/gunicorn-wagnaria.sock fail_timeout=0;
}
# This redirects HTTP traffic to HTTPS
server {
	server_name     $name;
	listen          $name:80;
	rewrite         ^ https://$server_name$request_uri? permanent;
}
server {
	server_name             $name;
	listen                  $ip:443 ssl;
	ssl_certificate         /etc/ssl/http/$name.pem;
	ssl_certificate_key     /etc/ssl/http/$name.key;
	access_log              logs/access_logs/$name;
	keepalive_timeout       70;
	location / {
		try_files $uri @wagnaria;
	}
	location @wagnaria {
		proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header        Host $host;
		proxy_redirect          off;
		proxy_pass              http://wagnaria;
	}
}

About

Fansubbing tools, pretty much.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published