Commit graph

82 commits

Author SHA1 Message Date
Brad Warren
82d0ff1df2 Fix permissions error when upgrading certbot-auto. (#5086)
Now we always check if we have root access if --cb-auto-has-root is not given
on the command line. This allows certbot-auto to properly acquire root when
upgrading from an older version. People upgrading from 0.18.0 to 0.18.1 may
check for root access twice, however, if root's user ID is 0, this check is
essentially a noop. If root's user ID is not 0, we'll request root access a 2nd
time during this upgrade.
2017-09-07 17:23:57 -07:00
Brad Warren
a5fae7eab5 certbot-auto OS dependency update system (#4971)
* Add version number to bootstrap scripts.

* Always determine Bootstrap function and version.

* Write bootstrap version into venv.

* Add PrevBootstrapVersion function.

* Add OS bootstrapping check to phase 2.

* Differentiate -n and renew when rebootstrapping.

* Quote all environment variables.

* Correct test condition

* Add loud warning about hardcoded version list.

* s/VENV_BOOTSTRAP_VERSION/BOOTSTRAP_VERSION_PATH

* Properly handle noop bootstrap functions.
2017-08-23 11:01:20 -07:00
Brad Warren
56db211367 Change certbot-auto's installation path to /opt (#4970)
* Update comment about root usage.

* run all of certbot-auto as root

* remove other $SUDO uses from template

* remove $SUDO usage from bootstrappers

* default venv path = /opt/eff.org/certbot/venv

* Create symlinks from old default venvs

* Delete old venv path when it exists.

Also, quote expansion of paths.

* fix typo

* Separate venv_dir and le_auto_path

* Deduplicate code with test_dirs()

* Ignore cleanup errors.

This is caused by subdirectories being owned by root.

* Split test into test_phase2_upgrade.

* Rename test_dirs to temp_paths for clarity.

* Check both venvs before bootstrapping again.

* Use OLD_VENV_PATH/bin

* Preserve environment with sudo.

* Remove "esp. under sudo" comment.

* Export *VENV_PATH.

* Change check for OLD_VENV installation.

This approach better handles manually set VENV_PATH values.

* Remove SUDO_ENV.

* Print message before requesting root privileges.

* Make a function for selecting root auth method.

* Address @erikrose's feedback.
2017-08-21 12:23:09 -07:00
Noah Swartz
bb6a22b985 Merge pull request #4943 from certbot/issue_4520
add deprecation warning
2017-07-19 15:51:51 -07:00
Noah Swartz
1cf8c5a586 add changes to template 2017-07-18 16:37:03 -07:00
Noah Swartz
fa74a32245 updated letsencrypt-auto.template 2017-07-18 16:27:33 -07:00
Brad Warren
be7e99a461 Pin dependency versions when using tools/venv.sh (#4629)
* Revert "Pin python-augeas version to avoid error with 1.0.0 (#4422)"

This reverts commit 1c51ae2588.

* make dependency-requirements

* separate certbot and dependency requirements

* fix build.py

* update hashin comment

* simplify release pinning

* separate letsencrypt dependency

* pin hashes in venv

* error out when bad things happen

* use pinned dependencies in tox

* Revert "pin hashes in venv"

This reverts commit 1cd38a9e50.

* use pip_install.sh in venv_common

* quote pip install args

* bump mock version
2017-05-11 10:06:05 -07:00
Brad Warren
372d201111 use say now that if QUIET statement was moved (#4530) 2017-04-19 14:11:18 -07:00
Josh Soref
c13b2eae9b Make it easier to honor --quiet (#4292)
* say -- echo which honors quiet

* error -- echo which does not honor quiet

* switch non error echos to say

* switch error echos to error

* run letsencrypt-auto-source/build.py
2017-04-19 09:11:38 -07:00
Brad Warren
36891033dd Set HOME if it's not defined in certbot-auto (#4503)
* set HOME if it's not defined

* use ~root rather than /root
2017-04-17 14:39:08 -07:00
Peter Eckersley
1ed50497eb [certbot-auto]: "renew" implies --non-interactive (#4500) 2017-04-17 11:41:24 -07:00
Peter Eckersley
2bdfffb23a Support "certbot-auto --no-bootstrap" (#3955)
* Support "certbot-auto --no-bootstrap"

* Tell people about --no-bootstrap?

* Document new certbot-auto flag in its cli help

* Rebuild

* Less variables is less variability

* Alphabetize help

* Make it extra clear we only take one branch

* Add --no-bootstrap message to experimentalbootstrap exit
2017-04-04 16:12:31 -07:00
Josh Soref
6a39a42f45 Spelling (#4101)
* spelling: action

* spelling: artifacts

* spelling: asymmetric

* spelling: attempts

* spelling: bizarre

* spelling: certbot

* spelling: certificate

* spelling: certainly

* spelling: challenge

* spelling: client

* spelling: collated

* spelling: correct

* spelling: considered

* spelling: custom

* spelling: distinguish

* spelling: encoding

* spelling: enhancement

* spelling: equivalent

* spelling: execution

* spelling: existence

* spelling: failed

* spelling: handshake

* spelling: hyphen

* spelling: initialized

* spelling: initialization

* spelling: interpretation

* spelling: letsencrypt

* spelling: multiline

* spelling: multipart

* spelling: necessary

* spelling: otherwise

* spelling: output

* spelling: overridden

* spelling: positives

* spelling: preferable

* spelling: progress

* spelling: recommended

* spelling: referring

* spelling: relativity

* spelling: request

* spelling: requiring

* spelling: separate

* spelling: source

* spelling: specified

* spelling: standard

* spelling: successfully

* spelling: unparseable

* spelling: useful
2017-01-26 16:21:54 -08:00
Brad Warren
6a55de45ba Fix letsencrypt auto source (#4093)
* Some shells don't like ==

* run build.py
2017-01-23 17:55:59 -08:00
Nick Fong
02615c2ac6 Silence Package Manager Output when certbot-auto invoked with --quiet (#3776)
* Add quiet flags to package manager invocations

Add the following flags when 'certbot-auto --quiet' is invoked:
- Add '-qq' to calls to 'apt-get' in Debian
- Add '--quiet' to calls to 'yum' or 'dnf' in CentOS or Fedora
- Add '--quiet' to calls to 'urpmi' in Mageia
- Add '--quiet' to calls to 'pkg install' in FreeBSD

* Fix $QUIET flag in bootstrappers

- Set the value of $QUIET properly (i.e. s/$QUIET/QUIET when setting the
  variable) in
  - deb_common.sh
  - mageia_common.sh
  - rpm_common.sh
- Actually use $QUIET when running $tool in rpm_common.sh

* Add handling of $QUIET to Arch and Open Suse

* Add logic to set --non-interactive if --quiet

* Add missing $QUIET_FLAG to rpm_common.sh

* Run build.py

* Limit --help to 80 cols

* Update indentation within bootstrappers

* Add $QUIET_FLAG to second call to `urpmi` (redux)
2017-01-20 09:40:36 -08:00
Guillaume Boudreau
a5101d73a0 certbot-auto re-installs virtualenv when plugin is causing issues (#4035)
When certbot-auto cannot find the currently installed version, output the error to the end-user, instead of not showing anything, and re-installing the virtualenv.

Fixes #4034
2017-01-17 14:54:14 -08:00
Lipis
bba5d7d950 Rename OS X -> macOS (#3965)
* Rename OS X -> macOS

* Revert *-auto
2017-01-10 12:24:15 -08:00
Brad Warren
1125b4924d Remove quotes so tilde is expanded (#3978) 2017-01-05 20:27:39 -05:00
Kenneth Skovhede
184d673378 Busybox support (#3797)
* Added support for shells without default variable support

* Added support for BusyBox installs that do not have `command` but has `which`

* Style fixes as suggested by reviewer

* Renamed `WHERE_IS` to `EXISTS` as suggested by review

* Removed expansion of `$LE_AUTO_SUDO` to `x` as the `-n` can check empty strings.

* Added `EXISTS` to debian bootstrap as suggested in review
2016-12-05 19:40:07 -08:00
Timothy Guan-tin Chien
3dbf5c9fcb certbot-auto: Print link to doc on debugging pip install error [revision requested] (#3473)
* certbot-auto: Print link to doc on debugging pip install error

Also, update the doc to teach the user to workaround problem on a low
memory system.

* Correct formatting

* grep the PIP_OUT and print useful info if the problem is about memory allocation

* Fix logic on string to grep
2016-12-05 18:49:38 -08:00
Brad Warren
0289457a93 Use ${foo+x} not ${foo:+x} (#3833) 2016-11-30 16:09:16 -08: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
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
shodan
54eafcf8da
Change fatal warning to a fatal message 2016-07-21 14:50:12 +02:00
Brad Warren
62d6cc3b90 Merge pull request #3176 from TheNavigat/pip-verbose
Printing pip output to terminal when -v is used
2016-07-15 17:23:41 -07:00
Amjad Mashaal
4ab6a183f0 Removing 2>&1 2016-07-16 01:33:44 +02:00
Amjad Mashaal
797d0a0660 Printing pip output to terminal when -v is used
Signed-off-by: Amjad Mashaal <me@amjad.io>
2016-06-25 12:37:42 +02:00
Brad Warren
f98fb1c6b6 Merge pull request #3155 from gdoucet/master
Added the argument --quiet and -q so then when used with a regular user there is no output to the screen.
2016-06-21 15:19:05 -07:00
Peter Eckersley
4da0ee6185 Merge pull request #3111 from certbot/exit-if-no-bootstrap
Exit if cannot bootstrap in certbot-auto
2016-06-14 14:29:28 -07:00
Geoffroy Doucet
8c8125c6fd Added the argument --quiet and -q so then when used with a regular
user there is no output to the screen.
2016-06-13 21:29:51 -04:00
Peter Eckersley
28169f17e3 Merge pull request #3133 from certbot/mageia
Mageia Bootstrap
2016-06-13 14:26:05 -07:00
Brad Warren
e51c16d666 Update letsencrypt-auto changes for the new format 2016-06-07 17:24:56 -07:00
Brad Warren
2815361e63 Update the template as well 2016-06-03 11:12:49 -07:00
Brad Warren
76a939ceb3 Exit if cannot bootstrap 2016-06-02 16:00:19 -07:00
Brad Warren
c606273d14 use TEMP_DIR trap consistently 2016-05-24 13:16:21 -07:00
Brad Warren
70bb7ff68f fixes #3060 2016-05-24 13:08:10 -07:00
Brad Warren
507b154276 Don't saying you're requesting root unless you really are 2016-05-17 20:11:02 -07:00
Brad Warren
502eba1cc4 Simplify SUDO certbot prompt 2016-05-17 20:07:45 -07:00
Brad Warren
45b7c407c1 Don't tell people you check for updates on every run 2016-05-17 20:07:06 -07:00
Brad Warren
af41345967 Put arg parsing in one place 2016-05-17 20:06:35 -07:00
Peter Eckersley
248dc0962e Merge pull request #2895 from dietsche/joyent
Joyent SmartOS Zone Bootstrap Support [revised]
2016-05-17 14:54:08 -07:00
Brad Warren
d39dee20ad fix auto arg parsing 2016-05-16 15:06:51 -07:00
Peter Eckersley
c9cdefd780 Merge remote-tracking branch 'origin/master' into deprecation-warning 2016-05-11 09:40:57 -07:00
Gregory L. Dietsche
029a818370 Experimental Joyent SmartOS Support
Testing using image: 088b97b0-e1a1-11e5-b895-9baa2086eb33
                     base-64-lts 15.4.1

Signed-off-by: Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
2016-05-10 18:03:32 +00:00
Gregory L. Dietsche
62cf9c93a8 /etc/issue does not exist on all systems
Signed-off-by: Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
2016-05-10 18:03:32 +00:00
Peter Eckersley
ed23f2e27f CERTBOT_AUTO env was broken (especially if containing spaces) 2016-05-10 10:21:15 -07:00
Brad Warren
f38d59d675 Use --non-interactive instead of --yes and use getopt for parsing short opts 2016-05-09 19:08:25 -07:00
Brad Warren
c66f0bd18e Make le-auto helpful 2016-04-21 16:13:17 -04:00
Brad Warren
0fa18b6081 Add help text 2016-04-21 15:55:28 -04:00
Brad Warren
530033a37d Add CLI parsing 2016-04-21 15:16:39 -04:00