fix(render): ensure script is executable and improve permission testing

- Add chmod +x for render-start.sh in Dockerfile
- Improve permission testing with touch/rm
- Better error handling
This commit is contained in:
Ojus Save 2026-01-26 14:24:42 -08:00
parent df160aec5a
commit 0e1641f87b
2 changed files with 8 additions and 11 deletions

View File

@ -20,6 +20,8 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
COPY ui/package.json ./ui/package.json COPY ui/package.json ./ui/package.json
COPY patches ./patches COPY patches ./patches
COPY scripts ./scripts COPY scripts ./scripts
# Ensure startup script is executable
RUN chmod +x scripts/render-start.sh
RUN pnpm install --frozen-lockfile RUN pnpm install --frozen-lockfile

View File

@ -17,30 +17,25 @@ echo "CLAWDBOT_STATE_DIR=${CLAWDBOT_STATE_DIR}"
echo "User: $(whoami)" echo "User: $(whoami)"
echo "UID: $(id -u)" echo "UID: $(id -u)"
# Determine config directory - try to use preferred locations, fallback to HOME # Determine config directory
# Temporarily disable set -e for permission testing # Use CLAWDBOT_STATE_DIR if set and writable, otherwise try /data/.clawdbot, fallback to HOME
set +e
CONFIG_DIR="${HOME}/.clawdbot" CONFIG_DIR="${HOME}/.clawdbot"
# Try CLAWDBOT_STATE_DIR if set (test by trying to create it) # Try preferred locations (disable set -e temporarily for testing)
set +e
if [ -n "${CLAWDBOT_STATE_DIR}" ]; then if [ -n "${CLAWDBOT_STATE_DIR}" ]; then
mkdir -p "${CLAWDBOT_STATE_DIR}" 2>/dev/null mkdir -p "${CLAWDBOT_STATE_DIR}" 2>/dev/null && touch "${CLAWDBOT_STATE_DIR}/.test" 2>/dev/null && rm -f "${CLAWDBOT_STATE_DIR}/.test" 2>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
CONFIG_DIR="${CLAWDBOT_STATE_DIR}" CONFIG_DIR="${CLAWDBOT_STATE_DIR}"
echo "Using CLAWDBOT_STATE_DIR: ${CONFIG_DIR}"
fi fi
fi fi
# Try /data/.clawdbot if CLAWDBOT_STATE_DIR didn't work
if [ "${CONFIG_DIR}" = "${HOME}/.clawdbot" ]; then if [ "${CONFIG_DIR}" = "${HOME}/.clawdbot" ]; then
mkdir -p "/data/.clawdbot" 2>/dev/null mkdir -p "/data/.clawdbot" 2>/dev/null && touch "/data/.clawdbot/.test" 2>/dev/null && rm -f "/data/.clawdbot/.test" 2>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
CONFIG_DIR="/data/.clawdbot" CONFIG_DIR="/data/.clawdbot"
echo "Using /data/.clawdbot: ${CONFIG_DIR}"
fi fi
fi fi
# Re-enable set -e
set -e set -e
CONFIG_FILE="${CONFIG_DIR}/clawdbot.json" CONFIG_FILE="${CONFIG_DIR}/clawdbot.json"