mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-12-15 03:33:31 +01:00
Compare commits
11 Commits
github-act
...
update-and
| Author | SHA1 | Date | |
|---|---|---|---|
| bd273ec342 | |||
| d98cf62bb6 | |||
| 143513478f | |||
| ef1da02c37 | |||
| 4d062ec5cc | |||
| beed15abb5 | |||
| af4097161a | |||
| b5f1f4d069 | |||
| f524fd8087 | |||
| b8177e180f | |||
| a5da123525 |
1
.github/pull_request_template.md
generated
vendored
1
.github/pull_request_template.md
generated
vendored
@ -3,7 +3,6 @@ PRs without prior testing will be closed. -->
|
||||
|
||||
## ✍️ Description
|
||||
|
||||
|
||||
## 🔗 Related Issue
|
||||
|
||||
Fixes #
|
||||
|
||||
16
CHANGELOG.md
16
CHANGELOG.md
@ -10,24 +10,8 @@
|
||||
> [!CAUTION]
|
||||
Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit the project's popularity for potentially malicious purposes.
|
||||
|
||||
## 2025-12-15
|
||||
|
||||
## 2025-12-14
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- SonarQube: Fix database variables [@tremor021](https://github.com/tremor021) ([#9946](https://github.com/community-scripts/ProxmoxVE/pull/9946))
|
||||
|
||||
- #### 💥 Breaking Changes
|
||||
|
||||
- refactor: homarr [@CrazyWolf13](https://github.com/CrazyWolf13) ([#9948](https://github.com/community-scripts/ProxmoxVE/pull/9948))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- Update dependencies and remove unused files [@BramSuurdje](https://github.com/BramSuurdje) ([#9945](https://github.com/community-scripts/ProxmoxVE/pull/9945))
|
||||
|
||||
## 2025-12-13
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
145
ct/homarr.sh
145
ct/homarr.sh
@ -1,20 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ) | Co-Author: CrazyWolf13
|
||||
# Author: CrazyWolf13
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://homarr.dev/
|
||||
|
||||
APP="homarr"
|
||||
var_tags="${var_tags:-arr;dashboard}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_cpu="${var_cpu:-3}"
|
||||
var_ram="${var_ram:-6144}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
@ -27,33 +28,69 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if [[ -f /opt/homarr/database/db.sqlite ]]; then
|
||||
msg_error "Old Homarr detected due to existing database file (/opt/homarr/database/db.sqlite)."
|
||||
msg_error "Update not supported. Refer to:"
|
||||
msg_error " - https://github.com/community-scripts/ProxmoxVE/discussions/1551"
|
||||
msg_error " - https://homarr.dev/docs/getting-started/after-the-installation/#importing-a-zip-from-version-before-100"
|
||||
exit
|
||||
fi
|
||||
if [[ ! -f /opt/run_homarr.sh ]]; then
|
||||
msg_info "Detected outdated and missing service files"
|
||||
msg_error "Warning - The port of homarr changed from 3000 to 7575"
|
||||
$STD apt-get install -y nginx gettext openssl gpg
|
||||
sed -i '/^NODE_ENV=/d' /opt/homarr/.env && echo "NODE_ENV='production'" >>/opt/homarr/.env
|
||||
sed -i '/^DB_DIALECT=/d' /opt/homarr/.env && echo "DB_DIALECT='sqlite'" >>/opt/homarr/.env
|
||||
cat <<'EOF' >/opt/run_homarr.sh
|
||||
#!/bin/bash
|
||||
set -a
|
||||
source /opt/homarr/.env
|
||||
set +a
|
||||
export DB_DIALECT='sqlite'
|
||||
export AUTH_SECRET=$(openssl rand -base64 32)
|
||||
export CRON_JOB_API_KEY=$(openssl rand -base64 32)
|
||||
node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT
|
||||
for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do
|
||||
dirname=$(basename "$dir")
|
||||
mkdir -p "/opt/homarr_db/migrations/$dirname"
|
||||
cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true
|
||||
done
|
||||
export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+')
|
||||
envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
|
||||
nginx -g 'daemon off;' &
|
||||
redis-server /opt/homarr/packages/redis/redis.conf &
|
||||
node apps/tasks/tasks.cjs &
|
||||
node apps/websocket/wssServer.cjs &
|
||||
node apps/nextjs/server.js & PID=$!
|
||||
wait $PID
|
||||
EOF
|
||||
chmod +x /opt/run_homarr.sh
|
||||
rm /etc/systemd/system/homarr.service
|
||||
cat <<EOF >/etc/systemd/system/homarr.service
|
||||
[Unit]
|
||||
Description=Homarr Service
|
||||
After=network.target
|
||||
[Service]
|
||||
Type=exec
|
||||
WorkingDirectory=/opt/homarr
|
||||
EnvironmentFile=-/opt/homarr/.env
|
||||
ExecStart=/opt/run_homarr.sh
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
msg_ok "Updated Services"
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
|
||||
if check_for_gh_release "homarr" "homarr-labs/homarr"; then
|
||||
msg_info "Stopping Services (Patience)"
|
||||
systemctl stop homarr
|
||||
systemctl stop redis-server
|
||||
msg_ok "Services Stopped"
|
||||
|
||||
if ! { grep -q '^REDIS_IS_EXTERNAL=' /opt/homarr/.env 2>/dev/null || grep -q '^REDIS_IS_EXTERNAL=' /opt/homarr.env 2>/dev/null; }; then
|
||||
msg_info "Fixing old structure"
|
||||
# fix musl issues because homarr compiles on alpine not debian soure: https://github.com/alexander-akhmetov/python-telegram/issues/3
|
||||
$STD apt install -y musl-dev
|
||||
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
|
||||
cp /opt/homarr/.env /opt/homarr.env
|
||||
echo "REDIS_IS_EXTERNAL='true'" >> /opt/homarr.env
|
||||
sed -i 's|^ExecStart=.*|ExecStart=/opt/homarr/run.sh|' /etc/systemd/system/homarr.service
|
||||
sed -i 's|^EnvironmentFile=.*|EnvironmentFile=-/opt/homarr.env|' /etc/systemd/system/homarr.service
|
||||
chown -R redis:redis /appdata/redis
|
||||
chmod 744 /appdata/redis
|
||||
mkdir -p /etc/systemd/system/redis-server.service.d/
|
||||
cat <<EOF >/etc/systemd/system/redis-server.service.d/override.conf
|
||||
[Service]
|
||||
ReadWritePaths=-/appdata/redis -/var/lib/redis -/var/log/redis -/var/run/redis -/etc/redis
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
rm /opt/run_homarr.sh
|
||||
msg_ok "Fixed old structure"
|
||||
fi
|
||||
msg_info "Backup Data"
|
||||
mkdir -p /opt/homarr-data-backup
|
||||
cp /opt/homarr/.env /opt/homarr-data-backup/.env
|
||||
msg_ok "Backup Data"
|
||||
|
||||
msg_info "Updating Nodejs"
|
||||
$STD apt update
|
||||
@ -61,21 +98,69 @@ EOF
|
||||
msg_ok "Updated Nodejs"
|
||||
|
||||
NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]')
|
||||
NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')"
|
||||
setup_nodejs
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr" "prebuild" "latest" "/opt/homarr" "build-amd64.tar.gz"
|
||||
|
||||
msg_info "Updating Homarr"
|
||||
cp /opt/homarr/redis.conf /etc/redis/redis.conf
|
||||
rm -rf /opt/homarr
|
||||
fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr"
|
||||
|
||||
msg_info "Updating and rebuilding ${APP} (Patience)"
|
||||
rm /opt/run_homarr.sh
|
||||
cat <<'EOF' >/opt/run_homarr.sh
|
||||
#!/bin/bash
|
||||
set -a
|
||||
source /opt/homarr/.env
|
||||
set +a
|
||||
export DB_DIALECT='sqlite'
|
||||
export AUTH_SECRET=$(openssl rand -base64 32)
|
||||
export CRON_JOB_API_KEY=$(openssl rand -base64 32)
|
||||
node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT
|
||||
for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do
|
||||
dirname=$(basename "$dir")
|
||||
mkdir -p "/opt/homarr_db/migrations/$dirname"
|
||||
cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true
|
||||
done
|
||||
export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+')
|
||||
envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
|
||||
nginx -g 'daemon off;' &
|
||||
redis-server /opt/homarr/packages/redis/redis.conf &
|
||||
node apps/tasks/tasks.cjs &
|
||||
node apps/websocket/wssServer.cjs &
|
||||
node apps/nextjs/server.js & PID=$!
|
||||
wait $PID
|
||||
EOF
|
||||
chmod +x /opt/run_homarr.sh
|
||||
mv /opt/homarr-data-backup/.env /opt/homarr/.env
|
||||
cd /opt/homarr
|
||||
$STD pnpm install --recursive --frozen-lockfile --shamefully-hoist
|
||||
$STD pnpm build
|
||||
cp /opt/homarr/apps/nextjs/next.config.ts .
|
||||
cp /opt/homarr/apps/nextjs/package.json .
|
||||
cp -r /opt/homarr/packages/db/migrations /opt/homarr_db/migrations
|
||||
cp -r /opt/homarr/apps/nextjs/.next/standalone/* /opt/homarr
|
||||
mkdir -p /appdata/redis
|
||||
cp /opt/homarr/packages/redis/redis.conf /opt/homarr/redis.conf
|
||||
rm /etc/nginx/nginx.conf
|
||||
mkdir -p /etc/nginx/templates
|
||||
cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf
|
||||
msg_ok "Updated Homarr"
|
||||
|
||||
mkdir -p /opt/homarr/apps/cli
|
||||
cp /opt/homarr/packages/cli/cli.cjs /opt/homarr/apps/cli/cli.cjs
|
||||
echo $'#!/bin/bash\ncd /opt/homarr/apps/cli && node ./cli.cjs "$@"' >/usr/bin/homarr
|
||||
chmod +x /usr/bin/homarr
|
||||
|
||||
mkdir /opt/homarr/build
|
||||
cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node ./build/better_sqlite3.node
|
||||
msg_ok "Updated ${APP}"
|
||||
|
||||
msg_info "Starting Services"
|
||||
chmod +x /opt/homarr/run.sh
|
||||
systemctl start homarr
|
||||
systemctl start redis-server
|
||||
msg_ok "Started Services"
|
||||
msg_ok "Updated successfully!"
|
||||
read -p "${TAB3}It's recommended to reboot the LXC after an update, would you like to reboot the LXC now ? (y/n): " choice
|
||||
if [[ "$choice" =~ ^[Yy]$ ]]; then
|
||||
reboot
|
||||
fi
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
"type": "default",
|
||||
"script": "ct/homarr.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 1024,
|
||||
"cpu": 3,
|
||||
"ram": 6144,
|
||||
"hdd": 8,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
|
||||
@ -1,79 +1,4 @@
|
||||
[
|
||||
{
|
||||
"name": "BerriAI/litellm",
|
||||
"version": "v1.80.10.rc.2",
|
||||
"date": "2025-12-14T22:47:12Z"
|
||||
},
|
||||
{
|
||||
"name": "nickheyer/discopanel",
|
||||
"version": "v1.0.15",
|
||||
"date": "2025-12-14T21:49:36Z"
|
||||
},
|
||||
{
|
||||
"name": "AlexxIT/go2rtc",
|
||||
"version": "v1.9.13",
|
||||
"date": "2025-12-14T20:18:28Z"
|
||||
},
|
||||
{
|
||||
"name": "netvisor-io/netvisor",
|
||||
"version": "v0.12.0",
|
||||
"date": "2025-12-14T19:20:29Z"
|
||||
},
|
||||
{
|
||||
"name": "alexta69/metube",
|
||||
"version": "2025.12.14",
|
||||
"date": "2025-12-14T18:24:33Z"
|
||||
},
|
||||
{
|
||||
"name": "firefly-iii/firefly-iii",
|
||||
"version": "v6.4.10",
|
||||
"date": "2025-12-14T18:13:34Z"
|
||||
},
|
||||
{
|
||||
"name": "openhab/openhab-core",
|
||||
"version": "5.1.0.M4",
|
||||
"date": "2025-12-14T18:12:04Z"
|
||||
},
|
||||
{
|
||||
"name": "rcourtman/Pulse",
|
||||
"version": "v4.36.2",
|
||||
"date": "2025-12-03T22:46:29Z"
|
||||
},
|
||||
{
|
||||
"name": "Jackett/Jackett",
|
||||
"version": "v0.24.452",
|
||||
"date": "2025-12-14T15:50:44Z"
|
||||
},
|
||||
{
|
||||
"name": "semaphoreui/semaphore",
|
||||
"version": "v2.17.0-beta24",
|
||||
"date": "2025-12-14T14:04:23Z"
|
||||
},
|
||||
{
|
||||
"name": "blakeblackshear/frigate",
|
||||
"version": "v0.14.1",
|
||||
"date": "2024-08-29T22:32:51Z"
|
||||
},
|
||||
{
|
||||
"name": "docmost/docmost",
|
||||
"version": "v0.24.1",
|
||||
"date": "2025-12-14T13:49:16Z"
|
||||
},
|
||||
{
|
||||
"name": "laurent22/joplin",
|
||||
"version": "server-v3.5.1",
|
||||
"date": "2025-12-03T11:56:50Z"
|
||||
},
|
||||
{
|
||||
"name": "chrisbenincasa/tunarr",
|
||||
"version": "v1.0.3",
|
||||
"date": "2025-12-14T13:32:31Z"
|
||||
},
|
||||
{
|
||||
"name": "C4illin/ConvertX",
|
||||
"version": "v0.16.1",
|
||||
"date": "2025-12-14T13:21:05Z"
|
||||
},
|
||||
{
|
||||
"name": "globaleaks/globaleaks-whistleblowing-software",
|
||||
"version": "v5.0.87",
|
||||
@ -84,11 +9,21 @@
|
||||
"version": "2.223.0",
|
||||
"date": "2025-12-14T08:16:54Z"
|
||||
},
|
||||
{
|
||||
"name": "netvisor-io/netvisor",
|
||||
"version": "v0.12.0",
|
||||
"date": "2025-12-14T06:08:25Z"
|
||||
},
|
||||
{
|
||||
"name": "morpheus65535/bazarr",
|
||||
"version": "v1.5.3",
|
||||
"date": "2025-09-20T12:12:33Z"
|
||||
},
|
||||
{
|
||||
"name": "Jackett/Jackett",
|
||||
"version": "v0.24.448",
|
||||
"date": "2025-12-14T05:55:44Z"
|
||||
},
|
||||
{
|
||||
"name": "release-argus/Argus",
|
||||
"version": "0.28.1",
|
||||
@ -99,6 +34,16 @@
|
||||
"version": "1.3.12",
|
||||
"date": "2025-12-14T02:58:24Z"
|
||||
},
|
||||
{
|
||||
"name": "BerriAI/litellm",
|
||||
"version": "v1.80.10.rc.1",
|
||||
"date": "2025-12-14T02:32:50Z"
|
||||
},
|
||||
{
|
||||
"name": "nickheyer/discopanel",
|
||||
"version": "v1.0.14",
|
||||
"date": "2025-12-14T00:51:39Z"
|
||||
},
|
||||
{
|
||||
"name": "steveiliop56/tinyauth",
|
||||
"version": "v4.1.0",
|
||||
@ -159,6 +104,11 @@
|
||||
"version": "cli/v0.29.1",
|
||||
"date": "2025-12-13T13:55:51Z"
|
||||
},
|
||||
{
|
||||
"name": "chrisbenincasa/tunarr",
|
||||
"version": "v1.0.2",
|
||||
"date": "2025-12-13T13:34:22Z"
|
||||
},
|
||||
{
|
||||
"name": "fuma-nama/fumadocs",
|
||||
"version": "fumadocs-openapi@10.1.4",
|
||||
@ -179,6 +129,11 @@
|
||||
"version": "v0.26.2",
|
||||
"date": "2025-12-13T07:48:09Z"
|
||||
},
|
||||
{
|
||||
"name": "firefly-iii/firefly-iii",
|
||||
"version": "v6.4.9",
|
||||
"date": "2025-11-28T20:36:20Z"
|
||||
},
|
||||
{
|
||||
"name": "mealie-recipes/mealie",
|
||||
"version": "v3.7.0",
|
||||
@ -224,6 +179,11 @@
|
||||
"version": "2025.12.3",
|
||||
"date": "2025-12-12T18:12:39Z"
|
||||
},
|
||||
{
|
||||
"name": "docmost/docmost",
|
||||
"version": "v0.24.0",
|
||||
"date": "2025-12-12T18:05:49Z"
|
||||
},
|
||||
{
|
||||
"name": "booklore-app/booklore",
|
||||
"version": "v1.14.1",
|
||||
@ -494,6 +454,11 @@
|
||||
"version": "v1.4.7",
|
||||
"date": "2025-12-09T11:44:49Z"
|
||||
},
|
||||
{
|
||||
"name": "alexta69/metube",
|
||||
"version": "2025.12.09",
|
||||
"date": "2025-12-09T00:16:11Z"
|
||||
},
|
||||
{
|
||||
"name": "Dispatcharr/Dispatcharr",
|
||||
"version": "v0.14.0",
|
||||
@ -564,6 +529,11 @@
|
||||
"version": "2.7.1",
|
||||
"date": "2025-12-06T20:30:34Z"
|
||||
},
|
||||
{
|
||||
"name": "blakeblackshear/frigate",
|
||||
"version": "v0.14.1",
|
||||
"date": "2024-08-29T22:32:51Z"
|
||||
},
|
||||
{
|
||||
"name": "navidrome/navidrome",
|
||||
"version": "v0.59.0",
|
||||
@ -574,6 +544,11 @@
|
||||
"version": "v5.19.2",
|
||||
"date": "2025-12-06T14:56:53Z"
|
||||
},
|
||||
{
|
||||
"name": "openhab/openhab-core",
|
||||
"version": "4.3.9",
|
||||
"date": "2025-12-06T14:31:36Z"
|
||||
},
|
||||
{
|
||||
"name": "prometheus/blackbox_exporter",
|
||||
"version": "v0.28.0",
|
||||
@ -664,6 +639,11 @@
|
||||
"version": "11.0.4",
|
||||
"date": "2025-12-04T09:26:37Z"
|
||||
},
|
||||
{
|
||||
"name": "rcourtman/Pulse",
|
||||
"version": "v4.36.2",
|
||||
"date": "2025-12-03T22:46:29Z"
|
||||
},
|
||||
{
|
||||
"name": "danielbrendel/hortusfox-web",
|
||||
"version": "v5.5",
|
||||
@ -679,6 +659,11 @@
|
||||
"version": "6.2.10",
|
||||
"date": "2025-12-03T13:58:32Z"
|
||||
},
|
||||
{
|
||||
"name": "laurent22/joplin",
|
||||
"version": "server-v3.5.1",
|
||||
"date": "2025-12-03T11:56:50Z"
|
||||
},
|
||||
{
|
||||
"name": "SigNoz/signoz",
|
||||
"version": "v0.104.0",
|
||||
@ -749,6 +734,11 @@
|
||||
"version": "3000.7.0",
|
||||
"date": "2025-12-01T23:29:47Z"
|
||||
},
|
||||
{
|
||||
"name": "C4illin/ConvertX",
|
||||
"version": "v0.16.0",
|
||||
"date": "2025-12-01T21:35:19Z"
|
||||
},
|
||||
{
|
||||
"name": "slskd/slskd",
|
||||
"version": "0.24.1",
|
||||
@ -914,6 +904,11 @@
|
||||
"version": "2.3.0",
|
||||
"date": "2025-11-24T09:48:32Z"
|
||||
},
|
||||
{
|
||||
"name": "semaphoreui/semaphore",
|
||||
"version": "v2.17.0-beta22",
|
||||
"date": "2025-11-24T06:07:49Z"
|
||||
},
|
||||
{
|
||||
"name": "webmin/webmin",
|
||||
"version": "2.610",
|
||||
@ -1089,6 +1084,11 @@
|
||||
"version": "v2.15.0",
|
||||
"date": "2025-11-16T18:53:49Z"
|
||||
},
|
||||
{
|
||||
"name": "AlexxIT/go2rtc",
|
||||
"version": "v1.9.12",
|
||||
"date": "2025-11-16T16:14:55Z"
|
||||
},
|
||||
{
|
||||
"name": "outline/outline",
|
||||
"version": "v1.1.0",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ) | Co-Author: CrazyWolf13
|
||||
# Author: MickLesk (Canbiz)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/homarr-labs/homarr
|
||||
|
||||
@ -16,24 +16,28 @@ update_os
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
redis-server \
|
||||
ca-certificates \
|
||||
make \
|
||||
g++ \
|
||||
build-essential \
|
||||
nginx \
|
||||
gettext \
|
||||
openssl \
|
||||
musl-dev
|
||||
jq \
|
||||
openssl
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]')
|
||||
NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')"
|
||||
setup_nodejs
|
||||
fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr" "prebuild" "latest" "/opt/homarr" "build-amd64.tar.gz"
|
||||
fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr"
|
||||
|
||||
msg_info "Installing Homarr"
|
||||
# fix musl issues because homarr compiles on alpine not debian soure: https://github.com/alexander-akhmetov/python-telegram/issues/3
|
||||
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
|
||||
msg_info "Installing Homarr (Patience)"
|
||||
cd /opt
|
||||
mkdir -p /opt/homarr_db
|
||||
touch /opt/homarr_db/db.sqlite
|
||||
SECRET_ENCRYPTION_KEY="$(openssl rand -hex 32)"
|
||||
cd /opt/homarr
|
||||
cat <<EOF >/opt/homarr.env
|
||||
cat <<EOF >/opt/homarr/.env
|
||||
DB_DRIVER='better-sqlite3'
|
||||
DB_DIALECT='sqlite'
|
||||
SECRET_ENCRYPTION_KEY='${SECRET_ENCRYPTION_KEY}'
|
||||
@ -41,28 +45,54 @@ DB_URL='/opt/homarr_db/db.sqlite'
|
||||
TURBO_TELEMETRY_DISABLED=1
|
||||
AUTH_PROVIDERS='credentials'
|
||||
NODE_ENV='production'
|
||||
REDIS_IS_EXTERNAL='true'
|
||||
EOF
|
||||
$STD pnpm install --recursive --frozen-lockfile --shamefully-hoist
|
||||
$STD pnpm build
|
||||
msg_ok "Installed Homarr"
|
||||
|
||||
msg_info "Copying config files"
|
||||
msg_info "Copying build and config files"
|
||||
cp /opt/homarr/apps/nextjs/next.config.ts .
|
||||
cp /opt/homarr/apps/nextjs/package.json .
|
||||
cp -r /opt/homarr/packages/db/migrations /opt/homarr_db/migrations
|
||||
cp -r /opt/homarr/apps/nextjs/.next/standalone/* /opt/homarr
|
||||
mkdir -p /appdata/redis
|
||||
chown -R redis:redis /appdata/redis
|
||||
chmod 744 /appdata/redis
|
||||
cp /opt/homarr/redis.conf /etc/redis/redis.conf
|
||||
rm /etc/nginx/nginx.conf
|
||||
cp /opt/homarr/packages/redis/redis.conf /opt/homarr/redis.conf
|
||||
mkdir -p /etc/nginx/templates
|
||||
rm /etc/nginx/nginx.conf
|
||||
cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf
|
||||
mkdir -p /opt/homarr/apps/cli
|
||||
cp /opt/homarr/packages/cli/cli.cjs /opt/homarr/apps/cli/cli.cjs
|
||||
echo $'#!/bin/bash\ncd /opt/homarr/apps/cli && node ./cli.cjs "$@"' >/usr/bin/homarr
|
||||
chmod +x /usr/bin/homarr
|
||||
msg_ok "Copied config files"
|
||||
mkdir /opt/homarr/build
|
||||
cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node ./build/better_sqlite3.node
|
||||
msg_ok "Finished copying"
|
||||
|
||||
msg_info "Creating Services"
|
||||
mkdir -p /etc/systemd/system/redis-server.service.d/
|
||||
cat <<EOF >/etc/systemd/system/redis-server.service.d/override.conf
|
||||
[Service]
|
||||
ReadWritePaths=-/appdata/redis -/var/lib/redis -/var/log/redis -/var/run/redis -/etc/redis
|
||||
cat <<'EOF' >/opt/run_homarr.sh
|
||||
#!/bin/bash
|
||||
set -a
|
||||
source /opt/homarr/.env
|
||||
set +a
|
||||
export DB_DIALECT='sqlite'
|
||||
export AUTH_SECRET=$(openssl rand -base64 32)
|
||||
export CRON_JOB_API_KEY=$(openssl rand -base64 32)
|
||||
node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT
|
||||
for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do
|
||||
dirname=$(basename "$dir")
|
||||
mkdir -p "/opt/homarr_db/migrations/$dirname"
|
||||
cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true
|
||||
done
|
||||
export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+')
|
||||
envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
|
||||
nginx -g 'daemon off;' &
|
||||
redis-server /opt/homarr/packages/redis/redis.conf &
|
||||
node apps/tasks/tasks.cjs &
|
||||
node apps/websocket/wssServer.cjs &
|
||||
node apps/nextjs/server.js & PID=$!
|
||||
wait $PID
|
||||
EOF
|
||||
chmod +x /opt/run_homarr.sh
|
||||
cat <<EOF >/etc/systemd/system/homarr.service
|
||||
[Unit]
|
||||
Description=Homarr Service
|
||||
@ -71,17 +101,14 @@ After=network.target
|
||||
[Service]
|
||||
Type=exec
|
||||
WorkingDirectory=/opt/homarr
|
||||
EnvironmentFile=-/opt/homarr.env
|
||||
ExecStart=/opt/homarr/run.sh
|
||||
EnvironmentFile=-/opt/homarr/.env
|
||||
ExecStart=/opt/run_homarr.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
chmod +x /opt/homarr/run.sh
|
||||
systemctl daemon-reload
|
||||
systemctl enable -q --now redis-server && sleep 5
|
||||
systemctl enable -q --now homarr
|
||||
msg_ok "Created Services"
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
@ -27,9 +27,9 @@ chown -R sonarqube:sonarqube /opt/sonarqube
|
||||
chmod -R 755 /opt/sonarqube
|
||||
mkdir -p /opt/sonarqube/conf
|
||||
cat <<EOF >/opt/sonarqube/conf/sonar.properties
|
||||
sonar.jdbc.username=${PG_DB_USER}
|
||||
sonar.jdbc.password=${PG_DB_PASS}
|
||||
sonar.jdbc.url=jdbc:postgresql://localhost/${PG_DB_NAME}
|
||||
sonar.jdbc.username=${DB_USER}
|
||||
sonar.jdbc.password=${DB_PASS}
|
||||
sonar.jdbc.url=jdbc:postgresql://localhost/${DB_NAME}
|
||||
sonar.web.host=0.0.0.0
|
||||
sonar.web.port=9000
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user