Code Repositories xandikos / cabb18d
In wsgi mode, complain when base path or current user path don't exist. Jelmer Vernooń≥ 3 years ago
2 changed file(s) with 11 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
77 plugin = python3
88 module = xandikos.wsgi:app
99 env = XANDIKOSPATH=/var/lib/xandikos/collections
10 env = CURRENT_USER_PRINCIPAL=/dav/jelmer/
10 env = CURRENT_USER_PRINCIPAL=/jelmer/
1919 """WSGI wrapper for xandikos.
2020 """
2121
22 import logging
2223 import os
2324
2425 from xandikos.web import XandikosBackend, XandikosApp
2526
2627 backend = XandikosBackend(path=os.environ['XANDIKOSPATH'])
28 if not os.path.isdir(backend.path):
29 logging.warning('%r does not exist.', backend.path)
30
2731 current_user_principal = os.environ.get('CURRENT_USER_PRINCIPAL', '/user/')
32 if not backend.get_resource(current_user_principal):
33 logging.warning(
34 'default user principal \'%s\' does not exist. Create directory %s?',
35 current_user_principal, backend._map_to_file_path(
36 current_user_principal))
37
2838 backend._mark_as_principal(current_user_principal)
2939 app = XandikosApp(backend, current_user_principal)