mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-15 03:39:44 +00:00
Breaking Change: Homarr (#1825)
This commit is contained in:
parent
b973ca9d8d
commit
dae705056c
2 changed files with 48 additions and 39 deletions
|
@ -1,8 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# Co-Author: MickLesk (Canbiz)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: MickLesk (Canbiz)
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/ajnart/homarr
|
||||
|
@ -20,6 +19,7 @@ $STD apt-get install -y \
|
|||
sudo \
|
||||
mc \
|
||||
curl \
|
||||
redis-server \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
make \
|
||||
|
@ -30,32 +30,40 @@ msg_ok "Installed Dependencies"
|
|||
msg_info "Setting up Node.js Repository"
|
||||
mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||
msg_ok "Set up Node.js Repository"
|
||||
|
||||
msg_info "Installing Node.js/Yarn"
|
||||
msg_info "Installing Node.js/pnpm"
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y nodejs
|
||||
$STD npm install -g yarn
|
||||
msg_ok "Installed Node.js/Yarn"
|
||||
$STD npm install -g pnpm
|
||||
msg_ok "Installed Node.js/pnpm"
|
||||
|
||||
msg_info "Installing Homarr (Patience)"
|
||||
RELEASE=$(curl -s https://api.github.com/repos/ajnart/homarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
wget -q "https://github.com/ajnart/homarr/archive/refs/tags/v${RELEASE}.zip"
|
||||
cd /opt
|
||||
RELEASE=$(curl -s https://api.github.com/repos/homarr-labs/homarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
wget -q "https://github.com/homarr-labs/homarr/archive/refs/tags/v${RELEASE}.zip"
|
||||
unzip -q v${RELEASE}.zip
|
||||
rm -rf v${RELEASE}.zip
|
||||
mv homarr-${RELEASE} /opt/homarr
|
||||
mkdir -p /opt/homarr_db
|
||||
touch /opt/homarr_db/db.sqlite
|
||||
AUTH_SECRET="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
|
||||
SECRET_ENCRYPTION_KEY="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)"
|
||||
|
||||
cat <<EOF >/opt/homarr/.env
|
||||
DATABASE_URL="file:./database/db.sqlite"
|
||||
NEXTAUTH_URL="http://localhost:3000"
|
||||
NEXTAUTH_SECRET="$(openssl rand -base64 32)"
|
||||
NEXT_PUBLIC_DISABLE_ANALYTICS="true"
|
||||
DEFAULT_COLOR_SCHEME="dark"
|
||||
AUTH_SECRET="${AUTH_SECRET}"
|
||||
DB_DRIVER='better-sqlite3'
|
||||
SECRET_ENCRYPTION_KEY="${SECRET_ENCRYPTION_KEY}"
|
||||
DB_URL='/opt/homarr_db/db.sqlite'
|
||||
TURBO_TELEMETRY_DISABLED=1
|
||||
NODE_OPTIONS='-r @homarr/log/override'
|
||||
EOF
|
||||
|
||||
cd /opt/homarr
|
||||
$STD yarn install
|
||||
$STD yarn build
|
||||
$STD yarn db:migrate
|
||||
$STD pnpm run db:migration:sqlite:run
|
||||
$STD pnpm build
|
||||
mkdir build
|
||||
cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node ./build/better_sqlite3.node
|
||||
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
||||
msg_ok "Installed Homarr"
|
||||
|
||||
|
@ -69,18 +77,19 @@ After=network.target
|
|||
Type=exec
|
||||
WorkingDirectory=/opt/homarr
|
||||
EnvironmentFile=-/opt/homarr/.env
|
||||
ExecStart=/usr/bin/yarn start
|
||||
ExecStart=/usr/bin/pnpm start
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now homarr.service
|
||||
systemctl enable -q --now homarr
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/v${RELEASE}.zip
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue