mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-07 13:53:26 +01:00
Compare commits
33 Commits
update_doc
...
add-script
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
440b1602fc | ||
|
|
4e262ff5d8 | ||
|
|
abf2276ce0 | ||
|
|
317db4ef1e | ||
|
|
5f4cdcfbdb | ||
|
|
3eadc02a3d | ||
|
|
70c9df24d9 | ||
|
|
15397e1bbe | ||
|
|
bb561172cf | ||
|
|
eecff9db6b | ||
|
|
f5558638b0 | ||
|
|
f233c476b6 | ||
|
|
bdd7c0f6f1 | ||
|
|
c67a5a157c | ||
|
|
ac3732db2f | ||
|
|
2af418c729 | ||
|
|
22f971ca6c | ||
|
|
ca5b27250d | ||
|
|
7ca6b077d2 | ||
|
|
5975dfd599 | ||
|
|
62cd1429ec | ||
|
|
ee3ce2d420 | ||
|
|
1a544ba06b | ||
|
|
3e408fbf1a | ||
|
|
76aeec2907 | ||
|
|
ed2876ff59 | ||
|
|
bbaf0e448c | ||
|
|
822de63f48 | ||
|
|
cb939861b8 | ||
|
|
c576728833 | ||
|
|
1953f4c1c2 | ||
|
|
6ef18a47cb | ||
|
|
161e17e856 |
2
.github/DISCUSSION_TEMPLATE/request-script.yml
generated
vendored
2
.github/DISCUSSION_TEMPLATE/request-script.yml
generated
vendored
@@ -32,6 +32,8 @@ body:
|
||||
required: true
|
||||
- label: "The application requested has 600+ stars on Github (if applicable), is older than 6 months, actively maintained and has release tarballs published."
|
||||
required: true
|
||||
- label: "I understand that not all applications will be accepted due to various reasons and criteria by the community-scripts ORG."
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for submitting your request! The team will review it and reach out if we need more information."
|
||||
|
||||
31
CHANGELOG.md
31
CHANGELOG.md
@@ -398,6 +398,28 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
</details>
|
||||
|
||||
## 2026-02-06
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
- PVE LXC Apps Updater [@MickLesk](https://github.com/MickLesk) ([#11533](https://github.com/community-scripts/ProxmoxVE/pull/11533))
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- Pangolin: replace build:sqlite with db:generate + build [@MickLesk](https://github.com/MickLesk) ([#11616](https://github.com/community-scripts/ProxmoxVE/pull/11616))
|
||||
- [FIX] OpenCloud: path issues [@vhsdream](https://github.com/vhsdream) ([#11593](https://github.com/community-scripts/ProxmoxVE/pull/11593))
|
||||
- [FIX] Homepage: preserve public/images & public/icons if they exist [@vhsdream](https://github.com/vhsdream) ([#11594](https://github.com/community-scripts/ProxmoxVE/pull/11594))
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
- refactor: homepage [@CrazyWolf13](https://github.com/CrazyWolf13) ([#11605](https://github.com/community-scripts/ProxmoxVE/pull/11605))
|
||||
|
||||
### 📚 Documentation
|
||||
|
||||
- [gh] Update to the New Script request template [@tremor021](https://github.com/tremor021) ([#11612](https://github.com/community-scripts/ProxmoxVE/pull/11612))
|
||||
|
||||
## 2026-02-05
|
||||
|
||||
### 🆕 New Scripts
|
||||
@@ -408,6 +430,11 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- OpenCloud: pin version to 5.0.2; Collabora CSP fix [@vhsdream](https://github.com/vhsdream) ([#11585](https://github.com/community-scripts/ProxmoxVE/pull/11585))
|
||||
- Wanderer: Fix repo [@tremor021](https://github.com/tremor021) ([#11567](https://github.com/community-scripts/ProxmoxVE/pull/11567))
|
||||
|
||||
- #### ✨ New Features
|
||||
|
||||
- Refactor: Docker-VM (Multi-OS / Cloud-Init / Stabilization) [@MickLesk](https://github.com/MickLesk) ([#9047](https://github.com/community-scripts/ProxmoxVE/pull/9047))
|
||||
@@ -418,6 +445,10 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
- cloud-init: add interactive SSH key discovery and selection [@MickLesk](https://github.com/MickLesk) ([#11547](https://github.com/community-scripts/ProxmoxVE/pull/11547))
|
||||
|
||||
### 📚 Documentation
|
||||
|
||||
- github: extend docs / contribution / templates [@MickLesk](https://github.com/MickLesk) ([#10921](https://github.com/community-scripts/ProxmoxVE/pull/10921))
|
||||
|
||||
### 🌐 Website
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
____ ________ __
|
||||
____ ________ __
|
||||
/ __ \____ ___ ____ / ____/ /___ __ ______/ /
|
||||
/ / / / __ \/ _ \/ __ \/ / / / __ \/ / / / __ /
|
||||
/ /_/ / /_/ / __/ / / / /___/ / /_/ / /_/ / /_/ /
|
||||
|
||||
@@ -28,7 +28,6 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
get_lxc_ip
|
||||
NODE_VERSION="22" NODE_MODULE="pnpm@latest" setup_nodejs
|
||||
ensure_dependencies jq
|
||||
|
||||
@@ -37,12 +36,20 @@ function update_script() {
|
||||
systemctl stop homepage
|
||||
msg_ok "Stopped service"
|
||||
|
||||
msg_info "Creating Backup"
|
||||
cp /opt/homepage/.env /opt/homepage.env
|
||||
cp -r /opt/homepage/config /opt/homepage_config_backup
|
||||
[[ -d /opt/homepage/public/images ]] && cp -r /opt/homepage/public/images /opt/homepage_images_backup
|
||||
[[ -d /opt/homepage/public/icons ]] && cp -r /opt/homepage/public/icons /opt/homepage_icons_backup
|
||||
msg_ok "Created Backup"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "homepage" "gethomepage/homepage" "tarball"
|
||||
|
||||
msg_info "Restoring Backup"
|
||||
mv /opt/homepage.env /opt/homepage
|
||||
rm -rf /opt/homepage/config
|
||||
mv /opt/homepage_config_backup /opt/homepage/config
|
||||
msg_ok "Restored Backup"
|
||||
|
||||
msg_info "Updating Homepage (Patience)"
|
||||
RELEASE=$(get_latest_github_release "gethomepage/homepage")
|
||||
@@ -54,6 +61,8 @@ function update_script() {
|
||||
export NEXT_PUBLIC_BUILDTIME=$(curl -fsSL https://api.github.com/repos/gethomepage/homepage/releases/latest | jq -r '.published_at')
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
$STD pnpm build
|
||||
[[ -d /opt/homepage_images_backup ]] && mv /opt/homepage_images_backup /opt/homepage/public/images
|
||||
[[ -d /opt/homepage_icons_backup ]] && mv /opt/homepage_icons_backup /opt/homepage/public/icons
|
||||
msg_ok "Updated Homepage"
|
||||
|
||||
msg_info "Starting service"
|
||||
|
||||
58
ct/nightscout.sh
Normal file
58
ct/nightscout.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/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: aendel
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/nightscout/cgm-remote-monitor
|
||||
|
||||
APP="Nightscout"
|
||||
var_tags="${var_tags:-health}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-10}"
|
||||
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/nightscout ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "nightscout" "nightscout/cgm-remote-monitor"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop nightscout
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "tarball"
|
||||
|
||||
msg_info "Updating Nightscout"
|
||||
cd /opt/nightscout
|
||||
$STD npm install
|
||||
msg_ok "Updated Nightscout"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start nightscout
|
||||
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}:1337${CL}"
|
||||
@@ -29,7 +29,7 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
RELEASE="v5.0.1"
|
||||
RELEASE="v5.0.2"
|
||||
if check_for_gh_release "opencloud" "opencloud-eu/opencloud" "${RELEASE}"; then
|
||||
msg_info "Stopping services"
|
||||
systemctl stop opencloud opencloud-wopi
|
||||
|
||||
@@ -48,8 +48,10 @@ function update_script() {
|
||||
$STD npm run set:sqlite
|
||||
$STD npm run set:oss
|
||||
rm -rf server/private
|
||||
$STD npm run build:sqlite
|
||||
$STD npm run db:generate
|
||||
$STD npm run build
|
||||
$STD npm run build:cli
|
||||
$STD npm run db:sqlite:push
|
||||
cp -R .next/standalone ./
|
||||
chmod +x ./dist/cli.mjs
|
||||
cp server/db/names.json ./dist/names.json
|
||||
|
||||
@@ -20,50 +20,50 @@ color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /opt/wanderer/start.sh ]]; then
|
||||
msg_error "No wanderer Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "wanderer" "Flomp/wanderer"; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop wanderer-web
|
||||
msg_ok "Stopped service"
|
||||
|
||||
fetch_and_deploy_gh_release "wanderer" "Flomp/wanderer" "tarball" "latest" "/opt/wanderer/source"
|
||||
|
||||
msg_info "Updating wanderer"
|
||||
cd /opt/wanderer/source/db
|
||||
$STD go mod tidy
|
||||
$STD go build
|
||||
cd /opt/wanderer/source/web
|
||||
$STD npm ci --omit=dev
|
||||
$STD npm run build
|
||||
msg_ok "Updated wanderer"
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start wanderer-web
|
||||
msg_ok "Started service"
|
||||
msg_ok "Update Successful"
|
||||
fi
|
||||
if check_for_gh_release "meilisearch" "meilisearch/meilisearch"; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop wanderer-web
|
||||
msg_ok "Stopped service"
|
||||
|
||||
fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" "latest" "/opt/wanderer/source/search"
|
||||
grep -q -- '--experimental-dumpless-upgrade' /opt/wanderer/start.sh || sed -i 's|meilisearch --master-key|meilisearch --experimental-dumpless-upgrade --master-key|' /opt/wanderer/start.sh
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start wanderer-web
|
||||
msg_ok "Started service"
|
||||
msg_ok "Update Successful"
|
||||
fi
|
||||
if [[ ! -f /opt/wanderer/start.sh ]]; then
|
||||
msg_error "No wanderer Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "wanderer" "Flomp/wanderer"; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop wanderer-web
|
||||
msg_ok "Stopped service"
|
||||
|
||||
fetch_and_deploy_gh_release "wanderer" "open-wanderer/wanderer" "tarball" "latest" "/opt/wanderer/source"
|
||||
|
||||
msg_info "Updating wanderer"
|
||||
cd /opt/wanderer/source/db
|
||||
$STD go mod tidy
|
||||
$STD go build
|
||||
cd /opt/wanderer/source/web
|
||||
$STD npm ci --omit=dev
|
||||
$STD npm run build
|
||||
msg_ok "Updated wanderer"
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start wanderer-web
|
||||
msg_ok "Started service"
|
||||
msg_ok "Update Successful"
|
||||
fi
|
||||
if check_for_gh_release "meilisearch" "meilisearch/meilisearch"; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop wanderer-web
|
||||
msg_ok "Stopped service"
|
||||
|
||||
fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" "latest" "/opt/wanderer/source/search"
|
||||
grep -q -- '--experimental-dumpless-upgrade' /opt/wanderer/start.sh || sed -i 's|meilisearch --master-key|meilisearch --experimental-dumpless-upgrade --master-key|' /opt/wanderer/start.sh
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start wanderer-web
|
||||
msg_ok "Started service"
|
||||
msg_ok "Update Successful"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"generated": "2026-02-05T12:12:20Z",
|
||||
"generated": "2026-02-06T12:11:58Z",
|
||||
"versions": [
|
||||
{
|
||||
"slug": "2fauth",
|
||||
@@ -179,9 +179,9 @@
|
||||
{
|
||||
"slug": "cloudreve",
|
||||
"repo": "cloudreve/cloudreve",
|
||||
"version": "4.12.1",
|
||||
"version": "4.13.0",
|
||||
"pinned": false,
|
||||
"date": "2026-01-28T07:29:16Z"
|
||||
"date": "2026-02-05T12:53:24Z"
|
||||
},
|
||||
{
|
||||
"slug": "comfyui",
|
||||
@@ -221,9 +221,9 @@
|
||||
{
|
||||
"slug": "cronicle",
|
||||
"repo": "jhuckaby/Cronicle",
|
||||
"version": "v0.9.103",
|
||||
"version": "v0.9.105",
|
||||
"pinned": false,
|
||||
"date": "2026-02-05T03:09:04Z"
|
||||
"date": "2026-02-05T18:16:11Z"
|
||||
},
|
||||
{
|
||||
"slug": "cryptpad",
|
||||
@@ -375,9 +375,9 @@
|
||||
{
|
||||
"slug": "ghostfolio",
|
||||
"repo": "ghostfolio/ghostfolio",
|
||||
"version": "2.235.0",
|
||||
"version": "2.236.0",
|
||||
"pinned": false,
|
||||
"date": "2026-02-03T19:27:17Z"
|
||||
"date": "2026-02-05T19:30:11Z"
|
||||
},
|
||||
{
|
||||
"slug": "gitea",
|
||||
@@ -494,9 +494,9 @@
|
||||
{
|
||||
"slug": "homepage",
|
||||
"repo": "gethomepage/homepage",
|
||||
"version": "v1.10.0",
|
||||
"version": "v1.10.1",
|
||||
"pinned": false,
|
||||
"date": "2026-02-05T06:17:32Z"
|
||||
"date": "2026-02-05T15:03:45Z"
|
||||
},
|
||||
{
|
||||
"slug": "homer",
|
||||
@@ -515,9 +515,9 @@
|
||||
{
|
||||
"slug": "huntarr",
|
||||
"repo": "plexguide/Huntarr.io",
|
||||
"version": "9.2.0",
|
||||
"version": "9.2.1",
|
||||
"pinned": false,
|
||||
"date": "2026-02-05T04:18:08Z"
|
||||
"date": "2026-02-05T16:39:35Z"
|
||||
},
|
||||
{
|
||||
"slug": "inspircd",
|
||||
@@ -543,9 +543,9 @@
|
||||
{
|
||||
"slug": "jackett",
|
||||
"repo": "Jackett/Jackett",
|
||||
"version": "v0.24.1032",
|
||||
"version": "v0.24.1044",
|
||||
"pinned": false,
|
||||
"date": "2026-02-05T05:55:27Z"
|
||||
"date": "2026-02-06T05:55:31Z"
|
||||
},
|
||||
{
|
||||
"slug": "joplin-server",
|
||||
@@ -834,6 +834,13 @@
|
||||
"pinned": false,
|
||||
"date": "2026-02-03T13:54:26Z"
|
||||
},
|
||||
{
|
||||
"slug": "nginx-ui",
|
||||
"repo": "0xJacky/nginx-ui",
|
||||
"version": "v2.3.2",
|
||||
"pinned": false,
|
||||
"date": "2025-12-09T09:47:15Z"
|
||||
},
|
||||
{
|
||||
"slug": "nocodb",
|
||||
"repo": "nocodb/nocodb",
|
||||
@@ -876,6 +883,13 @@
|
||||
"pinned": false,
|
||||
"date": "2026-01-17T12:24:31Z"
|
||||
},
|
||||
{
|
||||
"slug": "opencloud",
|
||||
"repo": "opencloud-eu/opencloud",
|
||||
"version": "v5.0.2",
|
||||
"pinned": true,
|
||||
"date": "2026-02-05T16:29:01Z"
|
||||
},
|
||||
{
|
||||
"slug": "opengist",
|
||||
"repo": "thomiceli/opengist",
|
||||
@@ -928,9 +942,9 @@
|
||||
{
|
||||
"slug": "pangolin",
|
||||
"repo": "fosrl/pangolin",
|
||||
"version": "1.15.1",
|
||||
"version": "1.15.2",
|
||||
"pinned": false,
|
||||
"date": "2026-01-24T20:34:24Z"
|
||||
"date": "2026-02-05T19:23:58Z"
|
||||
},
|
||||
{
|
||||
"slug": "paperless-ai",
|
||||
@@ -1236,9 +1250,9 @@
|
||||
{
|
||||
"slug": "signoz",
|
||||
"repo": "SigNoz/signoz-otel-collector",
|
||||
"version": "v0.129.13",
|
||||
"version": "v0.142.0",
|
||||
"pinned": false,
|
||||
"date": "2026-01-27T15:43:00Z"
|
||||
"date": "2026-02-06T11:40:30Z"
|
||||
},
|
||||
{
|
||||
"slug": "silverbullet",
|
||||
@@ -1593,9 +1607,9 @@
|
||||
{
|
||||
"slug": "yubal",
|
||||
"repo": "guillevc/yubal",
|
||||
"version": "v0.3.1",
|
||||
"version": "v4.0.0",
|
||||
"pinned": false,
|
||||
"date": "2026-01-29T12:45:35Z"
|
||||
"date": "2026-02-05T22:42:02Z"
|
||||
},
|
||||
{
|
||||
"slug": "zigbee2mqtt",
|
||||
|
||||
52
frontend/public/json/nightscout.json
Normal file
52
frontend/public/json/nightscout.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "Nightscout",
|
||||
"slug": "nightscout",
|
||||
"categories": [
|
||||
0
|
||||
],
|
||||
"date_created": "2025-02-06",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 1337,
|
||||
"documentation": "https://nightscout.github.io/",
|
||||
"website": "http://www.nightscout.info/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/nightscout.webp",
|
||||
"config_path": "/opt/nightscout/my.env",
|
||||
"description": "Nightscout is an open source, DIY project that allows real time access to a CGM data via personal website, smartwatch watchers, or apps and widgets available for smartphones.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/nightscout.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 10,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Nightscout requires configuring `my.env` with your Mongo connection string. API_SECRET has been generated and saved to `~/nightscout.creds`.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Edit `/opt/nightscout/my.env` to configure your CGM source (Dexcom/CareLink). Then run: `systemctl restart nightscout`",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Official Configuration Guide: https://nightscout.github.io/nightscout/setup_variables/",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Nightscout requires HTTPS for many features (security, tokens, PWA). Usage of a reverse proxy (e.g. Nginx Proxy Manager, Traefik, Caddy) is highly recommended.",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
}
|
||||
84
frontend/public/json/update-apps.json
Normal file
84
frontend/public/json/update-apps.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"name": "PVE LXC Apps Updater",
|
||||
"slug": "update-apps",
|
||||
"categories": [
|
||||
1
|
||||
],
|
||||
"date_created": "2026-02-06",
|
||||
"type": "pve",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": null,
|
||||
"documentation": "https://github.com/community-scripts/ProxmoxVE/discussions/11532",
|
||||
"website": null,
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/proxmox.webp",
|
||||
"config_path": "",
|
||||
"description": "This script updates community-scripts managed LXC containers on a Proxmox VE node. It detects the installed service, verifies available update scripts, and applies updates interactively or unattended. Optionally, containers can be backed up before the update process. If additional build resources (CPU/RAM) are required, the script adjusts container resources temporarily and restores them after the update. Containers requiring a reboot will be listed at the end of the process.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "tools/pve/update-apps.sh",
|
||||
"resources": {
|
||||
"cpu": null,
|
||||
"ram": null,
|
||||
"hdd": null,
|
||||
"os": null,
|
||||
"version": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Execute within the Proxmox shell.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Full Guide can be found here: `https://github.com/community-scripts/ProxmoxVE/discussions/11532`",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Only containers with `community-script` or `proxmox-helper-scripts` tags are listed for update.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Optionally performs a vzdump backup before updating containers.",
|
||||
"type": "warning"
|
||||
},
|
||||
{
|
||||
"text": "If required, the script will temporarily increase container CPU/RAM resources for the build process and restore them after completion.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "At the end of the update, containers requiring a reboot will be listed, and you may choose to reboot them directly.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_backup=yes|no` to enable/disable backup (skip prompt).",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_backup_storage=<name>` to set backup storage location.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_container=all|all_running|all_stopped|101,102,...` to select containers.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_unattended=yes|no` to run updates without interaction.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_skip_confirm=yes` to skip initial confirmation dialog.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Use `var_auto_reboot=yes|no` to auto-reboot containers after update.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
69
install/nightscout-install.sh
Normal file
69
install/nightscout-install.sh
Normal file
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: aendel
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/nightscout/cgm-remote-monitor
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
build-essential \
|
||||
libssl-dev \
|
||||
openssl
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
MONGO_VERSION="8.0" setup_mongodb
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "tarball"
|
||||
|
||||
msg_info "Installing Nightscout"
|
||||
$STD npm install --prefix /opt/nightscout
|
||||
msg_ok "Installed Nightscout"
|
||||
|
||||
msg_info "Creating Service"
|
||||
useradd -s /bin/bash -m nightscout
|
||||
chown -R nightscout:nightscout /opt/nightscout
|
||||
API_SECRET=$(openssl rand -hex 16)
|
||||
cat <<EOF >/opt/nightscout/my.env
|
||||
MONGO_CONNECTION=mongodb://127.0.0.1:27017/nightscout
|
||||
BASE_URL=http://localhost:1337
|
||||
API_SECRET=${API_SECRET}
|
||||
DISPLAY_UNITS=mg/dl
|
||||
ENABLE=careportal boluscalc food bwp cage sage iage iob cob basal ar2 rawbg pushover bgi pump openaps pvb linear custom
|
||||
INSECURE_USE_HTTP=true
|
||||
EOF
|
||||
chown nightscout:nightscout /opt/nightscout/my.env
|
||||
cat <<EOF >/etc/systemd/system/nightscout.service
|
||||
[Unit]
|
||||
Description=Nightscout CGM Service
|
||||
After=network.target mongodb.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=nightscout
|
||||
WorkingDirectory=/opt/nightscout
|
||||
EnvironmentFile=/opt/nightscout/my.env
|
||||
ExecStart=/usr/bin/npm start
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now nightscout
|
||||
msg_ok "Created Service"
|
||||
|
||||
{
|
||||
echo "Nightscout Credentials"
|
||||
echo "API_SECRET: ${API_SECRET}"
|
||||
} >> ~/nightscout.creds
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -60,13 +60,13 @@ $STD sudo -u cool coolconfig set-admin-password --user=admin --password="$COOLPA
|
||||
echo "$COOLPASS" >~/.coolpass
|
||||
msg_ok "Installed Collabora Online"
|
||||
|
||||
fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "v5.0.1" "/usr/bin" "opencloud-*-linux-amd64"
|
||||
fetch_and_deploy_gh_release "opencloud" "opencloud-eu/opencloud" "singlefile" "v5.0.2" "/usr/bin" "opencloud-*-linux-amd64"
|
||||
|
||||
msg_info "Configuring OpenCloud"
|
||||
DATA_DIR="/var/lib/opencloud/"
|
||||
DATA_DIR="/var/lib/opencloud"
|
||||
CONFIG_DIR="/etc/opencloud"
|
||||
ENV_FILE="${CONFIG_DIR}/opencloud.env"
|
||||
mkdir -p "$DATA_DIR" "$CONFIG_DIR"/assets/apps
|
||||
mkdir -p "$DATA_DIR" "$CONFIG_DIR"/web/assets/{apps,themes}
|
||||
|
||||
curl -fsSL https://raw.githubusercontent.com/opencloud-eu/opencloud-compose/refs/heads/main/config/opencloud/csp.yaml -o "$CONFIG_DIR"/csp.yaml
|
||||
curl -fsSL https://raw.githubusercontent.com/opencloud-eu/opencloud-compose/refs/heads/main/config/opencloud/proxy.yaml -o "$CONFIG_DIR"/proxy.yaml.bak
|
||||
@@ -83,9 +83,10 @@ STORAGE_SYSTEM_OC_ROOT=${DATA_DIR}/storage/metadata
|
||||
## Web
|
||||
WEB_ASSET_CORE_PATH=${CONFIG_DIR}/web/assets
|
||||
WEB_ASSET_APPS_PATH=${CONFIG_DIR}/web/assets/apps
|
||||
WEB_UI_CONFIG_FILE=${CONFIG_DIR}/web/config.json
|
||||
# WEB_ASSET_THEMES_PATH=${CONFIG_DIR}/web/assets/themes
|
||||
WEB_ASSET_THEMES_PATH=${CONFIG_DIR}/web/assets/themes
|
||||
# WEB_UI_THEME_PATH=
|
||||
## Uncomment below to create & modify your web UI config
|
||||
# WEB_UI_CONFIG_FILE=${CONFIG_DIR}/web/config.json
|
||||
|
||||
## Frontend
|
||||
FRONTEND_DISABLE_RADICALE=true
|
||||
@@ -194,7 +195,7 @@ EOF
|
||||
$STD sudo -u cool coolconfig set ssl.enable false
|
||||
$STD sudo -u cool coolconfig set ssl.termination true
|
||||
$STD sudo -u cool coolconfig set ssl.ssl_verification true
|
||||
sed -i "s|CSP2\"/>|CSP2\">frame-ancestors https://${OPENCLOUD_FQDN}</content_security_policy>|" /etc/coolwsd/coolwsd.xml
|
||||
sed -i "s|-Policy\">|&frame-ancestors https://${OPENCLOUD_FQDN}|" /etc/coolwsd/coolwsd.xml
|
||||
useradd -r -M -s /usr/sbin/nologin opencloud
|
||||
chown -R opencloud:opencloud "$CONFIG_DIR" "$DATA_DIR"
|
||||
sudo -u opencloud opencloud init --config-path "$CONFIG_DIR" --insecure no
|
||||
|
||||
@@ -36,7 +36,8 @@ $STD npm ci
|
||||
$STD npm run set:sqlite
|
||||
$STD npm run set:oss
|
||||
rm -rf server/private
|
||||
$STD npm run build:sqlite
|
||||
$STD npm run db:generate
|
||||
$STD npm run build
|
||||
$STD npm run build:cli
|
||||
cp -R .next/standalone ./
|
||||
|
||||
@@ -177,7 +178,6 @@ http:
|
||||
servers:
|
||||
- url: "http://$LOCAL_IP:3000"
|
||||
EOF
|
||||
$STD npm run db:sqlite:generate
|
||||
$STD npm run db:sqlite:push
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
@@ -22,8 +22,8 @@ setup_deb822_repo \
|
||||
"mssql-server-2022" \
|
||||
"https://packages.microsoft.com/keys/microsoft.asc" \
|
||||
"https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022" \
|
||||
"./" \
|
||||
""
|
||||
"jammy" \
|
||||
"main"
|
||||
msg_ok "Repository configured"
|
||||
|
||||
msg_info "Installing SQL Server 2022"
|
||||
|
||||
@@ -22,8 +22,8 @@ setup_deb822_repo \
|
||||
"mssql-server-2025" \
|
||||
"https://packages.microsoft.com/keys/microsoft.asc" \
|
||||
"https://packages.microsoft.com/ubuntu/24.04/mssql-server-2025" \
|
||||
"./" \
|
||||
""
|
||||
"noble" \
|
||||
"main"
|
||||
msg_ok "Repository configured"
|
||||
|
||||
msg_info "Installing SQL Server 2025"
|
||||
|
||||
@@ -14,10 +14,10 @@ network_check
|
||||
update_os
|
||||
|
||||
setup_go
|
||||
setup_nodejs
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" "latest" "/opt/wanderer/source/search"
|
||||
mkdir -p /opt/wanderer/{source,data/pb_data,data/meili_data}
|
||||
fetch_and_deploy_gh_release "wanderer" "Flomp/wanderer" "tarball" "latest" "/opt/wanderer/source"
|
||||
fetch_and_deploy_gh_release "wanderer" "open-wanderer/wanderer" "tarball" "latest" "/opt/wanderer/source"
|
||||
|
||||
msg_info "Installing wanderer (patience)"
|
||||
cd /opt/wanderer/source/db
|
||||
@@ -58,7 +58,7 @@ cd /opt/wanderer/source/web && node build &
|
||||
|
||||
wait -n
|
||||
EOF
|
||||
chmod +x /opt/wanderer/start.sh
|
||||
chmod +x /opt/wanderer/start.sh
|
||||
|
||||
cat <<EOF >/etc/systemd/system/wanderer-web.service
|
||||
[Unit]
|
||||
|
||||
471
tools/pve/update-apps.sh
Normal file
471
tools/pve/update-apps.sh
Normal file
@@ -0,0 +1,471 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: BvdBerg01 | Co-Author: remz1337
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/core.func)
|
||||
|
||||
# =============================================================================
|
||||
# CONFIGURATION VARIABLES
|
||||
# Set these variables to skip interactive prompts (Whiptail dialogs)
|
||||
# =============================================================================
|
||||
# var_backup: Enable/disable backup before update
|
||||
# Options: "yes" | "no" | "" (empty = interactive prompt)
|
||||
var_backup="${var_backup:-}"
|
||||
|
||||
# var_backup_storage: Storage location for backups (only used if var_backup=yes)
|
||||
# Options: Storage name from /etc/pve/storage.cfg (e.g., "local", "nas-backup")
|
||||
# Leave empty for interactive selection
|
||||
var_backup_storage="${var_backup_storage:-}"
|
||||
|
||||
# var_container: Which containers to update
|
||||
# Options:
|
||||
# - "all" : All containers with community-scripts tags
|
||||
# - "all_running" : Only running containers with community-scripts tags
|
||||
# - "all_stopped" : Only stopped containers with community-scripts tags
|
||||
# - "101,102,109" : Comma-separated list of specific container IDs
|
||||
# - "" : Interactive selection via Whiptail
|
||||
var_container="${var_container:-}"
|
||||
|
||||
# var_unattended: Run updates without user interaction inside containers
|
||||
# Options: "yes" | "no" | "" (empty = interactive prompt)
|
||||
var_unattended="${var_unattended:-}"
|
||||
|
||||
# var_skip_confirm: Skip initial confirmation dialog
|
||||
# Options: "yes" | "no" (default: no)
|
||||
var_skip_confirm="${var_skip_confirm:-no}"
|
||||
|
||||
# var_auto_reboot: Automatically reboot containers that require it after update
|
||||
# Options: "yes" | "no" | "" (empty = interactive prompt)
|
||||
var_auto_reboot="${var_auto_reboot:-}"
|
||||
|
||||
# var_tags: Optionally override the tags used for auto-detection
|
||||
# Options: "community-script|proxmox-helper-scripts" (default)
|
||||
var_tags="${var_tags:-community-script|proxmox-helper-scripts}"
|
||||
# =============================================================================
|
||||
# JSON CONFIG EXPORT
|
||||
# Run with --export-config to output current configuration as JSON
|
||||
# =============================================================================
|
||||
|
||||
function export_config_json() {
|
||||
cat <<EOF
|
||||
{
|
||||
"var_backup": "${var_backup}",
|
||||
"var_backup_storage": "${var_backup_storage}",
|
||||
"var_container": "${var_container}",
|
||||
"var_unattended": "${var_unattended}",
|
||||
"var_skip_confirm": "${var_skip_confirm}",
|
||||
"var_auto_reboot": "${var_auto_reboot}",
|
||||
"var_tags": "${var_tags}"
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
function print_usage() {
|
||||
cat <<EOF
|
||||
Usage: $(basename "$0") [OPTIONS]
|
||||
|
||||
Update LXC containers created with community-scripts.
|
||||
|
||||
Options:
|
||||
--help Show this help message
|
||||
--export-config Export current configuration as JSON
|
||||
|
||||
Environment Variables:
|
||||
var_backup Enable backup before update (yes/no)
|
||||
var_backup_storage Storage location for backups
|
||||
var_container Container selection (all/all_running/all_stopped/101,102,...)
|
||||
var_unattended Run updates unattended (yes/no)
|
||||
var_skip_confirm Skip initial confirmation (yes/no)
|
||||
var_auto_reboot Auto-reboot containers if required (yes/no)
|
||||
var_tags Optionally override auto-detection tags ("prod|smb|community-script")
|
||||
|
||||
Examples:
|
||||
# Run interactively
|
||||
$(basename "$0")
|
||||
|
||||
# Update all running containers unattended with backup
|
||||
var_backup=yes var_backup_storage=local var_container=all_running var_unattended=yes var_skip_confirm=yes $(basename "$0")
|
||||
|
||||
# Update specific containers without backup
|
||||
var_backup=no var_container=101,102,105 var_unattended=yes var_skip_confirm=yes $(basename "$0")
|
||||
|
||||
# Export current configuration
|
||||
$(basename "$0") --export-config
|
||||
EOF
|
||||
}
|
||||
|
||||
# Handle command line arguments
|
||||
case "${1:-}" in
|
||||
--help|-h)
|
||||
print_usage
|
||||
exit 0
|
||||
;;
|
||||
--export-config)
|
||||
export_config_json
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# =============================================================================
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
__ _ ________ __ __ __ __
|
||||
/ / | |/ / ____/ / / / /___ ____/ /___ _/ /____
|
||||
/ / | / / / / / / __ \/ __ / __ `/ __/ _ \
|
||||
/ /___/ / /___ / /_/ / /_/ / /_/ / /_/ / /_/ __/
|
||||
/_____/_/|_\____/ \____/ .___/\__,_/\__,_/\__/\___/
|
||||
/_/
|
||||
EOF
|
||||
}
|
||||
|
||||
function detect_service() {
|
||||
pushd $(mktemp -d) >/dev/null
|
||||
pct pull "$1" /usr/bin/update update 2>/dev/null
|
||||
service=$(cat update | sed 's|.*/ct/||g' | sed 's|\.sh).*||g')
|
||||
popd >/dev/null
|
||||
}
|
||||
|
||||
function backup_container() {
|
||||
msg_info "Creating backup for container $1"
|
||||
vzdump $1 --compress zstd --storage $STORAGE_CHOICE -notes-template "community-scripts backup updater" >/dev/null 2>&1
|
||||
status=$?
|
||||
|
||||
if [ $status -eq 0 ]; then
|
||||
msg_ok "Backup created"
|
||||
else
|
||||
msg_error "Backup failed for container $1"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function get_backup_storages() {
|
||||
STORAGES=$(awk '
|
||||
/^[a-z]+:/ {
|
||||
if (name != "") {
|
||||
if (has_backup || (!has_content && type == "dir")) print name
|
||||
}
|
||||
split($0, a, ":")
|
||||
type = a[1]
|
||||
name = a[2]
|
||||
sub(/^ +/, "", name)
|
||||
has_content = 0
|
||||
has_backup = 0
|
||||
}
|
||||
/^ +content/ {
|
||||
has_content = 1
|
||||
if ($0 ~ /backup/) has_backup = 1
|
||||
}
|
||||
END {
|
||||
if (name != "") {
|
||||
if (has_backup || (!has_content && type == "dir")) print name
|
||||
}
|
||||
}
|
||||
' /etc/pve/storage.cfg)
|
||||
}
|
||||
|
||||
header_info
|
||||
|
||||
# Skip confirmation if var_skip_confirm is set to yes
|
||||
if [[ "$var_skip_confirm" != "yes" ]]; then
|
||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "LXC App Update" --yesno "This will update apps in LXCs installed by Helper-Scripts. Proceed?" 10 58 || exit
|
||||
fi
|
||||
|
||||
tags_formatted="${var_tags//|/, }"
|
||||
msg_info "Loading all possible LXC containers from Proxmox VE with tags: ${tags_formatted}. This may take a few seconds..."
|
||||
NODE=$(hostname)
|
||||
containers=$(pct list | tail -n +2 | awk '{print $0 " " $4}')
|
||||
|
||||
if [ -z "$containers" ]; then
|
||||
whiptail --title "LXC Container Update" --msgbox "No LXC containers available!" 10 60
|
||||
exit 1
|
||||
fi
|
||||
|
||||
menu_items=()
|
||||
FORMAT="%-10s %-15s %-10s"
|
||||
TAGS="${var_tags:-community-script|proxmox-helper-scripts}"
|
||||
|
||||
while read -r container; do
|
||||
container_id=$(echo $container | awk '{print $1}')
|
||||
container_name=$(echo $container | awk '{print $2}')
|
||||
container_status=$(echo $container | awk '{print $3}')
|
||||
formatted_line=$(printf "$FORMAT" "$container_name" "$container_status")
|
||||
if pct config "$container_id" | grep -qE "[^-][; ](${TAGS}).*"; then
|
||||
menu_items+=("$container_id" "$formatted_line" "OFF")
|
||||
fi
|
||||
done <<<"$containers"
|
||||
msg_ok "Loaded ${#menu_items[@]} containers"
|
||||
|
||||
# Determine container selection based on var_container
|
||||
if [[ -n "$var_container" ]]; then
|
||||
case "$var_container" in
|
||||
all)
|
||||
# Select all containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i=0; i<${#menu_items[@]}; i+=3)); do
|
||||
CHOICE="$CHOICE ${menu_items[$i]}"
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
all_running)
|
||||
# Select only running containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i=0; i<${#menu_items[@]}; i+=3)); do
|
||||
cid="${menu_items[$i]}"
|
||||
if pct status "$cid" 2>/dev/null | grep -q "running"; then
|
||||
CHOICE="$CHOICE $cid"
|
||||
fi
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
all_stopped)
|
||||
# Select only stopped containers with matching tags
|
||||
CHOICE=""
|
||||
for ((i=0; i<${#menu_items[@]}; i+=3)); do
|
||||
cid="${menu_items[$i]}"
|
||||
if pct status "$cid" 2>/dev/null | grep -q "stopped"; then
|
||||
CHOICE="$CHOICE $cid"
|
||||
fi
|
||||
done
|
||||
CHOICE=$(echo "$CHOICE" | xargs)
|
||||
;;
|
||||
*)
|
||||
# Assume comma-separated list of container IDs
|
||||
CHOICE=$(echo "$var_container" | tr ',' ' ')
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -z "$CHOICE" ]]; then
|
||||
msg_error "No containers matched the selection criteria: $var_container ${var_tags:-community-script|proxmox-helper-scripts}"
|
||||
exit 1
|
||||
fi
|
||||
msg_ok "Selected containers: $CHOICE"
|
||||
else
|
||||
CHOICE=$(whiptail --title "LXC Container Update" \
|
||||
--checklist "Select LXC containers to update:" 25 60 13 \
|
||||
"${menu_items[@]}" 3>&2 2>&1 1>&3 | tr -d '"')
|
||||
|
||||
if [ -z "$CHOICE" ]; then
|
||||
whiptail --title "LXC Container Update" \
|
||||
--msgbox "No containers selected!" 10 60
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
header_info
|
||||
|
||||
# Determine backup choice based on var_backup
|
||||
if [[ -n "$var_backup" ]]; then
|
||||
BACKUP_CHOICE="$var_backup"
|
||||
else
|
||||
BACKUP_CHOICE="no"
|
||||
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "LXC Container Update" --yesno "Do you want to backup your containers before update?" 10 58); then
|
||||
BACKUP_CHOICE="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Determine unattended update based on var_unattended
|
||||
if [[ -n "$var_unattended" ]]; then
|
||||
UNATTENDED_UPDATE="$var_unattended"
|
||||
else
|
||||
UNATTENDED_UPDATE="no"
|
||||
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "LXC Container Update" --yesno "Run updates unattended?" 10 58); then
|
||||
UNATTENDED_UPDATE="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$BACKUP_CHOICE" == "yes" ]; then
|
||||
get_backup_storages
|
||||
|
||||
if [ -z "$STORAGES" ]; then
|
||||
msg_error "No storage with 'backup' support found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Determine storage based on var_backup_storage
|
||||
if [[ -n "$var_backup_storage" ]]; then
|
||||
# Validate that the specified storage exists and supports backups
|
||||
if echo "$STORAGES" | grep -qw "$var_backup_storage"; then
|
||||
STORAGE_CHOICE="$var_backup_storage"
|
||||
msg_ok "Using backup storage: $STORAGE_CHOICE"
|
||||
else
|
||||
msg_error "Specified backup storage '$var_backup_storage' not found or doesn't support backups!"
|
||||
msg_info "Available storages: $(echo $STORAGES | tr '\n' ' ')"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
MENU_ITEMS=()
|
||||
for STORAGE in $STORAGES; do
|
||||
MENU_ITEMS+=("$STORAGE" "")
|
||||
done
|
||||
|
||||
STORAGE_CHOICE=$(whiptail --title "Select storage device" --menu "Select a storage device (Only storage devices with 'backup' support are listed):" 15 50 5 "${MENU_ITEMS[@]}" 3>&1 1>&2 2>&3)
|
||||
|
||||
if [ -z "$STORAGE_CHOICE" ]; then
|
||||
msg_error "No storage selected!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
UPDATE_CMD="update;"
|
||||
if [ "$UNATTENDED_UPDATE" == "yes" ]; then
|
||||
UPDATE_CMD="export PHS_SILENT=1;update;"
|
||||
fi
|
||||
|
||||
containers_needing_reboot=()
|
||||
for container in $CHOICE; do
|
||||
echo -e "${BL}[INFO]${CL} Updating container $container"
|
||||
|
||||
if [ "$BACKUP_CHOICE" == "yes" ]; then
|
||||
backup_container $container
|
||||
fi
|
||||
|
||||
os=$(pct config "$container" | awk '/^ostype/ {print $2}')
|
||||
status=$(pct status $container)
|
||||
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
|
||||
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
|
||||
echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
|
||||
pct start $container
|
||||
echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
#1) Detect service using the service name in the update command
|
||||
detect_service $container
|
||||
|
||||
#1.1) If update script not detected, return
|
||||
if [ -z "${service}" ]; then
|
||||
echo -e "${YW}[WARN]${CL} Update script not found. Skipping to next container"
|
||||
continue
|
||||
else
|
||||
echo -e "${BL}[INFO]${CL} Detected service: ${GN}${service}${CL}"
|
||||
fi
|
||||
|
||||
#2) Extract service build/update resource requirements from config/installation file
|
||||
script=$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/${service}.sh)
|
||||
|
||||
#2.1) Check if the script downloaded successfully
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RD}[ERROR]${CL} Issue while downloading install script."
|
||||
echo -e "${YW}[WARN]${CL} Unable to assess build resource requirements. Proceeding with current resources."
|
||||
fi
|
||||
|
||||
config=$(pct config "$container")
|
||||
build_cpu=$(echo "$script" | { grep -m 1 "var_cpu" || test $? = 1; } | sed 's|.*=||g' | sed 's|"||g' | sed 's|.*var_cpu:-||g' | sed 's|}||g')
|
||||
build_ram=$(echo "$script" | { grep -m 1 "var_ram" || test $? = 1; } | sed 's|.*=||g' | sed 's|"||g' | sed 's|.*var_ram:-||g' | sed 's|}||g')
|
||||
run_cpu=$(echo "$script" | { grep -m 1 "pct set \$CTID -cores" || test $? = 1; } | sed 's|.*cores ||g')
|
||||
run_ram=$(echo "$script" | { grep -m 1 "pct set \$CTID -memory" || test $? = 1; } | sed 's|.*memory ||g')
|
||||
current_cpu=$(echo "$config" | grep -m 1 "cores:" | sed 's|cores: ||g')
|
||||
current_ram=$(echo "$config" | grep -m 1 "memory:" | sed 's|memory: ||g')
|
||||
|
||||
#Test if all values are valid (>0)
|
||||
if [ -z "${run_cpu}" ] || [ "$run_cpu" -le 0 ]; then
|
||||
#echo "No valid value found for run_cpu. Assuming same as current configuration."
|
||||
run_cpu=$current_cpu
|
||||
fi
|
||||
|
||||
if [ -z "${run_ram}" ] || [ "$run_ram" -le 0 ]; then
|
||||
#echo "No valid value found for run_ram. Assuming same as current configuration."
|
||||
run_ram=$current_ram
|
||||
fi
|
||||
|
||||
if [ -z "${build_cpu}" ] || [ "$build_cpu" -le 0 ]; then
|
||||
#echo "No valid value found for build_cpu. Assuming same as current configuration."
|
||||
build_cpu=$current_cpu
|
||||
fi
|
||||
|
||||
if [ -z "${build_ram}" ] || [ "$build_ram" -le 0 ]; then
|
||||
#echo "No valid value found for build_ram. Assuming same as current configuration."
|
||||
build_ram=$current_ram
|
||||
fi
|
||||
|
||||
UPDATE_BUILD_RESOURCES=0
|
||||
if [ "$build_cpu" -gt "$run_cpu" ] || [ "$build_ram" -gt "$run_ram" ]; then
|
||||
UPDATE_BUILD_RESOURCES=1
|
||||
fi
|
||||
|
||||
#3) if build resources are different than run resources, then:
|
||||
if [ "$UPDATE_BUILD_RESOURCES" -eq "1" ]; then
|
||||
pct set "$container" --cores "$build_cpu" --memory "$build_ram"
|
||||
fi
|
||||
|
||||
#4) Update service, using the update command
|
||||
case "$os" in
|
||||
alpine) pct exec "$container" -- ash -c "$UPDATE_CMD" ;;
|
||||
archlinux) pct exec "$container" -- bash -c "$UPDATE_CMD" ;;
|
||||
fedora | rocky | centos | alma) pct exec "$container" -- bash -c "$UPDATE_CMD" ;;
|
||||
ubuntu | debian | devuan) pct exec "$container" -- bash -c "$UPDATE_CMD" ;;
|
||||
opensuse) pct exec "$container" -- bash -c "$UPDATE_CMD" ;;
|
||||
esac
|
||||
exit_code=$?
|
||||
|
||||
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
|
||||
echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n"
|
||||
pct shutdown $container &
|
||||
fi
|
||||
|
||||
#5) if build resources are different than run resources, then:
|
||||
if [ "$UPDATE_BUILD_RESOURCES" -eq "1" ]; then
|
||||
pct set "$container" --cores "$run_cpu" --memory "$run_ram"
|
||||
fi
|
||||
|
||||
if pct exec "$container" -- [ -e "/var/run/reboot-required" ]; then
|
||||
# Get the container's hostname and add it to the list
|
||||
container_hostname=$(pct exec "$container" hostname)
|
||||
containers_needing_reboot+=("$container ($container_hostname)")
|
||||
fi
|
||||
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
msg_ok "Updated container $container"
|
||||
elif [ "$BACKUP_CHOICE" == "yes" ]; then
|
||||
msg_info "Restoring LXC from backup"
|
||||
pct stop $container
|
||||
LXC_STORAGE=$(pct config $container | awk -F '[:,]' '/rootfs/ {print $2}')
|
||||
pct restore $container /var/lib/vz/dump/vzdump-lxc-${container}-*.tar.zst --storage $LXC_STORAGE --force >/dev/null 2>&1
|
||||
pct start $container
|
||||
restorestatus=$?
|
||||
if [ $restorestatus -eq 0 ]; then
|
||||
msg_ok "Restored LXC from backup"
|
||||
else
|
||||
msg_error "Restored LXC from backup failed"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
msg_error "Update failed for container $container. Exiting"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
wait
|
||||
header_info
|
||||
echo -e "${GN}The process is complete, and the containers have been successfully updated.${CL}\n"
|
||||
if [ "${#containers_needing_reboot[@]}" -gt 0 ]; then
|
||||
echo -e "${RD}The following containers require a reboot:${CL}"
|
||||
for container_name in "${containers_needing_reboot[@]}"; do
|
||||
echo "$container_name"
|
||||
done
|
||||
|
||||
# Determine reboot choice based on var_auto_reboot
|
||||
REBOOT_CHOICE="no"
|
||||
if [[ -n "$var_auto_reboot" ]]; then
|
||||
REBOOT_CHOICE="$var_auto_reboot"
|
||||
else
|
||||
echo -ne "${INFO} Do you wish to reboot these containers? <yes/No> "
|
||||
read -r prompt
|
||||
if [[ ${prompt,,} =~ ^(yes)$ ]]; then
|
||||
REBOOT_CHOICE="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$REBOOT_CHOICE" == "yes" ]]; then
|
||||
echo -e "${CROSS}${HOLD} ${YWB}Rebooting containers.${CL}"
|
||||
for container_name in "${containers_needing_reboot[@]}"; do
|
||||
container=$(echo $container_name | cut -d " " -f 1)
|
||||
pct reboot ${container}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user