Mercurial Hosting > luan
annotate host/update2.sh @ 2134:de3107eb911f
improve previous
| author | Violet7 |
|---|---|
| date | Fri, 16 Jan 2026 17:59:40 -0800 |
| parents | c3b4c19f2d8a |
| 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 |
| 2134 | 36 # DON'T put this in the auto-loaded configs dir, |
| 37 # it is not meant to be loaded on its own. | |
| 38 luan startup/nginx/nginx.default.conf.luan $(pwd) >$(pwd)/local/luanhost.default.conf | |
| 1628 | 39 |
| 2096 | 40 # this is done because the nginx conf uses absolute paths |
| 41 # 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
|
42 luan classpath:luan/host/update.luan |
| 2096 | 43 |
| 1628 | 44 echo Starting... |
| 45 ./start.sh |
