add apache.py

This commit is contained in:
Martijn Voncken 2008-04-01 17:44:30 +00:00
parent d9ec10dd28
commit c906af496f
1 changed files with 35 additions and 0 deletions

35
deluge/ui/webui/apache.py Normal file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env python
# Copyright (C) Martijn Voncken 2008 <mvoncken@gmail.com>
# License: GPL v2(+OpenSSL exception), see LICENSE file in base directory.
"""
this is an ugly hack, and it will be changed.
for experimental use only!!
"""
import os
def get_wsgi_application(base_url, config_dir):
#monkeypatch:
from deluge import common
def get_config_dir(filename = ""):
return os.path.join(config_dir, filename)
common.get_config_dir = get_config_dir
#/monkeypatch
from deluge.configmanager import ConfigManager
from deluge.ui.webui import deluge_webserver
from deluge.ui.webui import utils
config = ConfigManager("webui.conf")
utils.set_config_defaults()
config.set('base','/deluge')
config.set('disallow',{
'/daemon/control':'running as an apache user',
'/config/server':'running as an apache-user'
})
utils.apply_config()
return deluge_webserver.WsgiApplication()