Files
OmniRoute/scripts/check-permissions.sh
Shixi Li 82bed08404 docs(podman): clarify Podman Machine deployment (#8569)
* docs(podman): clarify Podman Machine deployment

* style(podman): format guidance and regression test
2026-07-27 19:06:41 -03:00

27 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
set -e
# ── Memory limit override ──────────────────────────────────────────────
# If OMNIROUTE_MEMORY_MB is set, build NODE_OPTIONS dynamically so the
# user can tune heap size via environment without editing the Dockerfile.
if [ -n "$OMNIROUTE_MEMORY_MB" ]; then
export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=${OMNIROUTE_MEMORY_MB}"
fi
DATA_PATH="${DATA_DIR:-/app/data}"
if [ -d "$DATA_PATH" ] && [ ! -w "$DATA_PATH" ]; then
echo "WARNING: $DATA_PATH is not writable by the current user (UID $(id -u))."
if [ "${CONTAINER_HOST:-}" = "podman" ]; then
echo "Podman bind-mount permissions depend on whether the engine is local or"
echo "reached through Podman Machine; this container cannot determine that topology."
echo "Use the host-side fix for your topology:"
echo " https://github.com/diegosouzapw/OmniRoute/blob/main/contrib/podman/README.md#data-directory-permissions-by-topology"
else
echo "Run this on the Docker host to fix (using the host-side bind-mount path):"
echo " sudo chown -R $(id -u):$(id -g) <host-data-dir>"
echo " chmod -R u+rwX <host-data-dir>"
fi
fi
exec "$@"