Skip to content

Commit

Permalink
letsencrypt: install from debian package
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Jun 18, 2018
1 parent 5aa071e commit 9210fb2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 31 deletions.
8 changes: 6 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@

[v0.57.2](https://github.com/nextcloud/nextcloudpi/commit/09943a8) (2018-06-18) nc-static-IP: autodetect default interface
[v0.57.4](https://github.com/nextcloud/nextcloudpi/commit/c00fbce) (2018-06-18) letsencrypt: install from debian package

[v0.57.1](https://github.com/nextcloud/nextcloudpi/commit/1c3d0c0) (2018-06-18) docker: replace systemd for service
[v0.57.3](https://github.com/nextcloud/nextcloudpi/commit/a74248b) (2018-06-18) armbian: default to SSH disabled

[v0.57.2 ](https://github.com/nextcloud/nextcloudpi/commit/5479305) (2018-06-18) nc-static-IP: autodetect default interface

[v0.57.1 ](https://github.com/nextcloud/nextcloudpi/commit/97375a1) (2018-06-18) docker: replace systemd for service

[v0.57.0](https://github.com/nextcloud/nextcloudpi/commit/ef5839d) (2018-06-18) update to NC 13.0.4

Expand Down
33 changes: 4 additions & 29 deletions etc/ncp-config.d/letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ install()
{
cd /etc || return 1
apt-get update
apt-get install --no-install-recommends -y python2.7-minimal
wget -O- --content-disposition https://github.com/letsencrypt/letsencrypt/archive/master/latest.tar.gz \
| tar -xz \
|| exit 1
mv certbot-master letsencrypt
/etc/letsencrypt/letsencrypt-auto --help # do not actually run certbot, only install packages
apt-get install --no-install-recommends -y letsencrypt

[[ "$DOCKERBUILD" == 1 ]] && {
# execute before lamp stack
Expand All @@ -46,21 +41,13 @@ install()
source /usr/local/etc/library.sh
persistent_cfg /etc/letsencrypt
cat > /etc/cron.weekly/letsencrypt-ncp <<EOFCRON
#!/bin/bash
/etc/letsencrypt/certbot-auto renew --quiet
rm -rf $NCDIR/.well-known
EOFCRON
chmod +x /etc/cron.weekly/letsencrypt-ncp
exit 0
EOF
chmod +x /etc/services-available.d/009letsencrypt
}
}

# tested with git version v0.11.0-71-g018a304
# tested with certbot 0.10.2
configure()
{
local DOMAIN_LOWERCASE="${DOMAIN_,,}"
Expand All @@ -69,10 +56,10 @@ configure()
sed -i "s|ServerName .*|ServerName $DOMAIN_|" $VHOSTCFG || \
sed -i "/DocumentRoot/aServerName $DOMAIN_" $VHOSTCFG

/etc/letsencrypt/letsencrypt-auto certonly -n --no-self-upgrade --webroot -w $NCDIR --hsts --agree-tos -m $EMAIL_ -d $DOMAIN_ && {
letsencrypt certonly -n --no-self-upgrade --webroot -w $NCDIR --hsts --agree-tos -m $EMAIL_ -d $DOMAIN_ && {
cat > /etc/cron.weekly/letsencrypt-ncp <<EOF
#!/bin/bash
/etc/letsencrypt/certbot-auto renew --quiet
/usr/bin/certbot renew --quiet
rm -rf $NCDIR/.well-known
EOF
chmod +x /etc/cron.weekly/letsencrypt-ncp
Expand All @@ -99,18 +86,6 @@ EOF
return 1
}

cleanup()
{
apt-get purge -y \
augeas-lenses \
libpython-dev \
libpython2.7-dev \
libssl-dev \
python-dev \
python2.7-dev \
python-pip-whl
}

# License
#
# This script is free software; you can redistribute it and/or modify it
Expand Down
8 changes: 8 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ EOF
activate_script nc-autoupdate-nc.sh
cd - &>/dev/null
}

# change letsencrypt from git to package based
[[ -f /usr/bin/letsencrypt ]] || {
echo "updating letsencrypt..."
apt-get update
apt-get install -y --no-install-recommends letsencrypt
}

} # end - only live updates

exit 0
Expand Down

0 comments on commit 9210fb2

Please sign in to comment.