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
|
# Copy default chats, characters and user avatars to <folder>.default folder
|
||||||
RUN \
|
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 ***" && \
|
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 ***" && \
|
echo "*** Create symbolic links to config directory ***" && \
|
||||||
for R in $RESOURCES; do ln -s "../config/$R" "public/$R"; done && \
|
for R in $RESOURCES; do ln -s "../config/$R" "public/$R"; done || true && \
|
||||||
# rm "config.conf" "public/settings.json" "public/css/bg_load.css" && \
|
\
|
||||||
ln -s "./config/config.conf" "config.conf" && \
|
ln -s "./config/config.conf" "config.conf" || true && \
|
||||||
ln -s "../config/settings.json" "public/settings.json" && \
|
ln -s "../config/settings.json" "public/settings.json" || true && \
|
||||||
ln -s "../../config/bg_load.css" "public/css/bg_load.css" && \
|
ln -s "../../config/bg_load.css" "public/css/bg_load.css" || true && \
|
||||||
mkdir "config"
|
mkdir "config" || true
|
||||||
|
|
||||||
# Cleanup unnecessary files
|
# Cleanup unnecessary files
|
||||||
RUN \
|
RUN \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Initialize missing user files
|
# 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
|
for R in $RESOURCES; do
|
||||||
if [ ! -e "config/$R" ]; then
|
if [ ! -e "config/$R" ]; then
|
||||||
echo "Resource not found, copying from defaults: $R"
|
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"
|
cp -r "default/bg_load.css" "config/bg_load.css"
|
||||||
fi
|
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
|
# Start the server
|
||||||
exec node server.js
|
exec node server.js
|
||||||
|
|
Loading…
Reference in New Issue