fix: auto-fix linting issues

This commit is contained in:
alexbelgium
2025-08-17 00:34:15 +00:00
committed by github-actions[bot]
parent 205a7e9b84
commit 0d3c7619b4
28 changed files with 375 additions and 352 deletions

View File

@@ -11,13 +11,13 @@ secure_download() {
local url="$1"
local output_file="$2"
local expected_sha256="$3"
echo "🔒 Securely downloading: $(basename "$output_file")"
# Download with retry logic
local retries=3
local retry_delay=2
for i in $(seq 1 $retries); do
if curl -fsSL --retry 3 --retry-delay 1 --connect-timeout 10 --max-time 30 "$url" -o "$output_file"; then
break
@@ -29,13 +29,13 @@ secure_download() {
sleep $retry_delay
fi
done
# Verify SHA256 checksum if provided
if [ -n "$expected_sha256" ]; then
echo "🔍 Verifying integrity..."
local actual_sha256
actual_sha256=$(sha256sum "$output_file" | cut -d' ' -f1)
if [ "$actual_sha256" = "$expected_sha256" ]; then
echo "✅ Integrity verification passed"
else
@@ -48,7 +48,7 @@ secure_download() {
else
echo "⚠️ No checksum provided - skipping integrity verification"
fi
# Set secure permissions
chmod 755 "$output_file"
echo "🔧 Set secure permissions (755)"
@@ -57,17 +57,17 @@ secure_download() {
# Function to install common dependencies securely
install_dependencies() {
echo "📦 Installing secure dependencies..."
# Install bash if needed
if ! command -v bash > /dev/null 2>&1; then
(apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) > /dev/null
fi
# Install curl if needed
if ! command -v curl > /dev/null 2>&1; then
(apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) > /dev/null
fi
# Install ca-certificates for SSL verification
(apt-get update && apt-get install -yqq --no-install-recommends ca-certificates || apk add --no-cache ca-certificates) > /dev/null 2>&1 || true
}
@@ -83,4 +83,4 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo ""
echo "Example:"
echo " secure_download 'https://example.com/script.sh' '/tmp/script.sh' 'abc123...'"
fi
fi