20 lines
691 B
Bash
20 lines
691 B
Bash
|
|
#!/bin/sh
|
||
|
|
set -e
|
||
|
|
|
||
|
|
# Fix permissions on mounted volume at runtime
|
||
|
|
chown -R node:node /var/opt/hardlounge 2>/dev/null || true
|
||
|
|
chmod -R 755 /var/opt/hardlounge 2>/dev/null || true
|
||
|
|
|
||
|
|
# Create required subdirectories
|
||
|
|
mkdir -p /var/opt/hardlounge/logs /var/opt/hardlounge/users /var/opt/hardlounge/packages 2>/dev/null || true
|
||
|
|
chown -R node:node /var/opt/hardlounge 2>/dev/null || true
|
||
|
|
|
||
|
|
# Copy default config if it doesn't exist
|
||
|
|
if [ ! -f /var/opt/hardlounge/config.js ]; then
|
||
|
|
cp /var/opt/hardlounge-src/dist/defaults/config.js /var/opt/hardlounge/config.js 2>/dev/null || true
|
||
|
|
chown node:node /var/opt/hardlounge/config.js 2>/dev/null || true
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Run as node user
|
||
|
|
exec su-exec node "$@"
|