Werk #6096

ComponentGUI
TitleCheck_MK GUI is now shipped via mod_wsgi as WSGI application
Date2018-05-16 19:09:13
Check_MK EditionCheck_MK Raw Edition (CRE)
Check_MK Version1.6.0i1
Level2 - Prominent Change
ClassNew Feature
CompatibilityCompatible - no manual interaction needed

This change should be seamless for most users, but may be interesting especially for users that use custom GUI extensions. In case you only use the GUI as it is and are not interested in technical details, you can skip the following details.

With this change we replaced mod_python apache module with mod_wsgi. Mod_python has been "deprecated" for several years. These days all modern python based web applications are built using the WSGI standard. There are a lot of implementations of WSGI applications out there. To have a smooth transition we decided to use the mod_wsgi apache module as application server for the GUI. It is now shipped with Check_MK instead of mod_python.

We have made the necessary changes to the GUI to work as WSGI application.

Some other cleanups and modifications have been made on the way.

  • Move index file to dedicated app folder as recommended for WSGI apps
  • Move several things from htmllib.html to dedicated helper classes
    • http.Request -> HTTP request parsing (from WSGI env)
    • http.Response -> HTTP response processing (for WSGI)
    • htmllib.TimeoutManager -> Handle GUI task timeouts
    • htmllib.TransactionManager -> Mange GUI action transaction IDs
  • Cleaned up several other things in the htmllib and parent classes

The following changes have been made to the htmllib.html API:

  • html.set_cookie() -> html.response.set_cookie()
  • html.del_cookie() -> html.response.del_cookie()
  • html.get_request_header() -> html.request.get_request_header()
  • html.lowlevel_write() -> html._lowlevel_write()
  • html.remote_ip() -> html.request.remote_ip
  • html.is_ssl_request() -> html.request.is_ssl_request
  • html.request_method() -> html.request.request_method
  • html.get_user_agent() -> html.request.user_agent
  • html.get_referer() -> html.request.referer
  • html.requested_url() -> html.request.requested_url
  • html.request_uri() -> html.request.requested_url
  • html.http_redirect() -> html.response.http_redirect()
  • html.client_request_timeout() -> html.request.request_timeout
  • html.get_cookie_names() -> html.request.get_cookie_names()
  • html.has_cookie() -> html.request.has_cookie()
  • html.cookie() -> html.request.cookie()
  • html.uploaded_file() -> html.request.uploaded_file()
  • html.request_timeout() -> html.request.request_timeout
  • html.get_request_timeout() -> html.request.request_timeout
  • html.set_ignore_transids() -> html.transaction_ids.ignore()
  • html.get_transid() -> html.transaction_ids.get()
  • html.store_new_transids() -> html.transaction_ids.store_new()
  • html.urlencode_plus() -> html.urlencode()

Dropped things:

  • html.add_keybinding()
  • html.add_keybidings()
  • html.disable_keybindings()
  • html.keybindings_enabled
  • html.keybindings
  • html.RETURN
  • html.SHIFT
  • html.CTRL
  • html.ALT
  • html.BACKSPACE
  • html.F1
  • html.u8()
  • html.utf8_to_entities()
  • html.varencode()