Repository: freedomofpress/securedrop

Issue:
Remove Trusty-specific logic from application code and dev env
## Description

Some platform-specific logic was added to handle the upgrade from Trusty to Xenial and should be removed:
- Source Interface Submission disable logic: https://github.com/freedomofpress/securedrop/pull/4325
- Admin Interface alert for end-of-life OS: https://github.com/freedomofpress/securedrop/pull/4055

There is also some Trusty-specific logic in the development environment: 
- [Docker images](https://github.com/freedomofpress/securedrop/tree/develop/securedrop/dockerfiles/trusty)
- [CI targets](https://github.com/freedomofpress/securedrop/blob/develop/.circleci/config.yml#L59
- The use of `BASE_OS` in Makefile targets
- Upgrade testing scenarios and boxes

Since Trusty will no longer be supported after 0.12.2, we should remove this logic to improve the maintainability of the codebase and reduce the risk of errors.


Discussion:

Resolving patch:
diff --git a/molecule/vagrant-packager/package.py b/molecule/vagrant-packager/package.py
--- a/molecule/vagrant-packager/package.py
+++ b/molecule/vagrant-packager/package.py
@@ -14,9 +14,6 @@
 import xml.etree.ElementTree as ET
 
 
-# Current script is symlinked into adjacent scenario, for Trusty compatibility.
-# Look up "name" for scenario from real path (relative to symlink), but store
-# all artifacts in primary scenario (via realpath).
 SCENARIO_NAME = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
 SCENARIO_PATH = os.path.dirname(os.path.realpath(__file__))
 BOX_BUILD_DIR = join(SCENARIO_PATH, "build")
@@ -132,8 +129,7 @@ def main():
     with open(TARGET_VERSION_FILE, 'r') as f:
         TARGET_VERSION = f.read().strip()
 
-    # Default to Xenial as base OS, but detect if script was invoked from the
-    # Trusty-specific scenario, and use Trusty if so.
+    # Default to Xenial as base OS.
     TARGET_PLATFORM = os.environ.get("SECUREDROP_TARGET_PLATFORM", "xenial")
 
     for srv in ["app-staging", "mon-staging"]:


Test patch:
diff --git a/molecule/testinfra/staging/app/test_apparmor.py b/molecule/testinfra/staging/app/test_apparmor.py
--- a/molecule/testinfra/staging/app/test_apparmor.py
+++ b/molecule/testinfra/staging/app/test_apparmor.py
@@ -107,7 +107,7 @@ def test_apparmor_total_profiles(host):
     with host.sudo():
         total_expected = str(len(sdvars.apparmor_enforce)
                              + len(sdvars.apparmor_complain))
-        # Trusty has ~10, Xenial about ~20 profiles, so let's expect
+        # Xenial about ~20 profiles, so let's expect
         # *at least* the sum.
         assert host.check_output("aa-status --profiled") >= total_expected
 
@@ -116,7 +116,7 @@ def test_aastatus_unconfined(host):
     """ Ensure that there are no processes that are unconfined but have
         a profile """
 
-    # Trusty and Xenial should show 0 unconfined processes.
+    # There should be 0 unconfined processes.
     expected_unconfined = 0
 
     unconfined_chk = str("{} processes are unconfined but have"
diff --git a/molecule/testinfra/staging/common/test_platform.py b/molecule/testinfra/staging/common/test_platform.py
--- a/molecule/testinfra/staging/common/test_platform.py
+++ b/molecule/testinfra/staging/common/test_platform.py
@@ -1,5 +1,4 @@
-# We expect Ubuntu, either Trusty or Xenial, the two LTSes
-# currently targeted for support.
+# We expect Ubuntu Xenial
 SUPPORTED_CODENAMES = ('xenial')
 SUPPORTED_RELEASES = ('16.04')
 
@@ -19,10 +18,7 @@ def test_ansible_version(host):
 
 def test_platform(host):
     """
-    SecureDrop requires Ubuntu Trusty 14.04 LTS. The shelf life
-    of that release means we'll need to migrate to Xenial LTS
-    at some point; until then, require hosts to be running
-    Ubuntu.
+    SecureDrop requires Ubuntu Ubuntu 16.04 LTS.
     """
     assert host.system_info.type == "linux"
     assert host.system_info.distribution == "ubuntu"