Commit graph

533 commits

Author SHA1 Message Date
Brad Warren
00a0e70fe6 test lock contention 2017-03-17 12:16:34 -07:00
Brad Warren
dc85f0c45f assert we log 2017-03-17 11:14:07 -07:00
Brad Warren
92aa5d8670 Add TestAcquireFileLock 2017-03-17 11:12:12 -07:00
Brad Warren
a48283c163 move locking code to separate function 2017-03-17 10:48:03 -07:00
Brad Warren
07b41dffe3 add --lock-path flag 2017-03-17 10:27:15 -07:00
Brad Warren
f61571bf0d move lock file path into CLI_CONSTANTS 2017-03-17 10:04:07 -07:00
Brad Warren
3caf7b9ad0 Move code to _run_subcommand 2017-03-17 09:55:33 -07:00
Brad Warren
440d2d5255 Add lock file to Certbot 2017-03-16 15:18:42 -07:00
Brad Warren
cd89f39f62 add LOCK_FILE constant 2017-03-16 15:02:45 -07:00
Jacob Hoffman-Andrews
018a304cd6 Remove Link rel=next for authzs and new-certs. (#4303)
An early version of the spec indicated that clients should process issuance
sequentially, following Link rel=next from an account URL to an authz URL, to a
new-cert URL. However, the spec has long since moved to putting these URLs in
the directory.

Certbot nominally supports either; This change consolidates on always using the
directory, simplifying things and making the transition to the latest ACME spec
easier.

* Revert "Revert "Remove Link rel=next for authzs and new-certs." (#4277)"

This reverts commit 11ec1eb911.

* Save new_authzr_uri with account for older clients.

* Add test that new_authzr_uri exists in regr.

* Restore backwards compatibility for new_authzr_uri.

* Fix account_test.

* Add test for deprecated URI argument to request_challenges.

* Review feedback.

* Fix test

* Add omitempty to new_cert_uri.
2017-03-14 21:44:57 -07:00
Brad Warren
82736e21d4 Improve path_surgery warning (#4293)
Stops output like:

Failed to find certbot.log in PATH: ...
renew-hook command certbot.log exists, but is not executable.
2017-03-06 17:32:49 -08:00
Alex Bowers
80326511bb Improve error reporting for hooks (#4235)
* Improve error reporting for hooks

* My bad

* Whitespace.
2017-03-03 10:28:05 -08:00
Blake Griffith
12a6e49cf1 Remove use of sha1 (#4271)
These are not security critical uses of sha1 but they should still be removed.
2017-03-02 21:16:19 -08:00
Jacob Hoffman-Andrews
53117b0ce0 Remove UnexpectedUpdate exceptions. (#4197)
* Remove UnexpectedUpdate exceptions.

These exceptions trigger when the server sends the client back an object with a
field that doesn't exactly match what the client previously sent.

This causes unnecessary breakage in various cases, doesn't prevent any problems,
and isn't required by spec.

* Back out all UnexpectedUpdate removals except registration update.
2017-03-02 17:27:29 -08:00
Erica Portnoy
5e671682ca Candidate 0.12.0 (#4286)
* Release 0.12.0

* Bump version to 0.13.0
2017-03-02 15:26:24 -08:00
Brad Warren
11ec1eb911 Revert "Remove Link rel=next for authzs and new-certs." (#4277) 2017-03-02 10:31:15 -08:00
Damien Tournoud
44a6ec29c5 Fix direct usages of the root logger (#4236)
Some code uses `logging.debug` and `logging.info` instead of
the file-specific logger in `logger.debug` and `logger.info`.
2017-02-27 18:13:06 -08:00
Erica Portnoy
52ce335ff0 lineage_for_certname should return None if there is no existing renewal file (#4243)
* lineage_for_certname should return None if there is no existing renewal file

* add unit test

* add regression test to integration test

* revent boulder-start to boulder-fetch
2017-02-23 18:31:23 -08:00
Erica Portnoy
5bab6b512f Refactor main (#4127)
* Refactor main to simplify logic

* Update tests and comments

* Correct main test

* increase timeout limit

* reset timeout limit

* call renew_cert in appropriate main test

* Update docstrings and revert signatures of _report_new_cert and _suggest_donation_of_appropriate

* replace renew_cert logic

* update tests

* rename _csr_obtain_cert and add a check to _report_new_cert
2017-02-22 13:08:56 -08:00
Jacob Hoffman-Andrews
1380e59f56 Remove Link rel=next for authzs and new-certs. (#4194)
An early version of the spec indicated that clients should process issuance
sequentially, following Link rel=next from an account URL to an authz URL, to a
new-cert URL. However, the spec has long since moved to putting these URLs in
the directory.

Certbot nominally supports either; This change consolidates on always using the
directory, simplifying things and making the transition to the latest ACME spec
easier.
2017-02-13 19:50:33 -08:00
Chad Whitacre
b0ee98a5c3 Satisfy linter 2017-02-13 09:04:15 -05:00
Chad Whitacre
90bbd93b05 Fix test 2017-02-13 08:49:35 -05:00
Chad Whitacre
14ce872b6b Remove erroneous advice
Per @pfg at https://community.letsencrypt.org/t/-/21318/2:

> This is not really true anymore - account recovery via email was planned to be added at some point, but has been removed from the spec since.
2017-02-10 17:44:11 -05:00
Ben Wolfe
f12dc84271 Certbot spelling correction (#4157) 2017-02-01 18:37:59 -08:00
Brad Warren
b5d4e0bf6a fix bug when certbot is ran without any arguments (#4151) 2017-02-01 18:02:21 -08:00
Brad Warren
a6b51f1edd Bump version to 0.12.0 2017-02-01 09:50:57 -08:00
Brad Warren
30bc68ccde
Release 0.11.0 2017-02-01 09:50:42 -08:00
Peter Eckersley
aa389cf8aa Revert "uncomment assertion (#4072)" (#4110)
Revert "uncomment assertion (#4072)"
2017-02-01 09:32:24 -08:00
Amjad Mashaal
1fd847e216 Adding checking name validity to the Apache plugin (#3639) 2017-02-01 07:12:51 -08:00
Brad Warren
20be8b327d Provide a way to opt-in to EFF e-mail (#4082)
* Add eff email flags

* add eff_sign_up

* add requests dep to certbot

* make pylint happy

* Add EFF subscribe uri

* add POST to EFF and write tests

* log EFF e-mail submission

* Add eff module and tests

* cleanup client tests

* offer subscription when changing e-mail

* cleanup client.py and tests

* expand e-mail prompt
2017-01-31 17:08:21 -08:00
Brad Warren
be5bcfe463 Remove optional dependencies (#4088)
* Stop using already_listening in standalone

* remove already_listening

* remove psutil entirely

* fix #595

* Add basic perform test

* make pep8 happy

* Add test_perform_eacces

* add _setup_perform_error

* Add test_perform_unexpected_socket_error

* add test_perform_eaddrinuse_no_retry

* add test_perform_eaddrinuse_retry

* cleanup tests

* stop using dnspython

* don't install dns extras in tox

* remove dns extras from setup.py

* Add simple_verify back to DNS response

* remove dnspython from oldest tests
2017-01-30 16:55:54 -08:00
Erica Portnoy
a1b1ae25ae Don't be unnecessarily inefficient when finding a cert by name. (#4128)
* Make lineage_for_certname and domains_for_certname O(1)

* update tests
2017-01-27 15:16:19 -08:00
Josh Soref
6a39a42f45 Spelling (#4101)
* spelling: action

* spelling: artifacts

* spelling: asymmetric

* spelling: attempts

* spelling: bizarre

* spelling: certbot

* spelling: certificate

* spelling: certainly

* spelling: challenge

* spelling: client

* spelling: collated

* spelling: correct

* spelling: considered

* spelling: custom

* spelling: distinguish

* spelling: encoding

* spelling: enhancement

* spelling: equivalent

* spelling: execution

* spelling: existence

* spelling: failed

* spelling: handshake

* spelling: hyphen

* spelling: initialized

* spelling: initialization

* spelling: interpretation

* spelling: letsencrypt

* spelling: multiline

* spelling: multipart

* spelling: necessary

* spelling: otherwise

* spelling: output

* spelling: overridden

* spelling: positives

* spelling: preferable

* spelling: progress

* spelling: recommended

* spelling: referring

* spelling: relativity

* spelling: request

* spelling: requiring

* spelling: separate

* spelling: source

* spelling: specified

* spelling: standard

* spelling: successfully

* spelling: unparseable

* spelling: useful
2017-01-26 16:21:54 -08:00
Brad Warren
4d860b37b0 Preserve preferred-challenges on renewal (#4112)
* use challenge type strings, not objectS

* Factor out parse_preferred_challenges

* restore pref_challs

* save pref_challs

* Make CheckCertCount more flexible

* improve integration tests

* Make pref_challs more flexible
2017-01-25 18:40:22 -08:00
Brad Warren
578815a20a uncomment assertion (#4072) 2017-01-24 14:39:27 -08:00
Brad Warren
ea951150a4 Enable Py36 Tests (#3972)
* add py36 to tox

* Add Python 3.6 tests to Travis

* Provide real path to python stdlib during tests

* set logs_dir in config_test

* set *_dirs in DetermineAccountTest

* Fix TLSSNI01Test

* Fix RenewalTest

* fix test_ancient_webroot_renewal_conf
2017-01-18 10:41:11 -08:00
Blake Griffith
49d46ef99a Impelment account deactivation [revision requested] (#3571)
Impelment account deactivation
2017-01-17 16:00:07 -08:00
yomna
0fa307806e Alternate help syntax - issue 3371 (#4068)
* [#3371] support for new help syntax + tests

* [#3371] splitting up test to satisfy linter
2017-01-17 15:19:33 -08:00
Juho Juopperi
2797a0377d Fix misspelling "recieved" (#4059) 2017-01-17 13:43:43 -08:00
Erica Portnoy
e0d112f5fb Fix expand certs regression (#4053)
* Fix expand certs regression

* also pass new domains to renew_hook
2017-01-13 15:23:09 -08:00
Brad Warren
aaa732d8f3 Fix problems with different test ordering (#4043)
* fixes #4030

* Properly restore set_by_cli after using it

* mock out post_hook so it isn't stored

* fixes #4044
2017-01-13 12:16:08 -08:00
Erica Portnoy
50cf1e9d1a Remove 'called_once_with' call (#4041)
* Remove 'called_once_with' call

* Migrate z_util callers to patch_get_utility
2017-01-12 17:45:15 -08:00
Craig Smith
94c23479e2 Add option to specify revocation reason (#3242) (#3988)
This includes two new tests in the integration test script to check that
boulder gets the correct code. The encoding is specified in RFC5280
5.3.1. The codes that boulder will accept are a subset of that,
specified in `boulder.revocation.reasons.go`.
2017-01-11 18:26:55 -08:00
Josh Soref
feaf69db08 make config-dir/work-dir/logs-dir output match help (#4017) 2017-01-11 16:57:46 -08:00
Brad Warren
364a6d8a2d Release 0.10.0 (#4022)
* Release 0.10.0

* Bump version to 0.11.0
2017-01-11 12:01:33 -08:00
Erica Portnoy
c00568a518 Break on failure to deploy cert (#4003)
* Break on failure to deploy cert

* Add error message for unable to install cert

* Add unit test
2017-01-10 17:27:09 -08:00
Brad Warren
9c9004aff1 Stop IDisplay AssertionErrors (#4010)
Fixes #3996.

I'm pretty confident this PR solves the problem. I've audited all calls to IDisplay methods and the assertions done in certbot.display.util are now done in all our unit tests.

With that said, it wouldn't hurt to have someone else double check I didn't miss anything. The easiest way to do this is to grep for IDisplay in our code and ensure all calls to IDisplay methods are valid. This means every method call other than notification (because a notification call is always OK) either provides a value for default or force_interactive. This is defined in interfaces.py.

I've also been considering removing the assertion that's been causing us trouble here from our release. The only argument I have for not doing so is it may hinder 3rd party plugin development. When they use IDisplay, they have the same problem as we do with prompting users without a TTY. Not keeping this assertion in makes it more likely they won't notice the issue and Certbot will crash on an unsuspecting user.

With that said, none of our known 3rd party plugins use IDisplay at all.

* Provide force_interactive in _get_certname

* Use force_interactive when asking for webroot

* Factor IDisplay assertion into it's own function

* Add util.patch_get_utility()

* Allow custom path to patch_get_utiity

* Change GetEmailTest to use patch_get_utility

* Use new_callable to create new objects

* Modify tests to use patch_get_utility

* Improve FreezableMock documentation

* Add user facing error to TTY magic

* Comment out assert_valid_call

* Add test_input_assertion_fail2()
2017-01-10 16:25:33 -08:00
Peter Eckersley
d8e72ee3bf Add update_symlinks to "--help manage" (#4008) 2017-01-10 12:31:27 -08:00
Nick Fong
a146102c73 Remove extra space introduced by #3994 (#4012)
Resolves #4011
The commits from PR #3994 failed to mention that they resolve #3347
2017-01-10 11:49:11 -08:00
Nick Fong
31d7b5f6d7 Fix Error Message for invalid FQDNs (#3994)
* Add better error handling for invalid FQDNs

Add explicit error handling for labels that are empty.  Also add test
cases to test invalid domains.

* Add more thorough tests
2017-01-09 18:59:48 -08:00