Changeset 2740


Ignore:
Timestamp:
Dec 21, 2009, 12:14:15 AM (15 years ago)
Author:
quentin
Message:

Merge auth.fcgi and unauth.fcgi fixes from the old branch

Location:
trunk/packages/invirt-web
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web

  • trunk/packages/invirt-web/code/invirt.fcgi

    r2737 r2740  
    1212
    1313def usage():
    14     print >>sys.stderr, """%s [config]
     14    argv0_dir = os.path.dirname(sys.argv[0])
     15    print >>sys.stderr, """%s <unauth|auth> [config]
     16%s/auth.fcgi [config]
     17%s/unauth.fcgi [config]
    1518
    1619Run server as FastCGI, with CherryPy config from "main.conf".
     
    1922
    2023Run this script as either 'auth.fcgi' or 'unauth.fcgi', to get
    21 the authenticated or unauthenticated site respectively.
    22 """ % sys.argv[0]
     24the authenticated or unauthenticated site respectively, or pass
     25'auth' or 'unauth' as the first parameter.
     26""" % (sys.argv[0], argv0_dir, argv0_dir)
    2327    sys.exit(2)
    2428
    2529if __name__ == "__main__":
    26     if len(sys.argv) > 2:
     30    if len(sys.argv) > 3 or len(sys.argv) == 1 or '-h' in sys.argv or '--help' in sys.argv:
    2731        usage()
    28     if len(sys.argv) > 1:
    29         if sys.argv[1] in ('-h', '--help'):
    30             usage()
    31         conf_file = sys.argv[1]
     32    if len(sys.argv) == 3:
     33        mode = sys.argv[1]
     34        conf_file = sys.argv[2]
    3235        dev = True
    3336    else:
     37        mode = sys.argv[1]
    3438        conf_file = os.path.join(base_dir, 'main.conf')
    3539
     
    4044        }
    4145
    42     if os.path.basename(sys.argv[0]).startswith('auth'):
     46    if mode.startswith('auth'):
    4347        root = main.InvirtWeb()
    44     elif os.path.basename(sys.argv[0]).startswith('unauth'):
     48        app_config['/']['tools.mako.module_directory'] = "/tmp/invirt-auth-web-templatecache"
     49    elif mode.startswith('unauth'):
    4550        root = main.InvirtUnauthWeb()
     51        app_config['/']['tools.mako.module_directory'] = "/tmp/invirt-unauth-web-templatecache"
    4652    else:
    4753        usage()
  • trunk/packages/invirt-web/code/main.conf

    r2737 r2740  
    33#auto_reload doesn't work with FastCGI
    44engine.auto_reload = False
    5 tools.mako.module_directory = "/tmp/invirt-web-templatecache"
    65tools.remote_user_login.on = True
    76
  • trunk/packages/invirt-web/debian/changelog

    r2737 r2740  
     1invirt-web (0.1.1) unstable; urgency=low
     2
     3  * Use a different Mako template cache for auth.fcgi and unauth.fcgi
     4  * Use shell scripts for the auth.fcgi and unauth.fcgi so that Apache
     5    will not think they are the same script.
     6
     7 -- Quentin Smith <quentin@mit.edu>  Sun, 20 Dec 2009 23:53:17 -0500
     8
    19invirt-web (0.1.0) unstable; urgency=low
    210
Note: See TracChangeset for help on using the changeset viewer.