Files
ProxmoxVE/install/homarr-install.sh

89 lines
2.4 KiB
Bash
Raw Normal View History

2023-08-16 08:56:17 -04:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
2025-12-14 23:56:45 +01:00
# Author: MickLesk (CanbiZ) | Co-Author: CrazyWolf13
2025-01-28 16:50:30 +01:00
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/homarr-labs/homarr
2023-08-16 08:56:17 -04:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2023-08-16 08:56:17 -04:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
Bump K to H-Scripts to Debian 13 (Trixie) (#8597) * Update scripts to use Debian 13 and improve update logic Bump default container OS version from Debian 12 to 13 across multiple LXC setup scripts. Refactor update_script functions for consistency, improve messaging, and standardize apt usage. Update Kimai install and update scripts to use setup_php, setup_composer, and fetch_and_deploy_gh_release helpers, and switch from MySQL to MariaDB. Update Kometa to use Python 3.13. Minor improvements to backup, cleanup, and service management steps in several scripts. * Refactor install scripts: unify cleanup and apt usage Replaces repeated apt-get commands with apt for installing dependencies, and consolidates cleanup steps into a single cleanup_lxc function across all install scripts. Also updates repository setup to use setup_deb822_repo where applicable, and makes minor improvements to dependency installation and service setup. * Update default Debian version to 13 and refactor updates Set the default Debian version to 13 across all container scripts. Standardize apt command usage by replacing 'apt-get' with 'apt' where appropriate. Remove redundant cleanup steps from update scripts and streamline update logic for consistency. Also, call 'cleanup_lxc' after 'update_script' in the build function. * Update default OS version to Debian 13 in JSON configs Updated the 'version' field from '12' to '13' for Debian-based install methods across multiple application JSON files. Also set default OS and version for inspircd. This ensures new containers use the latest supported Debian release. * fix kimai Update Check * grammar * Correct typo in success message * Fix typo in success message for update * refactor * fixed jenkins / improve komodo --------- Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
2025-11-12 10:56:18 +01:00
$STD apt install -y \
2025-01-28 16:32:44 +01:00
redis-server \
nginx \
gettext \
2025-12-19 22:43:40 +01:00
openssl
2023-08-16 08:56:17 -04:00
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]')
setup_nodejs
2025-12-19 22:43:40 +01:00
fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr" "prebuild" "latest" "/opt/homarr" "build-debian-amd64.tar.gz"
2023-08-16 08:56:17 -04:00
2025-12-14 23:56:45 +01:00
msg_info "Installing Homarr"
2025-01-28 16:32:44 +01:00
mkdir -p /opt/homarr_db
touch /opt/homarr_db/db.sqlite
2025-01-28 16:59:27 +01:00
SECRET_ENCRYPTION_KEY="$(openssl rand -hex 32)"
cd /opt/homarr
2025-12-14 23:56:45 +01:00
cat <<EOF >/opt/homarr.env
2025-01-28 16:32:44 +01:00
DB_DRIVER='better-sqlite3'
DB_DIALECT='sqlite'
2025-01-28 16:59:27 +01:00
SECRET_ENCRYPTION_KEY='${SECRET_ENCRYPTION_KEY}'
2025-01-28 16:32:44 +01:00
DB_URL='/opt/homarr_db/db.sqlite'
TURBO_TELEMETRY_DISABLED=1
AUTH_PROVIDERS='credentials'
NODE_ENV='production'
2025-12-14 23:56:45 +01:00
REDIS_IS_EXTERNAL='true'
2024-04-14 23:53:22 -04:00
EOF
msg_ok "Installed Homarr"
2025-12-14 23:56:45 +01:00
msg_info "Copying config files"
mkdir -p /appdata/redis
2025-12-14 23:56:45 +01:00
chown -R redis:redis /appdata/redis
chmod 744 /appdata/redis
cp /opt/homarr/redis.conf /etc/redis/redis.conf
rm /etc/nginx/nginx.conf
2025-12-14 23:56:45 +01:00
mkdir -p /etc/nginx/templates
cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf
echo $'#!/bin/bash\ncd /opt/homarr/apps/cli && node ./cli.cjs "$@"' >/usr/bin/homarr
chmod +x /usr/bin/homarr
2025-12-14 23:56:45 +01:00
msg_ok "Copied config files"
2023-08-16 08:56:17 -04:00
msg_info "Creating Services"
2025-12-14 23:56:45 +01:00
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
2023-08-16 08:56:17 -04:00
cat <<EOF >/etc/systemd/system/homarr.service
[Unit]
2025-12-19 22:43:40 +01:00
Requires=redis-server.service
After=redis-server.service
2023-08-16 08:56:17 -04:00
Description=Homarr Service
After=network.target
[Service]
Type=exec
WorkingDirectory=/opt/homarr
2025-12-14 23:56:45 +01:00
EnvironmentFile=-/opt/homarr.env
ExecStart=/opt/homarr/run.sh
2023-08-16 08:56:17 -04:00
[Install]
WantedBy=multi-user.target
EOF
2025-12-14 23:56:45 +01:00
chmod +x /opt/homarr/run.sh
systemctl daemon-reload
2025-12-19 22:43:40 +01:00
systemctl enable -q --now redis-server
2025-01-28 16:32:44 +01:00
systemctl enable -q --now homarr
2025-12-19 22:43:40 +01:00
systemctl disable -q --now nginx
2025-12-14 23:56:45 +01:00
msg_ok "Created Services"
2023-08-16 08:56:17 -04:00
motd_ssh
customize
Bump K to H-Scripts to Debian 13 (Trixie) (#8597) * Update scripts to use Debian 13 and improve update logic Bump default container OS version from Debian 12 to 13 across multiple LXC setup scripts. Refactor update_script functions for consistency, improve messaging, and standardize apt usage. Update Kimai install and update scripts to use setup_php, setup_composer, and fetch_and_deploy_gh_release helpers, and switch from MySQL to MariaDB. Update Kometa to use Python 3.13. Minor improvements to backup, cleanup, and service management steps in several scripts. * Refactor install scripts: unify cleanup and apt usage Replaces repeated apt-get commands with apt for installing dependencies, and consolidates cleanup steps into a single cleanup_lxc function across all install scripts. Also updates repository setup to use setup_deb822_repo where applicable, and makes minor improvements to dependency installation and service setup. * Update default Debian version to 13 and refactor updates Set the default Debian version to 13 across all container scripts. Standardize apt command usage by replacing 'apt-get' with 'apt' where appropriate. Remove redundant cleanup steps from update scripts and streamline update logic for consistency. Also, call 'cleanup_lxc' after 'update_script' in the build function. * Update default OS version to Debian 13 in JSON configs Updated the 'version' field from '12' to '13' for Debian-based install methods across multiple application JSON files. Also set default OS and version for inspircd. This ensures new containers use the latest supported Debian release. * fix kimai Update Check * grammar * Correct typo in success message * Fix typo in success message for update * refactor * fixed jenkins / improve komodo --------- Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
2025-11-12 10:56:18 +01:00
cleanup_lxc