v0.2.8
RustBox CI / rustbox (push) Canceled after 0s

This commit is contained in:
Mateusz Gruszczyński committed 2026-11-01 20:40:40 +01:00
1 parent cfc74d9db6
commit dacdf9c27d
76 files changed
+5209 -741

No files matched your search

+49 -3
View File
@@ -4,6 +4,17 @@ set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
# Local development settings live in .env. RustBox reads environment variables
# from the process; it does not parse dotenv files itself. Export the file here
# before applying development defaults so explicit .env values always win.
ENV_FILE="${RUSTBOX_ENV_FILE:-$ROOT/.env}"
if [ -f "$ENV_FILE" ]; then
set -a
# shellcheck disable=SC1090
. "$ENV_FILE"
set +a
fi
if ! command -v cargo >/dev/null 2>&1; then
echo "error: Rust/Cargo is required" >&2
exit 1
@@ -12,7 +23,28 @@ fi
mkdir -p "$ROOT/.dev/data"
export RUSTBOX_CONFIG="${RUSTBOX_CONFIG:-$ROOT/config.dev.toml}"
export DATA_DIR="${DATA_DIR:-$ROOT/.dev/data}"
export RUST_LOG="${RUST_LOG:-rustbox=debug,tower_http=info}"
# Keep application debugging useful without enabling verbose INFO/DEBUG output
# from every dependency. A legacy/simple RUST_LOG level from .env is scoped to
# RustBox automatically; explicit directive filters (containing '=' or ',') are
# respected exactly as provided.
case "${RUST_LOG:-}" in
""|debug)
export RUST_LOG="warn,rustbox=debug,tower_http=info"
;;
trace)
export RUST_LOG="warn,rustbox=trace,tower_http=debug"
;;
info)
export RUST_LOG="warn,rustbox=info,tower_http=info"
;;
warn|error|off)
export RUST_LOG="${RUST_LOG}"
;;
*)
export RUST_LOG="${RUST_LOG}"
;;
esac
if [ ! -f "$RUSTBOX_CONFIG" ]; then
echo "error: config not found: $RUSTBOX_CONFIG" >&2
@@ -20,8 +52,22 @@ if [ ! -f "$RUSTBOX_CONFIG" ]; then
fi
echo "RustBox: http://127.0.0.1:3001"
echo "Config: $RUSTBOX_CONFIG"
echo "Data: $DATA_DIR"
display_path() {
local value="$1"
if [[ "$value" == "$ROOT"/* ]]; then
printf './%s' "${value#"$ROOT"/}"
else
printf '%s' "$(basename "$value")"
fi
}
echo "Config: $(display_path "$RUSTBOX_CONFIG")"
echo "Data: $(display_path "$DATA_DIR")"
if [ -f "$ENV_FILE" ]; then
echo "Env: $(display_path "$ENV_FILE")"
fi
echo "IMAP: ${IMAP_HOST:-localhost}:${IMAP_PORT:-993}"
echo "SMTP: ${SMTP_HOST:-${IMAP_HOST:-localhost}}:${SMTP_PORT:-587}"
echo
cargo run --quiet --bin rustbox -- --check-config