From 3a02d9b0510a979f8b92e455dc759eeed63dcb9c Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 18 Jan 2025 07:32:02 +0100 Subject: [PATCH] feat: add support for SVR.JS zip archives with "svrjs.yaml" file --- installer.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/installer.sh b/installer.sh index a0045de..5b79100 100755 --- a/installer.sh +++ b/installer.sh @@ -170,8 +170,14 @@ if [ -f /usr/lib/svrjs/svr.compressed ]; then popd fi ln -s /usr/lib/svrjs/log /var/log/svrjs -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 +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