enable CRAWLAB_BASE_URL

This commit is contained in:
zerafachris PERSONAL
2022-01-02 13:18:00 +01:00
parent b2ad543de3
commit 28af7cb140

View File

@@ -1,4 +1,16 @@
#!/bin/bash
# replace base url
if [ "${CRAWLAB_BASE_URL}" = "" ];
then
:
else
indexpath=/app/dist/index.html
sed -i "s?/js/?${CRAWLAB_BASE_URL}/js/?g" ${indexpath}
sed -i "s?/css/?${CRAWLAB_BASE_URL}/css/?g" ${indexpath}
sed -i "s/ <link rel=\"icon\" type=\"image\/x-icon\" href=\"/ <link rel=\"icon\" type=\"image\/x-icon\" href=\"\/${CRAWLAB_BASE_URL}/g" ${indexpath}
sed -i "s/ <link rel=\"stylesheet\" href=\"/ <link rel=\"stylesheet\" href=\"${CRAWLAB_BASE_URL}\//g" ${indexpath}
sed -i "s/ window.VUE_APP_API_BASE_URL = '/ window.VUE_APP_API_BASE_URL = '\/${CRAWLAB_BASE_URL}/g" ${indexpath}
fi
# start nginx
service nginx start
@@ -18,3 +30,4 @@ weed server \
-volume.port 9999 \
-filer \
>> /var/log/weed.log 2>&1 &