mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-08 20:32:49 +00:00
Compare commits
5 Commits
update_ver
...
MickLesk-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c2b9d2513 | ||
|
|
34dac86b4b | ||
|
|
db29b241a9 | ||
|
|
528575f737 | ||
|
|
ac05febbbd |
@@ -16,6 +16,7 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- MediaManager: add LOG_FILE to start.sh script; fix BASE_PATH and PUBLIC_API_URL [@vhsdream](https://github.com/vhsdream) ([#8981](https://github.com/community-scripts/ProxmoxVE/pull/8981))
|
||||
- Firefly: Fix missing command in update script [@tremor021](https://github.com/tremor021) ([#8972](https://github.com/community-scripts/ProxmoxVE/pull/8972))
|
||||
- MongoDB: Remove unused message [@tremor021](https://github.com/tremor021) ([#8969](https://github.com/community-scripts/ProxmoxVE/pull/8969))
|
||||
- Set TZ=Etc/UTC in Ghostfolio installation script [@LuloDev](https://github.com/LuloDev) ([#8961](https://github.com/community-scripts/ProxmoxVE/pull/8961))
|
||||
|
||||
@@ -40,19 +40,24 @@ function update_script() {
|
||||
MM_DIR="/opt/mm"
|
||||
export CONFIG_DIR="${MM_DIR}/config"
|
||||
export FRONTEND_FILES_DIR="${MM_DIR}/web/build"
|
||||
export BASE_PATH=""
|
||||
export PUBLIC_VERSION=""
|
||||
export PUBLIC_API_URL=""
|
||||
export BASE_PATH="/web"
|
||||
cd /opt/mediamanager/web
|
||||
$STD npm ci
|
||||
$STD npm ci --no-fund --no-audit
|
||||
$STD npm run build
|
||||
rm -rf "$FRONTEND_FILES_DIR"/build
|
||||
cp -r build "$FRONTEND_FILES_DIR"
|
||||
export BASE_PATH=""
|
||||
export VIRTUAL_ENV="/opt/${MM_DIR}/venv"
|
||||
cd /opt/mediamanager
|
||||
rm -rf "$MM_DIR"/{media_manager,alembic*}
|
||||
cp -r {media_manager,alembic*} "$MM_DIR"
|
||||
$STD /usr/local/bin/uv sync --locked --active -n -p cpython3.13 --managed-python
|
||||
if ! grep -q "LOG_FILE" "$MM_DIR"/start.sh; then
|
||||
sed -i "\|build\"$|a\export LOG_FILE=\"$CONFIG_DIR/media_manager.log\"" "$MM_DIR"/start.sh
|
||||
fi
|
||||
|
||||
msg_ok "Updated $APP"
|
||||
|
||||
msg_info "Starting Service"
|
||||
|
||||
@@ -45,15 +45,15 @@ MM_DIR="/opt/mm"
|
||||
MEDIA_DIR="${MM_DIR}/media"
|
||||
export CONFIG_DIR="${MM_DIR}/config"
|
||||
export FRONTEND_FILES_DIR="${MM_DIR}/web/build"
|
||||
export BASE_PATH=""
|
||||
export PUBLIC_VERSION=""
|
||||
export PUBLIC_API_URL=""
|
||||
export BASE_PATH=""
|
||||
export BASE_PATH="/web"
|
||||
cd /opt/mediamanager/web
|
||||
$STD npm ci
|
||||
$STD npm ci --no-fund --no-audit
|
||||
$STD npm run build
|
||||
mkdir -p {"$MM_DIR"/web,"$MEDIA_DIR","$CONFIG_DIR"}
|
||||
cp -r build "$FRONTEND_FILES_DIR"
|
||||
export BASE_PATH=""
|
||||
export VIRTUAL_ENV="${MM_DIR}/venv"
|
||||
cd /opt/mediamanager
|
||||
cp -r {media_manager,alembic*} "$MM_DIR"
|
||||
@@ -81,8 +81,9 @@ cat <<EOF >"$MM_DIR"/start.sh
|
||||
|
||||
export CONFIG_DIR="$CONFIG_DIR"
|
||||
export FRONTEND_FILES_DIR="$FRONTEND_FILES_DIR"
|
||||
export LOG_FILE="$CONFIG_DIR/media_manager.log"
|
||||
export BASE_PATH=""
|
||||
cd "$MM_DIR"
|
||||
cd $MM_DIR
|
||||
source ./venv/bin/activate
|
||||
/usr/local/bin/uv run alembic upgrade head
|
||||
/usr/local/bin/uv run fastapi run ./media_manager/main.py --port 8000
|
||||
|
||||
@@ -1198,8 +1198,8 @@ ensure_apt_working() {
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Standardized deb822 repository setup
|
||||
# Validates all parameters and fails safely if any are empty
|
||||
# Standardized deb822 repository setup (with optional Architectures)
|
||||
# Always runs apt update after repo creation to ensure package availability
|
||||
# ------------------------------------------------------------------------------
|
||||
setup_deb822_repo() {
|
||||
local name="$1"
|
||||
@@ -1207,56 +1207,40 @@ setup_deb822_repo() {
|
||||
local repo_url="$3"
|
||||
local suite="$4"
|
||||
local component="${5:-main}"
|
||||
local architectures="${6:-$(dpkg --print-architecture)}"
|
||||
local architectures="$6" # optional
|
||||
|
||||
# Validate required parameters
|
||||
if [[ -z "$name" || -z "$gpg_url" || -z "$repo_url" || -z "$suite" ]]; then
|
||||
msg_error "setup_deb822_repo: missing required parameters (name=$name, gpg=$gpg_url, repo=$repo_url, suite=$suite)"
|
||||
msg_error "setup_deb822_repo: missing required parameters (name=$name repo=$repo_url suite=$suite)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Cleanup old configs for this app
|
||||
# Cleanup
|
||||
cleanup_old_repo_files "$name"
|
||||
|
||||
# Cleanup any orphaned .sources files from other apps
|
||||
cleanup_orphaned_sources
|
||||
|
||||
# Ensure keyring directory exists
|
||||
mkdir -p /etc/apt/keyrings || {
|
||||
msg_error "Failed to create /etc/apt/keyrings directory"
|
||||
msg_error "Failed to create /etc/apt/keyrings"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Download GPG key (with --yes to avoid interactive prompts)
|
||||
curl -fsSL "$gpg_url" | gpg --dearmor --yes -o "/etc/apt/keyrings/${name}.gpg" 2>/dev/null || {
|
||||
msg_error "Failed to download or import GPG key for ${name} from $gpg_url"
|
||||
# Import GPG
|
||||
curl -fsSL "$gpg_url" | gpg --dearmor --yes -o "/etc/apt/keyrings/${name}.gpg" || {
|
||||
msg_error "Failed to import GPG key for ${name}"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Create deb822 sources file
|
||||
cat <<EOF >/etc/apt/sources.list.d/${name}.sources
|
||||
Types: deb
|
||||
URIs: $repo_url
|
||||
Suites: $suite
|
||||
Components: $component
|
||||
Architectures: $architectures
|
||||
Signed-By: /etc/apt/keyrings/${name}.gpg
|
||||
EOF
|
||||
# Write deb822
|
||||
{
|
||||
echo "Types: deb"
|
||||
echo "URIs: $repo_url"
|
||||
echo "Suites: $suite"
|
||||
echo "Components: $component"
|
||||
[[ -n "$architectures" ]] && echo "Architectures: $architectures"
|
||||
echo "Signed-By: /etc/apt/keyrings/${name}.gpg"
|
||||
} >/etc/apt/sources.list.d/${name}.sources
|
||||
|
||||
# Use cached apt update
|
||||
local apt_cache_file="/var/cache/apt-update-timestamp"
|
||||
local current_time=$(date +%s)
|
||||
local last_update=0
|
||||
|
||||
if [[ -f "$apt_cache_file" ]]; then
|
||||
last_update=$(cat "$apt_cache_file" 2>/dev/null || echo 0)
|
||||
fi
|
||||
|
||||
# For repo changes, always update but respect short-term cache (30s)
|
||||
if ((current_time - last_update > 30)); then
|
||||
$STD apt update
|
||||
echo "$current_time" >"$apt_cache_file"
|
||||
fi
|
||||
$STD apt update
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user