Переглянути джерело

nextcloud: clean old Let's Encrypt stuff

multi_domain
ßingen 6 роки тому
джерело
коміт
25813a5a5e
3 змінених файлів з 1 додано та 41 видалено
  1. +1
    -3
      README.md
  2. +0
    -2
      deploy.sh
  3. +0
    -36
      letsencrypt.sh

+ 1
- 3
README.md Переглянути файл



Let's Encrypt Let's Encrypt
------------- -------------
Run the following script to enable Let's Encrypt for Nextcloud:

./letsencrypt.sh <your-stack-name>
Notice that when updating your certificate, you will need to restart haproxy container, due to [this issue](https://stackoverflow.com/a/50480260/1937418)


Own registry Own registry
------------ ------------

+ 0
- 2
deploy.sh Переглянути файл

curl http://${host}/index.nginx-debian.html 2>/dev/null | grep title | grep Welcome 1>/dev/null; curl http://${host}/index.nginx-debian.html 2>/dev/null | grep title | grep Welcome 1>/dev/null;
NC_UP=$((1 - $?)); NC_UP=$((1 - $?));
done; done;

./letsencrypt.sh ${STACK_NAME}

+ 0
- 36
letsencrypt.sh Переглянути файл

#!/bin/bash

STACK_NAME=$1

if [ $# -eq 0 ]; then
echo "You must pass stack name as a parameter"
exit 1
fi

# ##### Add Let's Encrypt certificates ###### #
echo ""
echo "Adding Let's Encrypt certificates"

# Find Nextcloud container
SERVICE=nextcloud
host=$(docker stack ps ${STACK_NAME} | grep Running | grep ${SERVICE} | awk '{ print $4 }')
#echo Host=$host
if [ -z $host ]; then
echo "No host found!";
exit 1;
fi
# add avahi suffix
localhostname=$(cat /etc/hostname)
if [ "${localhostname}" != "${host}" ]; then
host=${host}.local
fi

container=$(ssh $host 'docker ps | grep '${SERVICE}' | cut -f1 -d" "')
#echo Container=$container
if [ -z $container ]; then
echo "Qué me estás container?!";
exit 1;
fi

# Run script in container
ssh $host "docker exec ${container} sh -c '/usr/local/bin/letsencrypt.sh'"

Завантаження…
Відмінити
Зберегти