Commit graph

8047 commits

Author SHA1 Message Date
Erica Portnoy
e2c4da5de1 coverage 2017-10-12 17:23:39 -07:00
Erica Portnoy
34d7f98b63 Add logger.info message for using default address in tlssni01 auth 2017-10-12 17:17:25 -07:00
Erica Portnoy
c8202dbfb4 Address review nits 2017-10-12 17:14:30 -07:00
Erica Portnoy
3a94e8cac9 Merge branch 'master' into issue_5030 2017-10-12 17:04:19 -07:00
Brad Warren
7c11158810 Retry failures to start boulder (#5176)
Occasionally a network error prevents Docker from starting boulder causing
Travis tests to fail like it did at
https://travis-ci.org/certbot/certbot/jobs/282923098. This works around the
problem by using travis_retry to try to start boulder again if it fails.

This also moves the logic of waiting for boulder to start into
tests/boulder-fetch.sh so people running integration tests locally can benefit.
2017-10-12 17:00:13 -07:00
Joona Hoikkala
232f5a92d1 Fix naming in error message (#5181) 2017-10-11 08:18:41 -07:00
Brad Warren
1081a2501f integration test to prevent regressions of #5115 (#5172) 2017-10-11 08:18:17 -07:00
Brad Warren
03cbe9dd86 Document --no-directory-hooks (#5171) 2017-10-11 08:16:48 -07:00
Brad Warren
cacc40817b Update brew before installing packages (#5182)
* Update brew
2017-10-10 17:30:51 -07:00
r5d
d2c16fcb62 certbot: Flush output after write in IDisplay methods. (#5164)
- Update `notification`, `yesno`, `checklist`, `_print_menu`, and
  `_get_valid_int_ans` methods in `certbot.display.util.FileDisplay`.
- Update `notification` method in
  `certbot.display.util.NoninteractiveDisplay`.

Addresses issue #4879.
2017-10-04 18:06:57 -07:00
Brad Warren
a8051b58eb Update changelog to reflect 0.19.0. (#5170) 2017-10-04 17:58:10 -07:00
Brad Warren
2d4f36cc9f Merge pull request #5169 from certbot/candidate-0.19.0
Release 0.19.0
2017-10-04 16:58:07 -07:00
Brad Warren
13b4a4e1c2 Bump version to 0.20.0 2017-10-04 15:57:16 -07:00
Erica Portnoy
5ddde6b9ea python3 support 2017-10-04 13:50:03 -07:00
Erica Portnoy
8022d6c6f0 update docstring 2017-10-04 13:01:05 -07:00
Erica Portnoy
7567cdb0ce update unit tests 2017-10-04 12:35:57 -07:00
Erica Portnoy
be628544f8 don't add vhosts twice 2017-10-04 12:30:45 -07:00
Erica Portnoy
022f9317a5 address multiple default_server problem 2017-10-04 12:19:59 -07:00
Brad Warren
1f258449a4
Release 0.19.0 2017-10-04 12:11:20 -07:00
Erica Portnoy
db315e7113 Merge branch 'master' into issue_5030 2017-10-03 16:51:39 -07:00
yomna
3087b436f3 Delete after revoke [#4109] (#4914)
*     Switching from old branch (issue-4109) and addressing changes requested
    in last iteration of review:
    80aa857fd2

    Requested changes that were addressed:
    - fixed outdated docstring for `cert_path_to_lineage`
    - removed `full_archive_dir_from_renewal_conf` amd replaced with `full_archive_path` (and `_full_archive_path` -> `full_archive_path`)
    - matching on `cert` instead of `chain` in `cert_manager.cert_path_to_lineage`
    - fixed the two coding wrongs make a right issue

    Requested changes which were not addressed:
    - moving `cert_path_to_lineage` from `cert_manager` to `storage`,
      as it would introduce a hard to resolve circular dependency.

* Update integration tests to handle default deletion after revoke.

* Swapping test domains.

* Addressing PR feedback:
	- calling storage.full_archive_path with a ConfigObj instead of None
	- Removing lambda x: x.chain_path as an option to match against

* Addressing PR feedback: it's expected that len(pattern) is 0, so handle that case properly.

* Testing of conflicting values of --cert-name and --cert-path non-interactive mode.

* Silly test for when neither certname nor cert-path were specified.

* Changing archive_files to a private function, because mocking nested functions seems impossible.

* Tests for storage.cert_path_for_cert_name

* Splitting out _acceptable_matches

* Some tests for cert_manager.cert_path_to_lineage

* Offerings to the Lint God

* Cleaner way of dealing with files in archive dirs

* Handling the two different use cases of match_and_check_overlaps a bit better

* late night syntax errors

* Test for when multiple lineages share an archive dir

* Tests for certbot.cert_manager.match_and_check_overlaps

* Removing unneeded nesting

* Lint errors that Travis caught that didn't show up locally

* Adding two integration tests (matching & mismatched --cert-path, --cert-name)  based on feedback.

* Asking the user if they want to delete in interactive mode.
2017-10-03 16:36:26 -07:00
Erica Portnoy
352d2c6173 don't assume order from a set 2017-10-03 16:19:47 -07:00
Erica Portnoy
47b754e580 add configurator tests and leave finding the first server block for another PR 2017-10-03 15:11:21 -07:00
Brad Warren
356471cdf6 Add hook directories (#5151)
* Add hook dir constants

* Add hook dir properties to configuration

* test hook dir properties

* reuse certbot.util.is_exe

* Add certbot.hooks.list_hooks

* test list_hooks

* Run pre-hooks in directory

* Run deploy-hooks in directory

* Run post-hooks in directory

* Refactor and update certbot/tests/hook_test.py

* Add integration tests for hook directories

* Have Certbot create hook directories.

* document renewal hook directories

* Add --no-directory-hooks

* Make minor note about locale independent sorting
2017-10-03 13:52:02 -07:00
r5d
b9d129bd43 certbot: Stop using print in log module. (#5160)
* Update certbot.log.post_arg_parse_except_hook function.
* Update certbot.tests.log_test._test_common method.

See discussion #3720.
2017-10-03 12:52:41 -07:00
Giacomo Ghidini
b0e5809df2 [#5154] Enable certificate verification (incl. revocation) on Docker (#5159)
o Install `openssl` as part of `.certbot-deps`
o `certbot` on Docker container uses `openssl` to verify certificate
2017-10-02 18:34:59 -07:00
Erica Portnoy
ef4ee40ea2 add test for create_new_vhost_from_default 2017-10-02 17:36:41 -07:00
Joona Hoikkala
46052f826c Handle NoneType from Augeas better in Apache parser get_arg (#5135)
* Fix #4245

* Simpler, more accurate test

* Do not add empty values to parser modules

* Py26 fix
2017-10-02 16:18:37 -07:00
Brad Warren
5f6b1378ec Fixes #5115 (#5150) 2017-10-02 14:33:49 -07:00
Brad Warren
34d78ff626 Fix hook test. (#5152)
Up until now, this test was written incorrectly. In addition, when it has
failed, it simply prints error messages rather than reporting that the test
failed. This fixes both of these problems.
2017-10-02 13:20:35 -07:00
Erica Portnoy
d33da9bc7f Add docstring for create_new_vhost_from_default 2017-10-02 12:26:25 -07:00
Erica Portnoy
b748af3171 remove unneeded custom copy from Addr 2017-10-02 12:23:31 -07:00
Erica Portnoy
f764b422dd remove unused import 2017-10-02 12:19:24 -07:00
Erica Portnoy
40ac4f04c9 Switch isinstance(x, str) to isinstance(x, six.string_types) in the Nginx plugin 2017-10-02 12:02:31 -07:00
Erica Portnoy
c9e10e03c3 Fix existing bugs in nginxparser.py and obj.py 2017-09-30 14:41:50 -07:00
Erica Portnoy
4ef031ab39 make new vhost ssl 2017-09-29 18:39:08 -07:00
Erica Portnoy
f748627d18 remove traceback 2017-09-29 18:37:22 -07:00
Erica Portnoy
19235f3cc6 Allow installation if there's no appropriate vhost 2017-09-29 18:34:18 -07:00
Erica Portnoy
a805180cee add flag to suppress raising error if no match is found 2017-09-28 13:46:02 -07:00
Erica Portnoy
09309b885e Update test 2017-09-27 17:09:14 -07:00
Erica Portnoy
c8df0f9cde Allow authentication if there's no appropriate vhost 2017-09-27 17:06:23 -07:00
Brad Warren
cad7d4c8ed Update master to reflect 0.18.2 (#5127)
* Release 0.18.2

(cherry picked from commit d031c42b98)

* Bump version to 0.19.0
2017-09-27 16:02:40 -07:00
Joona Hoikkala
ba84b7ab49 Add test to prevent regressions of #4183 (#5134) 2017-09-27 15:51:28 -07:00
ohemorange
7412099567 Allow multiple interactive certname selections in certbot delete (#5133) 2017-09-27 15:47:40 -07:00
r5d
85deca588f Stop using print in certbot.main module. (#5121)
* Stop using print in `certbot.main` module.

* Update certbot.main.plugins_cmd` function.

* Update test methods `test_plugins_no_args`,
`test_plugins_no_args_unprivileged`, `test_plugins_init` and
`test_plugins_prepare` in `cerbot.tests.MainTest` class.

Addresses #3720.

* certbot: Add `patch_get_utility_with_stdout` function.

* Add functions `certbot.tests.util.patch_get_utility_with_stdout`
  and `certbot.tests.util._create_get_utility_mock_with_stdout`.

* certbot: tests: Update tests in MainTest.

* Update methods `test_plugins_no_args`,
`test_plugins_no_args_unprivileged`, and `test_plugins_init`,
`test_plugins_prepare` to use `patch_get_utility_with_stdout`.

* certbot: tests: Update _create_get_utility_mock_with_stdout.

* Update certbot.tests.util._create_get_utility_mock_with_stdout
  function. The mock function for all IDisplay methods, except
  `notification` method, calls _write_msg and _assert_valid_call.

* certbot: tests: Update `patch_get_utility_with_stdout`

* Update doc string.
* Argument stdout's default value is None now.

* certbot: tests: Update util._create_get_utility_mock_with_stdout.
2017-09-25 18:42:31 -07:00
Brad Warren
8b7d6c4ea3 Update changelog for 0.18.2 (#5128) 2017-09-25 16:46:04 -07:00
Christian Becker
36d5221bac certbot-dns-google: enable automatic credential lookup on google cloud (#5117)
- when no credentials are passed it will try to get valid credentials
using the google metadata service
- this is a feature of the google SDK, so we don't need to handle that
explicitly
- previous behaviour with a credentials file is retained
2017-09-25 12:17:15 -07:00
Joona Hoikkala
1ce813c3cc Do not parse disabled configuration files from under sites-available on Debian / Ubuntu (#4104)
This changes the apache plugin behaviour to only parse enabled configuration files and respecting the --apache-vhost-root CLI parameter for new SSL vhost creation. If --apache-vhost-root isn't defined, or doesn't exist, the SSL vhost will be created to originating non-SSL vhost directory.

This PR also implements actual check for vhost enabled state, and makes sure parser.parse_file() does not discard changes in Augeas DOM, by doing an autosave.

Also handles enabling the new SSL vhost, if it's on a path that's not parsed by Apache.

Fixes: #1328
Fixes: #3545
Fixes: #3791
Fixes: #4523
Fixes: #4837
Fixes: #4905

* First changes

* Handle rest of the errors

* Test fixes

* Final fixes

* Make parse_files accessible and fix linter problems

* Activate vhost at later time

* Cleanup

* Add a new test case, and fix old

* Enable site later in deploy_cert

* Make apache-conf-test default dummy configuration enabled

* Remove is_sites_available as obsolete

* Cleanup

* Brought back conditional vhost_path parsing

* Parenthesis

* Fix merge leftovers

* Fix to work with the recent changes to new file creation

* Added fix and tests for non-symlink vhost in sites-enabled

* Made vhostroot parameter for ApacheParser optional, and removed extra_path

* Respect vhost-root, and add Include statements to root configuration if needed

* Fixed site enabling order to prevent apache restart error while enabling mod_ssl

* Don't exclude Ubuntu / Debian vhost-root cli argument

* Changed the SSL vhost directory selection priority

* Requested fixes for paths and vhost discovery

* Make sure the Augeas DOM is written to disk before loading new files

* Actual checking for if the file is parsed within existing Apache configuration

* Fix the order of dummy SSL directives addition and enabling modules

* Restructured site_enabled checks

* Enabling vhost correctly for non-debian systems
2017-09-25 12:03:09 -07:00
Noah Swartz
ade01d618b add info about -d (#5097) 2017-09-21 08:52:01 -07:00
Michał Zegan
5a4028c763 fix dns-rfc2136 plugin not respecting cnames (#5101)
* fix dns-rfc2136 plugin not respecting cnames

The plugin does not work if the domain of a certificate is found to have a cname record in dns.
That is because when plugin tries to find zone boundary, it searches from the domain up for the SOA record, and each DNS response is checked for the answer being empty, assuming that empty answer means no SOA record is present and the higher level domain has to be checked, and non empty answer section means that this domain is a zone root.
However, if the initial domain, or any upper level domain except the zone root has a cname record pointing to the zone root, then the server will, instead of returning an empty answer, return one containing two records, first a cname pointing to the zone root, then the SOA record of zone root, and that will make the check fail and use a wrong domain as a zone name during update.
Fix that by replacing a check for empty answer with explicitly searching in response's answer section for a SOA record matching the domain that is being checked.

* dns-rfc2136: fix lint errors
2017-09-20 11:29:48 -07:00