From 3f942d742608cb97b897f0ea6167ac8fe3aa04dd Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Wed, 14 Oct 2015 18:19:10 +0000 Subject: [PATCH] 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