Add assets and update symbolic links in Dockerfile and entrypoint script
This commit is contained in:
parent
fc17f42f93
commit
c0a8186d37
16
Dockerfile
16
Dockerfile
|
@ -23,18 +23,18 @@ COPY . ./
|
|||
|
||||
# Copy default chats, characters and user avatars to <folder>.default folder
|
||||
RUN \
|
||||
IFS="," RESOURCES="characters,chats,groups,group chats,User Avatars,worlds,OpenAI Settings,NovelAI Settings,KoboldAI Settings,TextGen Settings" && \
|
||||
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" && \
|
||||
\
|
||||
echo "*** Store default $RESOURCES in <folder>.default ***" && \
|
||||
for R in $RESOURCES; do mv "public/$R" "public/$R.default"; done && \
|
||||
for R in $RESOURCES; do mv "public/$R" "public/$R.default"; done || true && \
|
||||
\
|
||||
echo "*** Create symbolic links to config directory ***" && \
|
||||
for R in $RESOURCES; do ln -s "../config/$R" "public/$R"; done && \
|
||||
# rm "config.conf" "public/settings.json" "public/css/bg_load.css" && \
|
||||
ln -s "./config/config.conf" "config.conf" && \
|
||||
ln -s "../config/settings.json" "public/settings.json" && \
|
||||
ln -s "../../config/bg_load.css" "public/css/bg_load.css" && \
|
||||
mkdir "config"
|
||||
for R in $RESOURCES; do ln -s "../config/$R" "public/$R"; done || true && \
|
||||
\
|
||||
ln -s "./config/config.conf" "config.conf" || true && \
|
||||
ln -s "../config/settings.json" "public/settings.json" || true && \
|
||||
ln -s "../../config/bg_load.css" "public/css/bg_load.css" || true && \
|
||||
mkdir "config" || true
|
||||
|
||||
# Cleanup unnecessary files
|
||||
RUN \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Initialize missing user files
|
||||
IFS="," RESOURCES="characters,chats,groups,group chats,User Avatars,worlds,OpenAI Settings,NovelAI Settings,KoboldAI Settings,TextGen Settings"
|
||||
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"
|
||||
for R in $RESOURCES; do
|
||||
if [ ! -e "config/$R" ]; then
|
||||
echo "Resource not found, copying from defaults: $R"
|
||||
|
@ -24,5 +24,17 @@ if [ ! -e "config/bg_load.css" ]; then
|
|||
cp -r "default/bg_load.css" "config/bg_load.css"
|
||||
fi
|
||||
|
||||
CONFIG_FILE="config.conf"
|
||||
|
||||
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.conf\" file and restart the container.\033[0m"
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
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.conf\" file and restart the container.\033[0m"
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
# Start the server
|
||||
exec node server.js
|
||||
|
|
Loading…
Reference in New Issue