Changeset 7f1e63c
- Timestamp:
- Feb 23, 2009, 6:42:45 PM (16 years ago)
- Branches:
- master, debian, mac, no-cups, web
- Children:
- b748ed1
- Parents:
- 77aa4c8
- git-author:
- Edward Z. Yang <edwardzyang@…> (02/23/09 18:42:45)
- git-committer:
- Edward Z. Yang <edwardzyang@…> (02/23/09 18:42:45)
- Location:
- gutenbach-web
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
gutenbach-web/about.html
r973dd91 r7f1e63c 13 13 14 14 <body> 15 ${sidebar_top()}16 ${sidebar_bottom()}17 15 <div id="getting_started"> 18 16 <h2>Architectural basics of a quickstart TG2 site.</h2> … … 71 69 <span class="code"> 72 70 <br/><br/> 73 $${sidebar_top()}74 71 <br/> 75 $${sidebar_bottom()}76 72 <br/><br/> 77 73 </span> in the page where they are wanted. CSS styling (in -
gutenbach-web/middleware.py
r973dd91 r7f1e63c 2 2 from sipbmp3web.config.app_cfg import base_config 3 3 from sipbmp3web.config.environment import load_environment 4 import subprocess, os 5 from pylons import config 4 6 5 7 #Use base_config to setup the necessary WSGI App factory. … … 7 9 make_base_app = base_config.setup_tg_wsgi_app(load_environment) 8 10 11 class FastCGIFixMiddleware(object): 12 """Remove dispatch.fcgi from the SCRIPT_NAME 13 14 mod_rewrite doesn't do a perfect job of hiding it's actions to the 15 underlying script, which causes TurboGears to get confused and tack 16 on dispatch.fcgi when it really shouldn't. This fixes that problem as a 17 Middleware that fiddles with the appropriate environment variable 18 before any processing takes place. 19 """ 20 def __init__(self, app, global_conf=None): 21 self.app = app 22 def __call__(self, environ, start_response): 23 environ['SCRIPT_NAME'] = environ['SCRIPT_NAME'].replace('/dispatch.fcgi', '') 24 return self.app(environ, start_response) 25 26 class KinitMiddleware(object): 27 """Performs Kerberos authentication with a keytab""" 28 def __init__(self, app, global_conf=None): 29 self.app = app 30 self.keytab = config["keytab"] 31 def __call__(self, environ, start_response): 32 if self.keytab: 33 subprocess.call(["/usr/kerberos/bin/kinit", "ezyang/extra", "-k", "-t", self.keytab]) 34 return self.app(environ, start_response) 35 9 36 def make_app(global_conf, full_stack=True, **app_conf): 10 37 app = make_base_app(global_conf, full_stack=True, **app_conf) 11 #Wrap your base turbogears app with custom middleware 38 app = FastCGIFixMiddleware(app, global_conf) 39 app = KinitMiddleware(app, global_conf) 12 40 return app 13 41 -
gutenbach-web/production.ini
r77aa4c8 r7f1e63c 9 9 10 10 [DEFAULT] 11 debug = false11 debug = true 12 12 # Uncomment and replace with the address which should receive any error reports 13 #email_to = you@yourdomain.com13 #email_to = ezyang@mit.edu 14 14 smtp_server = localhost 15 error_email_from = paste@localhost15 error_email_from = ezyang@mit.edu 16 16 17 17 [server:main] … … 27 27 beaker.session.key = sipbmp3web 28 28 beaker.session.secret = somesecret 29 keytab = /mit/ezyang/web_scripts/ezyang.extra.keytab 29 30 30 31 # If you'd like to fine-tune the individual locations of the cache data dirs -
gutenbach-web/root.py
r84ed773 r7f1e63c 19 19 def index(self): 20 20 out = dict() 21 out["volume"] = remctl("z sr", command=["v", "get"]).stdout21 out["volume"] = remctl("zygorthian-space-raiders.mit.edu", command=["v", "get"]).stdout 22 22 return out 23 23
Note: See TracChangeset
for help on using the changeset viewer.