Commit graph

10392 commits

Author SHA1 Message Date
Brad Warren
5388842e5b Fix pytest on macOS in Travis (#5360)
* Add tools/pytest.sh

* pass TRAVIS through in tox.ini

* Use tools/pytest.sh to run pytest

* Add quiet to pytest.ini

* ignore pytest cache
2018-01-03 17:49:22 -08:00
Brad Warren
ed2168aaa8 Fix auto_tests on systems with new bootstrappers (#5348) 2017-12-21 16:55:21 -08:00
Brad Warren
d6b11fea72 More pip dependency resolution workarounds (#5339)
* remove pyopenssl and six deps

* remove outdated tox.ini dep requirement
2017-12-19 16:16:45 -08:00
Brad Warren
a1aea021e7 Pin dependencies in oldest tests (#5316)
* Add tools/merge_requirements.py

* Revert "Fix oldest tests by pinning Google DNS deps (#5000)"

This reverts commit f68fba2be2.

* Add tools/oldest_constraints.txt

* Remove oldest constraints from tox.ini

* Rename dev constraints file

* Update tools/pip_install.sh

* Update install_and_test.sh

* Fix pip_install.sh

* Don't cat when you can cp

* Add ng-httpsclient to dev constraints for oldest tests

* Bump tested setuptools version

* Update dev_constraints comment

* Better document oldest dependencies

* test against oldest versions we say we require

* Update dev constraints

* Properly handle empty lines

* Update constraints gen in pip_install

* Remove duplicated zope.component

* Reduce pyasn1-modules dependency

* Remove blank line

* pin back google-api-python-client

* pin back uritemplate

* pin josepy for oldest tests

* Undo changes to install_and_test.sh

* Update install_and_test.sh description

* use split instead of partition
2017-12-18 12:31:36 -08:00
Brad Warren
1b6005cc61
Pin josepy in letsencrypt-auto (#5321)
* pin josepy in le-auto

* Put pinned versions in sorted order
2017-12-14 18:15:42 -08:00
Joona Hoikkala
0e92d4ea98 Parse variables without whitespace separator correctly in CentOS family of distributions (#5318) 2017-12-11 11:50:56 -08:00
Jannis Leidel
2abc94661a Use josepy instead of acme.jose. (#5203) 2017-12-11 11:25:09 -08:00
Brad Warren
8bc785ed46
Make Travis builds faster in master (#5314)
* Remove extra le-auto tests from master

* Remove dockerfile-dev test from master

* Remove intermediate Python 3.x tests from master

* Reorder travis jobs for speed
2017-12-08 16:35:59 -08:00
Noah Swartz
0046428382 print warnings for 3.3 users (#5283)
fix errors
2017-12-08 12:45:04 -08:00
Michael Coleman
5d0888809f Remove slash from document root path in Webroot example (#5293)
It seems the document root path to the `--webroot-path`, `-w` option
can't have a trailing slash.  
Here is an example of a user who followed this example and had their
certificate signing request error out.  
https://superuser.com/questions/1273984/why-does-certbot-letsencrypt-recieve-a-403-forbidden
2017-12-07 15:53:47 -08:00
Noah Swartz
8096b91496
Merge pull request #5304 from certbot/0.20.0-changelog
Update changelog for 0.20.0
2017-12-07 15:32:35 -08:00
Brad Warren
e696766ed1 Expand on changes to the Apache plugin 2017-12-07 13:48:44 -08:00
ohemorange
8b5d6879cc Create a new server block when making server block ssl (#5220)
* create_new_vhost_from_default --> duplicate_vhost

* add source_path property

* set source path for duplicated vhost

* change around logic of where making ssl happens

* don't add listen 80 to newly created ssl block

* cache vhosts list

* remove source path

* add redirect block if we created a new server block

* Remove listen directives when making server block ssl

* Reset vhost cache on parser load

* flip connected pointer direction for finding newly made server block to match previous redirect search constraints

* also test for new redirect block styles

* fix contains_list and test redirect blocks

* update lint, parser, and obj tests

* reset new vhost (fixing previous bug) and move removing default from addrs under if statement

* reuse and update newly created ssl server block when appropriate, and update unit tests

* append newly created server blocks to file instead of inserting directly after, so we don't have to update other vhosts' paths

* add coverage for NO_IF_REDIRECT_COMMENT_BLOCK

* add coverage for parser load calls

* replace some double quotes with single quotes

* replace backslash continuations with parentheses

* update docstrings

* switch to only creating a new block on redirect enhancement, including removing the get_vhosts cache

* update configurator tests

* update obj test

* switch delete_default default for duplicate_vhost
2017-12-07 09:48:54 -08:00
Brad Warren
d039106b68
Merge pull request #5303 from certbot/candidate-0.20.0
Release 0.20.0
2017-12-06 17:59:51 -08:00
Brad Warren
abed73a8e4
Revert "Nginx reversion (#5299)" (#5305)
This reverts commit c9949411cd.
2017-12-06 17:45:20 -08:00
Noah Swartz
3951baf6c0
Merge pull request #5284 from Eccenux/issue_5274
Show a diff when re-creating certificate
2017-12-06 17:07:36 -08:00
Brad Warren
716f25743c Update changelog for 0.20.0 2017-12-06 16:33:55 -08:00
Noah Swartz
b3ca6bb2b1
Merge pull request #5228 from jonasbn/master
Documentation update to certbot/main.py
2017-12-06 16:26:26 -08:00
Brad Warren
78d97ca023 Bump version to 0.21.0 2017-12-06 14:52:16 -08:00
Brad Warren
f1554324da
Release 0.20.0 2017-12-06 14:46:55 -08:00
Brad Warren
c9949411cd
Nginx reversion (#5299)
The reason for this PR is many bug fixes in the nginx plugin for changes we haven't released yet are included in #5220 which may not make our next release. If it doesn't, we will (mostly) revert the nginx plugin back to its previous state to avoid releasing these bugs and will revert this PR after the release.

* Revert "Nginx IPv6 support (#5178)"

This reverts commit 68e37b03c8.

* Revert "Fix bug that stopped nginx from finding new server block for redirect (#5198)"

This reverts commit e2ab940ac0.

* Revert "Nginx creates a vhost block if no matching block is found (#5153)"

This reverts commit 95a7d45856.
2017-12-05 20:04:08 -08:00
Brad Warren
678ab7328e
Merge pull request #5300 from certbot/flexible-challenge-uri++
ACMEv2: Allow "uri" or "url" in challenge part 2
2017-12-05 12:11:48 -08:00
Brad Warren
62c1112d10 Keep the same behavior with the uri attribute 2017-12-05 10:26:32 -08:00
Jacob Hoffman-Andrews
8c4f016b2d In ACMEv2, challenges have "url" instead of "uri". To handle this smoothly, Challenge's uri field becomes private (_uri), and is joined by _url. Serialization and deserialization will preserve whichever one was set. The uri name is taken over by an @property that returns whichever of the two is set. I chose not to enforce that they shouldn't both be present because it would just add unnecessary code and brittleness with no stability benefit.
* Make url a virtual field.

* Add @property annotation.
2017-12-04 20:51:19 -08:00
Brad Warren
4db7195e77
Fix coveralls (#5298) 2017-12-04 17:09:01 -08:00
Brad Warren
bb70962bb8
Stop using new mock functionality in tests (#5295)
* Remove assert_called_once from dns-route53

* Remove assert_called_once from main_test.py

* Remove assert_called() usage in dns-digitalocean

* Remove assert_called() usage in dns-route53

* Downgrade mock version in certbot-auto
2017-12-04 14:44:22 -08:00
Joona Hoikkala
dc78fd731e Distribution specific override functionality based on class inheritance (#5202)
Class inheritance based approach to distro specific overrides.

How it works:
The certbot-apache plugin entrypoint has been changed to entrypoint.ENTRYPOINT which is a variable containing appropriate override class for system, if available.

Override classes register themselves using decorator override.register() which takes a list of distribution fingerprints (ID & LIKE variables in /etc/os-release, or platform.linux_distribution() as a fallback). These end up as keys in dict override.OVERRIDE_CLASSES and values for the keys are references to the class that called the decorator, hence allowing self-registration of override classes when they are imported. The only file importing these override classes is entrypoint.py, so adding new override classes would need only one import in addition to the actual override class file.

Generic changes:

    Parser initialization has been moved to separate class method, allowing easy override where needed.
    Cleaned up configurator.py a bit, and moved some helper functions to newly created apache_util.py
    Split Debian specific code from configurator.py to debian_override.py
    Changed define_cmd to apache_cmd because the parameters are for every distribution supporting this behavior, and we're able to use the value to build the additional configuration dump commands.
    Moved add_parser_mod() from configurator to parser add_mod()
    Added two new configuration dump parsing methods to update_runtime_variables() in parser: update_includes() and update_modules().
    Changed init_modules() in parser to accommodate the changes above. (ie. don't throw existing self.modules out).
    Moved OS based constants to their respective override classes.
    Refactored configurator class discovery in tests to help easier test case creation using distribution based override configurator class.
    tests.util.get_apache_configurator() now takes keyword argument os_info which is string of the desired mock OS fingerprint response that's used for picking the right override class.

This PR includes two major generic additions that should vastly improve our parsing accuracy and quality:

    Includes are parsed from config dump from httpd binary. This is mandatory for some distributions (Like OpenSUSE) to get visibility over the whole configuration tree because of Include statements passed on in command line, and not via root httpd.conf file.
    Modules are parsed from config dump from httpd binary. This lets us jump into correct IfModule directives if for some reason we have missed the module availability (because of one being included on command line or such).

Distribution specific changes
Because of the generic changes, there are two distributions (or distribution families) that do not provide such functionality, so it had to be overridden in their respective override files. These distributions are:

    CentOS, because it deliberately limits httpd binary stdout using SELinux as a feature. We are doing opportunistic config dumps here however, in case SELinux enforcing is off.
    Gentoo, because it does not provide a way to invoke httpd with command line parsed from its specific configuration file. Gentoo relies heavily on Define statements that are passed over from APACHE2_OPTS variable /etc/conf.d/apache2 file and most of the configuration in root Apache configuration are dependent on these values.

Debian

    Moved the Debian specific parts from configurator.py to Debian specific override.

CentOS

    Parsing of /etc/sysconfig/httpd file for additional Define statements. This could hold other parameters too, but parsing everything off it would require a full Apache lexer. For CLI parameters, I think Defines are the most common ones. This is done in addition of opportunistic parsing of httpd binary config dump.
    Added CentOS default Apache configuration tree for realistic test cases.

Gentoo

    Parsing Defines from /etc/conf.d/apache2 variable APACHE2_OPTS, which holds additional Define statements to enable certain functionalities, enabling parts of the configuration in the Apache2 DOM. This is done instead of trying to parse httpd binary configuration dumps.
    Added default Apache configuration from Gentoo to testdata, including /etc/conf.d/apache2 file for realistic test cases.


* Distribution specific override functionality based on class inheritance

* Need to patch get_systemd_os_like to as travis has proper os-release

* Added pydoc

* Move parser initialization to a method and fix Python 3 __new__ errors

* Parser changes to parse HTTPD config

* Try to get modules and includes from httpd process for better visibility over the configuration

* Had to disable duplicate-code because of test setup (PyCQA/pylint/issues/214)

* CentOS tests and linter fixes

* Gentoo override, tests and linter fixes

* Mock the process call in all the tests that require it

* Fix CentOS test mock

* Restore reseting modules list functionality for cleanup

* Move OS fingerprinting and constant mocks to parent class

* Fixes requested in review

* New entrypoint structure and started moving OS constants to override classes

* OS constants move continued, test and linter fixes

* Removed dead code

* Apache compatibility test changest to reflect OS constant restructure

* Test fix

* Requested changes

* Moved Debian specific tests to own test file

* Removed decorator based override class registration in favor of entrypoint dict

* Fix for update_includes for some versions of Augeas

* Take fedora fix into account in tests

* Review fixes
2017-12-04 11:49:18 -08:00
Jacob Hoffman-Andrews
73ba9af442 Don't echo Boulder logs on failure. (#5290)
The extensive logs made it hard to spot the actual failure.
2017-12-04 11:20:53 -08:00
Eccenux
840c943711 W:266,28: Redefining built-in 'list' (redefined-builtin) 2017-12-02 12:28:53 +01:00
Eccenux
abdde886fa code style 2017-12-02 12:25:58 +01:00
Jacob Hoffman-Andrews
7319cc975a
Quiet pip install output. (#5288)
pip install generates a lot of lines of output that make it harder to see what
tox is running in general. This adds the -q flag to pip install.

At the same time, add `set -x` in install_and_test.sh and pip_install.sh so they
echo the commands they are running. This makes it a little clearer what's going
on in tests.

I didn't put `set -x` at the top or in the shebang, because moving it lower lets
us avoid echoing some of the messy if/then setup statements in these scripts,
which focussed attention on the pip install command.
2017-12-01 23:40:09 -08:00
Brad Warren
394dafd38c Revert requiring dnsmadeeasy extras for lexicon (#5291)
Fixes failures at https://travis-ci.org/certbot/certbot/jobs/310248574#L1558.

Additional context can be found at #5230 and 604584521a (diff-2eeaed663bd0d25b7e608891384b7298).
2017-12-01 17:00:24 -08:00
Jacob Hoffman-Andrews
8ce6ee5f3e
Remove all but one BOULDER_INTEGRATION, and macOS (#5270)
These tests are retained in the test-everything branch, which has a Travis cron
job to run nightly.

Removing these speeds up the Certbot Travis builds dramatically for two reasons:
 - The Boulder integration tests are slow (10-12 minutes), and it's exceedingly
   rare for them to fail on one Python environment but not another.
 - The macOS tests take a very long time to run, because they need to wait for
   build slots on the limited number of macOS instances, which are often in high
   demand.
2017-12-01 16:10:16 -08:00
Brad Warren
b9b329ecf7
pin pkging tools that have dropped support (#5281) 2017-12-01 13:20:27 -08:00
Brad Warren
48173ed1cb
Switch from nose to pytest (#5282)
* Use pipstrap to install a good version of pip

* Use pytest in cb-auto tests

* Remove nose usage in auto_test.py

* remove nose dev dep

* use pytest in test_tests

* Use pytest in tox

* Update dev dependency pinnings

* remove nose multiprocess lines

* Use pytest for coverage

* Use older py and pytest for old python versions

* Add test for Error.__str__

* pin pytest in oldest test

* Fix tests for DNS-DO plugin on py26

* Work around bug for Python 3.3

* Clarify dockerfile comments
2017-12-01 10:59:55 -08:00
Eccenux
20bca19420 Show a diff when re-creating certificate instead of full list of domains #5274 2017-11-30 20:24:49 +01:00
Brad Warren
d246ba78c7
Use pip3 if pip isn't available (#5277) 2017-11-29 13:09:25 -08:00
Jacob Hoffman-Andrews
8fd1d0d19e Small Travis cleanups (#5273)
* Test with no hosts.

* Simplify build matrix.

* Remove after_failure.
2017-11-28 18:22:01 -08:00
Noah Swartz
f5ed771d4f change some instances of help to flag (#5248) 2017-11-27 14:50:06 -08:00
Peter Eckersley
cdd89998e3 Add nginx to these weird instructions (#5243)
These are probably made obsolete by the instruction generator, and they don't include Ubuntu...
2017-11-27 14:49:19 -08:00
jonasbn
e795a79547 Lots of minor small cosmetic changes and addressing the feedback on uniformity (in the file) from @SwartzCr 2017-11-15 07:38:09 +01:00
jonasbn
02126c0961 Minor improvement to newly added documentation section 2017-11-15 07:24:54 +01:00
jonasbn
0b843bb851 Added some missing documentation 2017-11-15 07:23:34 +01:00
jonasbn
4d60f32865 Minor corrections to return types for improved formatting 2017-11-12 13:03:09 +01:00
jonasbn
069ce1c55f Merge branch 'master' of https://github.com/certbot/certbot 2017-11-12 00:32:45 +01:00
jonasbn
eb26e0aacf Updated parameter types for a lot of parametersm some aspects are still a bug unclear, hopefully a review can shed some light on this details 2017-11-12 00:32:24 +01:00
Brad Warren
686fa36b3b Install dnsmadeeasy extras from dns-lexicon (#5230)
* Add tools/pip_constraints.txt to pin all Python dependencies

* Use tools/pip_constraints.txt in tools/pip_install.sh

* Install dnsmadeeasy extras in dnsmadeeasy plugin
2017-11-08 10:58:00 -08:00
jonasbn
1173acfaf0 Making friends with the linter
lint: commands succeeded
congratulations :)
2017-11-07 22:18:11 +01:00
jonasbn
0aa9322280 Added a shot at what might be the proper type, I need to get a better understanding of certbot's datatypes 2017-11-07 21:47:59 +01:00
jonasbn
89485f7463 I think I figured out the authentication handler object 2017-11-07 21:40:35 +01:00