matrix.grapheneos.org/process-static
Daniel Micay 8b8ce937f6 remove unnecessary zopfli wrapper
The timestamps of the generated static files are no longer used.
2024-03-06 15:41:29 -05:00

31 lines
616 B
Bash
Executable File

#!/bin/bash
set -o errexit -o nounset -o pipefail
shopt -s dotglob extglob globstar
source venv/bin/activate
if [[ $# -eq 1 ]]; then
fd=$1
else
touch lock
exec {fd}< lock
fi
if ! flock -n $fd; then
echo already processing/deploying static files >&2
exit 1
fi
rm -rf nginx-tmp
cp -a nginx nginx-tmp
gixy nginx-tmp/nginx.conf
rm -rf static-tmp
cp -a /usr/share/webapps/element static-tmp
cp --remove-destination webapps/element/config.json static-tmp/config.json
find static-tmp -regex '.+\.\(css\|html\|ico\|js\|json\|map\|svg\|txt\|wasm\|xml\)' |
parallel -q ::: brotli zopfli :::: -