Files
ProxmoxVE/install/homepage-install.sh
T

78 lines
2.1 KiB
Bash
Raw Normal View History

2023-03-22 20:48:20 -04:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 tteck
2023-03-22 20:48:20 -04:00
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://gethomepage.dev/ | Github: https://github.com/gethomepage/homepage
2023-03-22 20:48:20 -04:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2023-03-22 20:48:20 -04:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y jq
2023-03-22 20:48:20 -04:00
msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="pnpm@latest" setup_nodejs
2026-01-19 15:45:41 +01:00
fetch_and_deploy_gh_release "homepage" "gethomepage/homepage" "tarball"
RELEASE=$(get_latest_github_release "gethomepage/homepage")
2023-03-22 20:48:20 -04:00
2026-01-19 15:45:41 +01:00
msg_info "Installing Homepage (Patience)"
2023-12-17 20:21:23 -05:00
mkdir -p /opt/homepage/config
2023-03-22 20:48:20 -04:00
cd /opt/homepage
cp /opt/homepage/src/skeleton/* /opt/homepage/config
2026-08-14 16:08:21 -04:00
echo 'onlyBuiltDependencies=*' >>.npmrc
2023-03-22 20:48:20 -04:00
$STD pnpm install
export NEXT_PUBLIC_VERSION="v$RELEASE"
export NEXT_PUBLIC_REVISION="source"
2025-05-01 19:17:16 +02:00
export NEXT_PUBLIC_BUILDTIME=$(curl -fsSL https://api.github.com/repos/gethomepage/homepage/releases/latest | jq -r '.published_at')
2025-03-15 04:06:20 -04:00
export NEXT_TELEMETRY_DISABLED=1
$STD pnpm build
2026-08-14 16:08:21 -04:00
cat <<EOF >/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=<your-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
2026-01-19 15:45:41 +01:00
msg_ok "Installed Homepage"
2023-03-22 20:48:20 -04:00
msg_info "Creating Service"
2024-04-23 10:34:50 -04:00
cat <<EOF >/etc/systemd/system/homepage.service
[Unit]
2023-03-22 20:48:20 -04:00
Description=Homepage
After=network.target
StartLimitIntervalSec=0
2026-01-19 15:45:41 +01:00
2023-03-22 20:48:20 -04:00
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
WorkingDirectory=/opt/homepage/
Environment=CI=true
ExecStart=/opt/homepage/node_modules/.bin/next start
2026-01-19 15:45:41 +01:00
2023-03-22 20:48:20 -04:00
[Install]
2024-04-23 10:34:50 -04:00
WantedBy=multi-user.target
EOF
systemctl enable -q --now homepage
2023-03-22 20:48:20 -04:00
msg_ok "Created Service"
motd_ssh
2023-05-15 07:39:30 -04:00
customize
cleanup_lxc