Move Nginx TLS configuration files into a specific folder (#7300)

Following discussions in #7298.

This PR moves the three Nginx TLS configuration files into a specific folder, tls_configs, update the MANIFEST to include this folder and its content into the certbot-nginx package, and update tests accordingly.

* Move tls configuration files in a specific folder

* Move new file
This commit is contained in:
Adrien Ferrand 2019-08-06 00:45:08 +02:00 committed by Brad Warren
parent 14e10f40e5
commit 8bcb04af4a
6 changed files with 9 additions and 8 deletions

View file

@ -2,5 +2,4 @@ include LICENSE.txt
include README.rst
recursive-include docs *
recursive-include certbot_nginx/tests/testdata *
include certbot_nginx/options-ssl-nginx.conf
include certbot_nginx/options-ssl-nginx-old.conf
recursive-include certbot_nginx/tls_configs *.conf

View file

@ -129,7 +129,8 @@ class NginxConfigurator(common.Installer):
config_filename = "options-ssl-nginx-old.conf"
elif self.version < (1, 13, 0):
config_filename = "options-ssl-nginx-tls12-only.conf"
return pkg_resources.resource_filename("certbot_nginx", config_filename)
return pkg_resources.resource_filename(
"certbot_nginx", os.path.join("tls_configs", config_filename))
@property
def mod_ssl_conf(self):

View file

@ -972,11 +972,12 @@ class InstallSslOptionsConfTest(util.NginxTest):
"""
from certbot_nginx.constants import ALL_SSL_OPTIONS_HASHES
import pkg_resources
all_files = [pkg_resources.resource_filename("certbot_nginx", x) for x in (
"options-ssl-nginx.conf",
"options-ssl-nginx-old.conf",
"options-ssl-nginx-tls12-only.conf"
)]
all_files = [
pkg_resources.resource_filename("certbot_nginx", os.path.join("tls_configs", x))
for x in ("options-ssl-nginx.conf",
"options-ssl-nginx-old.conf",
"options-ssl-nginx-tls12-only.conf")
]
self.assertTrue(all_files)
for one_file in all_files:
file_hash = crypto_util.sha256sum(one_file)