浏览代码

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'"

正在加载...
取消
保存