From c0a8186d3712de7387cfedd7f7cc9a04a05f534d Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Tue, 14 Nov 2023 01:30:47 +0200 Subject: [PATCH] Add assets and update symbolic links in Dockerfile and entrypoint script --- Dockerfile | 16 ++++++++-------- docker/docker-entrypoint.sh | 14 +++++++++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9ab76c8cf..3afd3b7a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,18 +23,18 @@ COPY . ./ # Copy default chats, characters and user avatars to .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 .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 \ diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index bbdfd5006..f3dd2aae9 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -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