Mercurial Hosting > luan
annotate host/update2.sh @ 2133:c3b4c19f2d8a default tip
attempt to autodetect and use nginx confs dir
| author | Violet7 |
|---|---|
| date | Fri, 16 Jan 2026 17:29:05 -0800 |
| parents | 6a2383baecb6 |
| children |
| rev | line source |
|---|---|
| 1628 | 1 #!/bin/bash |
| 2 set -e | |
| 3 | |
| 4 ../scripts/build-luan.sh | |
| 5 | |
| 6 mkdir -p local | |
| 7 mkdir -p logs | |
| 8 rm -f logs/* | |
| 9 hg identify >logs/changeset.txt | |
| 10 | |
| 2037 | 11 if [ ! -f local/tiny_account.key ]; then |
| 2096 | 12 echo "Register letsencrypt (tiny-acme)" |
| 13 openssl genrsa 4096 >local/tiny_account.key | |
|
2015
61b0cc7db09c
Manually specify letsencrypt server due to acme default server change (to zerossl)
Violet7
parents:
1632
diff
changeset
|
14 fi |
| 1630 | 15 |
| 2133 | 16 nginx_conf_dir=$( |
| 17 for d in \ | |
| 18 /usr/local/etc/nginx/servers \ | |
| 19 /etc/nginx/conf.d; do | |
| 20 if [ -d "$d" ]; then | |
| 21 echo "$d" | |
| 22 break | |
| 23 fi | |
| 24 done | |
| 25 ) | |
| 26 | |
| 27 if [ -n "$nginx_conf_dir" ]; then | |
| 28 echo "using nginx conf dir: $nginx_conf_dir" | |
| 29 else | |
| 30 echo "ERROR: No nginx conf dir found.\nFind it and add it to update2.sh." | |
| 31 exit 1 | |
| 32 fi | |
| 33 | |
| 2037 | 34 # id -gn gets the name of the primary group of the current user (staff) |
| 2133 | 35 luan startup/nginx/nginx.conf.luan $(pwd) $nginx_conf_dir $(whoami) $(id -gn) | sudo tee $nginx_conf_dir/luanhost.conf >/dev/null |
| 36 luan startup/nginx/nginx.default.conf.luan $(pwd) | sudo tee $nginx_conf_dir/luanhost.default.conf >/dev/null | |
| 1628 | 37 |
| 2096 | 38 # this is done because the nginx conf uses absolute paths |
| 39 # and this breaks sites when the luan/host directory is moved | |
|
2102
3112b06ab447
add host/update.luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
2099
diff
changeset
|
40 luan classpath:luan/host/update.luan |
| 2096 | 41 |
| 1628 | 42 echo Starting... |
| 43 ./start.sh |
