From d408ec5a95efec94fcd936baef4018febdd162e9 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sun, 10 May 2015 10:47:58 +0000 Subject: [PATCH] Move plugins to top-level --- MANIFEST.in | 8 +-- docs/api/client/plugins/apache.rst | 29 ---------- docs/api/client/plugins/nginx.rst | 35 ----------- docs/api/{client => }/plugins/common.rst | 0 docs/api/{client => }/plugins/disco.rst | 0 docs/api/{client => }/plugins/standalone.rst | 0 docs/index.rst | 2 + docs/letsencrypt_apache.rst | 29 ++++++++++ docs/letsencrypt_nginx.rst | 35 +++++++++++ letsencrypt/client/plugins/apache/__init__.py | 1 - letsencrypt/client/plugins/nginx/__init__.py | 1 - letsencrypt/client/tests/client_test.py | 3 +- letsencrypt/client/tests/revoker_test.py | 3 +- letsencrypt_apache/__init__.py | 1 + .../configurator.py | 58 ++++++++----------- .../constants.py | 2 +- .../apache => letsencrypt_apache}/dvsni.py | 2 +- .../apache => letsencrypt_apache}/obj.py | 0 .../options-ssl.conf | 0 .../apache => letsencrypt_apache}/parser.py | 0 .../tests/__init__.py | 0 .../tests/configurator_test.py | 25 ++++---- .../tests/dvsni_test.py | 20 +++---- .../tests/obj_test.py | 14 ++--- .../tests/parser_test.py | 21 ++++--- .../default_vhost/apache2/apache2.conf | 0 .../other-vhosts-access-log.conf | 0 .../apache2/conf-available/security.conf | 0 .../apache2/conf-available/serve-cgi-bin.conf | 0 .../conf-enabled/other-vhosts-access-log.conf | 0 .../apache2/conf-enabled/security.conf | 0 .../apache2/conf-enabled/serve-cgi-bin.conf | 0 .../default_vhost/apache2/envvars | 0 .../apache2/mods-available/ssl.conf | 0 .../apache2/mods-available/ssl.load | 0 .../default_vhost/apache2/ports.conf | 0 .../apache2/sites-available/000-default.conf | 0 .../apache2/sites-available/default-ssl.conf | 0 .../apache2/sites-enabled/000-default.conf | 0 .../debian_apache_2_4/default_vhost/sites | 0 .../two_vhost_80/apache2/apache2.conf | 0 .../other-vhosts-access-log.conf | 0 .../apache2/conf-available/security.conf | 0 .../apache2/conf-available/serve-cgi-bin.conf | 0 .../conf-enabled/other-vhosts-access-log.conf | 0 .../apache2/conf-enabled/security.conf | 0 .../apache2/conf-enabled/serve-cgi-bin.conf | 0 .../two_vhost_80/apache2/envvars | 0 .../apache2/mods-available/ssl.conf | 0 .../apache2/mods-available/ssl.load | 0 .../two_vhost_80/apache2/ports.conf | 0 .../apache2/sites-available/000-default.conf | 0 .../apache2/sites-available/default-ssl.conf | 0 .../sites-available/encryption-example.conf | 0 .../apache2/sites-available/letsencrypt.conf | 0 .../apache2/sites-enabled/000-default.conf | 0 .../sites-enabled/encryption-example.conf | 0 .../apache2/sites-enabled/letsencrypt.conf | 0 .../debian_apache_2_4/two_vhost_80/sites | 0 .../tests/util.py | 12 ++-- letsencrypt_nginx/__init__.py | 1 + .../configurator.py | 10 ++-- .../nginx => letsencrypt_nginx}/constants.py | 2 +- .../nginx => letsencrypt_nginx}/dvsni.py | 2 +- .../nginxparser.py | 0 .../nginx => letsencrypt_nginx}/obj.py | 2 +- .../options-ssl.conf | 0 .../nginx => letsencrypt_nginx}/parser.py | 14 ++--- .../tests/__init__.py | 0 .../tests/configurator_test.py | 19 +++--- .../tests/dvsni_test.py | 12 ++-- .../tests/nginxparser_test.py | 8 +-- .../tests/obj_test.py | 16 ++--- .../tests/parser_test.py | 11 ++-- .../tests/testdata/foo.conf | 0 .../tests/testdata/mime.types | 0 .../tests/testdata/nginx.conf | 0 .../tests/testdata/nginx.new.conf | 0 .../tests/testdata/server.conf | 0 .../tests/testdata/sites-enabled/default | 0 .../tests/testdata/sites-enabled/example.com | 0 .../default_vhost/nginx/fastcgi_params | 0 .../default_vhost/nginx/koi-utf | 0 .../default_vhost/nginx/koi-win | 0 .../default_vhost/nginx/mime.types | 0 .../default_vhost/nginx/naxsi-ui.conf.1.4.1 | 0 .../default_vhost/nginx/naxsi.rules | 0 .../default_vhost/nginx/naxsi_core.rules | 0 .../default_vhost/nginx/nginx.conf | 0 .../default_vhost/nginx/proxy_params | 0 .../default_vhost/nginx/scgi_params | 0 .../nginx/sites-available/default | 0 .../default_vhost/nginx/sites-enabled/default | 0 .../default_vhost/nginx/uwsgi_params | 0 .../default_vhost/nginx/win-utf | 0 .../nginx => letsencrypt_nginx}/tests/util.py | 8 +-- setup.cfg | 2 +- setup.py | 8 +-- tox.ini | 2 +- 99 files changed, 199 insertions(+), 219 deletions(-) delete mode 100644 docs/api/client/plugins/apache.rst delete mode 100644 docs/api/client/plugins/nginx.rst rename docs/api/{client => }/plugins/common.rst (100%) rename docs/api/{client => }/plugins/disco.rst (100%) rename docs/api/{client => }/plugins/standalone.rst (100%) create mode 100644 docs/letsencrypt_apache.rst create mode 100644 docs/letsencrypt_nginx.rst delete mode 100644 letsencrypt/client/plugins/apache/__init__.py delete mode 100644 letsencrypt/client/plugins/nginx/__init__.py create mode 100644 letsencrypt_apache/__init__.py rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/configurator.py (95%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/constants.py (90%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/dvsni.py (99%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/obj.py (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/options-ssl.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/parser.py (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/__init__.py (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/configurator_test.py (91%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/dvsni_test.py (91%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/obj_test.py (82%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/parser_test.py (83%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/envvars (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/default_vhost/sites (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/apache2.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/other-vhosts-access-log.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/security.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/serve-cgi-bin.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/other-vhosts-access-log.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/security.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/serve-cgi-bin.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/envvars (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.load (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/ports.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/000-default.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/default-ssl.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/encryption-example.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/letsencrypt.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/000-default.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/encryption-example.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/letsencrypt.conf (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/testdata/debian_apache_2_4/two_vhost_80/sites (100%) rename {letsencrypt/client/plugins/apache => letsencrypt_apache}/tests/util.py (91%) create mode 100644 letsencrypt_nginx/__init__.py rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/configurator.py (98%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/constants.py (84%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/dvsni.py (97%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/nginxparser.py (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/obj.py (98%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/options-ssl.conf (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/parser.py (97%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/__init__.py (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/configurator_test.py (94%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/dvsni_test.py (88%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/nginxparser_test.py (94%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/obj_test.py (87%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/parser_test.py (97%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/foo.conf (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/mime.types (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/nginx.conf (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/nginx.new.conf (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/server.conf (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/sites-enabled/default (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/sites-enabled/example.com (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf (100%) rename {letsencrypt/client/plugins/nginx => letsencrypt_nginx}/tests/util.py (90%) diff --git a/MANIFEST.in b/MANIFEST.in index 79c87e8f0..b628121e1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,8 +9,8 @@ recursive-include letsencrypt/client/tests/testdata * recursive-include acme/schemata *.json recursive-include acme/jose/testdata * -recursive-include letsencrypt/client/plugins/apache/tests/testdata * -include letsencrypt/client/plugins/apache/options-ssl.conf +recursive-include letsencrypt_apache/tests/testdata * +include letsencrypt_apache/options-ssl.conf -recursive-include letsencrypt/client/plugins/nginx/tests/testdata * -include letsencrypt/client/plugins/nginx/options-ssl.conf +recursive-include letsencrypt_nginx/tests/testdata * +include letsencrypt_nginx/options-ssl.conf diff --git a/docs/api/client/plugins/apache.rst b/docs/api/client/plugins/apache.rst deleted file mode 100644 index 6e6e6c462..000000000 --- a/docs/api/client/plugins/apache.rst +++ /dev/null @@ -1,29 +0,0 @@ -:mod:`letsencrypt.client.plugins.apache` ----------------------------------------- - -.. automodule:: letsencrypt.client.plugins.apache - :members: - -:mod:`letsencrypt.client.plugins.apache.configurator` -===================================================== - -.. automodule:: letsencrypt.client.plugins.apache.configurator - :members: - -:mod:`letsencrypt.client.plugins.apache.dvsni` -============================================== - -.. automodule:: letsencrypt.client.plugins.apache.dvsni - :members: - -:mod:`letsencrypt.client.plugins.apache.obj` -============================================ - -.. automodule:: letsencrypt.client.plugins.apache.obj - :members: - -:mod:`letsencrypt.client.plugins.apache.parser` -=============================================== - -.. automodule:: letsencrypt.client.plugins.apache.parser - :members: diff --git a/docs/api/client/plugins/nginx.rst b/docs/api/client/plugins/nginx.rst deleted file mode 100644 index cd64846bf..000000000 --- a/docs/api/client/plugins/nginx.rst +++ /dev/null @@ -1,35 +0,0 @@ -:mod:`letsencrypt.client.plugins.nginx` ----------------------------------------- - -.. automodule:: letsencrypt.client.plugins.nginx - :members: - -:mod:`letsencrypt.client.plugins.nginx.configurator` -===================================================== - -.. automodule:: letsencrypt.client.plugins.nginx.configurator - :members: - -:mod:`letsencrypt.client.plugins.nginx.dvsni` -============================================== - -.. automodule:: letsencrypt.client.plugins.nginx.dvsni - :members: - -:mod:`letsencrypt.client.plugins.nginx.obj` -============================================ - -.. automodule:: letsencrypt.client.plugins.nginx.obj - :members: - -:mod:`letsencrypt.client.plugins.nginx.parser` -=============================================== - -.. automodule:: letsencrypt.client.plugins.nginx.parser - :members: - -:mod:`letsencrypt.client.plugins.nginx.nginxparser` -==================================================== - -.. automodule:: letsencrypt.client.plugins.nginx.nginxparser - :members: diff --git a/docs/api/client/plugins/common.rst b/docs/api/plugins/common.rst similarity index 100% rename from docs/api/client/plugins/common.rst rename to docs/api/plugins/common.rst diff --git a/docs/api/client/plugins/disco.rst b/docs/api/plugins/disco.rst similarity index 100% rename from docs/api/client/plugins/disco.rst rename to docs/api/plugins/disco.rst diff --git a/docs/api/client/plugins/standalone.rst b/docs/api/plugins/standalone.rst similarity index 100% rename from docs/api/client/plugins/standalone.rst rename to docs/api/plugins/standalone.rst diff --git a/docs/index.rst b/docs/index.rst index 2edf74636..6bd5c06c9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,6 +9,8 @@ Welcome to the Let's Encrypt client documentation! contributing plugins acme + letsencrypt_apache + letsencrypt_nginx .. toctree:: :maxdepth: 1 diff --git a/docs/letsencrypt_apache.rst b/docs/letsencrypt_apache.rst new file mode 100644 index 000000000..44966cca6 --- /dev/null +++ b/docs/letsencrypt_apache.rst @@ -0,0 +1,29 @@ +:mod:`letsencrypt_apache` +------------------------- + +.. automodule:: letsencrypt_apache + :members: + +:mod:`letsencrypt_apache.configurator` +====================================== + +.. automodule:: letsencrypt_apache.configurator + :members: + +:mod:`letsencrypt_apache.dvsni` +=============================== + +.. automodule:: letsencrypt_apache.dvsni + :members: + +:mod:`letsencrypt_apache.obj` +============================= + +.. automodule:: letsencrypt_apache.obj + :members: + +:mod:`letsencrypt_apache.parser` +================================ + +.. automodule:: letsencrypt_apache.parser + :members: diff --git a/docs/letsencrypt_nginx.rst b/docs/letsencrypt_nginx.rst new file mode 100644 index 000000000..03114b685 --- /dev/null +++ b/docs/letsencrypt_nginx.rst @@ -0,0 +1,35 @@ +:mod:`letsencrypt_nginx` +------------------------ + +.. automodule:: letsencrypt_nginx + :members: + +:mod:`letsencrypt_nginx.configurator` +===================================== + +.. automodule:: letsencrypt_nginx.configurator + :members: + +:mod:`letsencrypt_nginx.dvsni` +============================== + +.. automodule:: letsencrypt_nginx.dvsni + :members: + +:mod:`letsencrypt_nginx.obj` +============================ + +.. automodule:: letsencrypt_nginx.obj + :members: + +:mod:`letsencrypt_nginx.parser` +=============================== + +.. automodule:: letsencrypt_nginx.parser + :members: + +:mod:`letsencrypt_nginx.nginxparser` +==================================== + +.. automodule:: letsencrypt_nginx.nginxparser + :members: diff --git a/letsencrypt/client/plugins/apache/__init__.py b/letsencrypt/client/plugins/apache/__init__.py deleted file mode 100644 index 70172b06d..000000000 --- a/letsencrypt/client/plugins/apache/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Let's Encrypt client.plugins.apache.""" diff --git a/letsencrypt/client/plugins/nginx/__init__.py b/letsencrypt/client/plugins/nginx/__init__.py deleted file mode 100644 index 63728924f..000000000 --- a/letsencrypt/client/plugins/nginx/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Let's Encrypt client.plugins.nginx.""" diff --git a/letsencrypt/client/tests/client_test.py b/letsencrypt/client/tests/client_test.py index 33530a083..52fc1be94 100644 --- a/letsencrypt/client/tests/client_test.py +++ b/letsencrypt/client/tests/client_test.py @@ -56,8 +56,7 @@ class DetermineAccountTest(unittest.TestCase): class RollbackTest(unittest.TestCase): """Test the rollback function.""" def setUp(self): - from letsencrypt.client.plugins.apache.configurator import ( - ApacheConfigurator) + from letsencrypt_apache.configurator import ApacheConfigurator self.m_install = mock.MagicMock(spec=ApacheConfigurator) @classmethod diff --git a/letsencrypt/client/tests/revoker_test.py b/letsencrypt/client/tests/revoker_test.py index 75510cc75..6810a1115 100644 --- a/letsencrypt/client/tests/revoker_test.py +++ b/letsencrypt/client/tests/revoker_test.py @@ -10,9 +10,10 @@ import mock from letsencrypt.client import errors from letsencrypt.client import le_util -from letsencrypt.client.plugins.apache import configurator from letsencrypt.client.display import util as display_util +from letsencrypt_apache import configurator + class RevokerBase(unittest.TestCase): # pylint: disable=too-few-public-methods """Base Class for Revoker Tests.""" diff --git a/letsencrypt_apache/__init__.py b/letsencrypt_apache/__init__.py new file mode 100644 index 000000000..c0d1e0d52 --- /dev/null +++ b/letsencrypt_apache/__init__.py @@ -0,0 +1 @@ +"""Let's Encrypt Apache plugin.""" diff --git a/letsencrypt/client/plugins/apache/configurator.py b/letsencrypt_apache/configurator.py similarity index 95% rename from letsencrypt/client/plugins/apache/configurator.py rename to letsencrypt_apache/configurator.py index 7006e7d2f..a7c7b68dc 100644 --- a/letsencrypt/client/plugins/apache/configurator.py +++ b/letsencrypt_apache/configurator.py @@ -18,10 +18,10 @@ from letsencrypt.client import errors from letsencrypt.client import interfaces from letsencrypt.client import le_util -from letsencrypt.client.plugins.apache import constants -from letsencrypt.client.plugins.apache import dvsni -from letsencrypt.client.plugins.apache import obj -from letsencrypt.client.plugins.apache import parser +from letsencrypt_apache import constants +from letsencrypt_apache import dvsni +from letsencrypt_apache import obj +from letsencrypt_apache import parser # TODO: Augeas sections ie. , beginning and closing @@ -69,12 +69,11 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): :type config: :class:`~letsencrypt.client.interfaces.IConfig` :ivar parser: Handles low level parsing - :type parser: :class:`~letsencrypt.client.plugins.apache.parser` + :type parser: :class:`~letsencrypt_apache.parser` :ivar tup version: version of Apache :ivar list vhosts: All vhosts found in the configuration - (:class:`list` of - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost`) + (:class:`list` of :class:`~letsencrypt_apache.obj.VirtualHost`) :ivar dict assoc: Mapping between domains and vhosts @@ -222,7 +221,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): :param str target_name: domain name :returns: ssl vhost associated with name - :rtype: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :rtype: :class:`~letsencrypt_apache.obj.VirtualHost` """ # Allows for domain names to be associated with a virtual host @@ -263,7 +262,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): :param str domain: domain name to associate :param vhost: virtual host to associate with domain - :type vhost: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type vhost: :class:`~letsencrypt_apache.obj.VirtualHost` """ self.assoc[domain] = vhost @@ -300,7 +299,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): """Helper function for get_virtual_hosts(). :param host: In progress vhost whose names will be added - :type host: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type host: :class:`~letsencrypt_apache.obj.VirtualHost` """ name_match = self.aug.match(("%s//*[self::directive=~regexp('%s')] | " @@ -321,7 +320,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): :param str path: Augeas path to virtual host :returns: newly created vhost - :rtype: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :rtype: :class:`~letsencrypt_apache.obj.VirtualHost` """ addrs = set() @@ -344,9 +343,8 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): def get_virtual_hosts(self): """Returns list of virtual hosts found in the Apache configuration. - :returns: List of - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` objects - found in configuration + :returns: List of :class:`~letsencrypt_apache.obj.VirtualHost` + objects found in configuration :rtype: list """ @@ -423,7 +421,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): """Checks to see if the server is ready for SNI challenges. :param vhost: VirtualHost to check SNI compatibility - :type vhost: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type vhost: :class:`~letsencrypt_apache.obj.VirtualHost` :param str default_addr: TODO - investigate function further @@ -455,11 +453,10 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): .. note:: This function saves the configuration :param nonssl_vhost: Valid VH that doesn't have SSLEngine on - :type nonssl_vhost: - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type nonssl_vhost: :class:`~letsencrypt_apache.obj.VirtualHost` :returns: SSL vhost - :rtype: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :rtype: :class:`~letsencrypt_apache.obj.VirtualHost` """ avail_fp = nonssl_vhost.filep @@ -579,15 +576,13 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): .. note:: This function saves the configuration :param ssl_vhost: Destination of traffic, an ssl enabled vhost - :type ssl_vhost: - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type ssl_vhost: :class:`~letsencrypt_apache.obj.VirtualHost` :param unused_options: Not currently used :type unused_options: Not Available :returns: Success, general_vhost (HTTP vhost) - :rtype: (bool, - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost`) + :rtype: (bool, :class:`~letsencrypt_apache.obj.VirtualHost`) """ if not mod_loaded("rewrite_module", self.conf('ctl')): @@ -638,7 +633,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): -1 is also returned in case of no redirection/rewrite directives :param vhost: vhost to check - :type vhost: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type vhost: :class:`~letsencrypt_apache.obj.VirtualHost` :returns: Success, code value... see documentation :rtype: bool, int @@ -670,12 +665,10 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): """Creates an http_vhost specifically to redirect for the ssl_vhost. :param ssl_vhost: ssl vhost - :type ssl_vhost: - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type ssl_vhost: :class:`~letsencrypt_apache.obj.VirtualHost` :returns: tuple of the form - (`success`, - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost`) + (`success`, :class:`~letsencrypt_apache.obj.VirtualHost`) :rtype: tuple """ @@ -758,8 +751,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): if not conflict: returns space separated list of new host addrs :param ssl_vhost: SSL Vhost to check for possible port 80 redirection - :type ssl_vhost: - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type ssl_vhost: :class:`~letsencrypt_apache.obj.VirtualHost` :returns: TODO :rtype: TODO @@ -792,12 +784,10 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): Consider changing this into a dict check :param ssl_vhost: ssl vhost to check - :type ssl_vhost: - :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type ssl_vhost: :class:`~letsencrypt_apache.obj.VirtualHost` :returns: HTTP vhost or None if unsuccessful - :rtype: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` - or None + :rtype: :class:`~letsencrypt_apache.obj.VirtualHost` or ``None`` """ # _default_:443 check @@ -887,7 +877,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): .. todo:: Make sure link is not broken... :param vhost: vhost to enable - :type vhost: :class:`~letsencrypt.client.plugins.apache.obj.VirtualHost` + :type vhost: :class:`~letsencrypt_apache.obj.VirtualHost` :returns: Success :rtype: bool diff --git a/letsencrypt/client/plugins/apache/constants.py b/letsencrypt_apache/constants.py similarity index 90% rename from letsencrypt/client/plugins/apache/constants.py rename to letsencrypt_apache/constants.py index d9f2a0b9d..b40e2ac65 100644 --- a/letsencrypt/client/plugins/apache/constants.py +++ b/letsencrypt_apache/constants.py @@ -13,7 +13,7 @@ CLI_DEFAULTS = dict( MOD_SSL_CONF = pkg_resources.resource_filename( - "letsencrypt.client.plugins.apache", "options-ssl.conf") + "letsencrypt_apache", "options-ssl.conf") """Path to the Apache mod_ssl config file found in the Let's Encrypt distribution.""" diff --git a/letsencrypt/client/plugins/apache/dvsni.py b/letsencrypt_apache/dvsni.py similarity index 99% rename from letsencrypt/client/plugins/apache/dvsni.py rename to letsencrypt_apache/dvsni.py index 7755658e7..790c4e025 100644 --- a/letsencrypt/client/plugins/apache/dvsni.py +++ b/letsencrypt_apache/dvsni.py @@ -2,7 +2,7 @@ import logging import os -from letsencrypt.client.plugins.apache import parser +from letsencrypt_apache import parser class ApacheDvsni(object): diff --git a/letsencrypt/client/plugins/apache/obj.py b/letsencrypt_apache/obj.py similarity index 100% rename from letsencrypt/client/plugins/apache/obj.py rename to letsencrypt_apache/obj.py diff --git a/letsencrypt/client/plugins/apache/options-ssl.conf b/letsencrypt_apache/options-ssl.conf similarity index 100% rename from letsencrypt/client/plugins/apache/options-ssl.conf rename to letsencrypt_apache/options-ssl.conf diff --git a/letsencrypt/client/plugins/apache/parser.py b/letsencrypt_apache/parser.py similarity index 100% rename from letsencrypt/client/plugins/apache/parser.py rename to letsencrypt_apache/parser.py diff --git a/letsencrypt/client/plugins/apache/tests/__init__.py b/letsencrypt_apache/tests/__init__.py similarity index 100% rename from letsencrypt/client/plugins/apache/tests/__init__.py rename to letsencrypt_apache/tests/__init__.py diff --git a/letsencrypt/client/plugins/apache/tests/configurator_test.py b/letsencrypt_apache/tests/configurator_test.py similarity index 91% rename from letsencrypt/client/plugins/apache/tests/configurator_test.py rename to letsencrypt_apache/tests/configurator_test.py index b4881d63b..d7e6b95cf 100644 --- a/letsencrypt/client/plugins/apache/tests/configurator_test.py +++ b/letsencrypt_apache/tests/configurator_test.py @@ -1,4 +1,4 @@ -"""Test for letsencrypt.client.plugins.apache.configurator.""" +"""Test for letsencrypt_apache.configurator.""" import os import re import shutil @@ -12,14 +12,14 @@ from letsencrypt.client import achallenges from letsencrypt.client import errors from letsencrypt.client import le_util -from letsencrypt.client.plugins.apache import configurator -from letsencrypt.client.plugins.apache import obj -from letsencrypt.client.plugins.apache import parser - -from letsencrypt.client.plugins.apache.tests import util - from letsencrypt.client.tests import acme_util +from letsencrypt_apache import configurator +from letsencrypt_apache import obj +from letsencrypt_apache import parser + +from letsencrypt_apache.tests import util + class TwoVhost80Test(util.ApacheTest): """Test two standard well configured HTTP vhosts.""" @@ -27,7 +27,7 @@ class TwoVhost80Test(util.ApacheTest): def setUp(self): super(TwoVhost80Test, self).setUp() - with mock.patch("letsencrypt.client.plugins.apache.configurator." + with mock.patch("letsencrypt_apache.configurator." "mod_loaded") as mock_load: mock_load.return_value = True self.config = util.get_apache_configurator( @@ -150,10 +150,8 @@ class TwoVhost80Test(util.ApacheTest): self.assertEqual(len(self.config.vhosts), 5) - @mock.patch("letsencrypt.client.plugins.apache.configurator." - "dvsni.ApacheDvsni.perform") - @mock.patch("letsencrypt.client.plugins.apache.configurator." - "ApacheConfigurator.restart") + @mock.patch("letsencrypt_apache.configurator.dvsni.ApacheDvsni.perform") + @mock.patch("letsencrypt_apache.configurator.ApacheConfigurator.restart") def test_perform(self, mock_restart, mock_dvsni_perform): # Only tests functionality specific to configurator.perform # Note: As more challenges are offered this will have to be expanded @@ -186,8 +184,7 @@ class TwoVhost80Test(util.ApacheTest): self.assertEqual(mock_restart.call_count, 1) - @mock.patch("letsencrypt.client.plugins.apache.configurator." - "subprocess.Popen") + @mock.patch("letsencrypt_apache.configurator.subprocess.Popen") def test_get_version(self, mock_popen): mock_popen().communicate.return_value = ( "Server Version: Apache/2.4.2 (Debian)", "") diff --git a/letsencrypt/client/plugins/apache/tests/dvsni_test.py b/letsencrypt_apache/tests/dvsni_test.py similarity index 91% rename from letsencrypt/client/plugins/apache/tests/dvsni_test.py rename to letsencrypt_apache/tests/dvsni_test.py index 9694ce69b..323bf8c31 100644 --- a/letsencrypt/client/plugins/apache/tests/dvsni_test.py +++ b/letsencrypt_apache/tests/dvsni_test.py @@ -1,4 +1,4 @@ -"""Test for letsencrypt.client.plugins.apache.dvsni.""" +"""Test for letsencrypt_apache.dvsni.""" import pkg_resources import unittest import shutil @@ -10,12 +10,11 @@ from acme import challenges from letsencrypt.client import achallenges from letsencrypt.client import le_util -from letsencrypt.client.plugins.apache.obj import Addr - -from letsencrypt.client.plugins.apache.tests import util - from letsencrypt.client.tests import acme_util +from letsencrypt_apache import obj +from letsencrypt_apache.tests import util + class DvsniPerformTest(util.ApacheTest): """Test the ApacheDVSNI challenge.""" @@ -23,14 +22,14 @@ class DvsniPerformTest(util.ApacheTest): def setUp(self): super(DvsniPerformTest, self).setUp() - with mock.patch("letsencrypt.client.plugins.apache.configurator." + with mock.patch("letsencrypt_apache.configurator." "mod_loaded") as mock_load: mock_load.return_value = True config = util.get_apache_configurator( self.config_path, self.config_dir, self.work_dir, self.ssl_options) - from letsencrypt.client.plugins.apache import dvsni + from letsencrypt_apache import dvsni self.sni = dvsni.ApacheDvsni(config) rsa256_file = pkg_resources.resource_filename( @@ -80,8 +79,7 @@ class DvsniPerformTest(util.ApacheTest): nonce_domain=self.achalls[0].nonce_domain) achall.gen_cert_and_response.return_value = ("pem", response) - with mock.patch("letsencrypt.client.plugins.apache.dvsni.open", - m_open, create=True): + with mock.patch("letsencrypt_apache.dvsni.open", m_open, create=True): # pylint: disable=protected-access self.assertEqual(response, self.sni._setup_challenge_cert( achall, "randomS1")) @@ -142,8 +140,8 @@ class DvsniPerformTest(util.ApacheTest): def test_mod_config(self): for achall in self.achalls: self.sni.add_chall(achall) - v_addr1 = [Addr(("1.2.3.4", "443")), Addr(("5.6.7.8", "443"))] - v_addr2 = [Addr(("127.0.0.1", "443"))] + v_addr1 = [obj.Addr(("1.2.3.4", "443")), obj.Addr(("5.6.7.8", "443"))] + v_addr2 = [obj.Addr(("127.0.0.1", "443"))] ll_addr = [] ll_addr.append(v_addr1) ll_addr.append(v_addr2) diff --git a/letsencrypt/client/plugins/apache/tests/obj_test.py b/letsencrypt_apache/tests/obj_test.py similarity index 82% rename from letsencrypt/client/plugins/apache/tests/obj_test.py rename to letsencrypt_apache/tests/obj_test.py index b0c65eadb..5ad683fae 100644 --- a/letsencrypt/client/plugins/apache/tests/obj_test.py +++ b/letsencrypt_apache/tests/obj_test.py @@ -1,11 +1,11 @@ -"""Test the helper objects in letsencrypt.client.plugins.apache.obj.""" +"""Test the helper objects in letsencrypt_apache.obj.""" import unittest class AddrTest(unittest.TestCase): """Test the Addr class.""" def setUp(self): - from letsencrypt.client.plugins.apache.obj import Addr + from letsencrypt_apache.obj import Addr self.addr1 = Addr.fromstring("192.168.1.1") self.addr2 = Addr.fromstring("192.168.1.1:*") self.addr3 = Addr.fromstring("192.168.1.1:80") @@ -34,7 +34,7 @@ class AddrTest(unittest.TestCase): self.assertFalse(self.addr1 == 3333) def test_set_inclusion(self): - from letsencrypt.client.plugins.apache.obj import Addr + from letsencrypt_apache.obj import Addr set_a = set([self.addr1, self.addr2]) addr1b = Addr.fromstring("192.168.1.1") addr2b = Addr.fromstring("192.168.1.1:*") @@ -46,15 +46,15 @@ class AddrTest(unittest.TestCase): class VirtualHostTest(unittest.TestCase): """Test the VirtualHost class.""" def setUp(self): - from letsencrypt.client.plugins.apache.obj import VirtualHost - from letsencrypt.client.plugins.apache.obj import Addr + from letsencrypt_apache.obj import VirtualHost + from letsencrypt_apache.obj import Addr self.vhost1 = VirtualHost( "filep", "vh_path", set([Addr.fromstring("localhost")]), False, False) def test_eq(self): - from letsencrypt.client.plugins.apache.obj import Addr - from letsencrypt.client.plugins.apache.obj import VirtualHost + from letsencrypt_apache.obj import Addr + from letsencrypt_apache.obj import VirtualHost vhost1b = VirtualHost( "filep", "vh_path", set([Addr.fromstring("localhost")]), False, False) diff --git a/letsencrypt/client/plugins/apache/tests/parser_test.py b/letsencrypt_apache/tests/parser_test.py similarity index 83% rename from letsencrypt/client/plugins/apache/tests/parser_test.py rename to letsencrypt_apache/tests/parser_test.py index 1696841f8..b8fbb5dea 100644 --- a/letsencrypt/client/plugins/apache/tests/parser_test.py +++ b/letsencrypt_apache/tests/parser_test.py @@ -1,4 +1,4 @@ -"""Tests for letsencrypt.client.plugins.apache.parser.""" +"""Tests for letsencrypt_apache.parser.""" import os import shutil import sys @@ -11,7 +11,7 @@ import zope.component from letsencrypt.client import errors from letsencrypt.client.display import util as display_util -from letsencrypt.client.plugins.apache.tests import util +from letsencrypt_apache.tests import util class ApacheParserTest(util.ApacheTest): @@ -22,7 +22,7 @@ class ApacheParserTest(util.ApacheTest): zope.component.provideUtility(display_util.FileDisplay(sys.stdout)) - from letsencrypt.client.plugins.apache.parser import ApacheParser + from letsencrypt_apache.parser import ApacheParser self.aug = augeas.Augeas(flags=augeas.Augeas.NONE) self.parser = ApacheParser(self.aug, self.config_path, self.ssl_options) @@ -32,19 +32,19 @@ class ApacheParserTest(util.ApacheTest): shutil.rmtree(self.work_dir) def test_root_normalized(self): - from letsencrypt.client.plugins.apache.parser import ApacheParser + from letsencrypt_apache.parser import ApacheParser path = os.path.join(self.temp_dir, "debian_apache_2_4/////" "two_vhost_80/../two_vhost_80/apache2") parser = ApacheParser(self.aug, path, None) self.assertEqual(parser.root, self.config_path) def test_root_absolute(self): - from letsencrypt.client.plugins.apache.parser import ApacheParser + from letsencrypt_apache.parser import ApacheParser parser = ApacheParser(self.aug, os.path.relpath(self.config_path), None) self.assertEqual(parser.root, self.config_path) def test_root_no_trailing_slash(self): - from letsencrypt.client.plugins.apache.parser import ApacheParser + from letsencrypt_apache.parser import ApacheParser parser = ApacheParser(self.aug, self.config_path + os.path.sep, None) self.assertEqual(parser.root, self.config_path) @@ -67,7 +67,7 @@ class ApacheParserTest(util.ApacheTest): self.assertTrue(matches) def test_find_dir(self): - from letsencrypt.client.plugins.apache.parser import case_i + from letsencrypt_apache.parser import case_i test = self.parser.find_dir(case_i("Listen"), "443") # This will only look in enabled hosts test2 = self.parser.find_dir(case_i("documentroot")) @@ -92,7 +92,7 @@ class ApacheParserTest(util.ApacheTest): Path must be valid before attempting to add to augeas """ - from letsencrypt.client.plugins.apache.parser import get_aug_path + from letsencrypt_apache.parser import get_aug_path self.parser.add_dir_to_ifmodssl( get_aug_path(self.parser.loc["default"]), "FakeDirective", "123") @@ -103,12 +103,11 @@ class ApacheParserTest(util.ApacheTest): self.assertTrue("IfModule" in matches[0]) def test_get_aug_path(self): - from letsencrypt.client.plugins.apache.parser import get_aug_path + from letsencrypt_apache.parser import get_aug_path self.assertEqual("/files/etc/apache", get_aug_path("/etc/apache")) def test_set_locations(self): - with mock.patch("letsencrypt.client.plugins.apache.parser." - "os.path") as mock_path: + with mock.patch("letsencrypt_apache.parser.os.path") as mock_path: mock_path.isfile.return_value = False diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/apache2.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/other-vhosts-access-log.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/security.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-available/serve-cgi-bin.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/other-vhosts-access-log.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/security.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/conf-enabled/serve-cgi-bin.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/envvars b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/envvars similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/envvars rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/envvars diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/mods-available/ssl.load diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/ports.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/000-default.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-available/default-ssl.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/apache2/sites-enabled/000-default.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/sites b/letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/sites similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/default_vhost/sites rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/default_vhost/sites diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/apache2.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/apache2.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/apache2.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/apache2.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/other-vhosts-access-log.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/other-vhosts-access-log.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/other-vhosts-access-log.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/other-vhosts-access-log.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/security.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/security.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/security.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/security.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/serve-cgi-bin.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/serve-cgi-bin.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/serve-cgi-bin.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-available/serve-cgi-bin.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/other-vhosts-access-log.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/other-vhosts-access-log.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/other-vhosts-access-log.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/other-vhosts-access-log.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/security.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/security.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/security.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/security.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/serve-cgi-bin.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/serve-cgi-bin.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/serve-cgi-bin.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/conf-enabled/serve-cgi-bin.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/envvars b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/envvars similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/envvars rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/envvars diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.load b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.load similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.load rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/mods-available/ssl.load diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/ports.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/ports.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/ports.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/ports.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/000-default.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/000-default.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/000-default.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/000-default.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/default-ssl.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/default-ssl.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/default-ssl.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/default-ssl.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/encryption-example.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/encryption-example.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/encryption-example.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/encryption-example.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/letsencrypt.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/letsencrypt.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/letsencrypt.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-available/letsencrypt.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/000-default.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/000-default.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/000-default.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/000-default.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/encryption-example.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/encryption-example.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/encryption-example.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/encryption-example.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/letsencrypt.conf b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/letsencrypt.conf similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/letsencrypt.conf rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/apache2/sites-enabled/letsencrypt.conf diff --git a/letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/sites b/letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/sites similarity index 100% rename from letsencrypt/client/plugins/apache/tests/testdata/debian_apache_2_4/two_vhost_80/sites rename to letsencrypt_apache/tests/testdata/debian_apache_2_4/two_vhost_80/sites diff --git a/letsencrypt/client/plugins/apache/tests/util.py b/letsencrypt_apache/tests/util.py similarity index 91% rename from letsencrypt/client/plugins/apache/tests/util.py rename to letsencrypt_apache/tests/util.py index 98c06af40..12e3a5140 100644 --- a/letsencrypt/client/plugins/apache/tests/util.py +++ b/letsencrypt_apache/tests/util.py @@ -1,4 +1,4 @@ -"""Common utilities for letsencrypt.client.plugins.apache.""" +"""Common utilities for letsencrypt_apache.""" import os import pkg_resources import shutil @@ -7,9 +7,9 @@ import unittest import mock -from letsencrypt.client.plugins.apache import configurator -from letsencrypt.client.plugins.apache import constants -from letsencrypt.client.plugins.apache import obj +from letsencrypt_apache import configurator +from letsencrypt_apache import constants +from letsencrypt_apache import obj class ApacheTest(unittest.TestCase): # pylint: disable=too-few-public-methods @@ -38,7 +38,7 @@ def dir_setup(test_dir="debian_apache_2_4/two_vhost_80"): work_dir = tempfile.mkdtemp("work") test_configs = pkg_resources.resource_filename( - "letsencrypt.client.plugins.apache.tests", "testdata/%s" % test_dir) + "letsencrypt_apache.tests", "testdata/%s" % test_dir) shutil.copytree( test_configs, os.path.join(temp_dir, test_dir), symlinks=True) @@ -59,7 +59,7 @@ def get_apache_configurator( backups = os.path.join(work_dir, "backups") - with mock.patch("letsencrypt.client.plugins.apache.configurator." + with mock.patch("letsencrypt_apache.configurator." "subprocess.Popen") as mock_popen: # This just states that the ssl module is already loaded mock_popen().communicate.return_value = ("ssl_module", "") diff --git a/letsencrypt_nginx/__init__.py b/letsencrypt_nginx/__init__.py new file mode 100644 index 000000000..34db9673d --- /dev/null +++ b/letsencrypt_nginx/__init__.py @@ -0,0 +1 @@ +"""Let's Encrypt nginx plugin.""" diff --git a/letsencrypt/client/plugins/nginx/configurator.py b/letsencrypt_nginx/configurator.py similarity index 98% rename from letsencrypt/client/plugins/nginx/configurator.py rename to letsencrypt_nginx/configurator.py index f7e64ebdb..e1d3bd367 100644 --- a/letsencrypt/client/plugins/nginx/configurator.py +++ b/letsencrypt_nginx/configurator.py @@ -20,9 +20,9 @@ from letsencrypt.client import reverter from letsencrypt.client.plugins import common -from letsencrypt.client.plugins.nginx import constants -from letsencrypt.client.plugins.nginx import dvsni -from letsencrypt.client.plugins.nginx import parser +from letsencrypt_nginx import constants +from letsencrypt_nginx import dvsni +from letsencrypt_nginx import parser class NginxConfigurator(common.Plugin): @@ -38,7 +38,7 @@ class NginxConfigurator(common.Plugin): :type config: :class:`~letsencrypt.client.interfaces.IConfig` :ivar parser: Handles low level parsing - :type parser: :class:`~letsencrypt.client.plugins.nginx.parser` + :type parser: :class:`~letsencrypt_nginx.parser` :ivar str save_notes: Human-readable config change notes @@ -166,7 +166,7 @@ class NginxConfigurator(common.Plugin): :param str target_name: domain name :returns: ssl vhost associated with name - :rtype: :class:`~letsencrypt.client.plugins.nginx.obj.VirtualHost` + :rtype: :class:`~letsencrypt_nginx.obj.VirtualHost` """ vhost = None diff --git a/letsencrypt/client/plugins/nginx/constants.py b/letsencrypt_nginx/constants.py similarity index 84% rename from letsencrypt/client/plugins/nginx/constants.py rename to letsencrypt_nginx/constants.py index 17d05f438..6c15b1664 100644 --- a/letsencrypt/client/plugins/nginx/constants.py +++ b/letsencrypt_nginx/constants.py @@ -11,6 +11,6 @@ CLI_DEFAULTS = dict( MOD_SSL_CONF = pkg_resources.resource_filename( - "letsencrypt.client.plugins.nginx", "options-ssl.conf") + "letsencrypt_nginx", "options-ssl.conf") """Path to the Nginx mod_ssl config file found in the Let's Encrypt distribution.""" diff --git a/letsencrypt/client/plugins/nginx/dvsni.py b/letsencrypt_nginx/dvsni.py similarity index 97% rename from letsencrypt/client/plugins/nginx/dvsni.py rename to letsencrypt_nginx/dvsni.py index 7233d7c62..c845db916 100644 --- a/letsencrypt/client/plugins/nginx/dvsni.py +++ b/letsencrypt_nginx/dvsni.py @@ -1,7 +1,7 @@ """NginxDVSNI""" import logging -from letsencrypt.client.plugins.apache.dvsni import ApacheDvsni +from letsencrypt_apache.dvsni import ApacheDvsni class NginxDvsni(ApacheDvsni): diff --git a/letsencrypt/client/plugins/nginx/nginxparser.py b/letsencrypt_nginx/nginxparser.py similarity index 100% rename from letsencrypt/client/plugins/nginx/nginxparser.py rename to letsencrypt_nginx/nginxparser.py diff --git a/letsencrypt/client/plugins/nginx/obj.py b/letsencrypt_nginx/obj.py similarity index 98% rename from letsencrypt/client/plugins/nginx/obj.py rename to letsencrypt_nginx/obj.py index acaacb3b0..3b3482beb 100644 --- a/letsencrypt/client/plugins/nginx/obj.py +++ b/letsencrypt_nginx/obj.py @@ -1,7 +1,7 @@ """Module contains classes used by the Nginx Configurator.""" import re -from letsencrypt.client.plugins.apache.obj import Addr as ApacheAddr +from letsencrypt_apache.obj import Addr as ApacheAddr class Addr(ApacheAddr): diff --git a/letsencrypt/client/plugins/nginx/options-ssl.conf b/letsencrypt_nginx/options-ssl.conf similarity index 100% rename from letsencrypt/client/plugins/nginx/options-ssl.conf rename to letsencrypt_nginx/options-ssl.conf diff --git a/letsencrypt/client/plugins/nginx/parser.py b/letsencrypt_nginx/parser.py similarity index 97% rename from letsencrypt/client/plugins/nginx/parser.py rename to letsencrypt_nginx/parser.py index 55a0b01e8..7e11fe0c3 100644 --- a/letsencrypt/client/plugins/nginx/parser.py +++ b/letsencrypt_nginx/parser.py @@ -6,8 +6,9 @@ import pyparsing import re from letsencrypt.client import errors -from letsencrypt.client.plugins.nginx import obj -from letsencrypt.client.plugins.nginx.nginxparser import dump, load + +from letsencrypt_nginx import obj +from letsencrypt_nginx import nginxparser class NginxParser(object): @@ -85,9 +86,8 @@ class NginxParser(object): Technically this is a misnomer because Nginx does not have virtual hosts, it has 'server blocks'. - :returns: List of - :class:`~letsencrypt.client.plugins.nginx.obj.VirtualHost` objects - found in configuration + :returns: List of :class:`~letsencrypt_nginx.obj.VirtualHost` + objects found in configuration :rtype: list """ @@ -159,7 +159,7 @@ class NginxParser(object): continue try: with open(item) as _file: - parsed = load(_file) + parsed = nginxparser.load(_file) self.parsed[item] = parsed trees.append(parsed) except IOError: @@ -213,7 +213,7 @@ class NginxParser(object): filename = filename + os.path.extsep + ext try: with open(filename, 'w') as _file: - dump(tree, _file) + nginxparser.dump(tree, _file) except IOError: logging.error("Could not open file for writing: %s", filename) diff --git a/letsencrypt/client/plugins/nginx/tests/__init__.py b/letsencrypt_nginx/tests/__init__.py similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/__init__.py rename to letsencrypt_nginx/tests/__init__.py diff --git a/letsencrypt/client/plugins/nginx/tests/configurator_test.py b/letsencrypt_nginx/tests/configurator_test.py similarity index 94% rename from letsencrypt/client/plugins/nginx/tests/configurator_test.py rename to letsencrypt_nginx/tests/configurator_test.py index 7be3177e3..12101949f 100644 --- a/letsencrypt/client/plugins/nginx/tests/configurator_test.py +++ b/letsencrypt_nginx/tests/configurator_test.py @@ -1,4 +1,4 @@ -"""Test for letsencrypt.client.plugins.nginx.configurator.""" +"""Test for letsencrypt_nginx.configurator.""" import shutil import unittest @@ -11,7 +11,7 @@ from letsencrypt.client import achallenges from letsencrypt.client import errors from letsencrypt.client import le_util -from letsencrypt.client.plugins.nginx.tests import util +from letsencrypt_nginx.tests import util class NginxConfiguratorTest(util.NginxTest): @@ -158,10 +158,8 @@ class NginxConfiguratorTest(util.NginxTest): ('/etc/nginx/cert.pem', '/etc/nginx/key.pem', nginx_conf), ]), self.config.get_all_certs_keys()) - @mock.patch("letsencrypt.client.plugins.nginx.configurator." - "dvsni.NginxDvsni.perform") - @mock.patch("letsencrypt.client.plugins.nginx.configurator." - "NginxConfigurator.restart") + @mock.patch("letsencrypt_nginx.configurator.dvsni.NginxDvsni.perform") + @mock.patch("letsencrypt_nginx.configurator.NginxConfigurator.restart") def test_perform(self, mock_restart, mock_dvsni_perform): # Only tests functionality specific to configurator.perform # Note: As more challenges are offered this will have to be expanded @@ -195,8 +193,7 @@ class NginxConfiguratorTest(util.NginxTest): self.assertEqual(responses, dvsni_ret_val) self.assertEqual(mock_restart.call_count, 1) - @mock.patch("letsencrypt.client.plugins.nginx.configurator." - "subprocess.Popen") + @mock.patch("letsencrypt_nginx.configurator.subprocess.Popen") def test_get_version(self, mock_popen): mock_popen().communicate.return_value = ( "", "\n".join(["nginx version: nginx/1.4.2", @@ -251,16 +248,14 @@ class NginxConfiguratorTest(util.NginxTest): self.assertRaises( errors.LetsEncryptConfiguratorError, self.config.get_version) - @mock.patch("letsencrypt.client.plugins.nginx.configurator." - "subprocess.Popen") + @mock.patch("letsencrypt_nginx.configurator.subprocess.Popen") def test_nginx_restart(self, mock_popen): mocked = mock_popen() mocked.communicate.return_value = ('', '') mocked.returncode = 0 self.assertTrue(self.config.restart()) - @mock.patch("letsencrypt.client.plugins.nginx.configurator." - "subprocess.Popen") + @mock.patch("letsencrypt_nginx.configurator.subprocess.Popen") def test_config_test(self, mock_popen): mocked = mock_popen() mocked.communicate.return_value = ('', '') diff --git a/letsencrypt/client/plugins/nginx/tests/dvsni_test.py b/letsencrypt_nginx/tests/dvsni_test.py similarity index 88% rename from letsencrypt/client/plugins/nginx/tests/dvsni_test.py rename to letsencrypt_nginx/tests/dvsni_test.py index 24e32bafe..94708e282 100644 --- a/letsencrypt/client/plugins/nginx/tests/dvsni_test.py +++ b/letsencrypt_nginx/tests/dvsni_test.py @@ -1,4 +1,4 @@ -"""Test for letsencrypt.client.plugins.nginx.dvsni.""" +"""Test for letsencrypt_nginx.dvsni.""" import pkg_resources import unittest import shutil @@ -11,7 +11,7 @@ from acme import messages2 from letsencrypt.client import achallenges from letsencrypt.client import le_util -from letsencrypt.client.plugins.nginx.tests import util +from letsencrypt_nginx.tests import util class DvsniPerformTest(util.NginxTest): @@ -31,7 +31,7 @@ class DvsniPerformTest(util.NginxTest): auth_key = le_util.Key(rsa256_file, rsa256_pem) - from letsencrypt.client.plugins.nginx import dvsni + from letsencrypt_nginx import dvsni self.sni = dvsni.NginxDvsni(config) self.achalls = [ @@ -67,8 +67,7 @@ class DvsniPerformTest(util.NginxTest): self.assertEqual(1, len(self.sni.achalls)) self.assertEqual([0], self.sni.indices) - @mock.patch("letsencrypt.client.plugins.nginx.configurator." - "NginxConfigurator.save") + @mock.patch("letsencrypt_nginx.configurator.NginxConfigurator.save") def test_perform0(self, mock_save): self.sni.add_chall(self.achalls[0]) responses = self.sni.perform() @@ -82,8 +81,7 @@ class DvsniPerformTest(util.NginxTest): # http://www.voidspace.org.uk/python/mock/helpers.html#mock.mock_open pass - @mock.patch("letsencrypt.client.plugins.nginx.configurator." - "NginxConfigurator.save") + @mock.patch("letsencrypt_nginx.configurator.NginxConfigurator.save") def test_perform1(self, mock_save): self.sni.add_chall(self.achalls[1]) responses = self.sni.perform() diff --git a/letsencrypt/client/plugins/nginx/tests/nginxparser_test.py b/letsencrypt_nginx/tests/nginxparser_test.py similarity index 94% rename from letsencrypt/client/plugins/nginx/tests/nginxparser_test.py rename to letsencrypt_nginx/tests/nginxparser_test.py index 2e19e71d1..e60dc9468 100644 --- a/letsencrypt/client/plugins/nginx/tests/nginxparser_test.py +++ b/letsencrypt_nginx/tests/nginxparser_test.py @@ -1,10 +1,10 @@ -"""Test for letsencrypt.client.plugins.nginx.nginxparser.""" +"""Test for letsencrypt_nginx.nginxparser.""" import operator import unittest -from letsencrypt.client.plugins.nginx.nginxparser import (RawNginxParser, - load, dumps, dump) -from letsencrypt.client.plugins.nginx.tests import util +from letsencrypt_nginx.nginxparser import ( + RawNginxParser, load, dumps, dump) +from letsencrypt_nginx.tests import util FIRST = operator.itemgetter(0) diff --git a/letsencrypt/client/plugins/nginx/tests/obj_test.py b/letsencrypt_nginx/tests/obj_test.py similarity index 87% rename from letsencrypt/client/plugins/nginx/tests/obj_test.py rename to letsencrypt_nginx/tests/obj_test.py index d5591c763..bad007973 100644 --- a/letsencrypt/client/plugins/nginx/tests/obj_test.py +++ b/letsencrypt_nginx/tests/obj_test.py @@ -1,11 +1,11 @@ -"""Test the helper objects in letsencrypt.client.plugins.nginx.obj.""" +"""Test the helper objects in letsencrypt_nginx.obj.""" import unittest class AddrTest(unittest.TestCase): """Test the Addr class.""" def setUp(self): - from letsencrypt.client.plugins.nginx.obj import Addr + from letsencrypt_nginx.obj import Addr self.addr1 = Addr.fromstring("192.168.1.1") self.addr2 = Addr.fromstring("192.168.1.1:* ssl") self.addr3 = Addr.fromstring("192.168.1.1:80") @@ -56,14 +56,14 @@ class AddrTest(unittest.TestCase): self.assertEqual(str(self.addr6), "80") def test_eq(self): - from letsencrypt.client.plugins.nginx.obj import Addr + from letsencrypt_nginx.obj import Addr new_addr1 = Addr.fromstring("192.168.1.1 spdy") self.assertEqual(self.addr1, new_addr1) self.assertNotEqual(self.addr1, self.addr2) self.assertFalse(self.addr1 == 3333) def test_set_inclusion(self): - from letsencrypt.client.plugins.nginx.obj import Addr + from letsencrypt_nginx.obj import Addr set_a = set([self.addr1, self.addr2]) addr1b = Addr.fromstring("192.168.1.1") addr2b = Addr.fromstring("192.168.1.1:* ssl") @@ -75,16 +75,16 @@ class AddrTest(unittest.TestCase): class VirtualHostTest(unittest.TestCase): """Test the VirtualHost class.""" def setUp(self): - from letsencrypt.client.plugins.nginx.obj import VirtualHost - from letsencrypt.client.plugins.nginx.obj import Addr + from letsencrypt_nginx.obj import VirtualHost + from letsencrypt_nginx.obj import Addr self.vhost1 = VirtualHost( "filep", set([Addr.fromstring("localhost")]), False, False, set(['localhost']), []) def test_eq(self): - from letsencrypt.client.plugins.nginx.obj import Addr - from letsencrypt.client.plugins.nginx.obj import VirtualHost + from letsencrypt_nginx.obj import Addr + from letsencrypt_nginx.obj import VirtualHost vhost1b = VirtualHost( "filep", set([Addr.fromstring("localhost blah")]), False, False, diff --git a/letsencrypt/client/plugins/nginx/tests/parser_test.py b/letsencrypt_nginx/tests/parser_test.py similarity index 97% rename from letsencrypt/client/plugins/nginx/tests/parser_test.py rename to letsencrypt_nginx/tests/parser_test.py index 21e96aa26..47b44e671 100644 --- a/letsencrypt/client/plugins/nginx/tests/parser_test.py +++ b/letsencrypt_nginx/tests/parser_test.py @@ -1,4 +1,4 @@ -"""Tests for letsencrypt.client.plugins.nginx.parser.""" +"""Tests for letsencrypt_nginx.parser.""" import glob import os import re @@ -6,10 +6,11 @@ import shutil import unittest from letsencrypt.client.errors import LetsEncryptMisconfigurationError -from letsencrypt.client.plugins.nginx import nginxparser -from letsencrypt.client.plugins.nginx import obj -from letsencrypt.client.plugins.nginx import parser -from letsencrypt.client.plugins.nginx.tests import util + +from letsencrypt_nginx import nginxparser +from letsencrypt_nginx import obj +from letsencrypt_nginx import parser +from letsencrypt_nginx.tests import util class NginxParserTest(util.NginxTest): diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/foo.conf b/letsencrypt_nginx/tests/testdata/foo.conf similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/foo.conf rename to letsencrypt_nginx/tests/testdata/foo.conf diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/mime.types b/letsencrypt_nginx/tests/testdata/mime.types similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/mime.types rename to letsencrypt_nginx/tests/testdata/mime.types diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/nginx.conf b/letsencrypt_nginx/tests/testdata/nginx.conf similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/nginx.conf rename to letsencrypt_nginx/tests/testdata/nginx.conf diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/nginx.new.conf b/letsencrypt_nginx/tests/testdata/nginx.new.conf similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/nginx.new.conf rename to letsencrypt_nginx/tests/testdata/nginx.new.conf diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/server.conf b/letsencrypt_nginx/tests/testdata/server.conf similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/server.conf rename to letsencrypt_nginx/tests/testdata/server.conf diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/sites-enabled/default b/letsencrypt_nginx/tests/testdata/sites-enabled/default similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/sites-enabled/default rename to letsencrypt_nginx/tests/testdata/sites-enabled/default diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/sites-enabled/example.com b/letsencrypt_nginx/tests/testdata/sites-enabled/example.com similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/sites-enabled/example.com rename to letsencrypt_nginx/tests/testdata/sites-enabled/example.com diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/fastcgi_params diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-utf diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/koi-win diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/mime.types diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi-ui.conf.1.4.1 diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi.rules diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/naxsi_core.rules diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/nginx.conf diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/proxy_params diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/scgi_params diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-available/default diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/sites-enabled/default diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/uwsgi_params diff --git a/letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf b/letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf similarity index 100% rename from letsencrypt/client/plugins/nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf rename to letsencrypt_nginx/tests/testdata/ubuntu_nginx_1_4_6/default_vhost/nginx/win-utf diff --git a/letsencrypt/client/plugins/nginx/tests/util.py b/letsencrypt_nginx/tests/util.py similarity index 90% rename from letsencrypt/client/plugins/nginx/tests/util.py rename to letsencrypt_nginx/tests/util.py index 47577daa1..57d11c188 100644 --- a/letsencrypt/client/plugins/nginx/tests/util.py +++ b/letsencrypt_nginx/tests/util.py @@ -7,8 +7,8 @@ import unittest import mock -from letsencrypt.client.plugins.nginx import constants -from letsencrypt.client.plugins.nginx import configurator +from letsencrypt_nginx import constants +from letsencrypt_nginx import configurator class NginxTest(unittest.TestCase): # pylint: disable=too-few-public-methods @@ -33,7 +33,7 @@ class NginxTest(unittest.TestCase): # pylint: disable=too-few-public-methods def get_data_filename(filename): """Gets the filename of a test data file.""" return pkg_resources.resource_filename( - "letsencrypt.client.plugins.nginx.tests", "testdata/%s" % filename) + "letsencrypt_nginx.tests", "testdata/%s" % filename) def dir_setup(test_dir="debian_nginx/two_vhost_80"): @@ -43,7 +43,7 @@ def dir_setup(test_dir="debian_nginx/two_vhost_80"): work_dir = tempfile.mkdtemp("work") test_configs = pkg_resources.resource_filename( - "letsencrypt.client.plugins.nginx.tests", test_dir) + "letsencrypt_nginx.tests", test_dir) shutil.copytree( test_configs, os.path.join(temp_dir, test_dir), symlinks=True) diff --git a/setup.cfg b/setup.cfg index a9fa682f2..cd572471c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,5 +6,5 @@ dev = develop easy_install letsencrypt[dev,docs,testing] [nosetests] nocapture=1 -cover-package=letsencrypt,acme +cover-package=letsencrypt,acme,letsencrypt_apache,letsencrypt_nginx cover-erase=1 diff --git a/setup.py b/setup.py index 9256f48ff..1c65ff880 100644 --- a/setup.py +++ b/setup.py @@ -115,12 +115,12 @@ setup( 'jws = letsencrypt.acme.jose.jws:CLI.run', ], 'letsencrypt.plugins': [ - 'apache = letsencrypt.client.plugins.apache.configurator' - ':ApacheConfigurator', - 'nginx = letsencrypt.client.plugins.nginx.configurator' - ':NginxConfigurator', 'standalone = letsencrypt.client.plugins.standalone.authenticator' ':StandaloneAuthenticator', + + # to be moved to separate pypi packages + 'apache = letsencrypt_apache.configurator:ApacheConfigurator', + 'nginx = letsencrypt_nginx.configurator:NginxConfigurator', ], }, diff --git a/tox.ini b/tox.ini index 5c869d289..add0a15e7 100644 --- a/tox.ini +++ b/tox.ini @@ -27,4 +27,4 @@ commands = basepython = python2.7 commands = pip install -e .[dev] - pylint --rcfile=.pylintrc letsencrypt acme + pylint --rcfile=.pylintrc letsencrypt acme letsencrypt_apache letsencrypt_nginx