From patchwork Wed Jul 3 03:39:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 1126599 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45dn1d452Gz9s3Z for ; Wed, 3 Jul 2019 13:40:21 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45dn1d2FC6zDqS2 for ; Wed, 3 Jul 2019 13:40:21 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=ajd@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45dn1V6WmvzDqQ5 for ; Wed, 3 Jul 2019 13:40:14 +1000 (AEST) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x633bQVR123811 for ; Tue, 2 Jul 2019 23:40:11 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2tgm3e90ya-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 02 Jul 2019 23:40:11 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Jul 2019 04:40:09 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 3 Jul 2019 04:40:07 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x633e6Db62521548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 3 Jul 2019 03:40:06 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45CF14204C for ; Wed, 3 Jul 2019 03:40:06 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A127142041 for ; Wed, 3 Jul 2019 03:40:05 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Wed, 3 Jul 2019 03:40:05 +0000 (GMT) Received: from intelligence.ozlabs.ibm.com (unknown [9.81.221.92]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 769E8A018D for ; Wed, 3 Jul 2019 13:40:04 +1000 (AEST) From: Andrew Donnellan To: patchwork@lists.ozlabs.org Subject: [PATCH] about: Display admin contact details Date: Wed, 3 Jul 2019 13:39:53 +1000 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19070303-0012-0000-0000-0000032EB014 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070303-0013-0000-0000-000021680063 Message-Id: <20190703033953.16706-1-ajd@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-03_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1031 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907030043 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Display the list of admins on the about page. Add an ADMINS_HIDE option if you don't want the details displayed publicly. Closes: #282 ("Display contact details for patchwork instance admins") Signed-off-by: Andrew Donnellan --- docs/deployment/configuration.rst | 12 ++++++++++++ patchwork/settings/base.py | 8 ++++++++ patchwork/settings/production.example.py | 3 ++- patchwork/templates/patchwork/about.html | 15 +++++++++++++++ patchwork/views/about.py | 1 + 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/deployment/configuration.rst b/docs/deployment/configuration.rst index ba9a2ebc8c97..833fd26268f5 100644 --- a/docs/deployment/configuration.rst +++ b/docs/deployment/configuration.rst @@ -114,3 +114,15 @@ access. This is useful if SSL protocol is terminated upstream of the server __ https://docs.djangoproject.com/en/1.8/ref/settings/ __ http://www.django-rest-framework.org/api-guide/settings/ + +``ADMINS`` +~~~~~~~~~~ + +Name and email address for Patchwork instance administrators. + +``ADMINS_HIDE`` +~~~~~~~~~~~~~~~ + +If True, the details in ``ADMINS`` will be hidden from the About page. + +.. versionadded:: 2.2 diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index 15644b405604..c76b5af22bfc 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -227,3 +227,11 @@ COMPAT_REDIR = True # the scheme based on current access. This is useful if SSL protocol # is terminated upstream of the server (e.g. at the load balancer) FORCE_HTTPS_LINKS = False + +# Administrator contact details. Will be listed on the about page for users to +# contact, unless ADMINS_HIDE is True. +ADMINS = ( + # Add administrator contact details in the form: + # ('Jeremy Kerr', 'jk@ozlabs.org'), +) +ADMINS_HIDE = False diff --git a/patchwork/settings/production.example.py b/patchwork/settings/production.example.py index f58896fc0ac7..c6aa2f2850c0 100644 --- a/patchwork/settings/production.example.py +++ b/patchwork/settings/production.example.py @@ -42,7 +42,8 @@ SERVER_EMAIL = DEFAULT_FROM_EMAIL NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL ADMINS = ( - ('Jeremy Kerr', 'jk@ozlabs.org'), + # Add administrator contact details in the form: + # ('Jeremy Kerr', 'jk@ozlabs.org'), ) # Database diff --git a/patchwork/templates/patchwork/about.html b/patchwork/templates/patchwork/about.html index f602c1351b56..b41d5fdc15ef 100644 --- a/patchwork/templates/patchwork/about.html +++ b/patchwork/templates/patchwork/about.html @@ -26,6 +26,21 @@ + {% if admins %} +
+
+

Administrators

+
+
    + {% for admin in admins %} +
  • + {{ admin.0 }} <{{ admin.1 }}> +
  • + {% endfor %} +
+
+ {% endif %} +

API Status

diff --git a/patchwork/views/about.py b/patchwork/views/about.py index 0061a3195298..91c3b74ebf8f 100644 --- a/patchwork/views/about.py +++ b/patchwork/views/about.py @@ -16,6 +16,7 @@ def about(request): 'rest': settings.ENABLE_REST_API, 'xmlrpc': settings.ENABLE_XMLRPC, }, + 'admins': () if settings.ADMINS_HIDE else settings.ADMINS, } return render(request, 'patchwork/about.html', context)