| 99 | |
| 100 | Note: It seems the wsgi entry point does not handle the Digest or Basic http authentication. To ensure the authentication middleware are passed, you'll have to hack a little bit the tracwsgi.py : |
| 101 | |
| 102 | |
| 103 | {{{ |
| 104 | |
| 105 | import sys |
| 106 | import os |
| 107 | |
| 108 | sys.stdout = sys.stderr |
| 109 | os.environ['TRAC_ENV_PARENT_DIR'] = '/home/repos/trac.enabled/' |
| 110 | os.environ['PYTHON_EGG_CACHE'] = '/home/repos/projects/.eggs/' |
| 111 | |
| 112 | from trac.web.standalone import AuthenticationMiddleware |
| 113 | from trac.web.main import dispatch_request |
| 114 | from trac.web.auth import BasicAuthentication |
| 115 | def application(environ, start_application): |
| 116 | auth = {"*" : BasicAuthentication("/etc/nginx/conf/users", "realm")} |
| 117 | wsgi_app = AuthenticationMiddleware(dispatch_request, auth) |
| 118 | return wsgi_app(environ, start_application) |
| 119 | |
| 120 | |
| 121 | }}} |