From 3f942d742608cb97b897f0ea6167ac8fe3aa04dd Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Wed, 14 Oct 2015 18:19:10 +0000 Subject: [PATCH 01/17] Basic virtualenv bootstrap script for end users. --- bootstrap/venv.sh | 35 +++++++++++++++++++++++++++++++++++ docs/using.rst | 12 +++--------- 2 files changed, 38 insertions(+), 9 deletions(-) create mode 100755 bootstrap/venv.sh diff --git a/bootstrap/venv.sh b/bootstrap/venv.sh new file mode 100755 index 000000000..619135d0d --- /dev/null +++ b/bootstrap/venv.sh @@ -0,0 +1,35 @@ +#!/bin/sh -e +# +# Installs and updates letencrypt virtualenv +# +# USAGE: source ./dev/venv.sh + + +XDG_DATA_HOME=${XDG_DATA_HOME:-~/.local/share} +VENV_NAME="letsencrypt" +VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"} + +# virtualenv call is not idempotent: it overwrites pip upgraded in +# later steps, causing "ImportError: cannot import name unpack_url" +if [ ! -d $VENV_PATH ] +then + virtualenv --no-site-packages --python python2 $VENV_PATH +fi + +. $VENV_PATH/bin/activate +pip install -U setuptools +pip install -U pip + +# TODO: install apache and nginx plugins by default? +# --pre is not necessary for dev releases in more recent pip versions +pip install -U letsencrypt letsencrypt-apache letsencrypt-nginx + +echo +echo "Congratulations, Let's Encrypt has been successfully installed/updated!" +echo +echo -n "Your prompt should now be prepended with ($VENV_NAME). Next " +echo -n "time, if the prompt is different, 'source' this script again " +echo -n "before running 'letsencrypt'." +echo +echo +echo "You can now run 'letsencrypt --help'." diff --git a/docs/using.rst b/docs/using.rst index 9611f37c0..b2d2db42a 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -122,15 +122,9 @@ bash``. Installation ============ -.. "pip install acme" doesn't search for "acme" in cwd, just like "pip - install -e acme" does; `-U setuptools pip` necessary for #722 - .. code-block:: shell - virtualenv --no-site-packages -p python2 venv - ./venv/bin/pip install -U setuptools - ./venv/bin/pip install -U pip - ./venv/bin/pip install -r requirements.txt acme/ . letsencrypt-apache/ letsencrypt-nginx/ + source ./bootstrap/venv.sh .. warning:: Please do **not** use ``python setup.py install``. Please do **not** attempt the installation commands as @@ -148,13 +142,13 @@ To get a new certificate run: .. code-block:: shell - sudo ./venv/bin/letsencrypt auth + (letsencrypt)$ letsencrypt auth The ``letsencrypt`` commandline tool has a builtin help: .. code-block:: shell - ./venv/bin/letsencrypt --help + (letsencrypt)$ letsencrypt --help Configuration file From 47eaf297fba19668d7c5e483ec7abaa6085eafad Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 15:57:09 -0700 Subject: [PATCH 02/17] Start a letsencrypt-auto script Which handles all venv-related tasks for installing from pip, and gives us auto-updating. --- letsencrypt-auto | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 letsencrypt-auto diff --git a/letsencrypt-auto b/letsencrypt-auto new file mode 100755 index 000000000..82720a3fc --- /dev/null +++ b/letsencrypt-auto @@ -0,0 +1,45 @@ +#!/bin/bash -e +# +# Installs and updates the letencrypt virtualenv, and runs letsencrypt +# using that virtual environment. This allows the client to function decently +# without requiring specific versions of its dependencies from the operating +# system. + +XDG_DATA_HOME=${XDG_DATA_HOME:-~/.local/share} +VENV_NAME="letsencrypt" +VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"} +VENV_BIN=${VENV_PATH}/bin + +for arg in "$@" ; do + if [ "$arg" = "-v" ] || [ "$arg" = "--verbose" ] ; then + VERBOSE=1 + fi +done + +# virtualenv call is not idempotent: it overwrites pip upgraded in +# later steps, causing "ImportError: cannot import name unpack_url" +if [ ! -d $VENV_PATH ] +then + echo "Creating virtual environment..." + if [ "$VERBOSE" = 1 ] ; then + virtualenv --no-site-packages --python python2 $VENV_PATH + else + virtualenv --no-site-packages --python python2 $VENV_PATH > /dev/null + fi +fi + +echo "Updating letsencrypt and virtual environment dependencies..." +if [ "$VERBOSE" = 1 ] ; then + $VENV_BIN/pip install -U setuptools + $VENV_BIN/pip install -U pip + $VENV_BIN/pip install -U letsencrypt letsencrypt-apache letsencrypt-nginx +else + $VENV_BIN/pip install -U setuptools > /dev/null + $VENV_BIN/pip install -U pip > /dev/null + $VENV_BIN/pip install -U letsencrypt letsencrypt-apache letsencrypt-nginx > /dev/null +fi + +# TODO: install apache and nginx plugins by default? +# --pre is not necessary for dev releases in more recent pip versions + +sudo $VENV_BIN/letsencrypt $@ From b85e13de3f126fca8612bf3ce01c777d1a03615e Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 16:07:12 -0700 Subject: [PATCH 03/17] Add bootstrapping to letsencrypt-auto --- letsencrypt-auto | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/letsencrypt-auto b/letsencrypt-auto index 82720a3fc..77a545fc6 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -20,6 +20,34 @@ done # later steps, causing "ImportError: cannot import name unpack_url" if [ ! -d $VENV_PATH ] then + BOOTSTRAP=`dirname $0`/bootstrap + if [ ! -f $BOOTSTRAP/debian.sh ] ; then + echo "Cannot find the letsencrypt bootstrap scripts in $BOOTSTRAP" + exit 1 + fi + if [ -f /etc/debian_version ] ; then + echo "Bootstrapping dependencies for Debian-based OSes..." + sudo $BOOTSTRAP/_deb_common.sh + elif [ -f /etc/arch-release ] ; then + echo "Bootstrapping dependencies for Archlinux..." + sudo $BOOTSTRAP/archlinux.sh + elif [ -f /etc/redhat-release ] ; then + echo "Bootstrapping dependencies for RedHat-based OSes..." + sudo $BOOTSTRAP/_rpm_common.sh + elif uname | grep -iq FreeBSD ; then + echo "Bootstrapping dependencies for FreeBSD..." + sudo $BOOTSTRAP/freebsd.sh + elif uname | grep -iq Darwin ; then + echo "Bootstrapping dependencies for Mac OS X..." + sudo $BOOTSTRAP/mac.sh + else + echo "Sorry, I don't know how to bootstrap Let's Encrypt on your operating system!" + echo + echo "You will need to bootstrap, configure virtualenv, and run a pip install manually" + echo "Please see https://letsencrypt.readthedocs.org/en/latest/using.html#prerequisites" + echo "for more info" + fi + echo "Creating virtual environment..." if [ "$VERBOSE" = 1 ] ; then virtualenv --no-site-packages --python python2 $VENV_PATH From 99793c54d6a0ca7a41ca9c1ab9ec9104e82dbc44 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 16:25:53 -0700 Subject: [PATCH 04/17] More portability --- bootstrap/mac.sh | 2 +- letsencrypt-auto | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bootstrap/mac.sh b/bootstrap/mac.sh index 6779188a7..84e87cf5b 100755 --- a/bootstrap/mac.sh +++ b/bootstrap/mac.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e if ! hash brew 2>/dev/null; then echo "Homebrew Not Installed\nDownloading..." ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" diff --git a/letsencrypt-auto b/letsencrypt-auto index 77a545fc6..7f7533f39 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/sh -e # # Installs and updates the letencrypt virtualenv, and runs letsencrypt # using that virtual environment. This allows the client to function decently @@ -39,7 +39,8 @@ then sudo $BOOTSTRAP/freebsd.sh elif uname | grep -iq Darwin ; then echo "Bootstrapping dependencies for Mac OS X..." - sudo $BOOTSTRAP/mac.sh + echo "WARNING: Mac support is very experimental at present..." + $BOOTSTRAP/mac.sh else echo "Sorry, I don't know how to bootstrap Let's Encrypt on your operating system!" echo From 7a1c37968cd35f9f7087cfaac24460afdf75bfeb Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 17:21:36 -0700 Subject: [PATCH 05/17] Make the UX clearer before sudo --- letsencrypt-auto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/letsencrypt-auto b/letsencrypt-auto index 7f7533f39..7ee715bf4 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -68,7 +68,7 @@ else $VENV_BIN/pip install -U letsencrypt letsencrypt-apache letsencrypt-nginx > /dev/null fi -# TODO: install apache and nginx plugins by default? -# --pre is not necessary for dev releases in more recent pip versions - +# Explain what's about to happen, for the benefit of those getting sudo +# password prompts... +echo "Running with virtualenv:" sudo $VENV_BIN/letsencrypt "$@" sudo $VENV_BIN/letsencrypt $@ From 2e0dc4fc5061864f73e9742f85c5ebefd1198f5f Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 18:25:14 -0700 Subject: [PATCH 06/17] Remove misleading Docker suggestion from the quick-install docs But keep it around in case anyone needs this? --- docs/using.rst | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/docs/using.rst b/docs/using.rst index b2d2db42a..3e3973d2f 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -2,26 +2,6 @@ Using the Let's Encrypt client ============================== -Quick start -=========== - -Using Docker_ you can quickly get yourself a testing cert. From the -server that the domain your requesting a cert for resolves to, -`install Docker`_, issue the following command: - -.. code-block:: shell - - sudo docker run -it --rm -p 443:443 --name letsencrypt \ - -v "/etc/letsencrypt:/etc/letsencrypt" \ - -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ - quay.io/letsencrypt/letsencrypt:latest - -and follow the instructions. Your new cert will be available in -``/etc/letsencrypt/certs``. - -.. _Docker: https://docker.com -.. _`install Docker`: https://docs.docker.com/docker/userguide/ - Getting the code ================ @@ -174,3 +154,25 @@ By default, the following locations are searched: .. _Augeas: http://augeas.net/ .. _Virtualenv: https://virtualenv.pypa.io + +Running with Docker +=================== + +Docker_ is another way to quickly obtaintesting certs. From the +server that the domain your requesting a cert for resolves to, +`install Docker`_, issue the following command: + +.. code-block:: shell + + sudo docker auth -it --rm -p 443:443 --name letsencrypt \ + -v "/etc/letsencrypt:/etc/letsencrypt" \ + -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ + quay.io/letsencrypt/letsencrypt:latest + +and follow the instructions. Your new cert will be available in +``/etc/letsencrypt/certs``. + +.. _Docker: https://docker.com +.. _`install Docker`: https://docs.docker.com/docker/userguide/ + + From 8a5d199ddffebc0b000b26989a9451f1d12f5639 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 18:35:34 -0700 Subject: [PATCH 07/17] Try to make the "using" instructions as simple and accurate as possible Some of the verbose stuff we had before is really of historical/developer interest only --- docs/contributing.rst | 96 +++++++++++++++++++++++++++++++++++++ docs/using.rst | 109 +++++++++++++++++++----------------------- 2 files changed, 146 insertions(+), 59 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index 614f6f2aa..ed74bbb60 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -296,3 +296,99 @@ commands: This should generate documentation in the ``docs/_build/html`` directory. + +Notes on OS depedencies +======================= + +OS level dependencies are managed by scripts in ``bootstrap``. Some notes +are provided here mainly for the :ref:`developers ` reference. + +In general: + +* ``sudo`` is required as a suggested way of running privileged process +* `Augeas`_ is required for the Python bindings +* ``virtualenv`` and ``pip`` are used for managing other python library + dependencies + + +Ubuntu +------ + +.. code-block:: shell + + sudo ./bootstrap/ubuntu.sh + + +Debian +------ + +.. code-block:: shell + + sudo ./bootstrap/debian.sh + +For squeeze you will need to: + +- Use ``virtualenv --no-site-packages -p python`` instead of ``-p python2``. + + +.. _`#280`: https://github.com/letsencrypt/letsencrypt/issues/280 + + +Mac OSX +------- + +.. code-block:: shell + + ./bootstrap/mac.sh + + +Fedora +------ + +.. code-block:: shell + + sudo ./bootstrap/fedora.sh + + +Centos 7 +-------- + +.. code-block:: shell + + sudo ./bootstrap/centos.sh + + +FreeBSD +------- + +.. code-block:: shell + + sudo ./bootstrap/freebsd.sh + +Bootstrap script for FreeBSD uses ``pkg`` for package installation, +i.e. it does not use ports. + +FreeBSD by default uses ``tcsh``. In order to activate virtulenv (see +below), you will need a compatbile shell, e.g. ``pkg install bash && +bash``. + + +Running with Docker +=================== + +Docker_ is another way to quickly obtaintesting certs. From the +server that the domain your requesting a cert for resolves to, +`install Docker`_, issue the following command: + +.. code-block:: shell + + sudo docker auth -it --rm -p 443:443 --name letsencrypt \ + -v "/etc/letsencrypt:/etc/letsencrypt" \ + -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ + quay.io/letsencrypt/letsencrypt:latest + +and follow the instructions. Your new cert will be available in +``/etc/letsencrypt/certs``. + +.. _Docker: https://docker.com +.. _`install Docker`: https://docs.docker.com/docker/userguide/ diff --git a/docs/using.rst b/docs/using.rst index 3e3973d2f..1920efe38 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -24,17 +24,62 @@ above method instead. .. _prerequisites: -Prerequisites -============= +Installation and Usage +====================== -The demo code is supported and known to work on **Ubuntu and -Debian**. Therefore, prerequisites for other platforms listed below -are provided mainly for the :ref:`developers ` reference. +To install and run the client you just need to type: + +.. code-block:: shell + + ./letsencrypt-auto + +.. warning:: Please do **not** use ``python setup.py install``. That mode of + operation might corrupt your operating system and is **not supported** + by the Let's Encrypt team! + +The ``letsencrypt`` commandline tool has a builtin help: + +.. code-block:: shell + + ./letsencrypt-auto --help + + +Configuration file +------------------ + +It is possible to specify configuration file with +``letsencrypt --config cli.ini`` (or shorter ``-c cli.ini``). For +instance, if you are a contributor, you might find the following +handy: + +.. include:: ../examples/dev-cli.ini + :code: ini + +By default, the following locations are searched: + +- ``/etc/letsencrypt/cli.ini`` +- ``$XDG_CONFIG_HOME/letsencrypt/cli.ini`` (or + ``~/.config/letsencrypt/cli.ini`` if ``$XDG_CONFIG_HOME`` is not + set). + +.. keep it up to date with constants.py + + +.. _Augeas: http://augeas.net/ +.. _Virtualenv: https://virtualenv.pypa.io + +Notes on OS depedencies +======================= + +OS level dependencies are managed by scripts in ``bootstrap``. Some notes +are provided here mainly for the :ref:`developers ` reference. In general: * ``sudo`` is required as a suggested way of running privileged process * `Augeas`_ is required for the Python bindings +* ``virtualenv`` and ``pip`` are used for managing other python library + dependencies Ubuntu @@ -99,61 +144,7 @@ below), you will need a compatbile shell, e.g. ``pkg install bash && bash``. -Installation -============ -.. code-block:: shell - - source ./bootstrap/venv.sh - -.. warning:: Please do **not** use ``python setup.py install``. Please - do **not** attempt the installation commands as - superuser/root and/or without Virtualenv_, e.g. ``sudo - python setup.py install``, ``sudo pip install``, ``sudo - ./venv/bin/...``. These modes of operation might corrupt - your operating system and are **not supported** by the - Let's Encrypt team! - - -Usage -===== - -To get a new certificate run: - -.. code-block:: shell - - (letsencrypt)$ letsencrypt auth - -The ``letsencrypt`` commandline tool has a builtin help: - -.. code-block:: shell - - (letsencrypt)$ letsencrypt --help - - -Configuration file ------------------- - -It is possible to specify configuration file with -``letsencrypt --config cli.ini`` (or shorter ``-c cli.ini``). For -instance, if you are a contributor, you might find the following -handy: - -.. include:: ../examples/dev-cli.ini - :code: ini - -By default, the following locations are searched: - -- ``/etc/letsencrypt/cli.ini`` -- ``$XDG_CONFIG_HOME/letsencrypt/cli.ini`` (or - ``~/.config/letsencrypt/cli.ini`` if ``$XDG_CONFIG_HOME`` is not - set). - -.. keep it up to date with constants.py - - -.. _Augeas: http://augeas.net/ -.. _Virtualenv: https://virtualenv.pypa.io Running with Docker =================== From 87000ac5c60eda6b8f7e4c291c53bc97a006c3e7 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 22:24:41 -0700 Subject: [PATCH 08/17] Move docker back into "using" It seems the changes removing bootstrap from "using" weren't commited earlier, either --- docs/contributing.rst | 21 ----------- docs/using.rst | 81 +------------------------------------------ 2 files changed, 1 insertion(+), 101 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index ed74bbb60..8661b195e 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -371,24 +371,3 @@ i.e. it does not use ports. FreeBSD by default uses ``tcsh``. In order to activate virtulenv (see below), you will need a compatbile shell, e.g. ``pkg install bash && bash``. - - -Running with Docker -=================== - -Docker_ is another way to quickly obtaintesting certs. From the -server that the domain your requesting a cert for resolves to, -`install Docker`_, issue the following command: - -.. code-block:: shell - - sudo docker auth -it --rm -p 443:443 --name letsencrypt \ - -v "/etc/letsencrypt:/etc/letsencrypt" \ - -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ - quay.io/letsencrypt/letsencrypt:latest - -and follow the instructions. Your new cert will be available in -``/etc/letsencrypt/certs``. - -.. _Docker: https://docker.com -.. _`install Docker`: https://docs.docker.com/docker/userguide/ diff --git a/docs/using.rst b/docs/using.rst index 1920efe38..125aa29b3 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -68,83 +68,6 @@ By default, the following locations are searched: .. _Augeas: http://augeas.net/ .. _Virtualenv: https://virtualenv.pypa.io -Notes on OS depedencies -======================= - -OS level dependencies are managed by scripts in ``bootstrap``. Some notes -are provided here mainly for the :ref:`developers ` reference. - -In general: - -* ``sudo`` is required as a suggested way of running privileged process -* `Augeas`_ is required for the Python bindings -* ``virtualenv`` and ``pip`` are used for managing other python library - dependencies - - -Ubuntu ------- - -.. code-block:: shell - - sudo ./bootstrap/ubuntu.sh - - -Debian ------- - -.. code-block:: shell - - sudo ./bootstrap/debian.sh - -For squeeze you will need to: - -- Use ``virtualenv --no-site-packages -p python`` instead of ``-p python2``. - - -.. _`#280`: https://github.com/letsencrypt/letsencrypt/issues/280 - - -Mac OSX -------- - -.. code-block:: shell - - ./bootstrap/mac.sh - - -Fedora ------- - -.. code-block:: shell - - sudo ./bootstrap/fedora.sh - - -Centos 7 --------- - -.. code-block:: shell - - sudo ./bootstrap/centos.sh - - -FreeBSD -------- - -.. code-block:: shell - - sudo ./bootstrap/freebsd.sh - -Bootstrap script for FreeBSD uses ``pkg`` for package installation, -i.e. it does not use ports. - -FreeBSD by default uses ``tcsh``. In order to activate virtulenv (see -below), you will need a compatbile shell, e.g. ``pkg install bash && -bash``. - - - Running with Docker =================== @@ -158,12 +81,10 @@ server that the domain your requesting a cert for resolves to, sudo docker auth -it --rm -p 443:443 --name letsencrypt \ -v "/etc/letsencrypt:/etc/letsencrypt" \ -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \ - quay.io/letsencrypt/letsencrypt:latest + quay.io/letsencrypt/letsencrypt:latest auth and follow the instructions. Your new cert will be available in ``/etc/letsencrypt/certs``. .. _Docker: https://docker.com .. _`install Docker`: https://docs.docker.com/docker/userguide/ - - From ecd987b8ca9dc3c31e9702d2f871b9f840ba51ed Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 22:30:18 -0700 Subject: [PATCH 09/17] letsencrypt-auto now knows about -vvvv --- letsencrypt-auto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/letsencrypt-auto b/letsencrypt-auto index 7ee715bf4..5106e2fae 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -11,7 +11,8 @@ VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"} VENV_BIN=${VENV_PATH}/bin for arg in "$@" ; do - if [ "$arg" = "-v" ] || [ "$arg" = "--verbose" ] ; then + # This first clause is redundant with the third, but hedging on portability + if [ "$arg" = "-v" ] || [ "$arg" = "--verbose" ] || echo "$arg" | grep -E -- -v+ ; then VERBOSE=1 fi done From 39e489d03cd935dcbbc725ad7370441d789b4c6d Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 23:03:18 -0700 Subject: [PATCH 10/17] Do not assume sudo is present - On Digital Ocean and perhaps other platforms, the user is root by default and sudo is uninstalled --- letsencrypt-auto | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/letsencrypt-auto b/letsencrypt-auto index 5106e2fae..662908c47 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -10,6 +10,12 @@ VENV_NAME="letsencrypt" VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"} VENV_BIN=${VENV_PATH}/bin +if test "`id -u`" -ne "0" ; then + SUDO=sudo +else + SUDO= +fi + for arg in "$@" ; do # This first clause is redundant with the third, but hedging on portability if [ "$arg" = "-v" ] || [ "$arg" = "--verbose" ] || echo "$arg" | grep -E -- -v+ ; then @@ -28,16 +34,16 @@ then fi if [ -f /etc/debian_version ] ; then echo "Bootstrapping dependencies for Debian-based OSes..." - sudo $BOOTSTRAP/_deb_common.sh + $SUDO $BOOTSTRAP/_deb_common.sh elif [ -f /etc/arch-release ] ; then echo "Bootstrapping dependencies for Archlinux..." - sudo $BOOTSTRAP/archlinux.sh + $SUDO $BOOTSTRAP/archlinux.sh elif [ -f /etc/redhat-release ] ; then echo "Bootstrapping dependencies for RedHat-based OSes..." - sudo $BOOTSTRAP/_rpm_common.sh + $SUDO $BOOTSTRAP/_rpm_common.sh elif uname | grep -iq FreeBSD ; then echo "Bootstrapping dependencies for FreeBSD..." - sudo $BOOTSTRAP/freebsd.sh + $SUDO $BOOTSTRAP/freebsd.sh elif uname | grep -iq Darwin ; then echo "Bootstrapping dependencies for Mac OS X..." echo "WARNING: Mac support is very experimental at present..." @@ -71,5 +77,5 @@ fi # Explain what's about to happen, for the benefit of those getting sudo # password prompts... -echo "Running with virtualenv:" sudo $VENV_BIN/letsencrypt "$@" -sudo $VENV_BIN/letsencrypt $@ +echo "Running with virtualenv:" $SUDO $VENV_BIN/letsencrypt "$@" +$SUDO $VENV_BIN/letsencrypt $@ From ab036e98e08ad3c9b9f686702ab03f16c640657e Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 23:06:20 -0700 Subject: [PATCH 11/17] Do not ship letsencrypt-nginx until it's somewhat plausibly working --- letsencrypt-auto | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/letsencrypt-auto b/letsencrypt-auto index 662908c47..20a7a40fa 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -68,11 +68,13 @@ echo "Updating letsencrypt and virtual environment dependencies..." if [ "$VERBOSE" = 1 ] ; then $VENV_BIN/pip install -U setuptools $VENV_BIN/pip install -U pip - $VENV_BIN/pip install -U letsencrypt letsencrypt-apache letsencrypt-nginx + # nginx is buggy / disabled for now... + $VENV_BIN/pip install -U letsencrypt letsencrypt-apache #letsencrypt-nginx else $VENV_BIN/pip install -U setuptools > /dev/null $VENV_BIN/pip install -U pip > /dev/null - $VENV_BIN/pip install -U letsencrypt letsencrypt-apache letsencrypt-nginx > /dev/null + # nginx is buggy / disabled for now... + $VENV_BIN/pip install -U letsencrypt letsencrypt-apache > /dev/null fi # Explain what's about to happen, for the benefit of those getting sudo From 2794b762d6199dc2c3f1e63ede22eb6c7e08ffe2 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 23:41:37 -0700 Subject: [PATCH 12/17] Add a subtle progress bar --- letsencrypt-auto | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/letsencrypt-auto b/letsencrypt-auto index 20a7a40fa..b43c22f87 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -64,17 +64,23 @@ then fi fi -echo "Updating letsencrypt and virtual environment dependencies..." +echo -n "Updating letsencrypt and virtual environment dependencies..." if [ "$VERBOSE" = 1 ] ; then + echo $VENV_BIN/pip install -U setuptools $VENV_BIN/pip install -U pip # nginx is buggy / disabled for now... $VENV_BIN/pip install -U letsencrypt letsencrypt-apache #letsencrypt-nginx else $VENV_BIN/pip install -U setuptools > /dev/null + echo -n . $VENV_BIN/pip install -U pip > /dev/null + echo -n . # nginx is buggy / disabled for now... - $VENV_BIN/pip install -U letsencrypt letsencrypt-apache > /dev/null + $VENV_BIN/pip install -U letsencrypt > /dev/null + echo -n . + $VENV_BIN/pip install -U letsencrypt-apache > /dev/null + echo fi # Explain what's about to happen, for the benefit of those getting sudo From be77909ef21af57a7d10a9799bd12460770db9fb Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 23:53:50 -0700 Subject: [PATCH 13/17] Further fixes to the docs --- docs/using.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/using.rst b/docs/using.rst index 125aa29b3..5683fba21 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -22,8 +22,6 @@ above method instead. https://github.com/letsencrypt/letsencrypt/archive/master.zip -.. _prerequisites: - Installation and Usage ====================== @@ -33,9 +31,13 @@ To install and run the client you just need to type: ./letsencrypt-auto -.. warning:: Please do **not** use ``python setup.py install``. That mode of - operation might corrupt your operating system and is **not supported** - by the Let's Encrypt team! +(Once letsencrypt is packaged by distributions, the command will just be +``letsencrypt``. ``letsencrypt-auto`` is a wrapper which installs virtualized +dependencies and provides automated updates during the beta program) + +.. warning:: Please do **not** use ``python setup.py install`` or ``sudo pip install`. + Those mode of operation might corrupt your operating system and is + **not supported** by the Let's Encrypt team! The ``letsencrypt`` commandline tool has a builtin help: @@ -48,7 +50,7 @@ Configuration file ------------------ It is possible to specify configuration file with -``letsencrypt --config cli.ini`` (or shorter ``-c cli.ini``). For +``letsencrypt-auto --config cli.ini`` (or shorter ``-c cli.ini``). For instance, if you are a contributor, you might find the following handy: @@ -72,7 +74,7 @@ By default, the following locations are searched: Running with Docker =================== -Docker_ is another way to quickly obtaintesting certs. From the +Docker_ is another way to quickly obtain testing certs. From the server that the domain your requesting a cert for resolves to, `install Docker`_, issue the following command: From 4ef385d3ad7e174452996cb41da0c9f6c02d8ab5 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 14 Oct 2015 23:56:56 -0700 Subject: [PATCH 14/17] Protect quotes on the way to the actual command --- letsencrypt-auto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt-auto b/letsencrypt-auto index b43c22f87..72c0c8aa4 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -86,4 +86,4 @@ fi # Explain what's about to happen, for the benefit of those getting sudo # password prompts... echo "Running with virtualenv:" $SUDO $VENV_BIN/letsencrypt "$@" -$SUDO $VENV_BIN/letsencrypt $@ +$SUDO $VENV_BIN/letsencrypt "$@" From 0fb00ca039d390de7508f7a0cfba2f94dc9d4134 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Thu, 15 Oct 2015 00:03:49 -0700 Subject: [PATCH 15/17] Try to make the dependencies link work --- docs/contributing.rst | 2 ++ letsencrypt-auto | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index 8661b195e..4c3d91902 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -297,6 +297,8 @@ commands: This should generate documentation in the ``docs/_build/html`` directory. +.. _prerequisites: + Notes on OS depedencies ======================= diff --git a/letsencrypt-auto b/letsencrypt-auto index 72c0c8aa4..0b3d9b72d 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -52,7 +52,7 @@ then echo "Sorry, I don't know how to bootstrap Let's Encrypt on your operating system!" echo echo "You will need to bootstrap, configure virtualenv, and run a pip install manually" - echo "Please see https://letsencrypt.readthedocs.org/en/latest/using.html#prerequisites" + echo "Please see https://letsencrypt.readthedocs.org/en/latest/contributing.html#prerequisites" echo "for more info" fi From 0fb8e3c47947e2b124734921e7b405c669703e16 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Thu, 15 Oct 2015 00:07:26 -0700 Subject: [PATCH 16/17] Move augeaus & venv references --- docs/contributing.rst | 2 ++ docs/using.rst | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index 4c3d91902..6d0a2d4ba 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -312,6 +312,8 @@ In general: * ``virtualenv`` and ``pip`` are used for managing other python library dependencies +.. _Augeas: http://augeas.net/ +.. _Virtualenv: https://virtualenv.pypa.io Ubuntu ------ diff --git a/docs/using.rst b/docs/using.rst index 5683fba21..0a781431a 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -67,10 +67,6 @@ By default, the following locations are searched: .. keep it up to date with constants.py -.. _Augeas: http://augeas.net/ -.. _Virtualenv: https://virtualenv.pypa.io - - Running with Docker =================== From 64385cbd80cde04e9ee53fd046df5bc0ee6ef270 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Thu, 15 Oct 2015 00:09:42 -0700 Subject: [PATCH 17/17] Disable nginx in bootstrap/venv.sh too --- bootstrap/venv.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bootstrap/venv.sh b/bootstrap/venv.sh index 619135d0d..ce31e6703 100755 --- a/bootstrap/venv.sh +++ b/bootstrap/venv.sh @@ -20,9 +20,7 @@ fi pip install -U setuptools pip install -U pip -# TODO: install apache and nginx plugins by default? -# --pre is not necessary for dev releases in more recent pip versions -pip install -U letsencrypt letsencrypt-apache letsencrypt-nginx +pip install -U letsencrypt letsencrypt-apache # letsencrypt-nginx echo echo "Congratulations, Let's Encrypt has been successfully installed/updated!"