ソースを参照

Add Let's Encrypt certificate to Nextcloud

multi_domain
ßingen 8年前
コミット
69f8b866f4
6個のファイルの変更41行の追加3行の削除
  1. +1
    -0
      deploy.sh
  2. +1
    -1
      images/rpi-haproxy
  3. +1
    -1
      images/rpi-nextcloud
  4. +28
    -0
      letsencrypt.sh
  5. +2
    -0
      nextcloud.env.template
  6. +8
    -1
      setup.sh

+ 1
- 0
deploy.sh ファイルの表示

# ##### Add users to LDAP ###### # # ##### Add users to LDAP ###### #


./add_users.sh ${STACK_NAME} ./add_users.sh ${STACK_NAME}
./letsencrypt.sh ${STACK_NAME}

+ 1
- 1
images/rpi-haproxy

Subproject commit 33fb70215bafd1def461ddc84d2b0bd800366851
Subproject commit a735079c742cb4e0aaad9e47029f280b2dbaf0d6

+ 1
- 1
images/rpi-nextcloud

Subproject commit b61004fadf280b4884effc9a2b0d7cf7ad2fb869
Subproject commit c75f25bb9657aa862e240b6c9f13a8cc7afdb922

+ 28
- 0
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 ###### #

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

+ 2
- 0
nextcloud.env.template ファイルの表示

DB_HOST=db DB_HOST=db
NEXTCLOUD_DB_NAME=nextcloud NEXTCLOUD_DB_NAME=nextcloud
NEXTCLOUD_DB_USER=nextcloud NEXTCLOUD_DB_USER=nextcloud
# Let's Encrypt
LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}

+ 8
- 1
setup.sh ファイルの表示

nextcloud_admin_pwd=`eval "$PWD_GEN"` nextcloud_admin_pwd=`eval "$PWD_GEN"`
fi fi


read -p "E-mail for Let's Encrypt account (admin@${domain}): " letsencrypt_email
if [[ ${#letsencrypt_email} -eq 0 ]]; then
letsencrypt_email=admin@${domain}
fi

echo "If you have a password salt and a secret from a previous installation, provide them here." echo "If you have a password salt and a secret from a previous installation, provide them here."
echo "They are used by Passman and need to remain the same for the vaults to be accessible" echo "They are used by Passman and need to remain the same for the vaults to be accessible"
read -p "Nextcloud Pwd Salt (a random one will be generated by NC if empty): " nextcloud_salt read -p "Nextcloud Pwd Salt (a random one will be generated by NC if empty): " nextcloud_salt
echo Your Volumes path is: $volumes echo Your Volumes path is: $volumes
echo Your LDAP Mail Bind DN Uid is: $ldap_mail_uid echo Your LDAP Mail Bind DN Uid is: $ldap_mail_uid
echo Your LDAP Nextcloud Bind DN Uid is: $ldap_nextcloud_uid echo Your LDAP Nextcloud Bind DN Uid is: $ldap_nextcloud_uid
echo Your Let\'s Encrypt account e-mail: $letsencrypt_email


echo $'\E[1;37m' echo $'\E[1;37m'
read -p "Are These Settings Correct? Yes (y), No (n): " confirm read -p "Are These Settings Correct? Yes (y), No (n): " confirm
sed -i "s/\${VOLUMES_PATH}/${volumes//\//\\/}/g" $i sed -i "s/\${VOLUMES_PATH}/${volumes//\//\\/}/g" $i
sed -i "s/\${MAIL_LDAP_UID}/${ldap_mail_uid}/g" $i sed -i "s/\${MAIL_LDAP_UID}/${ldap_mail_uid}/g" $i
sed -i "s/\${NEXTCLOUD_LDAP_UID}/${ldap_nextcloud_uid}/g" $i sed -i "s/\${NEXTCLOUD_LDAP_UID}/${ldap_nextcloud_uid}/g" $i
#sed -i "s/\${}/$/g" $i
sed -i "s/\${LETSENCRYPT_EMAIL}/${letsencrypt_email}/g" $i
#sed -i "s/\${}/${}/g" $i
done; done;


# read variables # read variables

読み込み中…
キャンセル
保存