use a temporary directory for nginx configuration

This commit is contained in:
Daniel Micay 2021-11-25 20:33:45 -05:00
parent 43c8ac3c45
commit 8b4e119821
3 changed files with 6 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
nginx.conf.tmp
nginx-tmp
static-tmp

View File

@ -24,8 +24,8 @@ ssh $remote sync -f $target
ssh $remote ln -snf $target /srv/element.grapheneos.org
ssh $remote sync /srv/element.grapheneos.org
sed -i "s|/srv/element.grapheneos.org|$target|" nginx.conf.tmp
rsync -rpcv --chmod=D755,F644 --delete nginx.conf.tmp $remote:/etc/nginx/nginx.conf
sed -i "s|/srv/element.grapheneos.org|$target|" nginx-tmp/nginx.conf
rsync -rpcv --chmod=D755,F644 --delete nginx-tmp/nginx.conf $remote:/etc/nginx/nginx.conf
ssh $remote sync -f /etc/nginx/nginx.conf
ssh $remote nginx -s reload

View File

@ -5,12 +5,13 @@ shopt -s dotglob extglob globstar
export PATH="$PWD/node_modules/.bin:$PATH"
rm -rf nginx-tmp
cp -a nginx nginx-tmp
rm -rf static-tmp
cp -a /usr/share/webapps/element static-tmp
cp --remove-destination webapps/element/config.json static-tmp/config.json
cp nginx/nginx.conf nginx.conf.tmp
brotli_k() {
brotli -k "$@"
}