Beispiel #1
0
    def make_app(https_server_manage: HttpsServerManage):
        """
        https_server_manage -- allows to controll the server (specifically
            reload its SSL certificates). A relevant handler should get this
            object via the method `initialize`.
        """
        routes = sinatra_remote.get_routes(
            ruby_pcsd_wrapper,
            sync_config_lock,
            https_server_manage,
        )

        if not disable_gui:
            routes.extend(
                # old web ui by default
                [(r"/", RedirectHandler, dict(url="/manage"))] +
                [(r"/ui", RedirectHandler, dict(url="/ui/"))] + ui.get_routes(
                    url_prefix="/ui/",
                    app_dir=os.path.join(public_dir, "ui"),
                    fallback_page_path=os.path.join(
                        public_dir,
                        "ui_instructions.html",
                    ),
                    session_storage=session_storage,
                ) + sinatra_ui.get_routes(session_storage, ruby_pcsd_wrapper,
                                          public_dir))

        return Application(routes, debug=debug)
Beispiel #2
0
 def get_routes(self):
     return sinatra_remote.get_routes(
         self.wrapper,
         self.lock,
         self.https_server_manage,
     )
Beispiel #3
0
 def get_routes(self):
     return sinatra_remote.get_routes(
         self.wrapper,
         self.lock,
         self.https_server_manage,
     )