From 884ab38334580f91fcda79cf38cc960b3843513b Mon Sep 17 00:00:00 2001 From: Damien Nozay Date: Wed, 26 Nov 2014 17:38:15 -0800 Subject: [PATCH 01/29] trivial: update readme --- README.md | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 878652b41..7459173df 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ -This is the Let's Encrypt Agent DEVELOPER PREVIEW repository. +This is the Let's Encrypt Agent **DEVELOPER PREVIEW** repository. -DO NOT RUN THIS CODE ON A PRODUCTION WEBSERVER. IT WILL INSTALL CERTIFICATES -SIGNED BY A TEST CA, AND WILL CAUSE CERT WARNINGS FOR USERS. +**DO NOT RUN THIS CODE ON A PRODUCTION WEBSERVER. IT WILL INSTALL CERTIFICATES +SIGNED BY A TEST CA, AND WILL CAUSE CERT WARNINGS FOR USERS.** This code is intended for testing, demonstration, and integration engineering with OSes and hosting platforms. Currently the code works with Linux and Apache, though we will be expanding it to other platforms. -## Running the demo code on Ubuntu +## Running the demo code + +### on Ubuntu ``` sudo apt-get install python python-setuptools python-virtualenv \ @@ -20,6 +22,16 @@ sudo ./venv/bin/letsencrypt Note, that letsencrypt does not yet handle Debian unstable's Apache2 conf layout. +### on OSX + +* [swig] is required for compiling [m2crypto]. +* [augeas] is required for editing configuration. + +``` +sudo brew install swig +sudo brew install augeas +``` + ## Hacking 1. Bootstrap: `./venv/bin/python setup.py dev` @@ -63,14 +75,18 @@ optional arguments: ## More Information -Further Setup, documentation and open projects are available in the [Wiki] -(https://github.com/letsencrypt/lets-encrypt-preview/wiki) +Further Setup, documentation and open projects are available in the [Wiki]. -Join us at our IRC channel @ freenode.net #letsencrypt +Join us at our IRC channel @ freenode.net `#letsencrypt`. -Client software development can be discussed on this [mailing list] -(https://groups.google.com/a/letsencrypt.org/forum/#!forum/client-dev) +Client software development can be discussed on this [mailing list]. -To subscribe without a Google account, send mail to -[client-dev+subscribe@letsencrypt.org] -(mailto:client-dev+subscribe@letsencrypt.org). +To subscribe without a Google account, send mail to . + + + +[swig]: http://www.swig.org/ +[m2crypto]: https://github.com/M2Crypto/M2Crypto +[augeas]: http://augeas.net/ +[mailing list]: https://groups.google.com/a/letsencrypt.org/forum/#!forum/client-dev +[wiki]: https://github.com/letsencrypt/lets-encrypt-preview/wiki From d9c9cdd6be08745501ee46d67148bc2091fddfa7 Mon Sep 17 00:00:00 2001 From: Damien Nozay Date: Wed, 26 Nov 2014 21:27:26 -0800 Subject: [PATCH 02/29] let travis-ci test the code :) --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..093995363 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: python +python: + - "2.7" +install: + - pip install tox +script: + - tox From e36fe2ced50a171f6c641bee48c815dbf57b6795 Mon Sep 17 00:00:00 2001 From: Damien Nozay Date: Wed, 26 Nov 2014 21:39:24 -0800 Subject: [PATCH 03/29] install swig/augeas et al. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 093995363..6ae49b47e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: python python: - "2.7" +before_install: + - sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev install: - pip install tox script: From 69fc4aed1d277c7b3d3a0f6f22a1b4164996e349 Mon Sep 17 00:00:00 2001 From: Damien Nozay Date: Thu, 27 Nov 2014 08:14:15 -0800 Subject: [PATCH 04/29] split test matrix to cover py26 and lint separately --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6ae49b47e..9ba69119a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,9 @@ before_install: - sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev install: - pip install tox +env: + - TOX_ENV=py26 + - TOX_ENV=py27 + - TOX_ENV=lint script: - - tox + - tox -e $TOX_ENV From 5631ed0a97a25260a501eda627dcbbb9ddf0b6fe Mon Sep 17 00:00:00 2001 From: Damien Nozay Date: Thu, 27 Nov 2014 08:36:58 -0800 Subject: [PATCH 05/29] travis-ci: install extras[testing] --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9ba69119a..16dca3983 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: before_install: - sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev install: + - pip install -e .[testing] - pip install tox env: - TOX_ENV=py26 From d8fcfc960738d49c87455d606375d3c10c7cc3f0 Mon Sep 17 00:00:00 2001 From: Damien Nozay Date: Thu, 27 Nov 2014 08:40:59 -0800 Subject: [PATCH 06/29] add travis-ci badge to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 878652b41..8280ee937 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +Build status: [![Build Status](https://travis-ci.org/letsencrypt/lets-encrypt-preview.svg?branch=master)](https://travis-ci.org/letsencrypt/lets-encrypt-preview) + This is the Let's Encrypt Agent DEVELOPER PREVIEW repository. DO NOT RUN THIS CODE ON A PRODUCTION WEBSERVER. IT WILL INSTALL CERTIFICATES From 3f9a708789e9c773de019953e32ec56fe5342488 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 20:13:21 +0100 Subject: [PATCH 07/29] tox.ini using setup.py dev --- tox.ini | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tox.ini b/tox.ini index 9b6ca773a..43aeaea4c 100644 --- a/tox.ini +++ b/tox.ini @@ -4,14 +4,14 @@ # and then run "tox" from this directory. [tox] -envlist = py26, py27, lint +envlist = py26,py27,lint [testenv] -commands = nosetests -deps = - nose +commands = + python setup.py dev + nosetests [testenv:lint] -commands = pylint letsencrypt -deps = - pylint +commands = + python setup.py dev + pylint letsencrypt From c2413ba5426f3f409d203af862cba4f3d3afd32b Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 20:24:50 +0100 Subject: [PATCH 08/29] setuptools test_suite --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4352b0c25..02a548f3e 100755 --- a/setup.py +++ b/setup.py @@ -33,6 +33,7 @@ setup( ], install_requires=install_requires, tests_require=install_requires, + test_suite='letsencrypt', extras_require={ 'testing': testing_extras, }, From f62ab0e351e23169c28f746aa6055d2b32b2b033 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 20:26:30 +0100 Subject: [PATCH 09/29] tox.ini uses setup.py test -q --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 43aeaea4c..7a7db6a7c 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ envlist = py26,py27,lint [testenv] commands = python setup.py dev - nosetests + python setup.py test -q # -q does not suppress errors [testenv:lint] commands = From 9d5ab7dbccb62b42778a40d5602f035588a71b3f Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 20:30:56 +0100 Subject: [PATCH 10/29] Test coverage --- setup.py | 1 + tox.ini | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 02a548f3e..93e22b4d9 100755 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ install_requires = [ testing_extras = [ 'coverage', 'nose', + 'nosexcover', 'pylint', 'tox', ] diff --git a/tox.ini b/tox.ini index 7a7db6a7c..114c3868b 100644 --- a/tox.ini +++ b/tox.ini @@ -4,13 +4,18 @@ # and then run "tox" from this directory. [tox] -envlist = py26,py27,lint +envlist = py26,py27,cover,lint [testenv] commands = python setup.py dev python setup.py test -q # -q does not suppress errors +[testenv:cover] +commands = + python setup.py dev + python setup.py nosetests --with-xunit --with-xcoverage --cover-min-percentage=100 + [testenv:lint] commands = python setup.py dev From dfd7e142c143e8f3f92541dfd02349592caf4de3 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 20:56:35 +0100 Subject: [PATCH 11/29] Do not use xunit. coverage instead of xcoverage. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 114c3868b..75941366e 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ commands = [testenv:cover] commands = python setup.py dev - python setup.py nosetests --with-xunit --with-xcoverage --cover-min-percentage=100 + python setup.py nosetests --with-coverage --cover-min-percentage=100 [testenv:lint] commands = From 93291feb58940d54b2b8d0cefdc02e80f5b5bfed Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 20:57:24 +0100 Subject: [PATCH 12/29] Ignore .coverage --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 437c9f0bd..d01ebf0fc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ build/ dist/ venv/ .tox/ +.coverage/ m3 From f2c1c30ac4f4916f497c6a3ae51d1b6f9323c4db Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 21:00:07 +0100 Subject: [PATCH 13/29] Restrict nosetests to our package --- setup.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.cfg b/setup.cfg index a848a847e..2b9124c06 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,3 +3,8 @@ zip_ok = false [aliases] dev = develop easy_install letsencrypt[testing] + +[nosetests] +nocapture=1 +cover-package=letsencrypt +cover-erase=1 From d40a7acf8a0241eebaf317e31783ad864f5fdc13 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 22:49:15 +0100 Subject: [PATCH 14/29] gitignore: .coverage is a file --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d01ebf0fc..e1dca3a57 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,5 @@ build/ dist/ venv/ .tox/ -.coverage/ +.coverage m3 From 89ea2888596bd5d6ee6e0d0f4094d41f702e4427 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 23:34:15 +0100 Subject: [PATCH 15/29] Fix dnozay README as per #81 --- README.md | 76 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 7459173df..cf190aaa2 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,55 @@ -This is the Let's Encrypt Agent **DEVELOPER PREVIEW** repository. +# Let's Encrypt -**DO NOT RUN THIS CODE ON A PRODUCTION WEBSERVER. IT WILL INSTALL CERTIFICATES -SIGNED BY A TEST CA, AND WILL CAUSE CERT WARNINGS FOR USERS.** +[![Build Status](https://travis-ci.org/letsencrypt/lets-encrypt-preview.svg?branch=master)] +(https://travis-ci.org/letsencrypt/lets-encrypt-preview) -This code is intended for testing, demonstration, and integration engineering -with OSes and hosting platforms. Currently the code works with Linux and -Apache, though we will be expanding it to other platforms. +## Disclaimer + +This is the [Let's Encrypt] Agent **DEVELOPER PREVIEW** repository. + +**DO NOT RUN THIS CODE ON A PRODUCTION WEBSERVER. IT WILL INSTALL +CERTIFICATES SIGNED BY A TEST CA, AND WILL CAUSE CERT WARNINGS FOR +USERS.** + +This code is intended for testing, demonstration, and integration +engineering with OSes and hosting platforms. For the time being +project focuses on Linux and Apache, though we will be expanding +it to other platforms. ## Running the demo code -### on Ubuntu +The demo code is supported and known to work on *Ubuntu only* (even +closely related [Debian is known to fail] +(https://github.com/letsencrypt/lets-encrypt-preview/issues/68)). +Therefore, prerequisites for other platforms listed below are provided +mainly for the [developers](#hacking) reference. + +### Prerequisites + +In general: + +* [swig] is required for compiling [m2crypto] +* [libaugeas] is required for the `python-augeas` bindings + +#### Ubuntu ``` sudo apt-get install python python-setuptools python-virtualenv \ python-dev gcc swig dialog libaugeas0 libssl-dev +``` + +#### Mac OSX + +`sudo brew install augeas swig` + +### Installation + +``` virtualenv --no-site-packages venv ./venv/bin/python setup.py install sudo ./venv/bin/letsencrypt ``` -Note, that letsencrypt does not yet handle Debian unstable's Apache2 -conf layout. - -### on OSX - -* [swig] is required for compiling [m2crypto]. -* [augeas] is required for editing configuration. - -``` -sudo brew install swig -sudo brew install augeas -``` - ## Hacking 1. Bootstrap: `./venv/bin/python setup.py dev` @@ -75,18 +93,20 @@ optional arguments: ## More Information -Further Setup, documentation and open projects are available in the [Wiki]. +- Further setup, documentation and open projects are available in the + [Wiki]. -Join us at our IRC channel @ freenode.net `#letsencrypt`. +- Join us at our IRC channel @ [freenode.net + `#letsencrypt`](irc://irc.freenode.net/letsencrypt). -Client software development can be discussed on this [mailing list]. - -To subscribe without a Google account, send mail to . +- Client software development can be discussed on this [mailing + list]. To subscribe without a Google account, send mail to + . - -[swig]: http://www.swig.org/ +[Let's Encrypt](https://letsencrypt.org) +[swig]: http://www.swig.org [m2crypto]: https://github.com/M2Crypto/M2Crypto -[augeas]: http://augeas.net/ +[augeas]: http://augeas.net [mailing list]: https://groups.google.com/a/letsencrypt.org/forum/#!forum/client-dev [wiki]: https://github.com/letsencrypt/lets-encrypt-preview/wiki From f4a8ee56abcc176cc511e2b36587b182a9d0f6c5 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 23:40:58 +0100 Subject: [PATCH 16/29] Further fixes to README --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cf190aaa2..3aad1c061 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ it to other platforms. ## Running the demo code -The demo code is supported and known to work on *Ubuntu only* (even +The demo code is supported and known to work on **Ubuntu only** (even closely related [Debian is known to fail] (https://github.com/letsencrypt/lets-encrypt-preview/issues/68)). Therefore, prerequisites for other platforms listed below are provided @@ -29,7 +29,7 @@ mainly for the [developers](#hacking) reference. In general: * [swig] is required for compiling [m2crypto] -* [libaugeas] is required for the `python-augeas` bindings +* [augeas] is required for the `python-augeas` bindings #### Ubuntu @@ -96,17 +96,17 @@ optional arguments: - Further setup, documentation and open projects are available in the [Wiki]. -- Join us at our IRC channel @ [freenode.net - `#letsencrypt`](irc://irc.freenode.net/letsencrypt). +- Join us at our IRC channel: #letsencrypt at [Freenode]. - Client software development can be discussed on this [mailing - list]. To subscribe without a Google account, send mail to + list]. To subscribe without a Google account, send an email to . -[Let's Encrypt](https://letsencrypt.org) -[swig]: http://www.swig.org -[m2crypto]: https://github.com/M2Crypto/M2Crypto [augeas]: http://augeas.net +[Freenode]: https://freenode.net +[Let's Encrypt]: https://letsencrypt.org +[m2crypto]: https://github.com/M2Crypto/M2Crypto [mailing list]: https://groups.google.com/a/letsencrypt.org/forum/#!forum/client-dev +[swig]: http://www.swig.org [wiki]: https://github.com/letsencrypt/lets-encrypt-preview/wiki From 58196f046e07c4f68aeab05dff72ab7e78dc11f8 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 23:43:13 +0100 Subject: [PATCH 17/29] Fix email link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3aad1c061..9dc7b8d16 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ optional arguments: - Client software development can be discussed on this [mailing list]. To subscribe without a Google account, send an email to - . + client-dev+subscribe@letsencrypt.org. [augeas]: http://augeas.net From 5665ea96d433a32112ee34c5758227d7d1256662 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 27 Nov 2014 23:48:25 +0100 Subject: [PATCH 18/29] Remove build badge --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 9dc7b8d16..e20f51b14 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # Let's Encrypt -[![Build Status](https://travis-ci.org/letsencrypt/lets-encrypt-preview.svg?branch=master)] -(https://travis-ci.org/letsencrypt/lets-encrypt-preview) - ## Disclaimer This is the [Let's Encrypt] Agent **DEVELOPER PREVIEW** repository. From 1d59dd12753aeef274cd9828121476cbd51ca3d0 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Fri, 28 Nov 2014 21:42:47 +0100 Subject: [PATCH 19/29] Travis CI: remove python version, use setup.py dev[testing] --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16dca3983..8f53c37ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,15 @@ language: python -python: - - "2.7" + before_install: - sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev + install: - - pip install -e .[testing] - - pip install tox + - python setup.py dev[testing] + env: - TOX_ENV=py26 - TOX_ENV=py27 - TOX_ENV=lint + script: - tox -e $TOX_ENV From 3de9ff387d5b6aa9b5941f6ec2abae3f821bb95b Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Fri, 28 Nov 2014 21:45:10 +0100 Subject: [PATCH 20/29] Use travis_retry. http://blog.travis-ci.com/2013-05-20-network-timeouts-build-retries --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8f53c37ca..69800415e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: python before_install: - - sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev + - travis_retry sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev install: - - python setup.py dev[testing] + - travis_retry python setup.py dev[testing] env: - TOX_ENV=py26 @@ -12,4 +12,4 @@ env: - TOX_ENV=lint script: - - tox -e $TOX_ENV + - travis_retry tox -e $TOX_ENV From 6957d1d1093984efd7d9cb1e2c79dc5d4d9162f1 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Fri, 28 Nov 2014 21:57:47 +0100 Subject: [PATCH 21/29] Travis: fix YAML style --- .travis.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69800415e..4e9b09cb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,13 @@ language: python -before_install: - - travis_retry sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev +before_install: > + travis_retry sudo apt-get install python python-setuptools + python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev -install: - - travis_retry python setup.py dev[testing] +install: travis_retry python setup.py dev[testing] +script: travis_retry tox -e $TOX_ENV env: - TOX_ENV=py26 - TOX_ENV=py27 - TOX_ENV=lint - -script: - - travis_retry tox -e $TOX_ENV From 016bf5d269ddb793d3cca1eedc941973fe9eceff Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Fri, 28 Nov 2014 21:58:16 +0100 Subject: [PATCH 22/29] Travis: explicit -e $TOX_ENV not necessary --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4e9b09cb9..66dadd738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ before_install: > python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev install: travis_retry python setup.py dev[testing] -script: travis_retry tox -e $TOX_ENV +script: travis_retry tox env: - TOX_ENV=py26 From 89e86606ea3341731b9ba6d9e7cba20d234fc4e2 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Fri, 28 Nov 2014 22:02:07 +0100 Subject: [PATCH 23/29] Travis: multiple Python environments. --- .travis.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 66dadd738..5f4edef70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,22 @@ +# To mimic README.md installation and hacking instructions as much as +# possible, this config file instructs Travis CI to create a build +# environment for each supported Python version, and then for each of +# those it runs tox with two environments: lint and pyXX corresponding +# to the currently used Travis CI build Python version. + language: python +python: + - "2.6" + - "2.7" + before_install: > travis_retry sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev -install: travis_retry python setup.py dev[testing] +install: travis_retry python setup.py dev[testing] # installs tox script: travis_retry tox env: - - TOX_ENV=py26 - - TOX_ENV=py27 + - TOX_ENV=py${TRAVIS_PYTHON_VERSION//[.]/} - TOX_ENV=lint From 0d64f5a358e4407727571ad1ad4884dd0f9190ff Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 29 Nov 2014 01:50:13 +0100 Subject: [PATCH 24/29] Fix dev[testing] typo in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f4edef70..c1cbd4a10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: > travis_retry sudo apt-get install python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev -install: travis_retry python setup.py dev[testing] # installs tox +install: travis_retry python setup.py dev # installs tox script: travis_retry tox env: From 1e235e3bde09dfb02d6b0da1d53d2a4939a5cf21 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 29 Nov 2014 02:01:18 +0100 Subject: [PATCH 25/29] TOXENV instead of TOX_ENV http://tox.readthedocs.org/en/latest/config.html?highlight=toxenv#confval-envlist=CSV --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1cbd4a10..1a63f343f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,5 +18,5 @@ install: travis_retry python setup.py dev # installs tox script: travis_retry tox env: - - TOX_ENV=py${TRAVIS_PYTHON_VERSION//[.]/} - - TOX_ENV=lint + - TOXENV=py${TRAVIS_PYTHON_VERSION//[.]/} + - TOXENV=lint From 86f8dad26445ea06f297f18c56c7fc5f019bf0bf Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 29 Nov 2014 02:37:51 +0100 Subject: [PATCH 26/29] Remove unnecessary "Build status" comment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 00714527f..3489a36b8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Let's Encrypt -Build status: [![Build Status] +[![Build Status] (https://travis-ci.org/letsencrypt/lets-encrypt-preview.svg?branch=master)] (https://travis-ci.org/letsencrypt/lets-encrypt-preview) From fa94a4f57a15ea013558e95f5b9df7c41b8dc217 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 29 Nov 2014 03:13:16 +0100 Subject: [PATCH 27/29] Fix chmods security error: 644 != 0644 --- letsencrypt/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/letsencrypt/client/client.py b/letsencrypt/client/client.py index 3fdcd7c1f..87d4b9d1f 100644 --- a/letsencrypt/client/client.py +++ b/letsencrypt/client/client.py @@ -384,7 +384,7 @@ class Client(object): """ cert_chain_abspath = None - cert_fd, cert_file = le_util.unique_file(CONFIG.CERT_PATH, 644) + cert_fd, cert_file = le_util.unique_file(CONFIG.CERT_PATH, 0644) cert_fd.write( crypto_util.b64_cert_to_pem(certificate_dict["certificate"])) cert_fd.close() @@ -392,7 +392,7 @@ class Client(object): cert_file) if certificate_dict.get("chain", None): - chain_fd, chain_fn = le_util.unique_file(CONFIG.CHAIN_PATH, 644) + chain_fd, chain_fn = le_util.unique_file(CONFIG.CHAIN_PATH, 0644) for cert in certificate_dict.get("chain", []): chain_fd.write(crypto_util.b64_cert_to_pem(cert)) chain_fd.close() From 3cfeac6f3baea7a2b9983086f8b4502fd5b5b32b Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 29 Nov 2014 03:31:12 +0100 Subject: [PATCH 28/29] PEP 3127, fixes pylint old-octal-literal. https://www.python.org/dev/peps/pep-3127 --- letsencrypt/client/apache_configurator.py | 6 +++--- letsencrypt/client/augeas_configurator.py | 2 +- letsencrypt/client/client.py | 14 +++++++------- letsencrypt/client/le_util.py | 4 ++-- letsencrypt/client/le_util_test.py | 16 ++++++++-------- letsencrypt/client/nginx_configurator.py | 6 +++--- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/letsencrypt/client/apache_configurator.py b/letsencrypt/client/apache_configurator.py index 080a3b24c..c8dd4df9a 100644 --- a/letsencrypt/client/apache_configurator.py +++ b/letsencrypt/client/apache_configurator.py @@ -1242,9 +1242,9 @@ LogLevel warn \n\ have permissions of root """ - le_util.make_or_verify_dir(CONFIG.CONFIG_DIR, 0755) - le_util.make_or_verify_dir(CONFIG.WORK_DIR, 0755) - le_util.make_or_verify_dir(CONFIG.BACKUP_DIR, 0755) + le_util.make_or_verify_dir(CONFIG.CONFIG_DIR, 0o755) + le_util.make_or_verify_dir(CONFIG.WORK_DIR, 0o755) + le_util.make_or_verify_dir(CONFIG.BACKUP_DIR, 0o755) def standardize_excl(self): """Standardize the excl arguments for the Httpd lens in Augeas. diff --git a/letsencrypt/client/augeas_configurator.py b/letsencrypt/client/augeas_configurator.py index 89d7277ec..8bfd4c1ff 100644 --- a/letsencrypt/client/augeas_configurator.py +++ b/letsencrypt/client/augeas_configurator.py @@ -257,7 +257,7 @@ class AugeasConfigurator(configurator.Configurator): :type save_files: set """ - le_util.make_or_verify_dir(cp_dir, 0755) + le_util.make_or_verify_dir(cp_dir, 0o755) existing_filepaths = [] op_fd = None diff --git a/letsencrypt/client/client.py b/letsencrypt/client/client.py index 87d4b9d1f..990df253e 100644 --- a/letsencrypt/client/client.py +++ b/letsencrypt/client/client.py @@ -384,7 +384,7 @@ class Client(object): """ cert_chain_abspath = None - cert_fd, cert_file = le_util.unique_file(CONFIG.CERT_PATH, 0644) + cert_fd, cert_file = le_util.unique_file(CONFIG.CERT_PATH, 0o644) cert_fd.write( crypto_util.b64_cert_to_pem(certificate_dict["certificate"])) cert_fd.close() @@ -392,7 +392,7 @@ class Client(object): cert_file) if certificate_dict.get("chain", None): - chain_fd, chain_fn = le_util.unique_file(CONFIG.CHAIN_PATH, 0644) + chain_fd, chain_fn = le_util.unique_file(CONFIG.CHAIN_PATH, 0o644) for cert in certificate_dict.get("chain", []): chain_fd.write(crypto_util.b64_cert_to_pem(cert)) chain_fd.close() @@ -498,7 +498,7 @@ class Client(object): """ list_file = os.path.join(CONFIG.CERT_KEY_BACKUP, "LIST") - le_util.make_or_verify_dir(CONFIG.CERT_KEY_BACKUP, 0700) + le_util.make_or_verify_dir(CONFIG.CERT_KEY_BACKUP, 0o700) idx = 0 if encrypt: @@ -627,9 +627,9 @@ class Client(object): if not self.key_file: key_pem = crypto_util.make_key(CONFIG.RSA_KEY_SIZE) # Save file - le_util.make_or_verify_dir(CONFIG.KEY_DIR, 0700) + le_util.make_or_verify_dir(CONFIG.KEY_DIR, 0o700) key_f, self.key_file = le_util.unique_file( - os.path.join(CONFIG.KEY_DIR, "key-letsencrypt.pem"), 0600) + os.path.join(CONFIG.KEY_DIR, "key-letsencrypt.pem"), 0o600) key_f.write(key_pem) key_f.close() logger.info("Generating key: %s" % self.key_file) @@ -643,9 +643,9 @@ class Client(object): if not self.csr_file: csr_pem, csr_der = crypto_util.make_csr(self.key_file, self.names) # Save CSR - le_util.make_or_verify_dir(CONFIG.CERT_DIR, 0755) + le_util.make_or_verify_dir(CONFIG.CERT_DIR, 0o755) csr_f, self.csr_file = le_util.unique_file( - os.path.join(CONFIG.CERT_DIR, "csr-letsencrypt.pem"), 0644) + os.path.join(CONFIG.CERT_DIR, "csr-letsencrypt.pem"), 0o644) csr_f.write(csr_pem) csr_f.close() logger.info("Creating CSR: %s" % self.csr_file) diff --git a/letsencrypt/client/le_util.py b/letsencrypt/client/le_util.py index 19070858f..5e8f5414b 100644 --- a/letsencrypt/client/le_util.py +++ b/letsencrypt/client/le_util.py @@ -5,7 +5,7 @@ import os import stat -def make_or_verify_dir(directory, mode=0755, uid=0): +def make_or_verify_dir(directory, mode=0o755, uid=0): """Make sure directory exists with proper permissions. :param directory: Path to a directry. @@ -50,7 +50,7 @@ def check_permissions(filepath, mode, uid=0): return stat.S_IMODE(file_stat.st_mode) == mode and file_stat.st_uid == uid -def unique_file(default_name, mode=0777): +def unique_file(default_name, mode=0o777): """Safely finds a unique file for writing only (by default).""" count = 1 f_parsed = os.path.splitext(default_name) diff --git a/letsencrypt/client/le_util_test.py b/letsencrypt/client/le_util_test.py index 30743c24a..926830602 100644 --- a/letsencrypt/client/le_util_test.py +++ b/letsencrypt/client/le_util_test.py @@ -16,7 +16,7 @@ class MakeOrVerifyDirTest(unittest.TestCase): def setUp(self): self.root_path = tempfile.mkdtemp() self.path = os.path.join(self.root_path, 'foo') - os.mkdir(self.path, 0400) + os.mkdir(self.path, 0o400) self.uid = os.getuid() @@ -29,16 +29,16 @@ class MakeOrVerifyDirTest(unittest.TestCase): def test_creates_dir_when_missing(self): path = os.path.join(self.root_path, 'bar') - self._call(path, 0650) + self._call(path, 0o650) self.assertTrue(os.path.isdir(path)) # TODO: check mode def test_existing_correct_mode_does_not_fail(self): - self._call(self.path, 0400) + self._call(self.path, 0o400) # TODO: check mode def test_existing_wrong_mode_fails(self): - self.assertRaises(Exception, self._call, self.path, 0600) + self.assertRaises(Exception, self._call, self.path, 0o600) class CheckPermissionsTest(unittest.TestCase): @@ -61,12 +61,12 @@ class CheckPermissionsTest(unittest.TestCase): return check_permissions(self.path, mode, self.uid) def test_ok_mode(self): - os.chmod(self.path, 0600) - self.assertTrue(self._call(0600)) + os.chmod(self.path, 0o600) + self.assertTrue(self._call(0o600)) def test_wrong_mode(self): - os.chmod(self.path, 0400) - self.assertFalse(self._call(0600)) + os.chmod(self.path, 0o400) + self.assertFalse(self._call(0o600)) # https://en.wikipedia.org/wiki/Base64#Examples diff --git a/letsencrypt/client/nginx_configurator.py b/letsencrypt/client/nginx_configurator.py index 70d775a8b..5ca0ab68c 100644 --- a/letsencrypt/client/nginx_configurator.py +++ b/letsencrypt/client/nginx_configurator.py @@ -174,9 +174,9 @@ class NginxConfigurator(augeas_configurator.AugeasConfigurator): # permissions. Aim for defensive coding... make sure all input files # have permissions of root # """ - # le_util.make_or_verify_dir(CONFIG.CONFIG_DIR, 0755) - # le_util.make_or_verify_dir(CONFIG.WORK_DIR, 0755) - # le_util.make_or_verify_dir(CONFIG.BACKUP_DIR, 0755) + # le_util.make_or_verify_dir(CONFIG.CONFIG_DIR, 0o755) + # le_util.make_or_verify_dir(CONFIG.WORK_DIR, 0o755) + # le_util.make_or_verify_dir(CONFIG.BACKUP_DIR, 0o755) def restart(self, quiet=False): """Restarts nginx server""" From aa7ca5f03d440f8f2a43c3f7875949fc74c2cf66 Mon Sep 17 00:00:00 2001 From: Dave Guarino Date: Fri, 28 Nov 2014 23:58:10 -0800 Subject: [PATCH 29/29] Fix typos in comments for ACME authorizationRequest message --- letsencrypt/client/acme.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/letsencrypt/client/acme.py b/letsencrypt/client/acme.py index 9384abadb..347b28494 100644 --- a/letsencrypt/client/acme.py +++ b/letsencrypt/client/acme.py @@ -81,7 +81,7 @@ def challenge_request(names): def authorization_request(req_id, name, server_nonce, responses, key_file): - """Create ACME "authoriazationRequest" message. + """Create ACME "authorizationRequest" message. :param req_id: TODO :type req_id: TODO @@ -98,7 +98,7 @@ def authorization_request(req_id, name, server_nonce, responses, key_file): :param key_file: TODO :type key_file: TODO - :returns: ACME "authoriazationRequest" message. + :returns: ACME "authorizationRequest" message. :rtype: dict """