Refactor: Homepage (#10950)

This commit is contained in:
Slaviša Arežina
2026-01-19 15:45:41 +01:00
committed by GitHub
parent 4f389c01f9
commit 56ab6a6cb8
3 changed files with 25 additions and 27 deletions

View File

@@ -18,16 +18,12 @@ $STD apt-get install -y jq
msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="pnpm@latest" setup_nodejs
import_local_ip
fetch_and_deploy_gh_release "homepage" "gethomepage/homepage" "tarball"
RELEASE=$(get_latest_github_release "gethomepage/homepage")
LOCAL_IP=$(hostname -I | awk '{print $1}')
RELEASE=$(curl -fsSL https://api.github.com/repos/gethomepage/homepage/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
msg_info "Installing Homepage v${RELEASE} (Patience)"
curl -fsSL "https://github.com/gethomepage/homepage/archive/refs/tags/v${RELEASE}.tar.gz" -o "v${RELEASE}.tar.gz"
$STD tar -xzf v${RELEASE}.tar.gz
rm -rf v${RELEASE}.tar.gz
msg_info "Installing Homepage (Patience)"
mkdir -p /opt/homepage/config
mv homepage-${RELEASE}/* /opt/homepage
rm -rf homepage-${RELEASE}
cd /opt/homepage
cp /opt/homepage/src/skeleton/* /opt/homepage/config
$STD pnpm install
@@ -37,8 +33,7 @@ export NEXT_PUBLIC_BUILDTIME=$(curl -fsSL https://api.github.com/repos/gethomepa
export NEXT_TELEMETRY_DISABLED=1
$STD pnpm build
echo "HOMEPAGE_ALLOWED_HOSTS=localhost:3000,${LOCAL_IP}:3000" >/opt/homepage/.env
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Homepage v${RELEASE}"
msg_ok "Installed Homepage"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/homepage.service
@@ -46,6 +41,7 @@ cat <<EOF >/etc/systemd/system/homepage.service
Description=Homepage
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
@@ -53,6 +49,7 @@ RestartSec=1
User=root
WorkingDirectory=/opt/homepage/
ExecStart=pnpm start
[Install]
WantedBy=multi-user.target
EOF