comparison host/update.sh @ 2096:c5b2b0bb841e ssltesting

inline update_ssl_conf.sh
author Violet7
date Mon, 15 Dec 2025 19:28:17 -0800
parents a4435e2e3417
children c1594d23d45b
comparison
equal deleted inserted replaced
2095:69b9d536779c 2096:c5b2b0bb841e
1 #!/bin/bash 1 #!/bin/bash
2 2
3 set -e 3 set -e
4
5 SCRIPT_DIR="$(cd -- "$(dirname -- "$0")" && pwd)"
6 cd $SCRIPT_DIR
4 7
5 ./stop.sh 8 ./stop.sh
6 9
7 echo Updating hg 10 echo Updating hg
8 hg pull -u 11 hg pull -u
13 mkdir -p logs 16 mkdir -p logs
14 rm -f logs/* 17 rm -f logs/*
15 hg identify >logs/changeset.txt 18 hg identify >logs/changeset.txt
16 19
17 if [ ! -f local/tiny_account.key ]; then 20 if [ ! -f local/tiny_account.key ]; then
18 echo "Register letsencrypt (tiny-acme)" 21 echo "Register letsencrypt (tiny-acme)"
19 openssl genrsa 4096 > local/tiny_account.key 22 openssl genrsa 4096 >local/tiny_account.key
20 fi 23 fi
21 24
22 cp startup/nginx/mime.types local/mime.types 25 cp startup/nginx/mime.types local/mime.types
23 # id -gn gets the name of the primary group of the current user (staff) 26 # id -gn gets the name of the primary group of the current user (staff)
24 luan startup/nginx/nginx.conf.luan $(pwd) $(whoami) $(id -gn) >local/nginx.conf 27 luan startup/nginx/nginx.conf.luan $(pwd) $(whoami) $(id -gn) >local/nginx.conf
25 luan startup/nginx/nginx.default.conf.luan $(pwd) >local/nginx.default.conf 28 luan startup/nginx/nginx.default.conf.luan $(pwd) >local/nginx.default.conf
26 29
30 # this is done because the nginx conf uses absolute paths
31 # and this breaks sites when the luan/host directory is moved
32 for conf in sites/*/nginx.ssl.conf; do
33 domain=$(basename $(dirname "$conf"))
34 luan startup/nginx/nginx.ssl.conf.luan $here $domain >$conf
35 done
36
27 echo Starting... 37 echo Starting...
28 ./start.sh 38 ./start.sh