mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-23 21:45:56 +01:00
Compare commits
4 Commits
pr-update-
...
add-script
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d845f7bbf | ||
|
|
9e87b79338 | ||
|
|
9c6cd7179a | ||
|
|
64d8ac5f5e |
@@ -418,17 +418,8 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
- #### ✨ New Features
|
||||
|
||||
- memos: unpin version due new release artifacts [@MickLesk](https://github.com/MickLesk) ([#12224](https://github.com/community-scripts/ProxmoxVE/pull/12224))
|
||||
- core: Enhance signal handling, reported "status" and logs [@MickLesk](https://github.com/MickLesk) ([#12216](https://github.com/community-scripts/ProxmoxVE/pull/12216))
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
- booklore v2: embed frontend, bump Java to 25, remove nginx [@MickLesk](https://github.com/MickLesk) ([#12223](https://github.com/community-scripts/ProxmoxVE/pull/12223))
|
||||
|
||||
### 🗑️ Deleted Scripts
|
||||
|
||||
- Remove huntarr [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#12226](https://github.com/community-scripts/ProxmoxVE/pull/12226))
|
||||
|
||||
### 💾 Core
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
@@ -30,7 +30,7 @@ function update_script() {
|
||||
fi
|
||||
|
||||
if check_for_gh_release "booklore" "booklore-app/BookLore"; then
|
||||
JAVA_VERSION="25" setup_java
|
||||
JAVA_VERSION="21" setup_java
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
setup_mariadb
|
||||
setup_yq
|
||||
@@ -60,16 +60,11 @@ function update_script() {
|
||||
$STD npm run build --configuration=production
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Embedding Frontend into Backend"
|
||||
mkdir -p /opt/booklore/booklore-api/src/main/resources/static
|
||||
cp -r /opt/booklore/booklore-ui/dist/booklore/browser/* /opt/booklore/booklore-api/src/main/resources/static/
|
||||
msg_ok "Embedded Frontend into Backend"
|
||||
|
||||
msg_info "Building Backend"
|
||||
cd /opt/booklore/booklore-api
|
||||
APP_VERSION=$(get_latest_github_release "booklore-app/BookLore")
|
||||
yq eval ".app.version = \"${APP_VERSION}\"" -i src/main/resources/application.yaml
|
||||
$STD ./gradlew clean build -x test --no-daemon
|
||||
$STD ./gradlew clean build --no-daemon
|
||||
mkdir -p /opt/booklore/dist
|
||||
JAR_PATH=$(find /opt/booklore/booklore-api/build/libs -maxdepth 1 -type f -name "booklore-api-*.jar" ! -name "*plain*" | head -n1)
|
||||
if [[ -z "$JAR_PATH" ]]; then
|
||||
@@ -79,22 +74,9 @@ function update_script() {
|
||||
cp "$JAR_PATH" /opt/booklore/dist/app.jar
|
||||
msg_ok "Built Backend"
|
||||
|
||||
if systemctl is-active --quiet nginx 2>/dev/null; then
|
||||
msg_info "Removing Nginx (no longer needed)"
|
||||
systemctl disable --now nginx
|
||||
$STD apt-get purge -y nginx nginx-common
|
||||
msg_ok "Removed Nginx"
|
||||
fi
|
||||
|
||||
if ! grep -q "^SERVER_PORT=" /opt/booklore_storage/.env 2>/dev/null; then
|
||||
echo "SERVER_PORT=6060" >>/opt/booklore_storage/.env
|
||||
fi
|
||||
|
||||
sed -i 's|ExecStart=/usr/bin/java -jar|ExecStart=/usr/bin/java -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompactObjectHeaders -jar|' /etc/systemd/system/booklore.service
|
||||
systemctl daemon-reload
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start booklore
|
||||
systemctl reload nginx
|
||||
rm -rf /opt/booklore_bak
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
|
||||
6
ct/headers/huntarr
Normal file
6
ct/headers/huntarr
Normal file
@@ -0,0 +1,6 @@
|
||||
__ __
|
||||
/ /_ __ ______ / /_____ ___________
|
||||
/ __ \/ / / / __ \/ __/ __ `/ ___/ ___/
|
||||
/ / / / /_/ / / / / /_/ /_/ / / / /
|
||||
/_/ /_/\__,_/_/ /_/\__/\__,_/_/ /_/
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
__
|
||||
_________ ____ ____ / /_ ____ ___________
|
||||
/ ___/ __ \/ __ \/ __ \/ __ \/ __ `/ ___/ ___/
|
||||
(__ ) /_/ / / / / /_/ / /_/ / /_/ / / / /
|
||||
/____/\____/_/ /_/\____/_.___/\__,_/_/ /_/
|
||||
|
||||
62
ct/huntarr.sh
Normal file
62
ct/huntarr.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/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: BiluliB
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/plexguide/Huntarr.io
|
||||
|
||||
APP="huntarr"
|
||||
var_tags="${var_tags:-arr}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-4}"
|
||||
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 [[ ! -f /opt/huntarr/main.py ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
if check_for_gh_release "huntarr" "plexguide/Huntarr.io"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop huntarr
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
ensure_dependencies build-essential
|
||||
fetch_and_deploy_gh_release "huntarr" "plexguide/Huntarr.io" "tarball"
|
||||
|
||||
msg_info "Updating Huntarr"
|
||||
cd /opt/huntarr
|
||||
$STD uv pip install -r requirements.txt --python /opt/huntarr/.venv/bin/python
|
||||
msg_ok "Updated Huntarr"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start huntarr
|
||||
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}:9705${CL}"
|
||||
@@ -27,12 +27,12 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if check_for_gh_release "memos" "usememos/memos"; then
|
||||
if check_for_gh_release "memos" "usememos/memos" "v0.25.3"; then
|
||||
msg_info "Stopping service"
|
||||
systemctl stop memos
|
||||
msg_ok "Service stopped"
|
||||
|
||||
fetch_and_deploy_gh_release "memos" "usememos/memos" "prebuild" "latest" "/opt/memos" "memos*linux_amd64.tar.gz"
|
||||
fetch_and_deploy_gh_release "memos" "usememos/memos" "prebuild" "v0.25.3" "/opt/memos" "memos*linux_amd64.tar.gz"
|
||||
|
||||
msg_info "Starting service"
|
||||
systemctl start memos
|
||||
|
||||
55
ct/seaweedfs.sh
Normal file
55
ct/seaweedfs.sh
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/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: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/seaweedfs/seaweedfs
|
||||
|
||||
APP="SeaweedFS"
|
||||
var_tags="${var_tags:-storage;s3;filesystem}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-16}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
var_fuse="${var_fuse:-yes}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /opt/seaweedfs/weed ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "seaweedfs" "seaweedfs/seaweedfs"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop seaweedfs
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "seaweedfs" "seaweedfs/seaweedfs" "prebuild" "latest" "/opt/seaweedfs" "linux_amd64.tar.gz"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start seaweedfs
|
||||
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}:9333${CL}"
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/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: GoldenSpringness
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/Dodelidoo-Labs/sonobarr
|
||||
|
||||
APP="sonobarr"
|
||||
var_tags="${var_tags:-music;discovery}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-20}"
|
||||
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/sonobarr" ]]; then
|
||||
msg_error "No sonobarr Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
if check_for_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop sonobarr
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr" "tarball"
|
||||
|
||||
msg_info "Updating sonobarr"
|
||||
$STD uv venv -c /opt/sonobarr/venv
|
||||
$STD source /opt/sonobarr/venv/bin/activate
|
||||
$STD uv pip install --no-cache-dir -r /opt/sonobarr/requirements.txt
|
||||
sed -i "/release_version/s/=.*/=$(cat ~/.sonobarr)/" /etc/sonobarr/.env
|
||||
msg_ok "Updated sonobarr"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start sonobarr
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}sonobarr setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}"
|
||||
36
frontend/public/json/huntarr.json
Normal file
36
frontend/public/json/huntarr.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "Huntarr",
|
||||
"slug": "huntarr",
|
||||
"categories": [
|
||||
14
|
||||
],
|
||||
"date_created": "2025-06-18",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9705,
|
||||
"documentation": "https://github.com/plexguide/Huntarr.io/wiki",
|
||||
"config_path": "/opt/huntarr",
|
||||
"website": "https://github.com/plexguide/Huntarr.io",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/huntarr.webp",
|
||||
"description": "Huntarr is a tool that automates the search for missing or low-quality media content in your collection. It works seamlessly with applications like Sonarr, Radarr, Lidarr, Readarr, and Whisparr, enhancing their functionality with continuous background scans to identify and update missed or outdated content. Through a user-friendly web interface accessible on port 9705, Huntarr provides real-time statistics, log views, and extensive configuration options. The software is especially useful for users who want to keep their media library up to date by automatically searching for missing episodes or higher-quality versions. Huntarr is well-suited for self-hosted environments and can easily run in LXC containers or Docker setups.",
|
||||
"disable": false,
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/huntarr.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 1024,
|
||||
"hdd": 4,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
}
|
||||
48
frontend/public/json/seaweedfs.json
Normal file
48
frontend/public/json/seaweedfs.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "SeaweedFS",
|
||||
"slug": "seaweedfs",
|
||||
"categories": [
|
||||
11
|
||||
],
|
||||
"date_created": "2026-02-22",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9333,
|
||||
"documentation": "https://github.com/seaweedfs/seaweedfs/wiki",
|
||||
"website": "https://seaweedfs.com/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/seaweedfs.webp",
|
||||
"config_path": "",
|
||||
"description": "SeaweedFS is a fast distributed storage system for blobs, objects, files, and data lakes, with O(1) disk seek, S3 API, FUSE mount, WebDAV, and cloud tiering support.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/seaweedfs.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 16,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Master UI available at port 9333, Filer UI at port 8888, S3 API at port 8333.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Data is stored in /opt/seaweedfs-data.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "FUSE mounting requires fuse3 (pre-installed).",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "Sonobarr",
|
||||
"slug": "sonobarr",
|
||||
"categories": [
|
||||
14
|
||||
],
|
||||
"date_created": "2026-01-21",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 5000,
|
||||
"documentation": "https://github.com/Dodelidoo-Labs/sonobarr",
|
||||
"config_path": "/etc/sonobarr/.env",
|
||||
"website": "https://github.com/Dodelidoo-Labs/sonobarr",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/sonobarr.webp",
|
||||
"description": "Sonobarr marries your existing Lidarr library with Last.fm’s discovery graph to surface artists you'll actually like. It runs as a Flask + Socket.IO application, ships with a polished Bootstrap UI, and includes admin tooling so folks can share a single instance safely.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/sonobarr.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 1024,
|
||||
"hdd": 20,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Default generated admin password is in the env file (sonobarr_superadmin_password)",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,7 +13,11 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
JAVA_VERSION="25" setup_java
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y nginx
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
JAVA_VERSION="21" setup_java
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
setup_mariadb
|
||||
setup_yq
|
||||
@@ -26,11 +30,6 @@ $STD npm install --force
|
||||
$STD npm run build --configuration=production
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Embedding Frontend into Backend"
|
||||
mkdir -p /opt/booklore/booklore-api/src/main/resources/static
|
||||
cp -r /opt/booklore/booklore-ui/dist/booklore/browser/* /opt/booklore/booklore-api/src/main/resources/static/
|
||||
msg_ok "Embedded Frontend into Backend"
|
||||
|
||||
msg_info "Creating Environment"
|
||||
mkdir -p /opt/booklore_storage/{data,books,bookdrop}
|
||||
cat <<EOF >/opt/booklore_storage/.env
|
||||
@@ -42,7 +41,6 @@ DATABASE_PASSWORD=${MARIADB_DB_PASS}
|
||||
# App Configuration (Spring Boot mapping from app.* properties)
|
||||
APP_PATH_CONFIG=/opt/booklore_storage/data
|
||||
APP_BOOKDROP_FOLDER=/opt/booklore_storage/bookdrop
|
||||
SERVER_PORT=6060
|
||||
EOF
|
||||
msg_ok "Created Environment"
|
||||
|
||||
@@ -50,7 +48,7 @@ msg_info "Building Backend"
|
||||
cd /opt/booklore/booklore-api
|
||||
APP_VERSION=$(get_latest_github_release "booklore-app/BookLore")
|
||||
yq eval ".app.version = \"${APP_VERSION}\"" -i src/main/resources/application.yaml
|
||||
$STD ./gradlew clean build -x test --no-daemon
|
||||
$STD ./gradlew clean build --no-daemon
|
||||
mkdir -p /opt/booklore/dist
|
||||
JAR_PATH=$(find /opt/booklore/booklore-api/build/libs -maxdepth 1 -type f -name "booklore-api-*.jar" ! -name "*plain*" | head -n1)
|
||||
if [[ -z "$JAR_PATH" ]]; then
|
||||
@@ -60,6 +58,16 @@ fi
|
||||
cp "$JAR_PATH" /opt/booklore/dist/app.jar
|
||||
msg_ok "Built Backend"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
rm -rf /usr/share/nginx/html
|
||||
ln -s /opt/booklore/booklore-ui/dist/booklore/browser /usr/share/nginx/html
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
cp /opt/booklore/nginx.conf /etc/nginx/nginx.conf
|
||||
sed -i 's/listen \${BOOKLORE_PORT};/listen 6060;/' /etc/nginx/nginx.conf
|
||||
sed -i 's/listen \[::\]:${BOOKLORE_PORT};/listen [::]:6060;/' /etc/nginx/nginx.conf
|
||||
systemctl restart nginx
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/booklore.service
|
||||
[Unit]
|
||||
@@ -70,7 +78,7 @@ After=network.target mariadb.service
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/booklore/dist
|
||||
ExecStart=/usr/bin/java -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompactObjectHeaders -jar /opt/booklore/dist/app.jar
|
||||
ExecStart=/usr/bin/java -jar /opt/booklore/dist/app.jar
|
||||
EnvironmentFile=/opt/booklore_storage/.env
|
||||
SuccessExitStatus=143
|
||||
TimeoutStopSec=10
|
||||
|
||||
45
install/huntarr-install.sh
Normal file
45
install/huntarr-install.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: BiluliB
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/plexguide/Huntarr.io
|
||||
|
||||
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
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
fetch_and_deploy_gh_release "huntarr" "plexguide/Huntarr.io" "tarball"
|
||||
|
||||
msg_info "Configure Huntarr"
|
||||
$STD uv venv --clear /opt/huntarr/.venv
|
||||
$STD uv pip install --python /opt/huntarr/.venv/bin/python -r /opt/huntarr/requirements.txt
|
||||
msg_ok "Configured Huntrarr"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/huntarr.service
|
||||
[Unit]
|
||||
Description=Huntarr Service
|
||||
After=network.target
|
||||
[Service]
|
||||
WorkingDirectory=/opt/huntarr
|
||||
ExecStart=/opt/huntarr/.venv/bin/python /opt/huntarr/main.py
|
||||
Restart=always
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now huntarr
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -14,7 +14,7 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "memos" "usememos/memos" "prebuild" "latest" "/opt/memos" "memos*linux_amd64.tar.gz"
|
||||
fetch_and_deploy_gh_release "memos" "usememos/memos" "prebuild" "v0.25.3" "/opt/memos" "memos*linux_amd64.tar.gz"
|
||||
mkdir -p /opt/memos_data
|
||||
|
||||
msg_info "Creating Service"
|
||||
|
||||
51
install/seaweedfs-install.sh
Normal file
51
install/seaweedfs-install.sh
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/seaweedfs/seaweedfs
|
||||
|
||||
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 \
|
||||
fuse3
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
fetch_and_deploy_gh_release "seaweedfs" "seaweedfs/seaweedfs" "prebuild" "latest" "/opt/seaweedfs" "linux_amd64.tar.gz"
|
||||
|
||||
msg_info "Setting up SeaweedFS"
|
||||
mkdir -p /opt/seaweedfs-data
|
||||
ln -sf /opt/seaweedfs/weed /usr/local/bin/weed
|
||||
msg_ok "Set up SeaweedFS"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/seaweedfs.service
|
||||
[Unit]
|
||||
Description=SeaweedFS Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/seaweedfs
|
||||
ExecStart=/opt/seaweedfs/weed server -dir=/opt/seaweedfs-data -master.port=9333 -volume.port=8080 -filer -s3
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
LimitNOFILE=65536
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now seaweedfs
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: GoldenSpringness
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/Dodelidoo-Labs/sonobarr
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr" "tarball"
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
msg_info "Setting up sonobarr"
|
||||
$STD uv venv -c /opt/sonobarr/venv
|
||||
source /opt/sonobarr/venv/bin/activate
|
||||
$STD uv pip install --no-cache-dir -r /opt/sonobarr/requirements.txt
|
||||
mkdir -p /etc/sonobarr
|
||||
mv /opt/sonobarr/.sample-env /etc/sonobarr/.env
|
||||
sed -i "s/^secret_key=.*/secret_key=$(openssl rand -hex 16)/" /etc/sonobarr/.env
|
||||
sed -i "s/^sonobarr_superadmin_password=.*/sonobarr_superadmin_password=$(openssl rand -hex 16)/" /etc/sonobarr/.env
|
||||
echo "release_version=$(cat ~/.sonobarr)" >>/etc/sonobarr/.env
|
||||
echo "sonobarr_config_dir=/etc/sonobarr" >>/etc/sonobarr.env
|
||||
msg_ok "Set up sonobarr"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/sonobarr.service
|
||||
[Unit]
|
||||
Description=sonobarr Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/sonobarr/src
|
||||
EnvironmentFile=/etc/sonobarr/.env
|
||||
Environment="PATH=/opt/sonobarr/venv/bin"
|
||||
ExecStart=/bin/bash -c 'gunicorn Sonobarr:app -c ../gunicorn_config.py'
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now sonobarr
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -25,9 +25,7 @@ get_lxc_ip
|
||||
# post_progress_to_api()
|
||||
#
|
||||
# - Lightweight progress ping from inside the container
|
||||
# - Updates the existing telemetry record status
|
||||
# - Arguments:
|
||||
# * $1: status (optional, default: "configuring")
|
||||
# - Updates the existing telemetry record status from "installing" to "configuring"
|
||||
# - Signals that the installation is actively progressing (not stuck)
|
||||
# - Fire-and-forget: never blocks or fails the script
|
||||
# - Only executes if DIAGNOSTICS=yes and RANDOM_UUID is set
|
||||
@@ -37,11 +35,9 @@ post_progress_to_api() {
|
||||
[[ "${DIAGNOSTICS:-no}" == "no" ]] && return 0
|
||||
[[ -z "${RANDOM_UUID:-}" ]] && return 0
|
||||
|
||||
local progress_status="${1:-configuring}"
|
||||
|
||||
curl -fsS -m 5 -X POST "https://telemetry.community-scripts.org/telemetry" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"execution_id\":\"${EXECUTION_ID:-${RANDOM_UUID}}\",\"type\":\"lxc\",\"nsapp\":\"${app:-unknown}\",\"status\":\"${progress_status}\"}" &>/dev/null || true
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"execution_id\":\"${EXECUTION_ID:-${RANDOM_UUID}}\",\"type\":\"lxc\",\"nsapp\":\"${app:-unknown}\",\"status\":\"configuring\"}" &>/dev/null || true
|
||||
}
|
||||
|
||||
# This function enables IPv6 if it's not disabled and sets verbose mode
|
||||
|
||||
@@ -35,11 +35,7 @@
|
||||
TELEMETRY_URL="https://telemetry.community-scripts.org/telemetry"
|
||||
|
||||
# Timeout for telemetry requests (seconds)
|
||||
# Progress pings (validation/configuring) use the short timeout
|
||||
TELEMETRY_TIMEOUT=5
|
||||
# Final status updates (success/failed) use the longer timeout
|
||||
# PocketBase may need more time under load (FindRecord + UpdateRecord)
|
||||
STATUS_TIMEOUT=10
|
||||
|
||||
# ==============================================================================
|
||||
# SECTION 0: REPOSITORY SOURCE DETECTION
|
||||
@@ -745,10 +741,7 @@ EOF
|
||||
# post_progress_to_api()
|
||||
#
|
||||
# - Lightweight progress ping from host or container
|
||||
# - Updates the existing telemetry record status
|
||||
# - Arguments:
|
||||
# * $1: status (optional, default: "configuring")
|
||||
# Valid values: "validation", "configuring"
|
||||
# - Updates the existing telemetry record status to "configuring"
|
||||
# - Signals that the installation is actively progressing (not stuck)
|
||||
# - Fire-and-forget: never blocks or fails the script
|
||||
# - Only executes if DIAGNOSTICS=yes and RANDOM_UUID is set
|
||||
@@ -759,13 +752,12 @@ post_progress_to_api() {
|
||||
[[ "${DIAGNOSTICS:-no}" == "no" ]] && return 0
|
||||
[[ -z "${RANDOM_UUID:-}" ]] && return 0
|
||||
|
||||
local progress_status="${1:-configuring}"
|
||||
local app_name="${NSAPP:-${app:-unknown}}"
|
||||
local telemetry_type="${TELEMETRY_TYPE:-lxc}"
|
||||
|
||||
curl -fsS -m 5 -X POST "${TELEMETRY_URL:-https://telemetry.community-scripts.org/telemetry}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"execution_id\":\"${EXECUTION_ID:-${RANDOM_UUID}}\",\"type\":\"${telemetry_type}\",\"nsapp\":\"${app_name}\",\"status\":\"${progress_status}\"}" &>/dev/null || true
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"execution_id\":\"${EXECUTION_ID:-${RANDOM_UUID}}\",\"type\":\"${telemetry_type}\",\"nsapp\":\"${app_name}\",\"status\":\"configuring\"}" &>/dev/null || true
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -901,7 +893,7 @@ post_update_to_api() {
|
||||
EOF
|
||||
)
|
||||
|
||||
http_code=$(curl -sS -w "%{http_code}" -m "${STATUS_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
http_code=$(curl -sS -w "%{http_code}" -m "${TELEMETRY_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$JSON_PAYLOAD" -o /dev/null 2>/dev/null) || http_code="000"
|
||||
|
||||
@@ -944,7 +936,7 @@ EOF
|
||||
EOF
|
||||
)
|
||||
|
||||
http_code=$(curl -sS -w "%{http_code}" -m "${STATUS_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
http_code=$(curl -sS -w "%{http_code}" -m "${TELEMETRY_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$RETRY_PAYLOAD" -o /dev/null 2>/dev/null) || http_code="000"
|
||||
|
||||
@@ -972,18 +964,12 @@ EOF
|
||||
EOF
|
||||
)
|
||||
|
||||
http_code=$(curl -sS -w "%{http_code}" -m "${STATUS_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
curl -sS -w "%{http_code}" -m "${TELEMETRY_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$MINIMAL_PAYLOAD" -o /dev/null 2>/dev/null) || http_code="000"
|
||||
-d "$MINIMAL_PAYLOAD" -o /dev/null 2>/dev/null || true
|
||||
|
||||
if [[ "$http_code" =~ ^2[0-9]{2}$ ]]; then
|
||||
POST_UPDATE_DONE=true
|
||||
return 0
|
||||
fi
|
||||
|
||||
# All 3 attempts failed — do NOT set POST_UPDATE_DONE=true.
|
||||
# This allows the EXIT trap (api_exit_script) to retry with 3 fresh attempts.
|
||||
# No infinite loop risk: EXIT trap fires exactly once.
|
||||
# Tried 3 times - mark as done regardless to prevent infinite loops
|
||||
POST_UPDATE_DONE=true
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
@@ -1359,27 +1345,9 @@ post_update_to_api_extended() {
|
||||
EOF
|
||||
)
|
||||
|
||||
local http_code
|
||||
http_code=$(curl -sS -w "%{http_code}" -m "${STATUS_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
curl -fsS -m "${TELEMETRY_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$JSON_PAYLOAD" -o /dev/null 2>/dev/null) || http_code="000"
|
||||
-d "$JSON_PAYLOAD" &>/dev/null || true
|
||||
|
||||
if [[ "$http_code" =~ ^2[0-9]{2}$ ]]; then
|
||||
POST_UPDATE_DONE=true
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Retry with minimal payload
|
||||
sleep 1
|
||||
http_code=$(curl -sS -w "%{http_code}" -m "${STATUS_TIMEOUT}" -X POST "${TELEMETRY_URL}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"execution_id\":\"${EXECUTION_ID:-${RANDOM_UUID}}\",\"type\":\"${TELEMETRY_TYPE:-lxc}\",\"nsapp\":\"${NSAPP:-unknown}\",\"status\":\"${pb_status}\",\"exit_code\":${exit_code},\"install_duration\":${duration:-0}}" \
|
||||
-o /dev/null 2>/dev/null) || http_code="000"
|
||||
|
||||
if [[ "$http_code" =~ ^2[0-9]{2}$ ]]; then
|
||||
POST_UPDATE_DONE=true
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Do NOT set POST_UPDATE_DONE=true — let EXIT trap retry
|
||||
POST_UPDATE_DONE=true
|
||||
}
|
||||
|
||||
@@ -3578,13 +3578,6 @@ build_container() {
|
||||
# DEV_MODE exports (optional, for debugging)
|
||||
export BUILD_LOG="$BUILD_LOG"
|
||||
export INSTALL_LOG="/root/.install-${SESSION_ID}.log"
|
||||
|
||||
# Keep host-side logging on BUILD_LOG (not exported — invisible to container)
|
||||
# Without this, get_active_logfile() would return INSTALL_LOG (a container path)
|
||||
# and all host msg_info/msg_ok/msg_error would write to /root/.install-SESSION.log
|
||||
# on the HOST instead of BUILD_LOG, causing incomplete telemetry logs.
|
||||
_HOST_LOGFILE="$BUILD_LOG"
|
||||
|
||||
export dev_mode="${dev_mode:-}"
|
||||
export DEV_MODE_MOTD="${DEV_MODE_MOTD:-false}"
|
||||
export DEV_MODE_KEEP="${DEV_MODE_KEEP:-false}"
|
||||
@@ -3671,9 +3664,6 @@ $PCT_OPTIONS_STRING"
|
||||
|
||||
create_lxc_container || exit $?
|
||||
|
||||
# Transition to 'configuring' — container created, now setting up OS/userland
|
||||
post_progress_to_api "configuring"
|
||||
|
||||
LXC_CONFIG="/etc/pve/lxc/${CTID}.conf"
|
||||
|
||||
# ============================================================================
|
||||
@@ -3915,6 +3905,7 @@ EOF
|
||||
for i in {1..10}; do
|
||||
if pct status "$CTID" | grep -q "status: running"; then
|
||||
msg_ok "Started LXC Container"
|
||||
post_progress_to_api # Signal container is running
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
@@ -3969,6 +3960,7 @@ EOF
|
||||
echo -e "${YW}Container may have limited internet access. Installation will continue...${CL}"
|
||||
else
|
||||
msg_ok "Network in LXC is reachable (ping)"
|
||||
post_progress_to_api # Signal network is ready
|
||||
fi
|
||||
fi
|
||||
# Function to get correct GID inside container
|
||||
@@ -4040,6 +4032,7 @@ EOF'
|
||||
fi
|
||||
|
||||
msg_ok "Customized LXC Container"
|
||||
post_progress_to_api # Signal ready for app installation
|
||||
|
||||
# Optional DNS override for retry scenarios (inside LXC, never on host)
|
||||
if [[ "${DNS_RETRY_OVERRIDE:-false}" == "true" ]]; then
|
||||
@@ -4064,15 +4057,8 @@ EOF'
|
||||
# that sends "configuring" status AFTER the host already reported "failed"
|
||||
export CONTAINER_INSTALLING=true
|
||||
|
||||
# Capture lxc-attach terminal output to host-side log via tee.
|
||||
# This is the ONLY reliable way to get install output when:
|
||||
# - install.func fails to load (DNS error) → no container-side logging
|
||||
# - install script crashes before logging starts
|
||||
# - $STD/silent() not used for some commands
|
||||
# PIPESTATUS[0] gets the real exit code from lxc-attach (not from tee).
|
||||
local _LXC_CAPTURE_LOG="/tmp/.install-capture-${SESSION_ID}.log"
|
||||
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/${var_install}.sh)" 2>&1 | tee "$_LXC_CAPTURE_LOG"
|
||||
local lxc_exit=${PIPESTATUS[0]}
|
||||
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/${var_install}.sh)"
|
||||
local lxc_exit=$?
|
||||
|
||||
unset CONTAINER_INSTALLING
|
||||
|
||||
@@ -4130,17 +4116,7 @@ EOF'
|
||||
|
||||
# Copy and append INSTALL_LOG from container (with timeout to prevent hangs)
|
||||
local temp_install_log="/tmp/.install-temp-${SESSION_ID}.log"
|
||||
local container_log_ok=false
|
||||
if timeout 8 pct pull "$CTID" "/root/.install-${SESSION_ID}.log" "$temp_install_log" 2>/dev/null; then
|
||||
# Only use container log if it has meaningful content (>100 bytes)
|
||||
if [[ -s "$temp_install_log" ]] && [[ $(stat -c%s "$temp_install_log" 2>/dev/null || echo 0) -gt 100 ]]; then
|
||||
container_log_ok=true
|
||||
fi
|
||||
fi
|
||||
|
||||
# PHASE 2: Use container-side log if available, otherwise use host-captured tee output
|
||||
local _LXC_CAPTURE_LOG="/tmp/.install-capture-${SESSION_ID}.log"
|
||||
if [[ "$container_log_ok" == true ]]; then
|
||||
{
|
||||
echo "================================================================================"
|
||||
echo "PHASE 2: APPLICATION INSTALLATION (Container)"
|
||||
@@ -4148,25 +4124,9 @@ EOF'
|
||||
cat "$temp_install_log"
|
||||
echo ""
|
||||
} >>"$combined_log"
|
||||
rm -f "$temp_install_log"
|
||||
install_log_copied=true
|
||||
elif [[ -s "$_LXC_CAPTURE_LOG" ]]; then
|
||||
# Fallback: host-captured terminal output from lxc-attach
|
||||
# This captures everything the user saw, including errors when install.func
|
||||
# failed to load (DNS issues, etc.) and no container-side logging was set up.
|
||||
{
|
||||
echo "================================================================================"
|
||||
echo "PHASE 2: APPLICATION INSTALLATION (Container - captured from terminal)"
|
||||
echo "================================================================================"
|
||||
# Strip ANSI escape codes from terminal capture
|
||||
sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' "$_LXC_CAPTURE_LOG" | sed 's/\r$//'
|
||||
echo ""
|
||||
} >>"$combined_log"
|
||||
install_log_copied=true
|
||||
fi
|
||||
rm -f "$temp_install_log"
|
||||
|
||||
if [[ "$install_log_copied" == true ]]; then
|
||||
# Point INSTALL_LOG to combined log so get_full_log() finds it
|
||||
# Point INSTALL_LOG to combined log so get_error_text() finds it
|
||||
INSTALL_LOG="$combined_log"
|
||||
fi
|
||||
fi
|
||||
@@ -4426,9 +4386,8 @@ EOF'
|
||||
# Re-run install script in existing container (don't destroy/recreate)
|
||||
set +Eeuo pipefail
|
||||
trap - ERR
|
||||
local _LXC_CAPTURE_LOG="/tmp/.install-capture-${SESSION_ID}.log"
|
||||
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/${var_install}.sh)" 2>&1 | tee "$_LXC_CAPTURE_LOG"
|
||||
local apt_retry_exit=${PIPESTATUS[0]}
|
||||
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/${var_install}.sh)"
|
||||
local apt_retry_exit=$?
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
|
||||
@@ -4534,9 +4493,6 @@ EOF'
|
||||
exit $install_exit_code
|
||||
fi
|
||||
|
||||
# Clean up host-side capture log (not needed on success, already in combined_log on failure)
|
||||
rm -f "/tmp/.install-capture-${SESSION_ID}.log" 2>/dev/null
|
||||
|
||||
# Re-enable error handling after successful install or recovery menu completion
|
||||
set -Eeuo pipefail
|
||||
trap 'error_handler' ERR
|
||||
@@ -4947,9 +4903,6 @@ create_lxc_container() {
|
||||
# Report installation start to API early - captures failures in storage/template/create
|
||||
post_to_api
|
||||
|
||||
# Transition to 'validation' — Proxmox-internal checks (storage, template, cluster)
|
||||
post_progress_to_api "validation"
|
||||
|
||||
# Storage capability check
|
||||
check_storage_support "rootdir" || {
|
||||
msg_error "No valid storage found for 'rootdir' [Container]"
|
||||
@@ -5479,6 +5432,7 @@ create_lxc_container() {
|
||||
}
|
||||
|
||||
msg_ok "LXC Container ${BL}$CTID${CL} ${GN}was successfully created."
|
||||
post_progress_to_api # Signal container creation complete
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
|
||||
@@ -395,20 +395,12 @@ ssh_check() {
|
||||
# get_active_logfile()
|
||||
#
|
||||
# - Returns the appropriate log file based on execution context
|
||||
# - _HOST_LOGFILE: Override for host context (keeps host logging on BUILD_LOG
|
||||
# even after INSTALL_LOG is exported for the container)
|
||||
# - INSTALL_LOG: Container operations (application installation)
|
||||
# - BUILD_LOG: Host operations (container creation)
|
||||
# - INSTALL_LOG: Container operations (application installation)
|
||||
# - Fallback to BUILD_LOG if neither is set
|
||||
# ------------------------------------------------------------------------------
|
||||
get_active_logfile() {
|
||||
# Host override: _HOST_LOGFILE is set (not exported) in build.func to keep
|
||||
# host-side logging in BUILD_LOG after INSTALL_LOG is exported for the container.
|
||||
# Without this, all host msg_info/msg_ok/msg_error would write to
|
||||
# /root/.install-SESSION.log (a container path) instead of BUILD_LOG.
|
||||
if [[ -n "${_HOST_LOGFILE:-}" ]]; then
|
||||
echo "$_HOST_LOGFILE"
|
||||
elif [[ -n "${INSTALL_LOG:-}" ]]; then
|
||||
if [[ -n "${INSTALL_LOG:-}" ]]; then
|
||||
echo "$INSTALL_LOG"
|
||||
elif [[ -n "${BUILD_LOG:-}" ]]; then
|
||||
echo "$BUILD_LOG"
|
||||
@@ -488,7 +480,7 @@ log_section() {
|
||||
# silent()
|
||||
#
|
||||
# - Executes command with output redirected to active log file
|
||||
# - On error: displays last 20 lines of log and exits with original exit code
|
||||
# - On error: displays last 10 lines of log and exits with original exit code
|
||||
# - Temporarily disables error trap to capture exit code correctly
|
||||
# - Sources explain_exit_code() for detailed error messages
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -530,8 +522,8 @@ silent() {
|
||||
msg_custom "→" "${YWB}" "${cmd}"
|
||||
|
||||
if [[ -s "$logfile" ]]; then
|
||||
echo -e "\n${TAB}--- Last 20 lines of log ---"
|
||||
tail -n 20 "$logfile"
|
||||
echo -e "\n${TAB}--- Last 10 lines of log ---"
|
||||
tail -n 10 "$logfile"
|
||||
echo -e "${TAB}-----------------------------------"
|
||||
echo -e "${TAB}📋 Full log: ${logfile}\n"
|
||||
fi
|
||||
@@ -1505,7 +1497,7 @@ cleanup_lxc() {
|
||||
fi
|
||||
|
||||
msg_ok "Cleaned"
|
||||
|
||||
|
||||
# Send progress ping if available (defined in install.func)
|
||||
if declare -f post_progress_to_api &>/dev/null; then
|
||||
post_progress_to_api
|
||||
|
||||
@@ -51,9 +51,7 @@ get_lxc_ip
|
||||
# post_progress_to_api()
|
||||
#
|
||||
# - Lightweight progress ping from inside the container
|
||||
# - Updates the existing telemetry record status
|
||||
# - Arguments:
|
||||
# * $1: status (optional, default: "configuring")
|
||||
# - Updates the existing telemetry record status from "installing" to "configuring"
|
||||
# - Signals that the installation is actively progressing (not stuck)
|
||||
# - Fire-and-forget: never blocks or fails the script
|
||||
# - Only executes if DIAGNOSTICS=yes and RANDOM_UUID is set
|
||||
@@ -63,11 +61,9 @@ post_progress_to_api() {
|
||||
[[ "${DIAGNOSTICS:-no}" == "no" ]] && return 0
|
||||
[[ -z "${RANDOM_UUID:-}" ]] && return 0
|
||||
|
||||
local progress_status="${1:-configuring}"
|
||||
|
||||
curl -fsS -m 5 -X POST "https://telemetry.community-scripts.org/telemetry" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"execution_id\":\"${EXECUTION_ID:-${RANDOM_UUID}}\",\"type\":\"lxc\",\"nsapp\":\"${app:-unknown}\",\"status\":\"${progress_status}\"}" &>/dev/null || true
|
||||
-d "{\"random_id\":\"${RANDOM_UUID}\",\"execution_id\":\"${EXECUTION_ID:-${RANDOM_UUID}}\",\"type\":\"lxc\",\"nsapp\":\"${app:-unknown}\",\"status\":\"configuring\"}" &>/dev/null || true
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
|
||||
@@ -169,7 +169,7 @@ get_active_logfile() {
|
||||
# silent()
|
||||
#
|
||||
# - Executes command with output redirected to active log file
|
||||
# - On error: displays last 20 lines of log and exits with original exit code
|
||||
# - On error: displays last 10 lines of log and exits with original exit code
|
||||
# - Temporarily disables error trap to capture exit code correctly
|
||||
# - Sources explain_exit_code() for detailed error messages
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -207,8 +207,8 @@ silent() {
|
||||
msg_custom "→" "${YWB}" "${cmd}"
|
||||
|
||||
if [[ -s "$logfile" ]]; then
|
||||
echo -e "\n${TAB}--- Last 20 lines of log ---"
|
||||
tail -n 20 "$logfile"
|
||||
echo -e "\n${TAB}--- Last 10 lines of log ---"
|
||||
tail -n 10 "$logfile"
|
||||
echo -e "${TAB}----------------------------\n"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user