From 2ae9bf3d4928ec9e38f98b1fd20734fb81b07827 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 2 Jun 2015 07:14:01 +0000 Subject: [PATCH 01/12] Use timedelta instead of now.month + 1 (partially fixes: #456). `ValueError: day is out of range for month` --- letsencrypt/tests/acme_util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/letsencrypt/tests/acme_util.py b/letsencrypt/tests/acme_util.py index 48e3beba7..8780e8095 100644 --- a/letsencrypt/tests/acme_util.py +++ b/letsencrypt/tests/acme_util.py @@ -125,10 +125,9 @@ def gen_authzr(authz_status, domain, challs, statuses, combos=True): if combos: authz_kwargs.update({"combinations": gen_combos(challbs)}) if authz_status == messages2.STATUS_VALID: - now = datetime.datetime.now() authz_kwargs.update({ "status": authz_status, - "expires": datetime.datetime(now.year, now.month + 1, now.day), + "expires": datetime.datetime.now() + datetime.timedelta(days=31), }) else: authz_kwargs.update({ From efde7d4effbbb0d19199b98efdd55c8c77e3abd9 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 2 Jun 2015 09:56:26 +0000 Subject: [PATCH 02/12] Refactor le_util, 100% cover --- letsencrypt/le_util.py | 64 +++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/letsencrypt/le_util.py b/letsencrypt/le_util.py index ec0be7514..ba2427c79 100644 --- a/letsencrypt/le_util.py +++ b/letsencrypt/le_util.py @@ -54,8 +54,25 @@ def check_permissions(filepath, mode, uid=0): return stat.S_IMODE(file_stat.st_mode) == mode and file_stat.st_uid == uid +def _safely_attempt_open(fname, mode): + file_d = os.open(fname, os.O_CREAT | os.O_EXCL | os.O_RDWR, mode) + return os.fdopen(file_d, "w"), fname + + +def _unique_file(path, filename_pat, count, mode): + while True: + try: + return _safely_attempt_open( + os.path.join(path, filename_pat(count)), mode) + except OSError as err: + # "File exists," is okay, try a different name. + if err.errno != errno.EEXIST: + raise + count += 1 + + def unique_file(path, mode=0o777): - """Safely finds a unique file for writing only (by default). + """Safely finds a unique file. :param str path: path/filename.ext :param int mode: File mode @@ -64,52 +81,35 @@ def unique_file(path, mode=0o777): """ path, tail = os.path.split(path) - count = 0 - while True: - fname = os.path.join(path, "%04d_%s" % (count, tail)) - try: - file_d = os.open(fname, os.O_CREAT | os.O_EXCL | os.O_RDWR, mode) - return os.fdopen(file_d, "w"), fname - except OSError as exception: - # "File exists," is okay, try a different name. - if exception.errno != errno.EEXIST: - raise - count += 1 + return _unique_file( + path, filename_pat=(lambda count: "%04d_%s" % (count, tail)), + count=0, mode=mode) def unique_lineage_name(path, filename, mode=0o777): - """Safely finds a unique file for writing only (by default). Uses a - file lineage convention. + """Safely finds a unique file using lineage convention. :param str path: directory path :param str filename: proposed filename :param int mode: file mode - :returns: tuple of file object and file name (which may be modified from - the requested one by appending digits to ensure uniqueness) + :returns: tuple of file object and file name (which may be modified + from the requested one by appending digits to ensure uniqueness) :raises OSError: if writing files fails for an unanticipated reason, - such as a full disk or a lack of permission to write to specified - location. + such as a full disk or a lack of permission to write to + specified location. """ - fname = os.path.join(path, "%s.conf" % (filename)) try: - file_d = os.open(fname, os.O_CREAT | os.O_EXCL | os.O_RDWR, mode) - return os.fdopen(file_d, "w"), fname + return _safely_attempt_open( + os.path.join(path, "%s.conf" % (filename)), mode=mode) except OSError as err: if err.errno != errno.EEXIST: - raise err - count = 1 - while True: - fname = os.path.join(path, "%s-%04d.conf" % (filename, count)) - try: - file_d = os.open(fname, os.O_CREAT | os.O_EXCL | os.O_RDWR, mode) - return os.fdopen(file_d, "w"), fname - except OSError as err: - if err.errno != errno.EEXIST: - raise err - count += 1 + raise + return _unique_file( + path, filename_pat=(lambda count: "%s-%04d.conf" % (filename, count)), + count=1, mode=mode) def safely_remove(path): From 9e5bd7c90d9ce61cd39a9331ec08bd0f34721753 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 2 Jun 2015 09:57:02 +0000 Subject: [PATCH 03/12] Do not use generic exceptions in le_util_test. --- letsencrypt/tests/le_util_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/letsencrypt/tests/le_util_test.py b/letsencrypt/tests/le_util_test.py index 475c82534..1ad6968a1 100644 --- a/letsencrypt/tests/le_util_test.py +++ b/letsencrypt/tests/le_util_test.py @@ -8,6 +8,8 @@ import unittest import mock +from letsencrypt import errors + class MakeOrVerifyDirTest(unittest.TestCase): """Tests for letsencrypt.le_util.make_or_verify_dir. @@ -42,7 +44,8 @@ class MakeOrVerifyDirTest(unittest.TestCase): self.assertEqual(stat.S_IMODE(os.stat(self.path).st_mode), 0o400) def test_existing_wrong_mode_fails(self): - self.assertRaises(Exception, self._call, self.path, 0o600) + self.assertRaises( + errors.LetsEncryptClientError, self._call, self.path, 0o600) def test_reraises_os_error(self): with mock.patch.object(os, 'makedirs') as makedirs: From d3ad5f8b561cc12f49ee7ddc9147aa9089977ea5 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 2 Jun 2015 10:40:47 +0000 Subject: [PATCH 04/12] gitignore: +htmlcov, -m3, reorg --- .gitignore | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 2e0578223..ace5d7a0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,18 @@ *.pyc -*.egg-info +*.egg-info/ .eggs/ build/ dist/ -venv/ -.tox/ +/venv/ +/.tox/ + +# coverage .coverage -m3 +/htmlcov/ + +/.vagrant + +# editor temporary files *~ -.vagrant *.swp \#*# \ No newline at end of file From 814ab083bde51c17e3fe445d4f3cb68939b77f71 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Tue, 2 Jun 2015 11:16:24 -0700 Subject: [PATCH 05/12] Added account registration message and fixed double output --- letsencrypt/cli.py | 2 +- letsencrypt/client.py | 9 +++++++++ letsencrypt/reporter.py | 14 +++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 169b55aff..798a816af 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -377,7 +377,7 @@ def main(args=sys.argv[1:]): # Reporter report = reporter.Reporter() zope.component.provideUtility(report) - atexit.register(report.print_messages) + atexit.register(report.atexit_print_messages) # Logging level = -args.verbose_count * 10 diff --git a/letsencrypt/client.py b/letsencrypt/client.py index c4b8ef40c..bb0a6d01f 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -99,6 +99,15 @@ class Client(object): raise errors.LetsEncryptClientError("Must agree to TOS") self.account.save() + reporter = zope.component.getUtility(interfaces.IReporter) + reporter.add_message( + "Your account credentials have been saved in your Let's Encrypt " + "configuration directory at {0}. You should make a secure backup " + "of this folder now. This configuration directory will also " + "contain certificates and private keys obtained by Let's Encrypt " + "so making regular backups of this folder is ideal.".format( + self.config.config_dir), + reporter.HIGH_PRIORITY, True) def obtain_certificate(self, domains, csr=None): """Obtains a certificate from the ACME server. diff --git a/letsencrypt/reporter.py b/letsencrypt/reporter.py index 7dfacaf14..947643d48 100644 --- a/letsencrypt/reporter.py +++ b/letsencrypt/reporter.py @@ -1,5 +1,7 @@ """Collects and displays information to the user.""" import collections +import logging +import os import Queue import sys import textwrap @@ -46,6 +48,16 @@ class Reporter(object): """ assert self.HIGH_PRIORITY <= priority <= self.LOW_PRIORITY self.messages.put(self._msg_type(priority, msg, on_crash)) + logging.info("Reporting to user: %s", msg) + + def atexit_print_messages(self, pid=os.getpid()): + """Function to be registered with atexit to print messages. + + :param int pid: Process ID + + """ + if pid == os.getpid(): + self.print_messages() def print_messages(self): """Prints messages to the user and clears the message queue. @@ -59,7 +71,7 @@ class Reporter(object): no_exception = sys.exc_info()[0] is None bold_on = sys.stdout.isatty() if bold_on: - sys.stdout.write(self._BOLD) + print self._BOLD print 'IMPORTANT NOTES:' wrapper = textwrap.TextWrapper(initial_indent=' - ', subsequent_indent=(' ' * 3)) From 4646d8d6bfd1d537657a163803c43201e735ea1f Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 2 Jun 2015 18:30:48 +0000 Subject: [PATCH 06/12] Standalone Authenticator: no fail when port taken (fixes #381) --- letsencrypt/plugins/standalone/authenticator.py | 1 - letsencrypt/plugins/standalone/tests/authenticator_test.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/letsencrypt/plugins/standalone/authenticator.py b/letsencrypt/plugins/standalone/authenticator.py index 8c06d1139..2ed60a096 100644 --- a/letsencrypt/plugins/standalone/authenticator.py +++ b/letsencrypt/plugins/standalone/authenticator.py @@ -152,7 +152,6 @@ class StandaloneAuthenticator(common.Plugin): :rtype: bool """ - display = zope.component.getUtility(interfaces.IDisplay) start_time = time.time() diff --git a/letsencrypt/plugins/standalone/tests/authenticator_test.py b/letsencrypt/plugins/standalone/tests/authenticator_test.py index 841285750..1794ff65c 100644 --- a/letsencrypt/plugins/standalone/tests/authenticator_test.py +++ b/letsencrypt/plugins/standalone/tests/authenticator_test.py @@ -317,6 +317,7 @@ class PerformTest(unittest.TestCase): """What happens if start_listener() returns True.""" self.authenticator.start_listener = mock.Mock() self.authenticator.start_listener.return_value = True + self.authenticator.already_listening = mock.Mock(return_value=False) result = self.authenticator.perform(self.achalls) self.assertEqual(len(self.authenticator.tasks), 2) self.assertTrue( @@ -335,6 +336,7 @@ class PerformTest(unittest.TestCase): """What happens if start_listener() returns False.""" self.authenticator.start_listener = mock.Mock() self.authenticator.start_listener.return_value = False + self.authenticator.already_listening = mock.Mock(return_value=False) result = self.authenticator.perform(self.achalls) self.assertEqual(len(self.authenticator.tasks), 2) self.assertTrue( From 59c5a77731ebc93887741b000b3fbadf1e83c769 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Tue, 2 Jun 2015 12:16:10 -0700 Subject: [PATCH 07/12] Fixed duplicate output --- letsencrypt/plugins/standalone/authenticator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/letsencrypt/plugins/standalone/authenticator.py b/letsencrypt/plugins/standalone/authenticator.py index 8c06d1139..77bcc81e9 100644 --- a/letsencrypt/plugins/standalone/authenticator.py +++ b/letsencrypt/plugins/standalone/authenticator.py @@ -266,6 +266,7 @@ class StandaloneAuthenticator(common.Plugin): signal.signal(signal.SIGUSR1, self.client_signal_handler) signal.signal(signal.SIGUSR2, self.client_signal_handler) + sys.stdout.flush() fork_result = os.fork() Crypto.Random.atfork() if fork_result: From 34a66b1bff0a663b96c75ac9b41ef509dc2003aa Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Tue, 2 Jun 2015 17:11:00 -0700 Subject: [PATCH 08/12] Added key notifications to the client --- letsencrypt/client.py | 49 ++++++++++++++++++++++++++++++++++++++--- letsencrypt/reporter.py | 5 +++-- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/letsencrypt/client.py b/letsencrypt/client.py index b755940e4..17bee6069 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -99,6 +99,10 @@ class Client(object): raise errors.LetsEncryptClientError("Must agree to TOS") self.account.save() + self._report_new_account() + + def _report_new_account(self): + """Informs the user about their new Let's Encrypt account.""" reporter = zope.component.getUtility(interfaces.IReporter) reporter.add_message( "Your account credentials have been saved in your Let's Encrypt " @@ -107,7 +111,17 @@ class Client(object): "contain certificates and private keys obtained by Let's Encrypt " "so making regular backups of this folder is ideal.".format( self.config.config_dir), - reporter.HIGH_PRIORITY, True) + reporter.MEDIUM_PRIORITY, True) + + assert self.account.recovery_token is not None + recovery_msg = ("If you lose your account credentials, you can recover " + "them using the token \"{0}\". You must write that down " + "and put it in a safe place.".format( + self.account.recovery_token)) + if self.account.email is not None: + recovery_msg += (" Another recovery method will be e-mails sent to " + "{0}.".format(self.account.email)) + reporter.add_message(recovery_msg, reporter.HIGH_PRIORITY, True) def obtain_certificate(self, domains, csr=None): """Obtains a certificate from the ACME server. @@ -204,9 +218,38 @@ class Client(object): params = vars(self.config.namespace) config = {"renewer_config_file": params["renewer_config_file"]} if "renewer_config_file" in params else None - return storage.RenewableCert.new_lineage(domains[0], cert, privkey, - chain, params, config) + renewable_cert = storage.RenewableCert.new_lineage(domains[0], cert, privkey, + chain, params, config) + self._report_renewal_status(renewable_cert) + return renewable_cert + def _report_renewal_status(self, cert): + # pylint: disable=no-self-use + """Informs the user about automatic renewal and deployment. + + :param cert: Newly issued certificate + :type cert: :class:`letsencrypt.storage.RenewableCert` + + """ + if ("autorenew" not in cert.configuration + or cert.configuration.as_bool("autorenew")): + if ("autodeploy" not in cert.configuration or + cert.configuration.as_bool("autodeploy")): + msg = "Automatic renewal and deployment has " + else: + msg = "Automatic renewal but not automatic deployment has " + else: + if ("autodeploy" not in cert.configuration or + cert.configuration.as_bool("autodeploy")): + msg = "Automatic deployment but not automatic renewal has " + else: + msg = "Automatic renewal and deployment has not " + + msg += ("been enabled for your certificate. These settings can be " + "configured in the directories under {0}.").format( + cert.configuration["renewal_configs_dir"]) + reporter = zope.component.getUtility(interfaces.IReporter) + reporter.add_message(msg, reporter.LOW_PRIORITY, True) def save_certificate(self, certr, cert_path, chain_path): # pylint: disable=no-self-use diff --git a/letsencrypt/reporter.py b/letsencrypt/reporter.py index 947643d48..045c1befa 100644 --- a/letsencrypt/reporter.py +++ b/letsencrypt/reporter.py @@ -56,6 +56,8 @@ class Reporter(object): :param int pid: Process ID """ + # This ensures that messages are only printed from the process that + # created the Reporter. if pid == os.getpid(): self.print_messages() @@ -64,8 +66,7 @@ class Reporter(object): If there is an unhandled exception, only messages for which ``on_crash`` is ``True`` are printed. - - """ +""" bold_on = False if not self.messages.empty(): no_exception = sys.exc_info()[0] is None From 9f37a46c92f672cff123fbe3734867fd4ffe5258 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 3 Jun 2015 11:40:14 -0700 Subject: [PATCH 09/12] Added client tests --- letsencrypt/tests/client_test.py | 43 +++++++++++++++++++ letsencrypt/tests/proof_of_possession_test.py | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/letsencrypt/tests/client_test.py b/letsencrypt/tests/client_test.py index 7687d5205..cfcee5b05 100644 --- a/letsencrypt/tests/client_test.py +++ b/letsencrypt/tests/client_test.py @@ -5,6 +5,7 @@ import pkg_resources import shutil import tempfile +import configobj import mock from letsencrypt import account @@ -35,6 +36,48 @@ class ClientTest(unittest.TestCase): self.network2.Network.assert_called_once_with( mock.ANY, mock.ANY, verify_ssl=True) + @mock.patch("letsencrypt.client.zope.component.getUtility") + def test_report_new_account(self, mock_zope): + self.config.config_dir = "/usr/bin/coffee" + self.account.recovery_token = "ECCENTRIC INVISIBILITY RHINOCEROS" + self.account.email = "rhino@jungle.io" + + self.client._report_new_account() + call_list = mock_zope().add_message.call_args_list + self.assertTrue(self.config.config_dir in call_list[0][0][0]) + self.assertTrue(self.account.recovery_token in call_list[1][0][0]) + self.assertTrue(self.account.email in call_list[1][0][0]) + + @mock.patch("letsencrypt.client.zope.component.getUtility") + def test_report_renewal_status(self, mock_zope): + cert = mock.MagicMock() + cert.configuration = configobj.ConfigObj() + cert.configuration["renewal_configs_dir"] = "/etc/letsencrypt/configs" + + cert.configuration["autorenew"] = "True" + cert.configuration["autodeploy"] = "True" + self.client._report_renewal_status(cert) + msg = mock_zope().add_message.call_args[0][0] + self.assertTrue("renewal and deployment has been" in msg) + self.assertTrue(cert.configuration["renewal_configs_dir"] in msg) + + cert.configuration["autorenew"] = "False" + self.client._report_renewal_status(cert) + msg = mock_zope().add_message.call_args[0][0] + self.assertTrue("deployment but not automatic renewal" in msg) + self.assertTrue(cert.configuration["renewal_configs_dir"] in msg) + + cert.configuration["autodeploy"] = "False" + self.client._report_renewal_status(cert) + msg = mock_zope().add_message.call_args[0][0] + self.assertTrue("renewal and deployment has not" in msg) + self.assertTrue(cert.configuration["renewal_configs_dir"] in msg) + + cert.configuration["autorenew"] = "True" + self.client._report_renewal_status(cert) + msg = mock_zope().add_message.call_args[0][0] + self.assertTrue("renewal but not automatic deployment" in msg) + self.assertTrue(cert.configuration["renewal_configs_dir"] in msg) class DetermineAccountTest(unittest.TestCase): """Tests for letsencrypt.client.determine_authenticator.""" diff --git a/letsencrypt/tests/proof_of_possession_test.py b/letsencrypt/tests/proof_of_possession_test.py index 3635b5ead..0a044810c 100644 --- a/letsencrypt/tests/proof_of_possession_test.py +++ b/letsencrypt/tests/proof_of_possession_test.py @@ -69,7 +69,7 @@ class ProofOfPossessionTest(unittest.TestCase): def test_perform_no_input(self): self.assertTrue(self.proof_of_pos.perform(self.achall).verify()) - @mock.patch("letsencrypt.recovery_token.zope.component.getUtility") + @mock.patch("letsencrypt.proof_of_possession.zope.component.getUtility") def test_perform_with_input(self, mock_input): # Remove the matching certificate self.installer.get_all_certs_keys.return_value.pop() From 2c40cc77fb5175f5753f943a6696b37a8ae1f6c4 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 3 Jun 2015 12:06:51 -0700 Subject: [PATCH 10/12] Added atexit_print_messages test --- letsencrypt/tests/client_test.py | 4 +++- letsencrypt/tests/reporter_test.py | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/letsencrypt/tests/client_test.py b/letsencrypt/tests/client_test.py index cfcee5b05..1fb9c2a03 100644 --- a/letsencrypt/tests/client_test.py +++ b/letsencrypt/tests/client_test.py @@ -38,6 +38,7 @@ class ClientTest(unittest.TestCase): @mock.patch("letsencrypt.client.zope.component.getUtility") def test_report_new_account(self, mock_zope): + # pylint: disable=protected-access self.config.config_dir = "/usr/bin/coffee" self.account.recovery_token = "ECCENTRIC INVISIBILITY RHINOCEROS" self.account.email = "rhino@jungle.io" @@ -50,6 +51,7 @@ class ClientTest(unittest.TestCase): @mock.patch("letsencrypt.client.zope.component.getUtility") def test_report_renewal_status(self, mock_zope): + # pylint: disable=protected-access cert = mock.MagicMock() cert.configuration = configobj.ConfigObj() cert.configuration["renewal_configs_dir"] = "/etc/letsencrypt/configs" @@ -66,7 +68,7 @@ class ClientTest(unittest.TestCase): msg = mock_zope().add_message.call_args[0][0] self.assertTrue("deployment but not automatic renewal" in msg) self.assertTrue(cert.configuration["renewal_configs_dir"] in msg) - + cert.configuration["autodeploy"] = "False" self.client._report_renewal_status(cert) msg = mock_zope().add_message.call_args[0][0] diff --git a/letsencrypt/tests/reporter_test.py b/letsencrypt/tests/reporter_test.py index e6a8c9005..2248e7caf 100644 --- a/letsencrypt/tests/reporter_test.py +++ b/letsencrypt/tests/reporter_test.py @@ -30,6 +30,15 @@ class ReporterTest(unittest.TestCase): self.reporter.print_messages() self.assertEqual(sys.stdout.getvalue(), "") + def test_atexit_print_messages(self): + self._add_messages() + self.reporter.atexit_print_messages() + output = sys.stdout.getvalue() + self.assertTrue("IMPORTANT NOTES:" in output) + self.assertTrue("High" in output) + self.assertTrue("Med" in output) + self.assertTrue("Low" in output) + def test_tty_successful_exit(self): sys.stdout.isatty = lambda: True self._successful_exit_common() From 8198e6c10551d79ee3d8367a1bdd6aa8a73c2309 Mon Sep 17 00:00:00 2001 From: Francois Marier Date: Mon, 1 Jun 2015 17:00:09 +1200 Subject: [PATCH 11/12] Rename the nginx ssl config file to match the final filename This config file will ultimately exist as /etc/letsencrypt/options-ssl-nginx.conf so we may as well use the right filename everywhere. This is much easier to deal with in the Debian packaging. --- MANIFEST.in | 2 +- letsencrypt_nginx/constants.py | 2 +- letsencrypt_nginx/{options-ssl.conf => options-ssl-nginx.conf} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename letsencrypt_nginx/{options-ssl.conf => options-ssl-nginx.conf} (100%) diff --git a/MANIFEST.in b/MANIFEST.in index f9364d64f..5149594f3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -12,4 +12,4 @@ recursive-include letsencrypt_apache/tests/testdata * include letsencrypt_apache/options-ssl.conf recursive-include letsencrypt_nginx/tests/testdata * -include letsencrypt_nginx/options-ssl.conf +include letsencrypt_nginx/options-ssl-nginx.conf diff --git a/letsencrypt_nginx/constants.py b/letsencrypt_nginx/constants.py index 6c15b1664..73b80c809 100644 --- a/letsencrypt_nginx/constants.py +++ b/letsencrypt_nginx/constants.py @@ -11,6 +11,6 @@ CLI_DEFAULTS = dict( MOD_SSL_CONF = pkg_resources.resource_filename( - "letsencrypt_nginx", "options-ssl.conf") + "letsencrypt_nginx", "options-ssl-nginx.conf") """Path to the Nginx mod_ssl config file found in the Let's Encrypt distribution.""" diff --git a/letsencrypt_nginx/options-ssl.conf b/letsencrypt_nginx/options-ssl-nginx.conf similarity index 100% rename from letsencrypt_nginx/options-ssl.conf rename to letsencrypt_nginx/options-ssl-nginx.conf From bce01419da21f84acb230caf6c1a60e74ccaf245 Mon Sep 17 00:00:00 2001 From: Francois Marier Date: Sun, 7 Jun 2015 20:31:50 +1200 Subject: [PATCH 12/12] Rename the apache config file to match the nginx one Since both config files end up in /etc/letsencrypt/, if we want the two plugins be to installable at the same time, their config files need different names. --- MANIFEST.in | 2 +- letsencrypt_apache/constants.py | 4 ++-- .../{options-ssl.conf => options-ssl-apache.conf} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename letsencrypt_apache/{options-ssl.conf => options-ssl-apache.conf} (100%) diff --git a/MANIFEST.in b/MANIFEST.in index f9364d64f..77b50432a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,7 +9,7 @@ recursive-include acme/schemata *.json recursive-include acme/jose/testdata * recursive-include letsencrypt_apache/tests/testdata * -include letsencrypt_apache/options-ssl.conf +include letsencrypt_apache/options-ssl-apache.conf recursive-include letsencrypt_nginx/tests/testdata * include letsencrypt_nginx/options-ssl.conf diff --git a/letsencrypt_apache/constants.py b/letsencrypt_apache/constants.py index b40e2ac65..bcc3a09bd 100644 --- a/letsencrypt_apache/constants.py +++ b/letsencrypt_apache/constants.py @@ -4,7 +4,7 @@ import pkg_resources CLI_DEFAULTS = dict( server_root="/etc/apache2", - mod_ssl_conf="/etc/letsencrypt/options-ssl.conf", + mod_ssl_conf="/etc/letsencrypt/options-ssl-apache.conf", ctl="apache2ctl", enmod="a2enmod", init_script="/etc/init.d/apache2", @@ -13,7 +13,7 @@ CLI_DEFAULTS = dict( MOD_SSL_CONF = pkg_resources.resource_filename( - "letsencrypt_apache", "options-ssl.conf") + "letsencrypt_apache", "options-ssl-apache.conf") """Path to the Apache mod_ssl config file found in the Let's Encrypt distribution.""" diff --git a/letsencrypt_apache/options-ssl.conf b/letsencrypt_apache/options-ssl-apache.conf similarity index 100% rename from letsencrypt_apache/options-ssl.conf rename to letsencrypt_apache/options-ssl-apache.conf