diff host/update.sh @ 1630:b735ed134662

add nginx and ssl for host
author fffilimonov
date Fri, 10 Dec 2021 17:08:17 +0000
parents 124887e02dab
children 35c626c06dd5
line wrap: on
line diff
--- a/host/update.sh	Tue Dec 07 23:39:48 2021 -0700
+++ b/host/update.sh	Fri Dec 10 17:08:17 2021 +0000
@@ -5,7 +5,6 @@
 ./stop.sh
 
 echo Updating hg
-#hg pull -u https://luanhost_update:njer2ndsBVG@hg.luan.software/luanhost
 hg pull -u
 
 ../scripts/build-luan.sh
@@ -15,9 +14,14 @@
 rm -f logs/*
 hg identify >logs/changeset.txt
 
-#cp startup/mime.types local/mime.types;
-#./luan.sh startup/nginx.conf.luan $(pwd) $(whoami) $(id -gn) > local/nginx.conf
-#./luan.sh startup/nginx.default.conf.luan $(pwd) $(whoami) $(id -gn) > local/nginx.default.conf
+if [ ! -f local/leKey.txt ]; then
+  echo Register letsencrypt
+  ./acme.sh --register-account --cert-home ../sites --config-home local/letsencrypt/config 2>&1 | grep 'ACCOUNT_THUMBPRINT' | awk -F "'" '{print $2}' > local/leKey.txt;
+fi;
+
+cp startup/mime.types local/mime.types;
+luan startup/nginx.conf.luan $(pwd) $(whoami) $(id -gn) > local/nginx.conf
+luan startup/nginx.default.conf.luan $(pwd) $(cat local/leKey.txt) > local/nginx.default.conf
 
 echo Starting...
 ./start.sh