mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-02 17:05:55 +01:00
Part of #12467 — scripts only (no framework changes). New exit codes 250-254 registered in api.func and error_handler.func: - 250: App download failed or version not determined - 251: App file extraction failed (corrupt/incomplete archive) - 252: App required file or resource not found - 253: App data migration required — update aborted - 254: App user declined prompt or input timed out Existing codes reused where applicable: - 10: privileged/Docker required (unifi-os-server) - 64: invalid user input (postgresql, tomcat) - 71: system error (pulse useradd) - 150: service failed to start (docker, npmplus) - 153: build failed (booklore) - 233: app not installed (evcc, endurain, grafana, loki, itsm-ng) - 236: hardware not detected (unifi-os-server /dev/net/tun) - 238: OS not supported (frigate)
84 lines
2.4 KiB
Bash
84 lines
2.4 KiB
Bash
#!/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
|
|
# Author: johanngrobe
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/joaovitoriasilva/endurain
|
|
|
|
APP="Endurain"
|
|
var_tags="${var_tags:-sport;social-media}"
|
|
var_cpu="${var_cpu:-2}"
|
|
var_ram="${var_ram:-4096}"
|
|
var_disk="${var_disk:-5}"
|
|
var_os="${var_os:-debian}"
|
|
var_version="${var_version:-13}"
|
|
var_unprivileged="${var_unprivileged:-1}"
|
|
|
|
header_info "$APP"
|
|
variables
|
|
color
|
|
catch_errors
|
|
|
|
function update_script() {
|
|
header_info
|
|
check_container_storage
|
|
check_container_resources
|
|
|
|
if [[ ! -d /opt/endurain ]]; then
|
|
msg_error "No ${APP} installation found!"
|
|
exit 233
|
|
fi
|
|
if check_for_gh_release "endurain" "endurain-project/endurain"; then
|
|
msg_info "Stopping Service"
|
|
systemctl stop endurain
|
|
msg_ok "Stopped Service"
|
|
|
|
msg_info "Creating Backup"
|
|
cp /opt/endurain/.env /opt/endurain.env
|
|
cp /opt/endurain/frontend/app/dist/env.js /opt/endurain.env.js
|
|
msg_ok "Created Backup"
|
|
|
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "endurain" "endurain-project/endurain" "tarball" "latest" "/opt/endurain"
|
|
|
|
msg_info "Preparing Update"
|
|
cd /opt/endurain
|
|
rm -rf \
|
|
/opt/endurain/{docs,example.env,screenshot_01.png} \
|
|
/opt/endurain/docker* \
|
|
/opt/endurain/*.yml
|
|
cp /opt/endurain.env /opt/endurain/.env
|
|
rm /opt/endurain.env
|
|
msg_ok "Prepared Update"
|
|
|
|
msg_info "Updating Frontend"
|
|
cd /opt/endurain/frontend/app
|
|
$STD npm ci
|
|
$STD npm run build
|
|
cp /opt/endurain.env.js /opt/endurain/frontend/app/dist/env.js
|
|
rm /opt/endurain.env.js
|
|
msg_ok "Updated Frontend"
|
|
|
|
msg_info "Updating Backend"
|
|
cd /opt/endurain/backend
|
|
$STD poetry export -f requirements.txt --output requirements.txt --without-hashes
|
|
$STD uv venv --clear
|
|
$STD uv pip install -r requirements.txt
|
|
msg_ok "Backend Updated"
|
|
|
|
msg_info "Starting Service"
|
|
systemctl start endurain
|
|
msg_ok "Started Service"
|
|
msg_ok "Updated successfully!"
|
|
fi
|
|
exit
|
|
}
|
|
|
|
start
|
|
build_container
|
|
description
|
|
|
|
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}:8080${CL}"
|