try api validation

This commit is contained in:
12e70ig
2025-05-07 00:49:01 +02:00
parent 5fd159b812
commit a3f28b1c4f
3 changed files with 115 additions and 5 deletions

42
ct/debian.sh Normal file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://www.debian.org/
APP="Debian"
var_tags="${var_tags:-os}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-2}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
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 /var ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating $APP LXC"
$STD apt-get update
$STD apt-get -y upgrade
msg_ok "Updated $APP LXC"
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"

42
install/debian-install.sh Normal file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
source <(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/misc/build.func)
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://www.debian.org/
APP="Debian"
var_tags="${var_tags:-os}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-2}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
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 /var ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating $APP LXC"
$STD apt-get update
$STD apt-get -y upgrade
msg_ok "Updated $APP LXC"
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"

View File

@ -34,22 +34,48 @@ $STD tar -xzf "$temp_file" -C /opt/huntarr --strip-components=1
# Check if package.json exists
if [ ! -f "/opt/huntarr/package.json" ]; then
msg_info "Looking for package.json in subdirectories"
# Try to find package.json in subdirectories
PACKAGE_DIR=$(find /opt/huntarr -name package.json -type f -print -quit | xargs dirname)
# Use find with better subdirectory exploration - search deeper
PACKAGE_FILES=$(find /opt/huntarr -name package.json -type f -print -quit)
if [ -n "$PACKAGE_DIR" ]; then
if [ -n "$PACKAGE_FILES" ]; then
# Only use dirname when we actually found the file
PACKAGE_DIR=$(dirname "$PACKAGE_FILES")
msg_info "Found package.json in $PACKAGE_DIR"
# Create symlinks or copy files to right locations
cp -R "$PACKAGE_DIR"/* /opt/huntarr/
cd /opt/huntarr
else
# First approach failed, try the backup repository immediately
msg_error "Could not find package.json in the extracted files"
# Attempt to use a specific version that's known to work
msg_info "Trying alternate repository or specific version"
msg_info "Trying backup repository directly"
# Clean up and try alternate repository
rm -rf /opt/huntarr
$STD mkdir -p /opt/huntarr
# Try the known working repository
$STD curl -fsSL "https://github.com/huntarr/huntarr/archive/refs/heads/master.tar.gz" -o "$temp_file"
$STD tar -xzf "$temp_file" -C /opt/huntarr --strip-components=1
# Verify if this worked by listing files
ls -la /opt/huntarr
# If still no package.json, try to look more deeply
if [ ! -f "/opt/huntarr/package.json" ]; then
msg_info "Exploring repository structure"
# Find any package.json files in any subdirectory
DEEP_PACKAGE=$(find /opt/huntarr -name package.json -type f | head -n 1)
if [ -n "$DEEP_PACKAGE" ]; then
DEEP_DIR=$(dirname "$DEEP_PACKAGE")
msg_info "Found package.json in $DEEP_DIR"
# Copy the directory containing package.json to root
cp -R "$DEEP_DIR"/* /opt/huntarr/
else
msg_error "Failed to find package.json anywhere in the repository"
exit 1
fi
fi
cd /opt/huntarr
fi
else