Commit Graph
2125 Commits
Author SHA1 Message Date
r5dandBrad Warren b43bf8f94a Stop using print in certbot.cli module. (#5028)
* Update cerbot.tests.util.patch_get_utility (#3720)

* Add new arg `stdout_notification` to
  `cerbot.tests.util.patch_get_utility` function.

  If `stdout_notification` is True, then the mock
  interfaces.IDisplay.notification function will print out to stdout.

* Add new arg `stdout_notification` to _create_get_utility_mock
  function.

* Add new function `_stdout_notification`.

* Stop using print in certbot.cli (#3720)

* certbot/cli.py (HelpfulArgumentParser._usage_string)
(HelpfulArgumentParser.__init__): Update methods.
* certbot/tests/cli_test.py (test_cli_ini_domains, test_no_args)
(test_install_abspath, test_help, test_help_no_dashes)
(test_parse_domains, test_preferred_challenges, test_server_flag)
(test_must_staple_flag, test_no_gui, test_staging_flag)
(test_dry_run_flag, test_option_was_set)
(test_encode_revocation_reason, test_force_interactive)
(test_deploy_hook_conflict, test_deploy_hook_matches_renew_hook)
(test_deploy_hook_sets_renew_hook, test_renew_hook_conflict)
(test_renew_hook_matches_deploy_hook)
(test_renew_hook_does_not_set_renew_hook, test_max_log_backups_error)
(test_max_log_backups_success, test_webroot_map)
(test_report_config_interaction_str)
(test_report_config_interaction_iterable): Update tests.
* certbot/tests/main_test.py (test_certificates)
(test_certonly_abspath, test_certonly_bad_args)
(test_agree_dev_preview_config): Update tests.

* certbot: Refactor cli_test.ParseTest.

* certbot/tests/cli_test.py (ParseTest._unmocked_parse): Rename parse
to _unmocked_parse.
(parse): New method.
(ParseTest._help_output, ParseTest.test_cli_ini_domains)
(ParseTest.test_no_args, ParseTest.test_install_abspath)
(ParseTest.test_help, ParseTest.test_help_no_dashes)
(ParseTest.test_parse_domains, ParseTest.test_preferred_challenges)
(ParseTest.test_server_flag, ParseTest.test_must_staple_flag)
(ParseTest.test_no_gui, ParseTest.test_staging_flag)
(ParseTest.test_dry_run_flag, ParseTest.test_option_was_set)
(ParseTest.test_encode_revocation_reason)
(ParseTest.test_force_interactive)
(ParseTest.test_deploy_hook_conflict)
(ParseTest.test_deploy_hook_matches_renew_hook)
(ParseTest.test_deploy_hook_sets_renew_hook)
(ParseTest.test_renew_hook_conflict)
(ParseTest.test_renew_hook_matches_deploy_hook)
(ParseTest.test_renew_hook_does_not_set_renew_hook)
(ParseTest.test_max_log_backups_error)
(ParseTest.test_max_log_backups_success): Update methods.

* certbot: Refactor cli_test.SetByCliTest

* certbot/tests/cli_test.py (SetByCliTest.test_webroot_map)
(SetByCliTest.test_report_config_interaction_str)
(SetByCliTest.test_report_config_interaction_iteratable)
(_call_set_by_cli): Update methods.

* certbot: cli: Fix style.

* certbot/cli.py (HelpfulArgumentParser.__init__): Update method.

* certbot: Revert changes to tests.util.patch_get_utility

* certbot/tests/util.py (patch_get_utility): Remove
`stdout_notification` arg.
(_creat_get_utility_mock): Remove `stdout_notification` arg.
(_stdout_notification): Remove function.

* certbot: Revert changes to MainTest.

* certbot/tests/main_test.py
(MainTest.test_certificates, MainTest.test_certonly_abspath)
(MainTest.test_certonly_bad_args): Update methods.

* certbot: cli_test.py: Remove 'pylint: disable' lines.

* certbot/tests/cli_test.py (ParseTest.parse): Update method.
(_call_set_by_cli): Update function.
2017-08-25 10:05:58 -07:00
Winston SmithandBrad Warren 8ca36a0b62 Organize + document certbot/tests/testdata directory (#4983)
* wp organize keys documentation start

* oganized testdata directory + readme

* clean up doc

* del acme change
2017-08-23 10:32:27 -07:00
Winston SmithandBrad Warren 16ed141301 Include plugin selection at the info logging level (#5010)
* Plugin selection on INFO

* Fixed lint errors

* Fixed lint errors

* record_chosen_plugin log plugin
2017-08-10 16:51:19 -07:00
Noah SwartzandGitHub af322a6068 Merge pull request #4896 from certbot/order-matters2
Explain --domains and --cert-name usage
2017-08-10 09:51:19 -07:00
cj-devandBrad Warren 48c890be61 #4434 Test Config Base Class (#4974)
* Addressing #4434 by implementing ConfigTestCase which mocks out a NamespaceConfig for consistent config use across tests

* Refactor account_test.py for use with ConfigTestCase

* Remove superfluous setup/teardown

* Pylint oops.

* Fix redundant inheritance class definitions

* Separate ConfigTestCase's mocked directories

* Module import style consistency

* Refactor log_test.py for use with ConfigTestCase

* Refactor eff_test.py for use with ConfigTestCase. Also tweak for import style consistency

* Refactor reverter_test.py for use with ConfigTestCase

* Refactor renewal_test.py for use with ConfigTestCase

* Refactor main_test.py for use with ConfigTestCase

* Refactor storage_test.py for use with ConfigTestCase

* Refactor cert_manager_test.py for use with ConfigTestCase

* Refactor client_test.py for use with ConfigTestCase

* Refactor configuration_test.py for use with ConfigTestCase

* Pylint!

* Incorporating PR feedback

* Remove comment
2017-08-09 13:19:43 -07:00
Noah SwartzandBrad Warren f9ed53e698 Revocation reason (#4987)
* fix revocation reason help text

* add it to the docs

* move and expand revoke reason example
2017-08-07 17:13:27 -07:00
Brad WarrenandPeter Eckersley d4676610e9 Unhide Nginx (#4969)
* Be careful with new interaction from enabling nginx

* Fix py3 compataibility & better docs

* Make minor changes to @pde's PR to unhide nginx

* unhide nginx plugin

* Only protect against nginx interaction in cb-auto
2017-08-07 08:36:41 -07:00
Brad Warren 744c993040 Bump version to 0.18.0 2017-08-01 17:01:19 -07:00
Brad Warren 912d235466 Release 0.17.0 2017-08-01 17:01:07 -07:00
Zach ShepherdandBrad Warren 314f4bbe22 client: allow callers to add information to the user agent (#4690)
This change introduces a new flag to allow callers to add information to
the user agent without replacing it entirely.

This allows people re-packaging or wrapping Certbot to influence its user
agent string. They may which to do this so that stats/metrics related to
their distribution are available to boulder.

This is beneficial for both the Certbot team and the party re-packaging
Certbot as it allows the custom user agent to match the Certbot user
agent as closely as possible, allowing data about use of the re-packaged
version to be collected along side or separately from vanilla certbot.
2017-08-01 11:34:35 -07:00
r5dandohemorange 142ced234b Add cert name in renewal error messages (#4932) (#4957)
* Add cert name in renewal error messages (#4932)

* certbot: Fix error message in `handle_renewal_request`.
2017-07-26 13:16:20 -07:00
Brad Warren c314ec0474 Correct --cert-name and --domains usage.
* Revert "Mention that the domain is used to choose filename"

This reverts commit 1c06144e18.

* Correct --cert-name and --domains usage.

* Clarify which paths --domains affects
2017-07-20 17:26:05 -07:00
Jacob Hoffman-AndrewsandBrad Warren d327c1c28f Tweak non-root error message. (#4944)
For most people, the right answer will be "run as root," so we should emphasize
that over the "how to run as non-root" instructions.
2017-07-18 12:47:10 -07:00
yomnaandGitHub 7d0e4d7bad Merge pull request #4915 from Baeumla/master
Check keys if revoke certificate by private key
2017-07-17 15:54:47 -07:00
Chris J a8b5dfc76c Enhancement #4893. More copypastable output, including private key location on disk 2017-07-16 22:38:21 -04:00
Baime 0f30f9e96f Added test to check revoke cert by key mismatch 2017-07-15 15:17:25 +02:00
r5dandohemorange 331d12ed50 certbot: Update storage.get_link_target (#4750) (#4923)
* certbot: Update storage.get_link_target (#4750)

* The `get_link_target` function raises `errors.CertStorageError` when
  link does not exists.

* certbot: Fix typo in storage.get_link_target.
2017-07-13 10:13:59 -07:00
Brad WarrenandGitHub 29d80f334f Merge pull request #4907 from certbot/backup-count
Make Certbot's log rotation configurable
2017-07-13 08:56:24 -05:00
Brad Warren a7a8e060e3 Finish adding configurable log rotation
* Update log backupCount name and description.

* Add additional error handling to --log-backups

* test --log-backups flag

* Pass log_backups value to RotatingFileHandler

* Test that log_backups is properly used

* add _test_success_common

* Add test_success_with_rollover

* Add test_success_without_rollover

* mock stderr in cli tests

* Set log_backups in PostArgParseSetupTest

* Rename "log backups" to "max log backups"
2017-07-11 21:14:18 -05:00
yomnaandBrad Warren bc3765d6d0 No longer mask failed challenge errors with encoding errors (#4867)
*     no longer masker failed challenge errors with encoding errors

* simplifying through type-checking

* bytes
2017-07-10 21:05:52 -05:00
John HarlanandBrad Warren fad1a4b576 Add flags to configure log rotation
* Add & enable --disable-log-rotation

* Add --max-log-count

* Correct max-log-count: remove action=store_true add type=int

* Add logging to cli argument groups.

* Add logging group to HELP_TOPICS in __init__

* Adjust line length

* test simplifying to one argument
2017-07-10 19:43:28 -05:00
Baime 368beee8bf Use correct key/cert for revoke by key test 2017-07-09 12:10:35 +02:00
Baime 3a9150a7ba Fix for revoke cert by key process 2017-07-08 19:36:39 +02:00
Baime ab286e0887 fixed path errors in revoking by key process 2017-07-08 18:00:33 +02:00
Baime 62bdf663f2 Check keys if revoke certificate by private key 2017-07-08 16:20:12 +02:00
Florian Mutterandohemorange 48ef16ab0d Align domain names output to command line input (#4874)
The command line takes a comma separated list of domain names. To be able to use the list of existing domain names it would be helpful to get a list that is also comma separated.

Sample use case: If you would like to add a new domain to an existing certificate you need to list all existing domain names.

Makes certbot certificates use comma-separated domain names instead of space-separated.
2017-07-07 12:46:30 -07:00
ohemorangeandGitHub 57e56cc97b Candidate 0.16.0 (#4908)
* Release 0.16.0

* Bump version to 0.17.0
2017-07-06 15:57:11 -07:00
yomnaandGitHub 1f3b028398 Merge pull request #4895 from certbot/deploy-hook
Deploy hook
2017-07-06 15:56:55 -07:00
ohemorangeandGitHub 97b22da1b6 Replace the easy v. secure prompt with more clear choices (#4897)
* Replace the easy v. secure prompt with more clear choices
2017-06-30 17:12:09 -07:00
Peter EckersleyandBrad Warren 595745e044 Clarify domain name <-> cert name docs 2017-06-30 13:58:18 -04:00
Brad Warren 62327b49c3 Test hook validation order 2017-06-30 11:40:34 -04:00
Brad Warren 8a664622ea Call deploy_hook during certonly and run 2017-06-30 10:33:49 -04:00
Brad Warren 1b65ba88d8 test hooks.deploy_hook 2017-06-30 10:30:33 -04:00
Brad Warren e94ee31a6f add hooks.deploy_hook 2017-06-30 10:24:00 -04:00
Brad Warren 32fa3b1d04 test deploy-hook and renew-hook match 2017-06-30 09:59:19 -04:00
Brad Warren ad4ed22932 test --renew-hook 2017-06-30 09:56:17 -04:00
Brad Warren feffeb275b add --renew-hook error handling 2017-06-30 09:56:17 -04:00
Brad Warren 4243db1525 test --renew-hook is hidden 2017-06-30 09:56:17 -04:00
Brad Warren 220d486190 remove --renew-hook from help output 2017-06-30 09:56:17 -04:00
Brad Warren ed4be4117c hide --renew-hook 2017-06-30 09:56:17 -04:00
Brad Warren 5cf82e4843 test --deploy-hook 2017-06-30 09:56:13 -04:00
Brad Warren af354e9099 add --deploy-hook parsing 2017-06-30 09:18:07 -04:00
Brad Warren d57e8bfaa3 add --deploy-hook 2017-06-30 09:11:51 -04:00
Brad WarrenandGitHub 828363b21a Fix nginx --dry-run (#4889)
* Revert "Don't save keys/csr on dry run (#4380)"

This reverts commit e034b50363.

* Don't save CSRs and keys during dry run

* Factor out _test_obtain_certificate_common

* Add test_obtain_certificate_dry_run

* Wrap key from make_key in util.Key

* Wrap result from make_csr in util.CSR
2017-06-30 08:10:55 -04:00
Alexandre de VerteuilandBrad Warren ed717d6bc4 tls-sni-01 with the manual plugin (#4636)
* Add TLS-SNI-01 support to Manual plugin

* Add environment variable CERTBOT_SNI_DOMAIN for manual-auth-hook

* Make AuthenticatorTest inherit from TempDirTestCase

* Add test_get_z_domain()

* Document CERTBOT_SNI_DOMAIN in docs/using.rst
2017-06-19 09:39:14 -07:00
Matt DaintyandZach Shepherd 811d436d5a RFC 2136 DNS Authenticator (#4701)
Introduce a plugin that automates the process of completing a dns-01 challenge by creating, and subsequently removing, TXT records using RFC 2136 Dynamic Updates (a.k.a. nsupdate).

This plugin has been tested with BIND, but may work with other RFC 2136-compatible DNS servers, such as PowerDNS.
2017-06-16 16:53:46 -07:00
Brad WarrenandPeter Eckersley bb8e504a02 Add warning about changing the UA (#4843) 2017-06-16 15:01:13 -07:00
Zach ShepherdandBrad Warren 3f86e13acc LuaDNS DNS Authenticator (#4605)
Implement an Authenticator which can fulfill a dns-01 challenge using
the LuaDNS API. Applicable only for domains using LuaDNS for DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-luadns -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Path to credentials file without an email.
    * Path to credentials file with an invalid email.
    * Path to credentials file without a token.
    * Path to credentials file with an invalid token.
    * Domain name not registered to LuaDNS account.
2017-06-16 14:43:12 -07:00
Zach ShepherdandBrad Warren f51d345d5b Low-impact cleanup of IDisplay (#4818)
Remove unused help-related display code. When NcursesDisplay was
removed[1], help was deprecated. This change removes the remaining
bits and pieces of code.

Remove unused escape-related display code. When NcursesDisplay was
removed[1], escape was deprecated. This change removes the remaining
bits and pieces of code.

Remove uses of unused menu parameters.

Remove unused default_status/default_state argument from checklist.
(This seems safe because not only is it unused, the parameter has
different names in the interface and implementation)

1 - d54cb76432

Resolves #4795.
2017-06-15 17:14:38 -07:00
Zach ShepherdandBrad Warren 0a269f31d0 DNS Made Easy DNS Authenticator (#4603)
Implement an Authenticator which can fulfill a dns-01 challenge using
the DNS Made Easy API. Applicable only for domains using DNS Made Easy.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
   (`http://api.sandbox.dnsmadeeasy.com/V2.0` used as the
    `api_endpoint` for all manual testing)
    * Used `certbot certonly --dns-dnsmadeeasy -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Path to credentials file with an invalid API key.
    * Path to credentials file with a malformed API key.
    * Path to credentials file with an invalid Secret key.
    * Path to credentials file with a malformed Secret key.
    * Domain name not registered to DNS Made Easy account.
2017-06-15 16:41:00 -07:00