From b2997c15ede71db30c3654b32966112360405de7 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 14 Aug 2026 16:08:21 -0400 Subject: [PATCH] Homepage v2.0 (#16500) --- ct/homepage.sh | 27 ++++++++++++++++++++++++--- install/homepage-install.sh | 19 +++++++++++++++++-- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/ct/homepage.sh b/ct/homepage.sh index 44f31271a..3dc4457f8 100644 --- a/ct/homepage.sh +++ b/ct/homepage.sh @@ -39,15 +39,15 @@ function update_script() { create_backup /opt/homepage/.env /opt/homepage/config BACKUP_DIR=/opt/homepage-assets.backup create_backup /opt/homepage/public/images /opt/homepage/public/icons - + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "homepage" "gethomepage/homepage" "tarball" - + restore_backup msg_info "Updating Homepage (Patience)" RELEASE=$(get_latest_github_release "gethomepage/homepage") cd /opt/homepage - echo 'onlyBuiltDependencies=*' >> .npmrc + echo 'onlyBuiltDependencies=*' >>.npmrc $STD pnpm install $STD pnpm update --no-save caniuse-lite export NEXT_PUBLIC_VERSION="v$RELEASE" @@ -56,6 +56,27 @@ function update_script() { export NEXT_TELEMETRY_DISABLED=1 $STD pnpm build BACKUP_DIR=/opt/homepage-assets.backup restore_backup + if ! grep -q 'AUTH' /opt/homepage/.env; then + msg_info "Updating .env" + cp /opt/homepage/.env /opt/homepage/env.bak + cat <>/opt/homepage/.env +## Optional Authentication +# HOMEPAGE_AUTH_ENABLED=true +# HOMEPAGE_AUTH_SECRET="$(openssl rand -base64 32)" +# HOMEPAGE_EXTERNAL_URL= +## Uncomment below and use strong, unique password for password login +# HOMEPAGE_AUTH_PASSWORD= +## Uncomment and fill in below for OIDC login +# HOMEPAGE_OIDC_ISSUER= +# HOMEPAGE_OIDC_CLIENT_ID= +# HOMEPAGE_OIDC_CLIENT_SECRET= +# HOMEPAGE_OIDC_SCOPE=openid email profile +# HOMEPAGE_OIDC_NAME= +EOF + msg_ok "Updated .env" + rm /opt/homepage/env.bak + chmod 600 /opt/homepage/.env + fi msg_ok "Updated Homepage" msg_info "Starting service" diff --git a/install/homepage-install.sh b/install/homepage-install.sh index 45cba3d82..4b4cc9f7d 100644 --- a/install/homepage-install.sh +++ b/install/homepage-install.sh @@ -25,14 +25,29 @@ msg_info "Installing Homepage (Patience)" mkdir -p /opt/homepage/config cd /opt/homepage cp /opt/homepage/src/skeleton/* /opt/homepage/config -echo 'onlyBuiltDependencies=*' >> .npmrc +echo 'onlyBuiltDependencies=*' >>.npmrc $STD pnpm install export NEXT_PUBLIC_VERSION="v$RELEASE" export NEXT_PUBLIC_REVISION="source" export NEXT_PUBLIC_BUILDTIME=$(curl -fsSL https://api.github.com/repos/gethomepage/homepage/releases/latest | jq -r '.published_at') export NEXT_TELEMETRY_DISABLED=1 $STD pnpm build -echo "HOMEPAGE_ALLOWED_HOSTS=localhost:3000,${LOCAL_IP}:3000" >/opt/homepage/.env +cat </opt/homepage/.env +HOMEPAGE_ALLOWED_HOSTS=localhost:3000,${LOCAL_IP}:3000 +## Optional Authentication +# HOMEPAGE_AUTH_ENABLED=true +# HOMEPAGE_AUTH_SECRET="$(openssl rand -base64 32)" +# HOMEPAGE_EXTERNAL_URL= +## Uncomment below and use strong, unique password for password login +# HOMEPAGE_AUTH_PASSWORD= +## Uncomment and fill in below for OIDC login +# HOMEPAGE_OIDC_ISSUER= +# HOMEPAGE_OIDC_CLIENT_ID= +# HOMEPAGE_OIDC_CLIENT_SECRET= +# HOMEPAGE_OIDC_SCOPE=openid email profile +# HOMEPAGE_OIDC_NAME= +EOF +chmod 600 /opt/homepage/.env msg_ok "Installed Homepage" msg_info "Creating Service"