Commit Graph
2125 Commits
Author SHA1 Message Date
Brad WarrenandGitHub 79d5c890c3 Add a timeout to prompts (#4601)
* Add input_with_timeout

* use input_with_timeout
2017-05-01 14:55:31 -07:00
Brad WarrenandPeter Eckersley 5ca8f7c5b9 Add lockfile (#4449)
* add lock_file

* cleanup lock file

* Add LockFile tests

* add lock_dir

* add lock_dir_until_exit

* add set_up_core_dir and move lock_dir_until_exit

* Move lock_and_call to certbot.test.util

* Add lock to Apache

* Add lock to the Nginx plugin

* Improve permissions error message

* sort plugins

* add test_prepare_order

* provide more actionable permissions error

* Document and catch use of OSError

* don't lock a directory twice

* add conditional dependency on ordereddict

* Add lock_test

* expand sorted plugins comment

* Add lock_test to lint

* make make_lineage more conventional and flexible

* enhance lock_test.py

* add lock_test to tox

* Readd success message

* make py26 happy

* add test_acquire_without_deletion
2017-05-01 14:49:12 -07:00
ohemorangeandGitHub 5885b09e13 Merge pull request #4354 from certbot/more-ua
Add extra information to user-agent
2017-04-28 19:17:39 -07:00
Peter Eckersley 72b6179e0e Remove vestigial thingy 2017-04-28 18:46:01 -07:00
Peter Eckersley f6c02728e4 Address review comments 2017-04-28 18:42:03 -07:00
Peter Eckersley 0a4ee306a9 Fix UA flag setting (and set more of them) 2017-04-28 18:02:34 -07:00
Noah Swartz 8ceb216fe5 add to cli.py 2017-04-28 15:30:07 -07:00
schoenandBrad Warren 0c4e813a72 Demote PEM generation to logger.debug (#4549) 2017-04-26 10:54:40 -07:00
Zach ShepherdandBrad Warren b41472afce Enhance display.util to support input validation (#4372)
* display: support validation of user input

To avoid each caller of `display.input` and `display.directory_select`
needing to implement validation logic, this allows for a validator to be
supplied as a part of the call.

Following the existing pattern from `webroot`, this validator is expected
to throw a `Error` when it encounters invalid input. The user then
receives a `notification` is re-prompted.

Testing Done:
 * tox -e py27
 * tox -e lint

* plugins: update webroot to use display's validation functionality

This change updates the webroot plugin to use the now-built-in validation
functionality in display, reducing duplicated code.

Testing Done:
 * tox -e py27
 * tox -e lint

* display: move validation logic to ops

To avoid adding complexity to `IDisplay` methods, move validation logic
to helper methods in `display.ops`.

Testing Done:
 * tox -e py27
 * tox -e lint
2017-04-24 17:36:00 -07:00
Jacob Hoffman-AndrewsandBrad Warren d54cb3c59d Improve Account.repr() (#4325)
* Include more detail in Account's repr.

In particular, regr and meta.

* Fix test.

* Review feedback.

* Lint

* Test prefix only.
2017-04-18 17:09:22 -07:00
Arthur GautierandBrad Warren b0600483fd interface: IConfig is missing fields used in client.py (#4453)
Signed-off-by: Arthur Gautier <baloo@gandi.net>
2017-04-18 11:18:56 -07:00
Peter Eckersley 5be0811bdc Replace removed "renewing" with potential future substitutes :/ 2017-04-13 20:07:03 -07:00
Peter Eckersley cb66ba95e1 Revert "Also report if we're renewing"
This reverts commit 6fa521bc5f.
2017-04-13 20:00:31 -07:00
Carl Michael SkogandPeter Eckersley f54280d9b9 Use binary flag when writing cert and key files (#4462)
* Use binary flag when writing cert and key files

Add binary flag to mode argument when opening files for writing key and
certificate files.
On Python 3 the data buffers use for writing are bytes objects not
strings, and the write fails accordingly.
As far as I understand, it the "b" flag will not hurt things in Python 2
either.

* Update the tests for RenewableCert::save_successor

Update the tests for RenewableCert::save_successor after changing
three  parameters to be called with bytes objects instead of strings.

Also, update the doc comment of the function.
2017-04-13 19:10:12 -07:00
Brad WarrenandGitHub bd8c31021a Logging setup before argument parsing (#4446)
Second part of #4443. Built on #4444. Fixes #3148.

This fixes an old problem with code logging messages before logging has been set up. How this works is explained in the docstring of certbot.log.pre_arg_setup.

* add memory handler

* Add exit_with_log_path

* add new_except_hook

* pre_arg_parse_setup++ and remove old except_hook

* Rewrite post_arg_setup

* test restricted permissions

* move changes to main

* Use .name of NamedTemporaryFile

* use better assertions

* set exc_info in except_hook

* Make post_arg_setup more robust

* final cleanup

* Add TempHandler

* undo main_test changes

* improve documentation

* use decorators instead of with for mock.patch

* add inline comment about logging.shutdown
2017-04-13 13:42:01 -07:00
Noah SwartzandBrad Warren 3381cc10ec fix 3664 (#4495) 2017-04-13 11:57:14 -07:00
Noah SwartzandGitHub 9f3e9e56a9 Merge pull request #4497 from certbot/star-link
Make sphinx happy
2017-04-13 09:48:18 -07:00
John Morrissey fef3262759 add example of --renew-hook envvar values and hook script (#3502) 2017-04-13 11:00:32 -04:00
Brad Warren 42d732d3c2 make sphinx happy 2017-04-12 18:38:45 -07:00
Peter EckersleyandGitHub fbaf145c29 "Renew" now ignores domains in cli.ini (#4479)
* "Renew" now ignores domains in cli.ini

* Document things slightly better

* fix variable names

* py3fix
2017-04-12 15:48:58 -07:00
Yen Chi HsuanandBrad Warren 4b91f7fbbc Replace e.message with str(e) for Python 3 compatibility (#4416) 2017-04-07 09:58:19 -07:00
Jacob Hoffman-AndrewsandBrad Warren cacee80c51 Move make_csr into acme.crypto_util (#4165)
It's relatively finicky to make a CSR appropriate to pass to poll_and_request_issuance. I think most users want to be able to give a list of domains and a private key, and get back a CSR. This branch adds that functionality to crypto_util.

Note that the two new functions take arguments, and return values, as PEM-encoded buffers. This is a departure from some existing ACME interfaces that take PyOpenSSL types. I've discussed with the Certbot team, and we agree that this is broadly the direction the ACME API should take, so that users of the module don't need to import PyOpenSSL themselves, or use its primitives.

* Add make_csr.

* accept privkey

* Tweak API.

* Remove make_csr from certbot package.

* Skip test in older Pythons.

* Move get_Extensions call under protection.

* Remove assertIn because not backwards-compatible.

* Fix encoding, and use PEM.

* Fix test

* Fix tests on py35.

* Fix error in test.

* Make import_csr_file always return PEM.

Also delete get_sans_from_csr (unused) and get_names_from_csr (newly unused).

* Fix function doc.

* Fix indent

* Fix call of obtain_certificate_from_Csr

* lint

* Handle review feedback.

* Fix test.
2017-04-07 09:43:33 -07:00
Brad WarrenandGitHub 2e8a5ef477 Call certbot client cb_client rather than acme_client (#4357)
In some sense, certbot.client.Client is an ACME client, but it's the not the client in the ACME library and this leads to confusion. Let's make what this is clear.

* call certbot client cb_client rather than acme_client

* update tests
2017-04-06 16:05:54 -07:00
Peter Eckersley c35ca9775b tweak comment 2017-04-06 14:41:40 -07:00
Erica PortnoyandGitHub 82f3f7523e Candidate 0.13.0 (#4475)
* Release 0.13.0

* Bump version to 0.14.0
2017-04-06 11:33:32 -07:00
Peter Eckersley 23a2ecb36e Fixup 2017-04-05 15:28:14 -07:00
Erica PortnoyandGitHub 18486d6ea0 Revert "More thoroughly rename during certbot rename. (#4320)" (#4467)
This reverts commit 43dccfc671.
2017-04-05 12:45:03 -07:00
Peter Eckersley 2f0ec5c388 Set renewing: correctly for the "renew" case. 2017-04-05 12:40:26 -07:00
Peter Eckersley b614fe8491 Merge remote-tracking branch 'origin/master' into more-ua 2017-04-05 11:58:03 -07:00
Peter Eckersley 572b9fe5be Merge remote-tracking branch 'origin/master' into more-ua 2017-04-05 11:57:51 -07:00
Peter Eckersley a313eebc7f Conform to RFC 1945 2017-04-05 11:54:23 -07:00
Peter EckersleyandGitHub 2bdfffb23a Support "certbot-auto --no-bootstrap" (#3955)
* Support "certbot-auto --no-bootstrap"

* Tell people about --no-bootstrap?

* Document new certbot-auto flag in its cli help

* Rebuild

* Less variables is less variability

* Alphabetize help

* Make it extra clear we only take one branch

* Add --no-bootstrap message to experimentalbootstrap exit
2017-04-04 16:12:31 -07:00
Erica PortnoyandGitHub 43dccfc671 More thoroughly rename during certbot rename. (#4320)
* rename more files in rename command

* Revert "Hide rename command (#4007)"

This reverts commit 8c14de13a5.

* Rename files in configuration files

* Delete new files if we fail during the renaming process

* update tests and error catching

* More expressive error message
2017-04-04 11:20:58 -07:00
Brad WarrenandGitHub e194e0dd5f Refactoring for better logging (#4444)
* Move colored_logging.py to log.py

* Add atexit.register code to util

* Add tests for atexit_register

* Copy except_hook to log

* Add pre_arg_setup

* move setup_log_file_handler to log.py

* Add post_arg_setup

* move changes to main

* Undo changes to MainTest

* s/pre_arg_setup/pre_arg_parse_setup

* s/post_arg_setup/post_arg_parse_setup
2017-03-30 16:17:57 -07:00
Brad WarrenandGitHub a542fcd019 Revert "Add a global lock file to Certbot (#4369)" (#4445)
This reverts commit 32122cfa21.
2017-03-30 15:47:31 -07:00
Zach ShepherdandBrad Warren 67e11ae1d8 tests: deduplicate temporary directory code (#4078) (#4297)
Introduce a test class to deduplicate temporary directory setup and teardown in
testing code and update existing test code to use this new class.
2017-03-29 10:01:16 -07:00
Noah SwartzandGitHub 446509620f Merge pull request #4420 from certbot/issue4331
Ensure --fullchain-path gets put under paths in --help all
2017-03-28 14:08:56 -07:00
Erica PortnoyandGitHub e9608945c3 Change registering unsafely without email logging level to info (#4425)
* Change registering unsafely without email logging level to info

* update test with new behavior
2017-03-27 14:47:14 -07:00
Erica Portnoy 7d57e3104a Ensure --fulchain-path gets put under paths in --help all 2017-03-27 12:20:51 -07:00
Brad WarrenandGitHub b7d282309d Save hyphenated plugin params for renewal (#4281)
* fix plugin namespace check

* Add test to prevent regressions
2017-03-20 17:57:09 -07:00
Brad WarrenandPeter Eckersley 32122cfa21 Add a global lock file to Certbot (#4369)
* add fasteners as a dependency

* add LOCK_FILE constant

* Add lock file to Certbot

* Move code to _run_subcommand

* move lock file path into CLI_CONSTANTS

* add --lock-path flag

* move locking code to separate function

* Add TestAcquireFileLock

* assert we log

* test lock contention

* add fasteners to certbot-auto

* Use a different lock file for each test in MainTest
2017-03-20 15:48:39 -07:00
dokazakiandBrad Warren 8011fb2879 Add mypy (#4386)
* Initial configuration of mypy in box, correction of base mypy errors.

* Move mypy install to toe

* Add pylint comments for typing imports.

* Remove typing module for Python 2.6 compatibility.
2017-03-18 19:10:10 -07:00
Daniel HuangandBrad Warren 679887f691 Add --debug-challenges flag (#1684) (#4385)
* Add --debug-challenges flag (#1684)

* Specify None as topic for --debug-challenges
2017-03-18 18:33:29 -07:00
Daniel HuangandBrad Warren d54d3eba78 Retry fetch chain errors (#4196) (#4383)
* Retry fetch chain errors (#4196)

* Trying to avoid confusing pylint

* Pylint disable

* Typo certz->certr

* Move pylint disable, log when fetch chain fails
2017-03-18 17:04:16 -07:00
Daniel HuangandBrad Warren e034b50363 Don't save keys/csr on dry run (#4380)
* Don't save keys/csr on dry run (#2495)

* Replace assertIsNone for py26

* Fix config defaults for compat tests
2017-03-18 13:42:54 -07:00
Peter Eckersley 4846217445 Make config.renewing always a string. 2017-03-17 15:20:24 -07:00
Brad WarrenandPeter Eckersley edcfc49303 Use setattr in NamespaceConfig (#4362)
* set setattr in NamespaceConfig

* remove unnecessary uses of .namespace

* add simple test to ensure it works
2017-03-17 13:02:41 -07:00
Peter Eckersley f259a17549 Lint 2017-03-16 01:14:34 -07:00
Peter Eckersley 6fa521bc5f Also report if we're renewing 2017-03-15 18:02:03 -07:00
Peter Eckersley 9aca5d2a79 Merge remote-tracking branch 'alex/user-agent-python-version' into more-ua 2017-03-15 17:51:34 -07:00