2026-04-29 01:42:41 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
2026-04-30 03:12:58 +03:00
|
|
|
# Load .env if exists
|
|
|
|
|
if [ -f .env ]; then
|
|
|
|
|
export $(grep -v '^#' .env | xargs)
|
|
|
|
|
fi
|
|
|
|
|
|
2026-04-29 01:42:41 +03:00
|
|
|
# Core service switches.
|
|
|
|
|
export WARPBOX_GUEST_UPLOADS_ENABLED="${WARPBOX_GUEST_UPLOADS_ENABLED:-true}"
|
|
|
|
|
export WARPBOX_API_ENABLED="${WARPBOX_API_ENABLED:-true}"
|
|
|
|
|
export WARPBOX_ZIP_DOWNLOADS_ENABLED="${WARPBOX_ZIP_DOWNLOADS_ENABLED:-true}"
|
|
|
|
|
export WARPBOX_ONE_TIME_DOWNLOADS_ENABLED="${WARPBOX_ONE_TIME_DOWNLOADS_ENABLED:-true}"
|
2026-04-30 04:24:49 +03:00
|
|
|
export WARPBOX_ONE_TIME_DOWNLOAD_EXPIRY_SECONDS="${WARPBOX_ONE_TIME_DOWNLOAD_EXPIRY_SECONDS:-604800}" # 7 days
|
|
|
|
|
export WARPBOX_ONE_TIME_DOWNLOAD_RETRY_ON_FAILURE="${WARPBOX_ONE_TIME_DOWNLOAD_RETRY_ON_FAILURE:-false}"
|
2026-04-29 01:42:41 +03:00
|
|
|
|
|
|
|
|
# Storage and expiry limits used by the upload UI and backend validators.
|
|
|
|
|
# Use megabytes here; WarpBox converts these to bytes internally.
|
|
|
|
|
export WARPBOX_GLOBAL_MAX_FILE_SIZE_MB="${WARPBOX_GLOBAL_MAX_FILE_SIZE_MB:-2048}" # 2 GiB
|
|
|
|
|
export WARPBOX_GLOBAL_MAX_BOX_SIZE_MB="${WARPBOX_GLOBAL_MAX_BOX_SIZE_MB:-4096}" # 4 GiB
|
|
|
|
|
export WARPBOX_DEFAULT_GUEST_EXPIRY_SECONDS="${WARPBOX_DEFAULT_GUEST_EXPIRY_SECONDS:-3600}" # 1 hour
|
|
|
|
|
export WARPBOX_MAX_GUEST_EXPIRY_SECONDS="${WARPBOX_MAX_GUEST_EXPIRY_SECONDS:-172800}" # 48 hours
|
|
|
|
|
|
|
|
|
|
# Download-page refresh and thumbnail worker tuning.
|
|
|
|
|
export WARPBOX_BOX_POLL_INTERVAL_MS="${WARPBOX_BOX_POLL_INTERVAL_MS:-5000}"
|
|
|
|
|
export WARPBOX_THUMBNAIL_BATCH_SIZE="${WARPBOX_THUMBNAIL_BATCH_SIZE:-10}"
|
|
|
|
|
export WARPBOX_THUMBNAIL_INTERVAL_SECONDS="${WARPBOX_THUMBNAIL_INTERVAL_SECONDS:-30}"
|
|
|
|
|
|
|
|
|
|
# Data location.
|
|
|
|
|
export WARPBOX_DATA_DIR="${WARPBOX_DATA_DIR:-./data}"
|
|
|
|
|
|
|
|
|
|
# Admin Area
|
|
|
|
|
export WARPBOX_ADMIN_ENABLED="${WARPBOX_ADMIN_ENABLED:-true}"
|
|
|
|
|
export WARPBOX_ADMIN_PASSWORD="${WARPBOX_ADMIN_PASSWORD:-123}"
|
|
|
|
|
|
2026-04-30 03:12:58 +03:00
|
|
|
# Option to run via Docker Compose
|
|
|
|
|
if [ "${1:-}" = "--docker" ]; then
|
|
|
|
|
docker-compose up --build
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2026-04-30 04:24:49 +03:00
|
|
|
go run ./cmd/main.go run
|