unraid fix
This commit is contained in:
parent
08eb014da8
commit
14cfbd01f4
2 changed files with 31 additions and 3 deletions
|
|
@ -31,9 +31,12 @@ COPY . .
|
||||||
RUN mkdir -p /app/config /app/database /app/logs /app/downloads /app/Transfer && \
|
RUN mkdir -p /app/config /app/database /app/logs /app/downloads /app/Transfer && \
|
||||||
chown -R soulsync:soulsync /app
|
chown -R soulsync:soulsync /app
|
||||||
|
|
||||||
# Copy example config as default config.json and set proper ownership
|
# Create defaults directory and copy template files
|
||||||
RUN cp /app/config/config.example.json /app/config/config.json && \
|
# These will be used by entrypoint.sh to initialize empty volumes
|
||||||
chown soulsync:soulsync /app/config/config.json
|
RUN mkdir -p /defaults && \
|
||||||
|
cp /app/config/config.example.json /defaults/config.json && \
|
||||||
|
cp /app/config/settings.py /defaults/settings.py && \
|
||||||
|
chmod 644 /defaults/config.json /defaults/settings.py
|
||||||
|
|
||||||
# Create volume mount points
|
# Create volume mount points
|
||||||
VOLUME ["/app/config", "/app/database", "/app/logs", "/app/downloads", "/app/Transfer"]
|
VOLUME ["/app/config", "/app/database", "/app/logs", "/app/downloads", "/app/Transfer"]
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,31 @@ fi
|
||||||
echo "🎭 Setting UMASK to $UMASK"
|
echo "🎭 Setting UMASK to $UMASK"
|
||||||
umask "$UMASK"
|
umask "$UMASK"
|
||||||
|
|
||||||
|
# Initialize config files if they don't exist (first-time setup)
|
||||||
|
echo "🔍 Checking for configuration files..."
|
||||||
|
|
||||||
|
if [ ! -f "/app/config/config.json" ]; then
|
||||||
|
echo " 📄 Creating default config.json..."
|
||||||
|
cp /defaults/config.json /app/config/config.json
|
||||||
|
chown soulsync:soulsync /app/config/config.json
|
||||||
|
else
|
||||||
|
echo " ✅ config.json already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "/app/config/settings.py" ]; then
|
||||||
|
echo " 📄 Creating default settings.py..."
|
||||||
|
cp /defaults/settings.py /app/config/settings.py
|
||||||
|
chown soulsync:soulsync /app/config/settings.py
|
||||||
|
else
|
||||||
|
echo " ✅ settings.py already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure all directories exist and have proper permissions
|
||||||
|
mkdir -p /app/config /app/database /app/logs /app/downloads /app/Transfer
|
||||||
|
chown -R soulsync:soulsync /app/config /app/database /app/logs /app/downloads /app/Transfer
|
||||||
|
|
||||||
|
echo "✅ Configuration initialized successfully"
|
||||||
|
|
||||||
# Display final user info
|
# Display final user info
|
||||||
echo "👤 Running as:"
|
echo "👤 Running as:"
|
||||||
echo " User: $(id -u soulsync):$(id -g soulsync) ($(id -un soulsync):$(id -gn soulsync))"
|
echo " User: $(id -u soulsync):$(id -g soulsync) ($(id -un soulsync):$(id -gn soulsync))"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue