示例#1
0
 def metadata() -> flask.Response:
     meta = {
         'allow_document_uploads':
         current_app.instance_config.allow_document_uploads,
         'gpg_fpr': config.JOURNALIST_KEY,
         'sd_version': version.__version__,
         'server_os': server_os,
         'supported_languages': config.SUPPORTED_LOCALES,
         'v2_source_url': get_sourcev2_url(),
         'v3_source_url': get_sourcev3_url()
     }
     resp = make_response(json.dumps(meta))
     resp.headers['Content-Type'] = 'application/json'
     return resp
示例#2
0
 def metadata() -> flask.Response:
     meta = {
         "organization_name":
         InstanceConfig.get_default().organization_name,
         "allow_document_uploads":
         InstanceConfig.get_default().allow_document_uploads,
         "gpg_fpr": config.JOURNALIST_KEY,
         "sd_version": version.__version__,
         "server_os": server_os.get_os_release(),
         "supported_languages": config.SUPPORTED_LOCALES,
         "v3_source_url": get_sourcev3_url(),
     }
     resp = make_response(json.dumps(meta))
     resp.headers["Content-Type"] = "application/json"
     return resp
示例#3
0
 def tor2web_warning() -> flask.Response:
     flash_msg("error", None,
               gettext("Your connection is not anonymous right now!"))
     return flask.Response(
         render_template("tor2web-warning.html",
                         source_url=get_sourcev3_url()), 403)