2023-07-20 19:32:15 +02:00
#!/bin/sh
# Initialize missing user files
2023-11-14 00:30:47 +01:00
IFS = "," RESOURCES = "assets,backgrounds,user,context,instruct,QuickReplies,movingUI,themes,characters,chats,groups,group chats,User Avatars,worlds,OpenAI Settings,NovelAI Settings,KoboldAI Settings,TextGen Settings"
2023-07-20 19:32:15 +02:00
for R in $RESOURCES ; do
if [ ! -e " config/ $R " ] ; then
echo " Resource not found, copying from defaults: $R "
cp -r " public/ $R .default " " config/ $R "
fi
done
2023-11-25 22:45:33 +01:00
if [ ! -e "config/config.yaml" ] ; then
echo "Resource not found, copying from defaults: config.yaml"
cp -r "default/config.yaml" "config/config.yaml"
2023-07-23 15:52:25 +02:00
fi
if [ ! -e "config/settings.json" ] ; then
echo "Resource not found, copying from defaults: settings.json"
cp -r "default/settings.json" "config/settings.json"
fi
2023-11-25 22:45:33 +01:00
CONFIG_FILE = "config.yaml"
2023-11-14 00:30:47 +01:00
2023-11-25 23:41:28 +01:00
echo "Starting with the following config:"
cat $CONFIG_FILE
2023-11-25 22:45:33 +01:00
if grep -q "listen: false" $CONFIG_FILE ; then
echo -e "\033[1;31mThe listen parameter is set to false. If you can't connect to the server, edit the \"docker/config/config.yaml\" file and restart the container.\033[0m"
2023-11-14 00:30:47 +01:00
sleep 5
fi
2023-11-25 22:45:33 +01:00
if grep -q "whitelistMode: true" $CONFIG_FILE ; then
echo -e "\033[1;31mThe whitelistMode parameter is set to true. If you can't connect to the server, edit the \"docker/config/config.yaml\" file and restart the container.\033[0m"
2023-11-14 00:30:47 +01:00
sleep 5
fi
2023-07-20 19:32:15 +02:00
# Start the server
exec node server.js