Files
warpbox-dev/scripts/run/dev.sh
Daniel Legt e12878887c feat: add configurable data directory and file-based logging
Introduce the `WARPBOX_DATA_DIR` environment variable to define where runtime data is stored. This directory will house uploaded files, the bbolt metadata database, and application logs.

Changes include:
- Added `WARPBOX_DATA_DIR` to configuration, defaulting to `./data`.
- Implemented a custom logging package that writes JSONL logs to the data directory.
- Updated `.gitignore` and `.env.example` to support the new data directory.
- Documented the runtime data structure in `README.md`.
- Updated the frontend upload script to handle form submission and display results.
2026-05-25 16:26:47 +03:00

23 lines
474 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
ENV_FILE="${ROOT_DIR}/scripts/env/dev.env"
if [[ ! -f "${ENV_FILE}" ]]; then
echo "Missing ${ENV_FILE}. Create it from scripts/env/dev.env.example." >&2
exit 1
fi
set -a
source "${ENV_FILE}"
set +a
if [[ "${WARPBOX_DATA_DIR:-}" != /* ]]; then
export WARPBOX_DATA_DIR="${ROOT_DIR}/${WARPBOX_DATA_DIR:-data}"
fi
cd "${ROOT_DIR}/backend"
exec go run ./cmd/warpbox