From b56c4131ad7e438b1a525db4afe054af1c57dccf Mon Sep 17 00:00:00 2001 From: Kushal Das Date: Thu, 17 Jan 2019 20:44:05 +0530 Subject: [PATCH 1/2] Fixes #4038 python-gnupg works with gpg binary For the python-gnupg to work properly on Xenial, we should call `gpg` binary instead of `gpg2` (which we use in Trusty). --- securedrop/crypto_util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/securedrop/crypto_util.py b/securedrop/crypto_util.py index 3c7c73689b..46d1e71138 100644 --- a/securedrop/crypto_util.py +++ b/securedrop/crypto_util.py @@ -5,6 +5,7 @@ import os import io import scrypt +import platform import subprocess from random import SystemRandom @@ -79,7 +80,11 @@ def __init__(self, self.do_runtime_tests() - self.gpg = gnupg.GPG(binary='gpg2', homedir=gpg_key_dir) + os_details = platform.linux_distribution() + if os_details[1] == "16.04": + self.gpg = gnupg.GPG(binary='gpg', homedir=gpg_key_dir) + else: + self.gpg = gnupg.GPG(binary='gpg2', homedir=gpg_key_dir) # map code for a given language to a localized wordlist self.__language2words = {} # type: Dict[Text, List[str]] From 0c64e4d4a8e56fdf1b722e4e1c45209bec808d52 Mon Sep 17 00:00:00 2001 From: Kushal Das Date: Thu, 17 Jan 2019 20:54:20 +0530 Subject: [PATCH 2/2] Fixes #4037 #4036 Updates setuptools for ci With the upgraded setuptools package, the errors in both the mentioned issues get fixed. --- securedrop/dockerfiles/xenial/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/securedrop/dockerfiles/xenial/Dockerfile b/securedrop/dockerfiles/xenial/Dockerfile index e64c65b165..9fa83f5b65 100644 --- a/securedrop/dockerfiles/xenial/Dockerfile +++ b/securedrop/dockerfiles/xenial/Dockerfile @@ -24,6 +24,8 @@ COPY requirements requirements RUN pip install -r requirements/securedrop-app-code-requirements.txt && \ pip install -r requirements/test-requirements.txt +RUN pip install --upgrade setuptools + RUN if test $USER_NAME != root ; then useradd --no-create-home --home-dir /tmp --uid $USER_ID $USER_NAME && echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers ; fi STOPSIGNAL SIGKILL