-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable source interface when Trusty is end-of-life
If the underlying OS is Ubuntu 14.04 (Trusty) and the date for Trusty's end-of-life has passed, we should shortcut the source interface application logic to display an internationalized page indicating that the source interface has been disabled, to preserve the security and anonymity of sources.
- Loading branch information
Showing
5 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from datetime import date | ||
from flask import render_template | ||
from source_app.decorators import ignore_static | ||
import platform | ||
|
||
XENIAL_VER = "16.04" | ||
TRUSTY_DISABLE_DATE = date(2019, 4, 30) | ||
|
||
|
||
def disable_app(app): | ||
|
||
@app.before_request | ||
@ignore_static | ||
def disable_ui(): | ||
if(platform.linux_distribution()[1] != XENIAL_VER and | ||
date.today() > TRUSTY_DISABLE_DATE): | ||
return render_template('disabled.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends "base.html" %} | ||
{% block body %} | ||
<h1>{{ gettext("We're sorry, our SecureDrop is currently offline.") }}</h1> | ||
|
||
<p>{{ gettext("Please try again later. Check our website for more information.") }}</p> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters