From owner-freebsd-python@freebsd.org  Wed Apr  4 23:56:23 2018
Return-Path: <owner-freebsd-python@freebsd.org>
Delivered-To: freebsd-python@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC48DF8132C
 for <freebsd-python@mailman.ysv.freebsd.org>;
 Wed,  4 Apr 2018 23:56:23 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org
 [IPv6:2001:1900:2254:206a::50:5])
 by mx1.freebsd.org (Postfix) with ESMTP id 606A37AEB7
 for <freebsd-python@freebsd.org>; Wed,  4 Apr 2018 23:56:23 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: by mailman.ysv.freebsd.org (Postfix)
 id 1A99BF81323; Wed,  4 Apr 2018 23:56:23 +0000 (UTC)
Delivered-To: python@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 069E9F81322
 for <python@mailman.ysv.freebsd.org>; Wed,  4 Apr 2018 23:56:23 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org
 [IPv6:2001:1900:2254:206a::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.ysv.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 93EFC7AEB3
 for <python@FreeBSD.org>; Wed,  4 Apr 2018 23:56:22 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: from kenobi.freebsd.org (kenobi.freebsd.org
 [IPv6:2001:1900:2254:206a::16:76])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id D8023431E
 for <python@FreeBSD.org>; Wed,  4 Apr 2018 23:56:21 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: from kenobi.freebsd.org ([127.0.1.118])
 by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w34NuLoU032460
 for <python@FreeBSD.org>; Wed, 4 Apr 2018 23:56:21 GMT
 (envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
 by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w34NuLhl032459
 for python@FreeBSD.org; Wed, 4 Apr 2018 23:56:21 GMT
 (envelope-from bugzilla-noreply@freebsd.org)
X-Authentication-Warning: kenobi.freebsd.org: www set sender to
 bugzilla-noreply@freebsd.org using -f
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
From: bugzilla-noreply@freebsd.org
To: python@FreeBSD.org
Subject: maintainer-feedback requested: [Bug 227289]
 security/py-certbot-nginx: Wrong nginx configuration path set
Date: Wed, 04 Apr 2018 23:56:21 +0000
X-Bugzilla-Type: request
X-Bugzilla-Product: Ports & Packages
X-Bugzilla-Component: Individual Port(s)
X-Bugzilla-Version: Latest
X-Bugzilla-Keywords: 
X-Bugzilla-Severity: Affects Many People
X-Bugzilla-Who: 
X-Bugzilla-Status: New
X-Bugzilla-Resolution: 
X-Bugzilla-Priority: ---
X-Bugzilla-Assigned-To: python@FreeBSD.org
X-Bugzilla-Flags: maintainer-feedback?
Message-ID: <bug-227289-21822-vw0c8BDvo2@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-227289-21822@https.bugs.freebsd.org/bugzilla/>
References: <bug-227289-21822@https.bugs.freebsd.org/bugzilla/>
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-BeenThere: freebsd-python@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: FreeBSD-specific Python issues <freebsd-python.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-python>, 
 <mailto:freebsd-python-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-python/>
List-Post: <mailto:freebsd-python@freebsd.org>
List-Help: <mailto:freebsd-python-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-python>,
 <mailto:freebsd-python-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 04 Apr 2018 23:56:24 -0000

Bugzilla Automation <bugzilla@FreeBSD.org> has asked FreeBSD Python
<python@FreeBSD.org> for maintainer-feedback:
Bug 227289: security/py-certbot-nginx: Wrong nginx configuration path set
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227289



--- Description ---
Installing nginx, py-certbot and py-certbot-nginx results in wrong behaviour
when running certbot:

# certbot
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or
directory)
nginx: configuration file /etc/nginx/nginx.conf test failed

Certbot doesn't know how to automatically configure the web server on
this system. However, it can still get a certificate for you. Please run
"certbot certonly" to do so. You'll need to manually configure your web
server to use the resulting certificate.

Digging through the system, I eventually came across this file:

/usr/local/lib/python2.7/site-packages/certbot_nginx/constants.py

In constants.py, the server_root for nginx is set:

CLI_DEFAULTS =3D dict(
    server_root=3D"/etc/nginx",
    ctl=3D"nginx",
)

This should be set to /usr/local/etc/nginx, which is where nginx' config fi=
les
reside on FreeBSD.

Changing server_root to /usr/local/etc/nginx and recompiling constants.py to
constants.pyc and constants.pyo solves the problem and certificate requests=
 and
renewals work as expected.


System: FreeBSD 11.1-RELEASE-p9 amd64
Nginx: www/nginx-devel (1.13.10)
Certbot: security/py-certbot (0.22.2,1)
Certbot-nginx: security/py-certbot-nginx (0.22.2)