mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-05 06:23:22 +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 to catch any unexpected exits
|
||||||
trap 'echo "[ERROR] Script exited unexpectedly at line $LINENO with exit code $?"' ERR EXIT
|
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))"
|
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
|
# Download and execute in separate steps to avoid stdin issues with piping
|
||||||
install_output=$(timeout 180 pct exec "$vmid" -- bash -c "
|
install_output=$(timeout 180 pct exec "$vmid" -- bash -c "
|
||||||
export API_ID='$api_id'
|
|
||||||
export API_KEY='$api_key'
|
|
||||||
cd /tmp
|
cd /tmp
|
||||||
curl $CURL_FLAGS \
|
curl $CURL_FLAGS \
|
||||||
-H 'X-API-ID: \$API_ID' \
|
-H \"X-API-ID: $api_id\" \
|
||||||
-H 'X-API-KEY: \$API_KEY' \
|
-H \"X-API-KEY: $api_key\" \
|
||||||
-o patchmon-install.sh \
|
-o patchmon-install.sh \
|
||||||
'$PATCHMON_URL/api/v1/hosts/install' && \
|
'$PATCHMON_URL/api/v1/hosts/install' && \
|
||||||
bash patchmon-install.sh && \
|
bash patchmon-install.sh && \
|
||||||
|
|||||||
Reference in New Issue
Block a user