fix: use absolute paths for DATA_DIR and LOGS_DIR in start_server.sh
- Resolves sqlite3.OperationalError when database path is relative - Uses script directory as base for all relative paths - Ensures consistent behavior regardless of working directory
This commit is contained in:
@@ -29,8 +29,8 @@ pip install -q -r backend/requirements.txt
|
|||||||
LOCAL_IP=$(ipconfig getifaddr en0 || ipconfig getifaddr en1 || echo "localhost")
|
LOCAL_IP=$(ipconfig getifaddr en0 || ipconfig getifaddr en1 || echo "localhost")
|
||||||
export ALLOWED_ORIGINS="http://localhost:$FRONTEND_PORT,http://localhost:$BACKEND_PORT,https://localhost:$FRONTEND_SSL_PORT,https://localhost:$BACKEND_SSL_PORT,https://$LOCAL_IP:$FRONTEND_SSL_PORT,https://$LOCAL_IP:$BACKEND_SSL_PORT"
|
export ALLOWED_ORIGINS="http://localhost:$FRONTEND_PORT,http://localhost:$BACKEND_PORT,https://localhost:$FRONTEND_SSL_PORT,https://localhost:$BACKEND_SSL_PORT,https://$LOCAL_IP:$FRONTEND_SSL_PORT,https://$LOCAL_IP:$BACKEND_SSL_PORT"
|
||||||
export JWT_SECRET_KEY="${JWT_SECRET_KEY:-ephemeral-dev-key-$(date +%s)}"
|
export JWT_SECRET_KEY="${JWT_SECRET_KEY:-ephemeral-dev-key-$(date +%s)}"
|
||||||
export DATA_DIR="./data"
|
export DATA_DIR="$(cd "$(dirname "$0")" && pwd)/data"
|
||||||
export LOGS_DIR="./logs"
|
export LOGS_DIR="$(cd "$(dirname "$0")" && pwd)/logs"
|
||||||
|
|
||||||
echo "🔥 Starting Backend on port $BACKEND_PORT..."
|
echo "🔥 Starting Backend on port $BACKEND_PORT..."
|
||||||
echo " CORS origins: $ALLOWED_ORIGINS"
|
echo " CORS origins: $ALLOWED_ORIGINS"
|
||||||
|
|||||||
Reference in New Issue
Block a user