mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-10-23 07:42:05 +00:00
fix: Pass API credentials directly to curl instead of via env vars
This commit is contained in:
@@ -4,7 +4,7 @@ set -euo pipefail # Exit on error, undefined vars, pipe failures
|
||||
# Trap to catch any unexpected exits
|
||||
trap 'echo "[ERROR] Script exited unexpectedly at line $LINENO with exit code $?"' ERR EXIT
|
||||
|
||||
SCRIPT_VERSION="1.0.0-debug.8"
|
||||
SCRIPT_VERSION="1.0.0-debug.9"
|
||||
echo "[DEBUG] Script Version: $SCRIPT_VERSION ($(date +%Y-%m-%d\ %H:%M:%S))"
|
||||
|
||||
# =============================================================================
|
||||
@@ -196,12 +196,10 @@ while IFS= read -r line; do
|
||||
|
||||
# Download and execute in separate steps to avoid stdin issues with piping
|
||||
install_output=$(timeout 180 pct exec "$vmid" -- bash -c "
|
||||
export API_ID='$api_id'
|
||||
export API_KEY='$api_key'
|
||||
cd /tmp
|
||||
curl $CURL_FLAGS \
|
||||
-H 'X-API-ID: \$API_ID' \
|
||||
-H 'X-API-KEY: \$API_KEY' \
|
||||
-H \"X-API-ID: $api_id\" \
|
||||
-H \"X-API-KEY: $api_key\" \
|
||||
-o patchmon-install.sh \
|
||||
'$PATCHMON_URL/api/v1/hosts/install' && \
|
||||
bash patchmon-install.sh && \
|
||||
|
Reference in New Issue
Block a user