No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

__init__.py 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ##@brief
  2. #
  3. #Lodel2 multisite uwsgi plugin
  4. from lodel.context import LodelContext, ContextError
  5. try:
  6. LodelContext.expose_modules(globals(), {
  7. 'lodel.validator.validator': ['Validator']})
  8. __plugin_type__ = 'ui' #Warning !!! It's a MULTISITE interface
  9. __plugin_name__ = 'multisite_web'
  10. __version__ = '0.0.1'
  11. __loader__ = 'main.py'
  12. #__plugin_deps__ = ['multisite']
  13. CONFSPEC = {
  14. 'lodel2.server': {
  15. 'listen_address': ('127.0.0.1', Validator('dummy')),
  16. #'listen_address': ('', Validator('ip')), #<-- not implemented
  17. 'listen_port': ( 1337, Validator('int')),
  18. 'uwsgi_workers': (8, Validator('int')),
  19. 'uwsgicmd': ('/usr/bin/uwsgi', Validator('dummy')),
  20. 'virtualenv': (None, Validator('path', none_is_valid = True)),
  21. },
  22. #A copy from webui confspec
  23. ##@todo automatic merging of webuig confspecs
  24. 'lodel2.webui': {
  25. 'standalone': ( 'False',
  26. Validator('string')),
  27. 'listen_address': ( '127.0.0.1',
  28. Validator('dummy')),
  29. 'listen_port': ( '9090',
  30. Validator('int')),
  31. 'static_url': ( 'http://127.0.0.1/static/',
  32. Validator('regex', pattern = r'^https?://[^/].*$')),
  33. 'virtualenv': (None,
  34. Validator('path', none_is_valid=True)),
  35. 'uwsgicmd': ('/usr/bin/uwsgi', Validator('dummy')),
  36. 'cookie_secret_key': ('ConfigureYourOwnCookieSecretKey', Validator('dummy')),
  37. 'cookie_session_id': ('lodel', Validator('dummy')),
  38. 'uwsgi_workers': (2, Validator('int'))
  39. },
  40. 'lodel2.webui.sessions': {
  41. 'directory': ( '/tmp',
  42. Validator('path')),
  43. 'expiration': ( 900,
  44. Validator('int')),
  45. 'file_template': ( 'lodel2_%s.sess',
  46. Validator('dummy')),
  47. }
  48. }
  49. except ContextError:
  50. #This case append when uwsgi call the run.py directly
  51. pass