2023-03-22 20:48:20 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2026-01-06 13:28:12 +01:00
|
|
|
# Copyright (c) 2021-2026 tteck
|
2023-03-22 20:48:20 -04:00
|
|
|
# Author: tteck (tteckster)
|
2025-03-04 17:54:20 +01:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
2026-02-24 15:11:53 +01:00
|
|
|
# Source: https://gethomepage.dev/ | Github: https://github.com/gethomepage/homepage
|
2023-03-22 20:48:20 -04:00
|
|
|
|
2025-03-24 14:20:56 +01: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"
|
2026-10-01 08:14:33 +02:00
|
|
|
$STD apt install -y jq
|
2023-03-22 20:48:20 -04:00
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
|
2025-06-18 12:03:00 +02:00
|
|
|
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
|
2025-01-01 18:25:46 +01:00
|
|
|
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
|
2024-12-31 08:59:53 +01:00
|
|
|
$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/
|
2026-08-28 17:09:26 +02:00
|
|
|
Environment=CI=true
|
2026-09-11 07:41:21 +02:00
|
|
|
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
|
2025-11-22 17:27:13 +01:00
|
|
|
cleanup_lxc
|