Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Apr 2018 23:56:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        python@FreeBSD.org
Subject:   [Bug 227289] security/py-certbot-nginx: Wrong nginx configuration path set
Message-ID:  <bug-227289-21822@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227289

            Bug ID: 227289
           Summary: security/py-certbot-nginx: Wrong nginx configuration
                    path set
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: python@FreeBSD.org
          Reporter: fbsdbugzilla@csj.no
             Flags: maintainer-feedback?(python@FreeBSD.org)
          Assignee: python@FreeBSD.org

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)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227289-21822>