mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:14:54 +02:00
Merge branch 'master' into crash_recovery
This commit is contained in:
+5
-1
@@ -32,7 +32,7 @@ RUN /opt/letsencrypt/src/ubuntu.sh && \
|
|||||||
# the above is not likely to change, so by putting it further up the
|
# the above is not likely to change, so by putting it further up the
|
||||||
# Dockerfile we make sure we cache as much as possible
|
# Dockerfile we make sure we cache as much as possible
|
||||||
|
|
||||||
COPY setup.py README.rst CHANGES.rst MANIFEST.in requirements.txt EULA linter_plugin.py tox.cover.sh tox.ini /opt/letsencrypt/src/
|
COPY setup.py README.rst CHANGES.rst MANIFEST.in requirements.txt EULA linter_plugin.py tox.cover.sh tox.ini pep8.travis.sh .pep8 .pylintrc /opt/letsencrypt/src/
|
||||||
|
|
||||||
# all above files are necessary for setup.py, however, package source
|
# all above files are necessary for setup.py, however, package source
|
||||||
# code directory has to be copied separately to a subdirectory...
|
# code directory has to be copied separately to a subdirectory...
|
||||||
@@ -46,6 +46,8 @@ COPY letsencrypt /opt/letsencrypt/src/letsencrypt/
|
|||||||
COPY acme /opt/letsencrypt/src/acme/
|
COPY acme /opt/letsencrypt/src/acme/
|
||||||
COPY letsencrypt-apache /opt/letsencrypt/src/letsencrypt-apache/
|
COPY letsencrypt-apache /opt/letsencrypt/src/letsencrypt-apache/
|
||||||
COPY letsencrypt-nginx /opt/letsencrypt/src/letsencrypt-nginx/
|
COPY letsencrypt-nginx /opt/letsencrypt/src/letsencrypt-nginx/
|
||||||
|
COPY letshelp-letsencrypt /opt/letsencrypt/src/letshelp-letsencrypt/
|
||||||
|
COPY letsencrypt-compatibility-test /opt/letsencrypt/src/letsencrypt-compatibility-test/
|
||||||
COPY tests /opt/letsencrypt/src/tests/
|
COPY tests /opt/letsencrypt/src/tests/
|
||||||
|
|
||||||
RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \
|
RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \
|
||||||
@@ -55,6 +57,8 @@ RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \
|
|||||||
-e /opt/letsencrypt/src \
|
-e /opt/letsencrypt/src \
|
||||||
-e /opt/letsencrypt/src/letsencrypt-apache \
|
-e /opt/letsencrypt/src/letsencrypt-apache \
|
||||||
-e /opt/letsencrypt/src/letsencrypt-nginx \
|
-e /opt/letsencrypt/src/letsencrypt-nginx \
|
||||||
|
-e /opt/letsencrypt/src/letshelp-letsencrypt \
|
||||||
|
-e /opt/letsencrypt/src/letsencrypt-compatibility-test \
|
||||||
-e /opt/letsencrypt/src[dev,docs,testing]
|
-e /opt/letsencrypt/src[dev,docs,testing]
|
||||||
|
|
||||||
# install in editable mode (-e) to save space: it's not possible to
|
# install in editable mode (-e) to save space: it's not possible to
|
||||||
|
|||||||
@@ -1,2 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
if ! hash brew 2>/dev/null; then
|
||||||
|
echo "Homebrew Not Installed\nDownloading..."
|
||||||
|
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
fi
|
||||||
|
|
||||||
brew install augeas
|
brew install augeas
|
||||||
|
brew install dialog
|
||||||
|
|||||||
@@ -129,9 +129,8 @@ Docker
|
|||||||
|
|
||||||
OSX users will probably find it easiest to set up a Docker container for
|
OSX users will probably find it easiest to set up a Docker container for
|
||||||
development. Let's Encrypt comes with a Dockerfile (``Dockerfile-dev``)
|
development. Let's Encrypt comes with a Dockerfile (``Dockerfile-dev``)
|
||||||
for doing so. To use Docker on OSX, install boot2docker using the
|
for doing so. To use Docker on OSX, install and setup docker-machine using the
|
||||||
instructions at https://docs.docker.com/installation/mac/ and start it
|
instructions at https://docs.docker.com/installation/mac/.
|
||||||
from the command line (``boot2docker init``).
|
|
||||||
|
|
||||||
To build the development Docker image::
|
To build the development Docker image::
|
||||||
|
|
||||||
|
|||||||
+10
-7
@@ -845,14 +845,17 @@ def _handle_exception(exc_type, exc_value, trace, args):
|
|||||||
|
|
||||||
if issubclass(exc_type, errors.Error):
|
if issubclass(exc_type, errors.Error):
|
||||||
sys.exit(exc_value)
|
sys.exit(exc_value)
|
||||||
elif args is None:
|
|
||||||
sys.exit(
|
|
||||||
"An unexpected error occurred. Please see the logfile '{0}' "
|
|
||||||
"for more details.".format(logfile))
|
|
||||||
else:
|
else:
|
||||||
sys.exit(
|
# Tell the user a bit about what happened, without overwhelming
|
||||||
"An unexpected error occurred. Please see the logfiles in {0} "
|
# them with a full traceback
|
||||||
"for more details.".format(args.logs_dir))
|
msg = ("An unexpected error occurred.\n" +
|
||||||
|
traceback.format_exception_only(exc_type, exc_value)[0] +
|
||||||
|
"Please see the ")
|
||||||
|
if args is None:
|
||||||
|
msg += "logfile '{0}' for more details.".format(logfile)
|
||||||
|
else:
|
||||||
|
msg += "logfiles in {0} for more details.".format(args.logs_dir)
|
||||||
|
sys.exit(msg)
|
||||||
else:
|
else:
|
||||||
sys.exit("".join(
|
sys.exit("".join(
|
||||||
traceback.format_exception(exc_type, exc_value, trace)))
|
traceback.format_exception(exc_type, exc_value, trace)))
|
||||||
|
|||||||
@@ -46,12 +46,9 @@ class ManualAuthenticatorTest(unittest.TestCase):
|
|||||||
self.assertEqual([], self.auth.perform([]))
|
self.assertEqual([], self.auth.perform([]))
|
||||||
|
|
||||||
@mock.patch("letsencrypt.plugins.manual.sys.stdout")
|
@mock.patch("letsencrypt.plugins.manual.sys.stdout")
|
||||||
@mock.patch("letsencrypt.plugins.manual.os.urandom")
|
|
||||||
@mock.patch("acme.challenges.SimpleHTTPResponse.simple_verify")
|
@mock.patch("acme.challenges.SimpleHTTPResponse.simple_verify")
|
||||||
@mock.patch("__builtin__.raw_input")
|
@mock.patch("__builtin__.raw_input")
|
||||||
def test_perform(self, mock_raw_input, mock_verify, mock_urandom,
|
def test_perform(self, mock_raw_input, mock_verify, mock_stdout):
|
||||||
mock_stdout):
|
|
||||||
mock_urandom.side_effect = nonrandom_urandom
|
|
||||||
mock_verify.return_value = True
|
mock_verify.return_value = True
|
||||||
|
|
||||||
resp = challenges.SimpleHTTPResponse(tls=False)
|
resp = challenges.SimpleHTTPResponse(tls=False)
|
||||||
@@ -61,27 +58,7 @@ class ManualAuthenticatorTest(unittest.TestCase):
|
|||||||
self.achalls[0].challb.chall, "foo.com", KEY.public_key(), 4430)
|
self.achalls[0].challb.chall, "foo.com", KEY.public_key(), 4430)
|
||||||
|
|
||||||
message = mock_stdout.write.mock_calls[0][1][0]
|
message = mock_stdout.write.mock_calls[0][1][0]
|
||||||
self.assertEqual(message, """\
|
self.assertTrue(self.achalls[0].chall.encode("token") in message)
|
||||||
Make sure your web server displays the following content at
|
|
||||||
http://foo.com/.well-known/acme-challenge/ZXZhR3hmQURzNnBTUmIyTEF2OUlaZjE3RHQzanV4R0orUEN0OTJ3citvQQ before continuing:
|
|
||||||
|
|
||||||
{"header": {"alg": "RS256", "jwk": {"e": "AQAB", "kty": "RSA", "n": "rHVztFHtH92ucFJD_N_HW9AsdRsUuHUBBBDlHwNlRd3fp580rv2-6QWE30cWgdmJS86ObRz6lUTor4R0T-3C5Q"}}, "payload": "eyJ0bHMiOiBmYWxzZSwgInRva2VuIjogIlpYWmhSM2htUVVSek5uQlRVbUl5VEVGMk9VbGFaakUzUkhRemFuVjRSMG9yVUVOME9USjNjaXR2UVEiLCAidHlwZSI6ICJzaW1wbGVIdHRwIn0", "signature": "jFPJFC-2eRyBw7Sl0wyEBhsdvRZtKk8hc6HykEPAiofZlIwdIu76u2xHqMVZWSZdpxwMNUnnawTEAqgMWFydMA"}
|
|
||||||
|
|
||||||
Content-Type header MUST be set to application/jose+json.
|
|
||||||
|
|
||||||
If you don\'t have HTTP server configured, you can run the following
|
|
||||||
command on the target server (as root):
|
|
||||||
|
|
||||||
mkdir -p /tmp/letsencrypt/public_html/.well-known/acme-challenge
|
|
||||||
cd /tmp/letsencrypt/public_html
|
|
||||||
echo -n \'{"header": {"alg": "RS256", "jwk": {"e": "AQAB", "kty": "RSA", "n": "rHVztFHtH92ucFJD_N_HW9AsdRsUuHUBBBDlHwNlRd3fp580rv2-6QWE30cWgdmJS86ObRz6lUTor4R0T-3C5Q"}}, "payload": "eyJ0bHMiOiBmYWxzZSwgInRva2VuIjogIlpYWmhSM2htUVVSek5uQlRVbUl5VEVGMk9VbGFaakUzUkhRemFuVjRSMG9yVUVOME9USjNjaXR2UVEiLCAidHlwZSI6ICJzaW1wbGVIdHRwIn0", "signature": "jFPJFC-2eRyBw7Sl0wyEBhsdvRZtKk8hc6HykEPAiofZlIwdIu76u2xHqMVZWSZdpxwMNUnnawTEAqgMWFydMA"}\' > .well-known/acme-challenge/ZXZhR3hmQURzNnBTUmIyTEF2OUlaZjE3RHQzanV4R0orUEN0OTJ3citvQQ
|
|
||||||
# run only once per server:
|
|
||||||
$(command -v python2 || command -v python2.7 || command -v python2.6) -c \\
|
|
||||||
"import BaseHTTPServer, SimpleHTTPServer; \\
|
|
||||||
SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map = {\'\': \'application/jose+json\'}; \\
|
|
||||||
s = BaseHTTPServer.HTTPServer((\'\', 4430), SimpleHTTPServer.SimpleHTTPRequestHandler); \\
|
|
||||||
s.serve_forever()" \n""")
|
|
||||||
#self.assertTrue(validation in message)
|
|
||||||
|
|
||||||
mock_verify.return_value = False
|
mock_verify.return_value = False
|
||||||
self.assertEqual([None], self.auth.perform(self.achalls))
|
self.assertEqual([None], self.auth.perform(self.achalls))
|
||||||
@@ -130,10 +107,5 @@ s.serve_forever()" \n""")
|
|||||||
mock_killpg.assert_called_once_with(1234, signal.SIGTERM)
|
mock_killpg.assert_called_once_with(1234, signal.SIGTERM)
|
||||||
|
|
||||||
|
|
||||||
def nonrandom_urandom(num_bytes):
|
|
||||||
"""Returns a string of length num_bytes"""
|
|
||||||
return "x" * num_bytes
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main() # pragma: no cover
|
unittest.main() # pragma: no cover
|
||||||
|
|||||||
@@ -288,12 +288,12 @@ class Revoker(object):
|
|||||||
:class:`letsencrypt.revoker.Cert`
|
:class:`letsencrypt.revoker.Cert`
|
||||||
|
|
||||||
"""
|
"""
|
||||||
list_path2 = tempfile.mktemp(".tmp", "LIST")
|
newfile_handle, list_path2 = tempfile.mkstemp(".tmp", "LIST")
|
||||||
idx = 0
|
idx = 0
|
||||||
|
|
||||||
with open(self.list_path, "rb") as orgfile:
|
with open(self.list_path, "rb") as orgfile:
|
||||||
csvreader = csv.reader(orgfile)
|
csvreader = csv.reader(orgfile)
|
||||||
with open(list_path2, "wb") as newfile:
|
with os.fdopen(newfile_handle, "wb") as newfile:
|
||||||
csvwriter = csv.writer(newfile)
|
csvwriter = csv.writer(newfile)
|
||||||
|
|
||||||
for row in csvreader:
|
for row in csvreader:
|
||||||
|
|||||||
+2
-2
@@ -16,13 +16,13 @@ fi
|
|||||||
|
|
||||||
cover () {
|
cover () {
|
||||||
if [ "$1" = "letsencrypt" ]; then
|
if [ "$1" = "letsencrypt" ]; then
|
||||||
min=96
|
min=97
|
||||||
elif [ "$1" = "acme" ]; then
|
elif [ "$1" = "acme" ]; then
|
||||||
min=100
|
min=100
|
||||||
elif [ "$1" = "letsencrypt_apache" ]; then
|
elif [ "$1" = "letsencrypt_apache" ]; then
|
||||||
min=100
|
min=100
|
||||||
elif [ "$1" = "letsencrypt_nginx" ]; then
|
elif [ "$1" = "letsencrypt_nginx" ]; then
|
||||||
min=96
|
min=97
|
||||||
elif [ "$1" = "letshelp_letsencrypt" ]; then
|
elif [ "$1" = "letshelp_letsencrypt" ]; then
|
||||||
min=100
|
min=100
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user