Files
ProxmoxVE/ct/homarr.sh

90 lines
3.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
2025-12-14 23:56:45 +01:00
# Author: MickLesk (CanbiZ) | Co-Author: CrazyWolf13
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://homarr.dev/
2023-08-16 08:57:18 -04:00
2025-05-14 16:52:46 +02:00
APP="homarr"
var_tags="${var_tags:-arr;dashboard}"
2025-12-14 23:56:45 +01:00
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
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
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
2023-08-16 08:57:18 -04:00
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/homarr ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
2025-01-28 16:32:44 +01:00
if check_for_gh_release "homarr" "homarr-labs/homarr"; then
msg_info "Stopping Services (Patience)"
systemctl stop homarr
2025-12-14 23:56:45 +01:00
systemctl stop redis-server
msg_ok "Services Stopped"
2025-12-14 23:56:45 +01:00
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"
2025-12-19 22:43:40 +01:00
systemctl disable -q --now nginx
cp /opt/homarr/.env /opt/homarr.env
echo "REDIS_IS_EXTERNAL='true'" >> /opt/homarr.env
2025-12-19 22:43:40 +01:00
sed -i '/^\[Unit\]/a Requires=redis-server.service\nAfter=redis-server.service' /etc/systemd/system/homarr.service
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
2025-12-14 23:56:45 +01:00
[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"
2025-12-14 23:56:45 +01:00
fi
2024-11-10 17:20:37 +01:00
2025-06-05 10:05:20 +02:00
msg_info "Updating Nodejs"
$STD apt update
$STD apt upgrade nodejs -y
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]')
setup_nodejs
2025-12-19 22:43:40 +01:00
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr" "prebuild" "latest" "/opt/homarr" "build-debian-amd64.tar.gz"
2025-12-14 23:56:45 +01:00
msg_info "Updating Homarr"
cp /opt/homarr/redis.conf /etc/redis/redis.conf
rm /etc/nginx/nginx.conf
cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf
2025-12-14 23:56:45 +01:00
msg_ok "Updated Homarr"
msg_info "Starting Services"
2025-12-14 23:56:45 +01:00
chmod +x /opt/homarr/run.sh
systemctl start homarr
2025-12-14 23:56:45 +01:00
systemctl start redis-server
msg_ok "Started Services"
msg_ok "Updated successfully!"
fi
exit
2023-08-16 08:57:18 -04:00
}
start
build_container
description
2026-01-06 22:57:40 +01:00
msg_ok "Completed successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7575${CL}"