feat: add support for SVR.JS zip archives with "svrjs.yaml" file

This commit is contained in:
Dorian Niemiec 2025-01-18 07:32:02 +01:00
parent 155ff2471c
commit 3a02d9b051

View file

@ -170,8 +170,14 @@ if [ -f /usr/lib/svrjs/svr.compressed ]; then
popd
fi
ln -s /usr/lib/svrjs/log /var/log/svrjs
if [ -f /usr/lib/svrjs/svrjs.yaml ]; then
ln -s /usr/lib/svrjs/svrjs.yaml /etc/svrjs.yaml
echo "global:" > /usr/lib/svrjs/svrjs.yaml
echo " wwwroot: /var/www/svrjs" >> /usr/lib/svrjs/svrjs.yaml
else
ln -s /usr/lib/svrjs/config.json /etc/svrjs-config.json
node -e 'var fs=require("fs"),config=JSON.parse(fs.readFileSync("/usr/lib/svrjs/config.json").toString());config.wwwroot="/var/www/svrjs",fs.writeFileSync("/usr/lib/svrjs/config.json",JSON.stringify(config,null,2));' > /dev/null
fi
if [ -d /usr/lib/svrjs/wwwroot ]; then
mkdir -p /var/www
mv /usr/lib/svrjs/wwwroot /var/www/svrjs