feat: add standalone (frontend-only) mode via VITE_STANDALONE build flag

- App.tsx: bypass auth gate, swap canvas save/load to localStorage
- Sidebar.tsx: hide scan views and Scan Network button
- useStatusPolling.ts: skip WebSocket connection
- Dockerfile.frontend: accept VITE_STANDALONE build arg
- docker-publish.yml: build ghcr.io/pouzor/homelable-frontend-standalone image
- docker-compose.standalone.yml: frontend-only compose file
- install.sh: add --standalone flag

Usage:
  curl -fsSL .../install.sh | bash -s -- --standalone
  cd homelable && docker compose up -d
This commit is contained in:
Pouzor
2026-03-09 14:00:25 +01:00
parent 1cd93ed250
commit 7ba5e888b4
7 changed files with 91 additions and 24 deletions
+36 -14
View File
@@ -4,39 +4,61 @@ set -euo pipefail
REPO="Pouzor/homelable"
INSTALL_DIR="${HOMELABLE_DIR:-homelable}"
RAW="https://raw.githubusercontent.com/${REPO}/main"
STANDALONE=0
for arg in "$@"; do
case $arg in
--standalone) STANDALONE=1 ;;
esac
done
# Detect install vs update
if [ -f "${INSTALL_DIR}/docker-compose.yml" ]; then
echo "Updating Homelable in ./${INSTALL_DIR}/"
IS_UPDATE=1
else
echo "Installing Homelable into ./${INSTALL_DIR}/"
if [ "${STANDALONE}" -eq 1 ]; then
echo "Installing Homelable (standalone mode) into ./${INSTALL_DIR}/"
else
echo "Installing Homelable into ./${INSTALL_DIR}/"
fi
IS_UPDATE=0
fi
mkdir -p "${INSTALL_DIR}"
cd "${INSTALL_DIR}"
# Always update docker-compose.yml and refresh .env.example
curl -fsSL "${RAW}/docker-compose.prebuilt.yml" -o docker-compose.yml
curl -fsSL "${RAW}/.env.example" -o .env.example
if [ "${STANDALONE}" -eq 1 ]; then
curl -fsSL "${RAW}/docker-compose.standalone.yml" -o docker-compose.yml
else
curl -fsSL "${RAW}/docker-compose.prebuilt.yml" -o docker-compose.yml
curl -fsSL "${RAW}/.env.example" -o .env.example
fi
if [ "${IS_UPDATE}" -eq 1 ]; then
echo ""
echo " docker-compose.yml updated."
echo " Check .env.example for any new variables, then restart:"
echo " Restart with:"
echo " cd ${INSTALL_DIR} && docker compose pull && docker compose up -d"
else
if [ ! -f .env ]; then
cp .env.example .env
if [ "${STANDALONE}" -eq 1 ]; then
echo ""
echo " Standalone mode: no backend, no login, canvas saves to browser localStorage."
echo ""
echo " Run:"
echo " cd ${INSTALL_DIR} && docker compose up -d"
else
if [ ! -f .env ]; then
cp .env.example .env
fi
echo ""
echo " Edit .env if needed (default login: admin / admin):"
echo " - Set SECRET_KEY to a random string"
echo " - Change AUTH_PASSWORD_HASH before exposing on a network"
echo ""
echo " Run:"
echo " cd ${INSTALL_DIR} && docker compose up -d"
fi
echo ""
echo " Edit .env if needed (default login: admin / admin):"
echo " - Set SECRET_KEY to a random string"
echo " - Change AUTH_PASSWORD_HASH before exposing on a network"
echo ""
echo " Then run:"
echo " cd ${INSTALL_DIR} && docker compose up -d"
echo ""
echo " Open http://localhost:3000"
fi