Commit graph

10392 commits

Author SHA1 Message Date
Peter Eckersley
0956e61c7c Remove the sphinxcontrib.programout [docs]dependency (#3830)
- By making a static text file at release time, and including that
   instead.
2016-11-30 10:47:10 -08:00
Hugo Peixoto
b3bc1a76b7 Merge pull request #1 from waylonflinn/master
Add Support for Root Domain
2016-11-30 16:05:06 +00:00
Craig Smith
83966cdfcf Fixed output (#3637). (#3809) 2016-11-29 16:53:06 -08:00
Craig Smith
df5f08843f Output success message for revoke command (#3823)
* Output status for `revoke` operation. Fixes #2819.

    - Added method to `certbot.display.ops` to output confirmation of `revoke`.

    - Wrapped call to `acme.client.Client.revoke` in a try to statement to
      handle possible error.

    - Added test for `main.revoke`.

* Added test for failure of certificate revocation.

Moved creation of mocks into RevokeTest setup function.

Stopped mocks in RevokeTest teardown function.

* Fixed lint errors.

* Do not call `unittest.TestCase.assertRaises` as a context manager (to work with py26).

* Fixed spelling error in successful revocation notification.

Added test for the notification.
2016-11-29 15:30:37 -08:00
Brad Warren
7951ba7337 pin pyopenssl 16.2.0 in certbot-auto (#3811) 2016-11-23 14:00:48 -08:00
Min RK
908e8a80a9 disallow binary (wheel) install for pycparser (#3575)
* disallow binary (wheel) install for pycparser

pycparser has uploaded a broken wheel for 2.14, failing for two reasons

1. sha mismatch, due to not instructing pip which dist to install
2. bug in the wheel itself

* regen letsencrypt-auto-source/letsencrypt-auto
2016-11-22 10:18:32 -08:00
Brad Warren
494c305b04 pin requests version in py26-oldest (#3803) 2016-11-21 17:56:22 -08:00
Brad Warren
e5f4d0cb5c Fix reinstall message (#3784)
* Changed informational messages because of confusing message on reinstallation.

Certbot prompts the user when it detects that an appropriately fresh certificate
is already available:

        You have an existing certificate that contains exactly the same domains you requested and isn't close to expiry.
        (ref: <path>)

        What would you like to do?
        -------------------------------------------------------------------------------
        1: Attempt to reinstall this existing certificate
        2: Renew & replace the cert (limit ~5 per 7 days)
        -------------------------------------------------------------------------------
        Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1

On selecting '1' (reinstall), the resulting message is:

        -------------------------------------------------------------------------------
        Your existing certificate has been successfully reinstalled, and the new
        certificate has been installed.

        The new certificate covers the following domains: https://<whatever>

        You should test your configuration at:
        https://www.ssllabs.com/ssltest/analyze.html?d=<whatever>
        -------------------------------------------------------------------------------

"Your existing certificate has been successfully reinstalled" <-- Okay

"and the new certificate has been installed." <-- Wait, what?

The issue appears to come from assumptions in certbot/certbot/main.py

It uses `len(lineage.available_versions("cert"))` to determine if this was a
fresh install or renewal, and then calls either `display_ops.success_renewal()`
(which produces the "existing certificate ... and the new certificate" language)
or `display_ops.success_installation()` (which has no messaging about existing
vs. new certificates).

The len(lineage) test isn't the right way to make this choice. The certificate's
lineage length doesn't imply anything about whether we've just obtained a new
certificate, because there is no new certificate in the case of a "reinstall"
action.

The new logic calls `display_ops.success_installation()` on all "reinstall"
actions, and otherwise employs the existing `len(lineage)` test.

Additionally the `display_ops.success_installation()` has been enhanced to
accept an action parameter, and has the message reworded slightly to make
sense regardless of the action passed. The messaging is mostly unchanged if it's
called without the action parameter:

Original message:
        -------------------------------------------------------------------------------
        Congratulations! You have successfully enabled https://<whatever>

        You should test your configuration at:
        https://www.ssllabs.com/ssltest/analyze.html?d=<whatever>
        -------------------------------------------------------------------------------

New message on initial install:
        -------------------------------------------------------------------------------
        Congratulations! You have successfully installed a certificate for
        https://<whatever>

        You should test your configuration at:
        https://www.ssllabs.com/ssltest/analyze.html?d=<whatever>
        -------------------------------------------------------------------------------

New message on re-install:
        -------------------------------------------------------------------------------
        Congratulations! You have successfully reinstalled a certificate for
        https://<whatever>

        You should test your configuration at:
        https://www.ssllabs.com/ssltest/analyze.html?d=<whatever>
        -------------------------------------------------------------------------------

* Typo in display message.

* Typo, characters transposed.

* undo changes to certbot/display/ops.py

* remove invalid todos

* Test success_installation() called for reinstall

* Simplify display_ops.success* functions

* refactor and expand run() tests
2016-11-15 11:56:05 -08:00
Brad Warren
3dbeef8ee7 fix --http-01-port typo at source (#3794) 2016-11-15 11:45:07 -08:00
Henri Salo
9aef15d09e Fix typo (#3790) 2016-11-14 10:58:14 -08:00
Brad Warren
1dd1afdc57 Remove letshelp-letsencrypt (#3775) 2016-11-10 23:04:41 -08:00
Amjad Mashaal
1e27e43c14 Expanding tests for le-auto, adding CentOS test suite (#2671)
* Adding Dockerfile for CentOS 6

* Adding CentOS 7 to LEA tests

* Enabling CentOS 6 LEA test

* Removing CentOS 7

* Fixing nits

* Using yum to install epel-release
2016-11-10 15:05:03 -08:00
Amjad Mashaal
c89bd421da Expanding tests for le-auto, adding Debian test suite (#2635)
* Adding Debian 7 (Wheezy) to LE tests

* Adding Debian 8 (Jessie) to LE tests

* Fixing Debian Wheezy certificate addition error

* Adding packages to LEA Debian Jessie test and refining the code commenting

* Adding installing OpenSSL to the Debian Wheezy LEA test script

* Removing LEA tests for Debian Jessie

* Fixing nits
2016-11-10 14:01:15 -08:00
Amjad Mashaal
469fc3775f Expanding tests for le-auto, adding Ubuntu test suite (#2548)
* Adding Ubuntu Wily to LEA testing

* Setting up certs correctly for Ubuntu 15.10

* Adding 12.04

* Removing redundant update-ca-certificates from 12.04 le-auto testing script

* Fixing OpenSSL on Precise

* Adding Vivid to le_auto tests

* Cleaning up LEA tests configuration for Trusty

* Ordering LEA test entries in .travis.yml and renaming them correctly

* Removing Ubuntu Vivid

* Refining comments

* Removing Ubuntu Wily since it reached EOL

* Removing .travis.yml duplicates

* Fixing nits
2016-11-10 13:15:17 -08:00
Peter Eckersley
6eb3ce2f7a Bump python-cryptography to 1.5.3 (#3773)
* [certbot-auto] Bump cryptography version to 1.5.2

* Actually bump to python-cryptography 1.5.3

* https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst#153---2016-11-05

Probably doesn't affect us, but best to ship the fix
2016-11-10 09:47:13 -08:00
Erica Portnoy
04bec308fb Add README file to each live directory explaining its contents. (#3696)
* Add README file to each live directory explaining its contents.

* add tests

* Update README copy

* add fragment

* update copy

* lint errors
2016-11-09 12:55:18 -08:00
Nick Fong
469b5fd441 Remove letsencrypt[-apache|-nginx] (#3769) 2016-11-08 17:21:49 -08:00
Nick Fong
dd8772b608 Remove get_all_certs_keys() from Apache and Nginx (#3768)
- Remove get_all_certs_keys() implementation in
    - certbot-apache/certbot_apache/configurator.py
- Remove corresponding tests for get_all_certs_keys() in
    - certbot-apache/certbot_apache/tests/configurator_test.py
- Remove get_all_certs_keys() implementation in
    - certbot-nginx/certbot_nginx/configurator.py
    - certbot-nginx/certbot_nginx/parser.py
- Remove corresponding tests for get_all_certs_keys() in:
    - certbot-nginx/certbot_nginx/tests/configurator_test.py
    - certbot-nginx/certbot_nginx/tests/parser_test.py

Resolves #3762
2016-11-08 17:19:05 -08:00
mstrache
8c1aa3ef46 #3408: Made Gentoo bootstrapping asking before performing any changes (#3410)
* #3408: Made gentoo bootstrapping ask before it performs any changes

* Update gentoo_common.sh

Removed use of the local keyword
2016-11-08 16:48:12 -08:00
Erica Portnoy
af46f644a7 Add list-certs command (#3669)
* Switch to using absolute path in symlink

* save archive_dir to config and read it back

* cli_config.archive_dir --> cli_config.default_archive_dir

* Use archive_dir specified in renewal config file

* add helpful broken symlink info

* add docstring to method

* Add tests

* remove extraneous test imports

* fix tests

* py2.6 syntax fix

* git problems

* Add list-certs command

* no dict comprehension in python2.6

* add test coverage

* More py26 wrangling

* update tests for py3 and lint

* remove extra dep from test

* test coverage

* test shouldn't be based on dict representation order

* Redo report UX and add tests to cover

* remove storage str test

* lint and use mock properly

* mock properly

* address code review comments

* lineage --> certificate name and print fullchain and privkey paths

* make py26 happy

* actually make py26 happy

* don't wrap text
2016-11-08 15:21:42 -08:00
Martey Dodoo
a7bfefc6d0 Change all "cerbot" references to "certbot" (#3770) 2016-11-08 11:09:20 -08:00
Erica Portnoy
2b229d4b9d Allow notification interface to not wrap text (#3728) 2016-11-07 16:14:09 -08:00
Erica Portnoy
df10a6431b Don't re-add redirects if one exists (#3751)
* Don't re-add redirects if one exists

* coverage

* make coverage happy

* don't re-add comment, and clean code
2016-11-07 15:48:46 -08:00
Gilles Pietri
0bc3e1860b Add renew_hook to options stored in the renewal config, partially tackles #3394 (#3724) 2016-11-07 15:31:50 -08:00
Joona Hoikkala
d741e684d0 Script plugin (#3521)
* Script plugin initial commit

* Fix auth script path

* Return correct responses

* Added DNS-01 support

* Report the challenge pref correctly

* Use config root from certbot constants rather than hardcoded

* Remove prehook and rename posthook to cleanup for clarity

* Refactoring

* Docs

* Refactoring

* Refactoring continued, working now

* Use global preferred-challenges argument in favor of local

* Added http-01 as fallback challenge if not defined

* Do not continue if auth script not defined

* Skip unnecessary steps when running

* Read config values from correct places

* Tests and minor fixes

* Make Python 2.6 happy again

* Added CERTBOT_AUTH_OUTPUT and better tests

* Lint & Py3 fixes

* Make Python 2.6 happy again

* Doc changes

* Refactor hook execute and reuse in script plugin

* Refactored hook validation

* Added long_description for plugin help text

* Refactored env var writing
2016-11-07 15:22:48 -08:00
Brad Warren
d197b5aa05 Fix OS Documentation (#3747)
* Update various package names in using.rst from "letsencrypt" to "certbot"

* Update using.rst

Change package name
2016-11-07 14:53:15 -08:00
kaiyou
82c69815d1 Fix writing pem files with Python3 (#3757)
* Standardize arguments name for mode and chmod in the util API

* Handle OpenSSL pem as bytes objects only for Python3 compatibility

* Handle OpenSSL pem as bytes objects only (remaining bits)

* Manipulate bytes objects only when testing PEM-related functions

* Fix argument order when calling util.unique_file
2016-11-07 14:22:20 -08:00
Nick Fong
549f0eccf9 Remove get_all_certs_keys() from interfaces.py (#3753)
- Remove method 'get_all_certs_keys()' from interfaces.py
- Also remove 'get_all_certs_keys()' from plugins/null.py and
  corresponding unit test
2016-11-07 11:36:58 -08:00
Peter Eckersley
f0ebd13ec2 [certbot-auto] Bump cryptography version to 1.5.2 (#3733) 2016-11-04 19:03:00 -07:00
Brad Warren
fd95a55054 use terminate not kill (#3750) 2016-11-04 18:39:58 -07:00
Waylon Flinn
ebe5d0c4f2 add support for root domain 2016-11-04 20:26:34 -05:00
Jaap Eldering
ca9b3f18af Allow user to override sudo as root authorization method [minor revision requested] (#1969)
* Move su_sudo() wrapper function outside of root method selection code.

* Improve comment language.

* Allow overriding root authorization mechanism (sudo/su/nothing)
by setting LE_AUTO_SUDO environment variable.

* Update generated letsencrypt-auto-source/letsencrypt-auto
from template.

* Add change requests from Brad Warren and regenerate letsencrypt-auto.

Thanks for pointing out.
2016-11-03 18:13:02 -07:00
Brad Warren
61094b06fd Do we need trusty in Travis? (#3737)
* do we need trusty?

* add docker as a dependency for boulder??
2016-11-03 17:19:53 -07:00
Jacob Hoffman-Andrews
db4c88856a Fix non-ASCII domain check. (#3727)
* Fix non-ASCII domain check.

Previously, the code would convert to utf-8, check for non-ASCII, and then try
to use .format() to interpolate the result into an error message. This would
generate a second error that would cause the whole message to get dropped, and
the program to silently exit. The problem can be succinctly observed like so:

$ python
>>> "{0}".format("ウェブ.crud.net")
'\xe3\x82\xa6\xe3\x82\xa7\xe3\x83\x96.crud.net'
>>> "{0}".format(u"ウェブ.crud.net")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

Note for the curious: This problem only seems to happen with .format():

>>> "%s" % ("ウェブ.crud.net")
'\xe3\x82\xa6\xe3\x82\xa7\xe3\x83\x96.crud.net'
>>> "%s" % (u"ウェブ.crud.net")
u'\u30a6\u30a7\u30d6.crud.net'
2016-11-02 16:14:14 -07:00
Brad Warren
2564fb785b I restructured Installation and Using a bit (#3725)
* Fixing a weird out-of-place paragraph in the Getting Certbot section

* De-duping and clarifying installation information, separating it from Using.

* Responding to feedback at https://github.com/certbot/certbot/pull/3675#pullrequestreview-5757007
2016-11-01 14:25:26 -07:00
Brad Warren
30dd22f2f8 No doc,dev depedencies for compatibility-test (#3722) 2016-10-31 18:30:02 -07:00
Amjad Mashaal
3534e4cb1f Allowing modification check to run using "tox" (#3704)
#3337 and #3338 should ideally run when the user type tox. This allows them to catch the problem locally before they make a PR.
2016-10-28 15:05:25 -07:00
tcottier
5ed0f3610c When getopts is called multiple time we need to reset OPTIND. (#3475)
Not resetting OPTIND between each call of getopts skips all short args except the first one.

It fixes this automated command: 
./certbot-auto certonly --webroot -w /tmp -d example.com --agree-tos --email contact@example.com -n

Where "-w" was parsed by getopts and not "-n"

* When getopts is called multiple time we need to reset OPTIND. Issue #3459 

* Adding OPTIND reset in the certbot-auto source file

* Building new letsencrypt-auto from template
2016-10-28 11:18:56 -07:00
Amjad Mashaal
88a2c5a8f6 Testing the output of build.py against lea-source/lea (#3460)
* Testing the output of build.py against lea-source/lea

* Replacing realpath with readlink
2016-10-28 10:50:07 -07:00
Erica Portnoy
981d59fb45 Specify archive directory in renewal configuration file (#3661)
* Switch to using absolute path in symlink

* save archive_dir to config and read it back

* cli_config.archive_dir --> cli_config.default_archive_dir

* Use archive_dir specified in renewal config file

* add helpful broken symlink info

* add docstring to method

* Add tests

* remove extraneous test imports

* fix tests

* py2.6 syntax fix

* git problems

* no dict comprehension in python2.6

* add test coverage

* More py26 wrangling
2016-10-27 17:23:21 -07:00
Peter Conrad
8f3f166186 Responding to feedback at https://github.com/certbot/certbot/pull/3675#pullrequestreview-5757007 2016-10-27 11:34:35 -07:00
Jacob Hoffman-Andrews
88076e46c7 Improve debug logs. (#3126)
Print request and response bodies with newlines, rather than all on one line.
Remove "Omitted empty field" log, which gets logged meaninglessly for every JSON
serialization.
Remove duplicated logging of responses.
Log the base64 version of the nonce, rather than turning it into bytes and
logging the backslash-escaped version of those bytes.
Only pass -vv in tests.
2016-10-26 18:07:33 -07:00
Erica Portnoy
4b5db7aec4 Allow user to select all domains by typing empty string at checklist (#3693)
* Allow user to select all domains by typing empty string at checklist
2016-10-26 15:43:40 -07:00
Brad Warren
42180ee9b5 fix travis tests? (#3695) 2016-10-26 14:34:01 -07:00
Brad Warren
6ad08f4f64 Fix link to Docker's user guide (#3651)
* Fix link to Docker's user guide

* Update link to the Docker installation guide
2016-10-25 18:51:01 -07:00
Patrick Figel
1dafaec5a9 Update CLI usage docs for --csr (#3677)
With #2403 and #3046, certbot gained the ability to parse CSRs
encoded as PEM and without a SAN extension. Update the CLI usage
docs to reflect this change.
2016-10-25 13:56:38 -07:00
Jay Faulkner
98911d0c3c Fix issue with suggest_unsafe undeclared (#3685)
Added missing declaration of support_unsafe and unit test to prevent
regression.

Issue #3672
2016-10-24 14:51:50 -07:00
Peter Conrad
5345195e0c De-duping and clarifying installation information, separating it from Using. 2016-10-21 16:24:43 -07:00
Erica Portnoy
d54cb76432 Remove the curses dialog, thereby deprecating the --help and --dialog command line options (#3665)
* Remove the curses dialog, thereby deprecating the --help and --dialog command line options

* Deprecate --dialog and suppress --text
2016-10-21 15:45:57 -07:00
Peter Conrad
5abfb51219 Keeping my fork up to date.
Merge https://github.com/certbot/certbot
2016-10-21 15:03:15 -07:00