mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
@@ -20,7 +20,14 @@ RUN \
|
||||
echo "*** Copy default chats, characters and user avatars to <folder>.default folder ***" && \
|
||||
mv "./public/characters" "./public/characters.default" && \
|
||||
mv "./public/chats" "./public/chats.default" && \
|
||||
mv "./public/User Avatars" "./public/User Avatars.default"
|
||||
mv "./public/User Avatars" "./public/User Avatars.default" && \
|
||||
mv "./public/settings.json" "./public/settings.json.default" && \
|
||||
|
||||
echo "*** Create symbolic links to config directory ***" && \
|
||||
ln -s "${APP_HOME}/config/characters" "${APP_HOME}/public/characters" && \
|
||||
ln -s "${APP_HOME}/config/chats" "${APP_HOME}/public/chats" && \
|
||||
ln -s "${APP_HOME}/config/User Avatars" "${APP_HOME}/public/User Avatars" && \
|
||||
ln -s "${APP_HOME}/config/settings.json" "${APP_HOME}/public/settings.json"
|
||||
|
||||
# Cleanup unnecessary files
|
||||
RUN \
|
||||
|
@@ -8,7 +8,5 @@ services:
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- "./config/characters:/home/node/app/public/characters"
|
||||
- "./config/chats:/home/node/app/public/chats"
|
||||
- "./config/User Avatars:/home/node/app/public/User Avatars"
|
||||
- "./config:/home/node/app/config"
|
||||
restart: unless-stopped
|
@@ -1,27 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check if the "characters" directory is empty
|
||||
if [ -z "$(ls -A /home/node/app/public/characters)" ]; then
|
||||
if [ -z "$(ls -A /home/node/app/config/characters)" ]; then
|
||||
echo "Characters directory is empty. Copying default characters."
|
||||
mkdir /home/node/app/public/characters
|
||||
mv /home/node/app/public/characters.default/* /home/node/app/public/characters/
|
||||
rm -rf /home/node/app/public/characters.default
|
||||
mv /home/node/app/public/characters.default /home/node/app/config/characters
|
||||
fi
|
||||
|
||||
# Check if the "chats" directory is empty
|
||||
if [ -z "$(ls -A /home/node/app/public/chats)" ]; then
|
||||
if [ -z "$(ls -A /home/node/app/config/chats)" ]; then
|
||||
echo "Chats directory is empty. Copying default chats."
|
||||
mkdir /home/node/app/public/chats
|
||||
mv /home/node/app/public/chats.default/* /home/node/app/public/chats/
|
||||
rm -rf /home/node/app/public/chats.default
|
||||
mv /home/node/app/public/chats.default /home/node/app/config/chats/
|
||||
fi
|
||||
|
||||
# Check if the "User Avatars" directory is empty
|
||||
if [ -z "$(ls -A '/home/node/app/public/User Avatars')" ]; then
|
||||
if [ -z "$(ls -A '/home/node/app/config/User Avatars')" ]; then
|
||||
echo "User Avatars directory is empty. Copying default user avatars."
|
||||
mkdir /home/node/app/public/User\ Avatars
|
||||
mv /home/node/app/public/User\ Avatars.default/* /home/node/app/public/User\ Avatars/
|
||||
rm -rf /home/node/app/public/User\ Avatars.default
|
||||
mv /home/node/app/public/User\ Avatars.default /home/node/app/config/User\ Avatars/
|
||||
fi
|
||||
|
||||
# Check if the "settings.json" file is not empty
|
||||
if [ ! -s "/home/node/app/config/settings.json" ]; then
|
||||
echo "Settings file does not exist. Copying default settings."
|
||||
mv /home/node/app/public/settings.json.default /home/node/app/config/settings.json
|
||||
fi
|
||||
|
||||
# Start the server
|
||||
|
Reference in New Issue
Block a user