Commit Graph
8372 Commits
Author SHA1 Message Date
Brad Warren dec97fc126 Revert "Add link to pycon issues (#5959)"
This reverts commit 68359086ff.
2018-05-18 17:48:30 -07:00
Paul KehrerandBrad Warren 366c50e28e switch signature verification to use pure cryptography (#6000)
* switch signature verification to use pure cryptography

On systems that prevent write/execute pages this prevents a segfault
that is caused by pyopenssl creating a dynamic callback in the
verification helper.

* switch to using a verifier for older cryptography releases

also add ec support, test vectors, and a test
2018-05-18 09:10:41 -07:00
Dmitry FigolandBrad Warren 36dfd06503 Prepare certbot module for mypy check untyped defs (#6005)
* Prepare certbot module for mypy check untyped defs

* Fix #5952

* Bump mypy to version 0.600 and fix associated bugs

* Fix pylint bugs after introducing mypy

* Implement Brad's suggestions

* Reenabling pylint and adding nginx mypy back
2018-05-18 06:28:17 -07:00
Brad WarrenandGitHub 250c0d6691 cd before running tests (#6017)
When importing a module, Python first searches the current directory. See
https://docs.python.org/3/tutorial/modules.html#the-module-search-path. This
means that running something like `import certbot` from the root of the Certbot
repo will use the local Certbot files regardless of the version installed on
the system or virtual environment.

Normally this behavior is fine because the local files are what we want to
test, however, during our "oldest" tests, we test against older versions of our
packages to make sure we're keeping compatibility. To make sure our tests use
the correct versions, this commit has our tests cd to an empty temporary
directory before running tests.

We also had to change the package names given to pytest to be the names used in
Python to import the package rather than the name of the files locally to
accommodate this.
2018-05-18 06:05:26 -07:00
Brad WarrenandJoona Hoikkala 94bf97b812 Add remaining DNS plugins to mypy.ini and sort (#6018) 2018-05-18 12:26:10 +03:00
TyrannosourceExeandBrad Warren 9b2862ebb0 3692 --dry-run expiration emails (#6015)
* If --dry-run is used and there exists no staging account, create account with no email

* added unit testing of dry-run to ensure certbot does not ask the user to create an email, and that certbot creates an account with no email
2018-05-17 16:03:01 -07:00
Brad WarrenandGitHub 1be1bd9211 remove PYTHONPATH (#6016) 2018-05-17 09:23:05 -07:00
pdamodaranandBrad Warren 20418cdd68 Fixed #5859 (#6011) 2018-05-17 06:52:11 -07:00
Brad WarrenandGitHub 41e1976c17 Fix noisy tests (#6004)
* Fixes #5570.

The issue is calls to atexit aren't mocked out. During the tests there are many
repeated calls registering functions to be called when the process exits so
when the tests finishes, it prints a ton of output from running those
registered functions. This suppresses that by mocking out atexit.

* Mock at a lower level.

This ensures we don't mess with any other mocks in this test class by mocking
at the lowest level we can. Other tests shouldn't be mocking out specific
internals of functions in other modules, so this should work just fine.
2018-05-16 06:24:14 -07:00
Douglas AngerandBrad Warren 722dac86d5 Fix crash when email submission endpoint unavailable (#6002)
* Fix crash when email submission endpoint unavailable

Handle KeyError and ValueError so that if the email submission endpoint
goes down, Certbot can still run.

Add tests to eff_test.py:
 - simulate non-JSON response as described in issue #5858
 - simulate JSON response without 'status' element

Non-JSON response throws an uncaught ValueError when attempting to
decode as JSON. A JSON response missing the 'status' element throws an
uncaught KeyError when checking whether status is True or False.

Teach _check_response to handle ValueError and KeyError and report an
issue to the user.

Rewrite if statement as assertion with try-except block to make error
handling consistent within the function. Update test_not_ok to make
mocked raise_for_status function raise a requests.exceptions.HTTPError.

Resolves #5858

* Update PR with requested changes

- Use `if` instead of `assert` to check `status` element of response JSON
- Handle KeyError and ValueError in the same way
- Import requests at the beginning of eff_test.py
- Clear JSON in test case in a more idiomatic way
2018-05-15 12:50:47 -07:00
GmHandBrad Warren 751f9843b4 fixed issue #5974 for certbot-dns-route53 (#5984)
* fixed issue #5974 for certbot-dns-route53

* fixed issue #5967 for certbot-dns-digitalocean

* update to use acme.magic_typing and DefaultDict class

* added no-name-in-module identifier, for issue #5974

* added unused-import identifier to disable option, for issue #5974
2018-05-15 11:22:09 -07:00
dschlessmanandBrad Warren 9bd5b3dda2 Issue 5951/check untyped defs apache (#5989)
* resolved mypy untyped defs in parser.py

* resolved mypy untyped defs in obj.py

* removed unused imports

* resolved mypy untyped defs in http_01.py

* resolved mypy untyped defs in tls_sni_01.py

* resolved mypy untyped defs in configurator.py

* address mypy too-many-arguments error in override_centos.py

* resolved mypy untyped defs in http_01_test.py

* removed unused 'conf' argument that was causing mypy method assignment error

* address mypy error where same variable reassigned to different type

* address pylint and coverage issues

* one character space change for formatting

* fix required acme version for certbot-apache
2018-05-15 10:40:32 -07:00
James HiebertandBrad Warren 307f45f88f Enable checking of type annotation in Nginx plugin (#5997)
* Adds type checking for certbot-nginx

* First pass at type annotation in certbot-nginx

* Ensure linting is disabled for timing imports

* Makes container types specific per PR comments

* Removes unnecessary lint option
2018-05-15 09:36:47 -07:00
signopandBrad Warren 802fcc99ee Add requests-toolbelt hashes to requirements. (#6001)
Fixes certbot/certbot#5993
2018-05-15 08:50:09 -07:00
Douglas AngerandBrad Warren 2d68c9b81e Display (None) instead of a bullet for empty lists (#5999)
Include a line break before "(None)" to maintain consistency with output
for lists that are not empty.

Previous result as expected for non-empty lists:

    >>> _format_list('+', ['one', 'two', 'three'])
    '\n+ one\n+ two\n+ three'

Previous unexpected result for empty lists:

    >>> _format_list('+', [])
    '\n+ '

New result as expected (unchanged) for non-empty lists:

    >>> _format_list('+', ['one', 'two', 'three'])
    '\n+ one\n+ two\n+ three'

New behavior more explicit for empty lists:

    >>> _format_list('+', [])
    '\n(None)'

Resolves #5886
2018-05-15 08:46:36 -07:00
James HiebertandBrad Warren 42ef252043 Adds a note about Python3 in the Developer Guide (#5998) 2018-05-15 07:58:33 -07:00
Douglas AngerandBrad Warren 99d94cc7e8 Make request logs pretty in Python 3 (#5992)
Decode response data as UTF-8 to eliminate ugly bytes repr in Python 3.

Resolves #5932
2018-05-14 14:45:25 -07:00
signopandBrad Warren 02b128a128 Add support for specifying source_address to ClientNetwork. (#5990)
For certbot/certbot#3489
2018-05-14 14:43:43 -07:00
speterandsydneyli 372d4a046c docs/using.rst: fix typo (#5962) 2018-05-14 14:40:06 -07:00
Sarah BradenandBrad Warren a724dc659b correct error message text now prompts user to run $certbot certificates (#5988) 2018-05-14 14:21:09 -07:00
Douglas AngerandBrad Warren 907ee79715 Check_untyped_defs in mypy with clean output for certbot-dns-nsone (#5987)
* check_untyped_defs in mypy with clean output for certbot-dns-nsone

Resolves #5972
2018-05-14 13:18:49 -07:00
Kevin LeandBrad Warren c1471fe873 Document IPv6/IPv4 binding on standalone. (#5983) 2018-05-14 13:15:02 -07:00
Brad WarrenandGitHub 94829e35be Merge pull request #5982 from certbot/handle-mypy-ini-conflicts
Check unchecked defs in various DNS plugins
2018-05-14 11:43:33 -07:00
Brad Warren 19c6a5e6ee Merge branch 'issue_5968' into handle-mypy-ini-conflicts 2018-05-14 11:12:31 -07:00
Brad Warren 875c8d4c01 Merge branch 'feature/5971' into handle-mypy-ini-conflicts 2018-05-14 11:11:08 -07:00
Brad Warren 8d994ae30d Merge branch 'issue_5970' into handle-mypy-ini-conflicts 2018-05-14 11:10:30 -07:00
Sarah BradenandBrad Warren be03a976d5 fixed issue #5969 for certbot-dns-dnsmadeeasy (#5976) 2018-05-14 10:54:26 -07:00
Kevin LeandBrad Warren 74448e9344 Set pause=False to fix view_config_changes (#5977) 2018-05-14 10:45:12 -07:00
Sarah Braden 33583792fa blank line at eof 2018-05-14 13:43:15 -04:00
Sarah Braden 430f9414a9 fix for issue #5968 for certbot-dns-dnsimple 2018-05-14 13:42:12 -04:00
Douglas Anger 5636b55507 Check_untyped_defs in mypy with clean output for certbot-dns-luadns
* check_untyped_defs in mypy with clean output for certbot-dns-luadns

Resolves #5971
2018-05-14 13:40:27 -04:00
Sarah Braden 4bd9f4dac4 fix for issue #5970 regarding certbot-dns-google 2018-05-14 13:30:38 -04:00
Douglas AngerandBrad Warren 2d45b0b07a Check_untyped_defs in mypy with clean output for certbot_dns_rfc2136 (#5975)
* check_untyped_defs in mypy with clean output for certbot_dns_rfc2136

Resolves #5973
2018-05-14 10:26:33 -07:00
Sarah Braden a0775f42ba fixed issue #5969 for certbot-dns-dnsmadeeasy 2018-05-14 12:34:27 -04:00
Brad WarrenandGitHub cce23c86c7 partially revert #5953 (#5964) 2018-05-14 08:08:24 -07:00
Brad WarrenandGitHub 68359086ff Add link to pycon issues (#5959)
* add link to pycon issues

* add especially
2018-05-13 08:06:19 -07:00
ohemorangeandGitHub 5940ee92ab add ready status type (#5941) 2018-05-11 14:25:02 -07:00
Brad WarrenandGitHub 9568f9d5b0 Add instructions on how to ask for help (#5957)
* Add instructions on how to ask for help

* s/setup/set up
2018-05-11 10:52:45 -07:00
Brad WarrenandGitHub 2f89a10f50 Small dev docs improvements (#5953)
* Clarify UNIX only

* Have people develop natively.

Some systems like Arch Linux and macOS require --debug in order to install
dependencies.

Our bootstrapping script for macOS works, so let's let people who want to
develop natively.

* briefly mention docker as dev option

* remove bad _common.sh info

* update OS dep section

* Remove sudo from certbot-auto usage

When sudo isn't available, Certbot is able to fall back to su. Removing it from
the instructions here allows the command to work when its run in minimal
systems like Docker where sudo may not be installed.

* copy advice about missing interpreters

* Improve integration tests docs

Explain what a boulder is and tell people they probably should just let the
tests run in Travis.

* Don't tell people to run integration tests.

I don't think any paid Certbot devs run integration tests locally and instead
rely on Travis. Let's not make others do it.

* fix spacing

* you wouldn't download a CA

* address review comments
2018-05-11 07:07:02 -07:00
Brad WarrenandGitHub 8851141dcf Revert "disable apacheconftest (#5937)" (#5954)
This reverts commit 83ea820525.
2018-05-11 06:12:10 -07:00
ohemorangeandGitHub 832941279b Specify that every domain name needs to be under a server_name directive (#5949) 2018-05-10 16:46:57 -07:00
Brad WarrenandGitHub 83ea820525 disable apacheconftest (#5937) 2018-05-09 12:11:36 -07:00
ohemorangeandBrad Warren 3eaf35f1e2 Check_untyped_defs in mypy with clean output for acme (#5874)
* check_untyped_defs in mypy with clean output for acme

* test entire acme module

* Add typing as a dependency because it's only in the stdlib for 3.5+

* Add str_utils, modified for python2.7 compatibility

* make mypy happy in acme

* typing is needed in prod

* we actually only need typing in acme so far

* add tests and more docs for str_utils

* pragma no cover

* add magic_typing

* s/from typing/from magic_typing/g

* move typing to dev_extras

* correctly set up imports

* remove str_utils

* only type: ignore for OpenSSL.SSL, not crypto

* Since we only run mypy with python3 anyway and we're fine importing it when it's not actually there, there's no actual need for typing to be present as a dependency

* comment magic_typing.py

* disable wildcard-import im magic_typing

* disable pylint errors

* add magic_typing_test

* make magic_typing tests work alongside other tests

* make sure temp_typing is set

* add typing as a dev dependency for python3.4

* run mypy with python3.4 on travis to get a little more testing with different environments

* don't stick typing into sys.modules

* reorder imports
2018-05-03 13:10:33 -07:00
Brad WarrenandJoona Hoikkala 32e85e9a23 correct metaclass usage everywhere (#5919) 2018-05-03 10:59:25 +03:00
Joona HoikkalaandBrad Warren 95c0c4a708 Py2 and Py3 compatibility for metaclass interfaces (#5913) 2018-05-02 15:56:37 -07:00
Brad WarrenandGitHub 03b20d972c Merge pull request #5914 from certbot/candidate-0.24.0
Update autos and version number for 0.24.0 release
2018-05-02 12:19:09 -07:00
Brad WarrenandGitHub 7fa3455dc6 Update changelog for 0.24.0 (#5915) 2018-05-02 12:18:29 -07:00
Joona HoikkalaandGitHub 552bfa5eb7 New interfaces for installers to run tasks on renew verb (#5879)
* ServerTLSUpdater and InstallerSpecificUpdater implementation

* Fixed tests and added disables for linter :/

* Added error logging for misconfigurationerror from plugin check

* Remove redundant parameter from interfaces

* Renaming the interfaces

* Finalize interface renaming and move tests to own file

* Refactored the runners

* Refactor the cli params

* Fix the interface args

* Fixed documentation

* Documentation and naming fixes

* Remove ServerTLSConfigurationUpdater

* Remove unnecessary linter disable

* Rename run_renewal_updaters to run_generic_updaters

* Do not raise exception, but make log message more informative and visible for the user

* Run renewal deployer before installer restart
2018-05-02 10:52:54 +03:00
Brad Warren 0ec0d79c35 Bump version to 0.25.0 2018-05-01 16:59:48 -07:00
Brad Warren 4b870ef940 Release 0.24.0 v0.24.0 2018-05-01 16:59:32 -07:00