mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-08 16:01:59 +00:00
Compare commits
8 Commits
renovate/v
...
feature/al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
082ceed27c | ||
|
|
5a3938d7fc | ||
|
|
eb433719dd | ||
|
|
106ab6f5f8 | ||
|
|
148ff2e77f | ||
|
|
a9e4349f5f | ||
|
|
a655a24f2f | ||
|
|
417f6deccf |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -346,7 +346,41 @@ install_apk_packages() {
|
||||
fi
|
||||
|
||||
info "Need to install: ${missing_packages[*]}"
|
||||
apk add --no-cache "${missing_packages[@]}"
|
||||
|
||||
# Update package index before installation
|
||||
info "Updating package index..."
|
||||
apk update -q || true
|
||||
|
||||
# Build apk command
|
||||
local apk_cmd="apk add --no-cache ${missing_packages[*]}"
|
||||
|
||||
# Try to install packages
|
||||
if eval "$apk_cmd" 2>&1 | tee /tmp/patchmon_apk_install.log; then
|
||||
success "Packages installed successfully"
|
||||
return 0
|
||||
else
|
||||
warning "Package installation encountered issues, checking if required tools are available..."
|
||||
|
||||
# Verify critical dependencies are actually available
|
||||
local all_ok=true
|
||||
for pkg in "${packages[@]}"; do
|
||||
if ! command_exists "$pkg"; then
|
||||
if [[ "$FORCE_INSTALL" == "true" ]]; then
|
||||
error "Critical dependency '$pkg' is not available even with --force. Please install manually."
|
||||
else
|
||||
error "Critical dependency '$pkg' is not available. Try again with --force flag or install manually: apk add $pkg"
|
||||
fi
|
||||
all_ok=false
|
||||
fi
|
||||
done
|
||||
|
||||
if $all_ok; then
|
||||
success "All required tools are available despite installation warnings"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Detect package manager and install jq, curl, and bc
|
||||
|
||||
@@ -318,7 +318,8 @@ while IFS= read -r line; do
|
||||
|
||||
# Download and execute in separate steps to avoid stdin issues with piping
|
||||
# Pass CURL_FLAGS as environment variable to container
|
||||
install_output=$(timeout 180 pct exec "$vmid" --env CURL_FLAGS="$CURL_FLAGS" -- bash -c "
|
||||
install_output=$(timeout 180 pct exec "$vmid" -- bash -c "
|
||||
export CURL_FLAGS='$CURL_FLAGS'
|
||||
cd /tmp
|
||||
curl \$CURL_FLAGS \
|
||||
-H \"X-API-ID: $api_id\" \
|
||||
@@ -458,7 +459,8 @@ if [[ ${#dpkg_error_containers[@]} -gt 0 ]]; then
|
||||
|
||||
install_exit_code=0
|
||||
# Pass CURL_FLAGS as environment variable to container
|
||||
install_output=$(timeout 180 pct exec "$vmid" --env CURL_FLAGS="$CURL_FLAGS" -- bash -c "
|
||||
install_output=$(timeout 180 pct exec "$vmid" -- bash -c "
|
||||
export CURL_FLAGS='$CURL_FLAGS'
|
||||
cd /tmp
|
||||
curl \$CURL_FLAGS \
|
||||
-H \"X-API-ID: $api_id\" \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "patchmon-backend",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "Backend API for Linux Patch Monitoring System",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "src/server.js",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const axios = require("axios");
|
||||
const fs = require("node:fs").promises;
|
||||
const path = require("node:path");
|
||||
const os = require("node:os");
|
||||
const { exec, spawn } = require("node:child_process");
|
||||
const { promisify } = require("node:util");
|
||||
const _execAsync = promisify(exec);
|
||||
@@ -106,10 +107,26 @@ class AgentVersionService {
|
||||
try {
|
||||
console.log("🔍 Getting current agent version...");
|
||||
|
||||
// Try to find the agent binary in agents/ folder only (what gets distributed)
|
||||
// Detect server architecture and map to Go architecture names
|
||||
const serverArch = os.arch();
|
||||
// Map Node.js architecture to Go architecture names
|
||||
const archMap = {
|
||||
x64: "amd64",
|
||||
ia32: "386",
|
||||
arm64: "arm64",
|
||||
arm: "arm",
|
||||
};
|
||||
const serverGoArch = archMap[serverArch] || serverArch;
|
||||
|
||||
console.log(
|
||||
`🔍 Detected server architecture: ${serverArch} -> ${serverGoArch}`,
|
||||
);
|
||||
|
||||
// Try to find the agent binary in agents/ folder based on server architecture
|
||||
const possiblePaths = [
|
||||
path.join(this.agentsDir, "patchmon-agent-linux-amd64"),
|
||||
path.join(this.agentsDir, "patchmon-agent"),
|
||||
path.join(this.agentsDir, `patchmon-agent-linux-${serverGoArch}`),
|
||||
path.join(this.agentsDir, "patchmon-agent-linux-amd64"), // Fallback
|
||||
path.join(this.agentsDir, "patchmon-agent"), // Legacy fallback
|
||||
];
|
||||
|
||||
let agentPath = null;
|
||||
@@ -126,7 +143,7 @@ class AgentVersionService {
|
||||
|
||||
if (!agentPath) {
|
||||
console.log(
|
||||
"⚠️ No agent binary found in agents/ folder, current version will be unknown",
|
||||
`⚠️ No agent binary found in agents/ folder for architecture ${serverGoArch}, current version will be unknown`,
|
||||
);
|
||||
console.log("💡 Use the Download Updates button to get agent binaries");
|
||||
this.currentVersion = null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "patchmon-frontend",
|
||||
"private": true,
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"license": "AGPL-3.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "patchmon",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "Linux Patch Monitoring System",
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
|
||||
2
setup.sh
2
setup.sh
@@ -34,7 +34,7 @@ BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Global variables
|
||||
SCRIPT_VERSION="self-hosting-install.sh v1.3.2-selfhost-2025-10-31-1"
|
||||
SCRIPT_VERSION="self-hosting-install.sh v1.3.3-selfhost-2025-11-07"
|
||||
DEFAULT_GITHUB_REPO="https://github.com/PatchMon/PatchMon.git"
|
||||
FQDN=""
|
||||
CUSTOM_FQDN=""
|
||||
|
||||
Reference in New Issue
Block a user