Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ct/homepage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ function update_script() {
echo "Installed NPM..."
fi
fi
# ensure that jq is installed
if ! command -v jq &>/dev/null; then
$STD msg_info "Installing jq..."
$STD apt-get update -qq &>/dev/null
$STD apt-get install -y jq &>/dev/null || {
msg_error "Failed to install jq"
exit
}
fi
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) }')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
Expand All @@ -50,6 +59,7 @@ function update_script() {
$STD npx --yes update-browserslist-db@latest
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
if [[ ! -f /opt/homepage/.env ]]; then
Expand Down
3 changes: 2 additions & 1 deletion install/homepage-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ network_check
update_os

msg_info "Installing Dependencies"
$STD apt-get install -y gpg
$STD apt-get install -y gpg jq
msg_ok "Installed Dependencies"

msg_info "Setting up Node.js Repository"
Expand Down Expand Up @@ -43,6 +43,7 @@ cp /opt/homepage/src/skeleton/* /opt/homepage/config
$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
Expand Down