From 452f3b08605de79d1a7cf45737308b8ab411dfc6 Mon Sep 17 00:00:00 2001 From: Pouzor Date: Mon, 9 Mar 2026 12:03:27 +0100 Subject: [PATCH] feat: add one-liner install script curl -fsSL https://raw.githubusercontent.com/Pouzor/homelable/main/install.sh | bash Handles fresh install and updates. Pulls prebuilt images, creates .env from .env.example on first run. Update README Quick Start accordingly. --- README.md | 17 +++++++++++------ install.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 6 deletions(-) create mode 100755 install.sh diff --git a/README.md b/README.md index 4d2623a..45f39b3 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,9 @@ Homelable also offers a healthcheck system (WIP) through multiple methods (ping/ ## Quick Start — Docker -No clone needed. Pull the pre-built images directly: - ```bash -mkdir homelable && cd homelable -curl -fsSL https://raw.githubusercontent.com/Pouzor/homelable/main/.env.example -o .env -curl -fsSL https://raw.githubusercontent.com/Pouzor/homelable/main/docker-compose.prebuilt.yml -o docker-compose.yml -docker compose up -d +curl -fsSL https://raw.githubusercontent.com/Pouzor/homelable/main/install.sh | bash +cd homelable && docker compose up -d ``` Open **http://localhost:3000** — login with `admin` / `admin`. @@ -26,6 +22,15 @@ Open **http://localhost:3000** — login with `admin` / `admin`. > > ⚠️ Keep the single quotes around the hash value in `.env` — bcrypt hashes contain `$` characters that Docker Compose would otherwise misinterpret. +### Update + +Re-run the install script — it detects an existing install and only updates `docker-compose.yml`: + +```bash +curl -fsSL https://raw.githubusercontent.com/Pouzor/homelable/main/install.sh | bash +cd homelable && docker compose pull && docker compose up -d +``` + ### Build from source ```bash diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..43c95ce --- /dev/null +++ b/install.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO="Pouzor/homelable" +INSTALL_DIR="${HOMELABLE_DIR:-homelable}" +RAW="https://raw.githubusercontent.com/${REPO}/main" + +# 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}/" + 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 [ "${IS_UPDATE}" -eq 1 ]; then + echo "" + echo " docker-compose.yml updated." + echo " Check .env.example for any new variables, then restart:" + echo " cd ${INSTALL_DIR} && docker compose pull && 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 " Then run:" + echo " cd ${INSTALL_DIR} && docker compose up -d" + echo "" + echo " Open http://localhost:3000" +fi