Compare commits

..

3 Commits

Author SHA1 Message Date
MickLesk fad1773fe3 patchmon: use fetch_and_deploy_gh_release for SCAP content 2026-08-14 10:05:45 +02:00
MickLesk 6b8cf490e0 patchmon: simplify SCAP content fetch with &&/|| chaining 2026-08-14 10:00:51 +02:00
MickLesk fe6e395fc8 patchmon: fetch SCAP Security Guide content, bump disk default 2026-08-14 09:29:46 +02:00
4 changed files with 10 additions and 13 deletions
+1 -9
View File
@@ -39,15 +39,7 @@ function update_script() {
/opt/ampache/public/play/.htaccess \
/opt/ampache/advanced-config
CURRENT_PHP=$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2)
if [[ "$CURRENT_PHP" != "8.5" ]]; then
msg_info "Migrating PHP $CURRENT_PHP to 8.5"
$STD apt remove -y php"${CURRENT_PHP//./}"*
PHP_VERSION="8.5" PHP_APACHE="YES" setup_php
msg_ok "Migrated PHP $CURRENT_PHP to 8.5"
fi
fetch_and_deploy_gh_release "Ampache" "ampache/ampache" "prebuild" "latest" "/opt/ampache" "ampache-*_all_php8.5.zip"
fetch_and_deploy_gh_release "Ampache" "ampache/ampache" "prebuild" "latest" "/opt/ampache" "ampache-*_all_php8.4.zip"
restore_backup
chmod 664 /opt/ampache/public/rest/.htaccess /opt/ampache/public/play/.htaccess
+3 -1
View File
@@ -9,7 +9,7 @@ APP="PatchMon"
var_tags="${var_tags:-monitoring}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-4}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
@@ -30,6 +30,8 @@ function update_script() {
exit
fi
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ssg-content" "ComplianceAsCode/content" "prebuild" "latest" "/opt/patchmon/ssg-content" "scap-security-guide-*.tar.gz"
if check_for_gh_release "PatchMon" "PatchMon/PatchMon"; then
msg_info "Stopping Service"
systemctl stop patchmon-server
+3 -3
View File
@@ -27,11 +27,11 @@ $STD apt install -y \
libvpx-dev
msg_ok "Installed dependencies"
PHP_VERSION="8.5" PHP_APACHE="YES" setup_php
PHP_VERSION="8.4" PHP_APACHE="YES" setup_php
setup_mariadb
MARIADB_DB_USER="ampache" MARIADB_DB_NAME="ampache" setup_mariadb_db
fetch_and_deploy_gh_release "ampache" "ampache/ampache" "prebuild" "latest" "/opt/ampache" "ampache-*_all_php8.5.zip"
fetch_and_deploy_gh_release "ampache" "ampache/ampache" "prebuild" "latest" "/opt/ampache" "ampache-*_all_php8.4.zip"
msg_info "Setting up Ampache"
rm -rf /var/www/html
@@ -58,7 +58,7 @@ msg_info "Configuring PHP"
sed -i -e 's/upload_max_filesize = .*/upload_max_filesize = 100M/' \
-e 's/post_max_size = .*/post_max_size = 100M/' \
-e 's/max_execution_time = .*/max_execution_time = 600/' \
-e 's/memory_limit = .*/memory_limit = 512M/' /etc/php/8.5/apache2/php.ini
-e 's/memory_limit = .*/memory_limit = 512M/' /etc/php/8.4/apache2/php.ini
$STD a2enmod rewrite
$STD systemctl restart apache2
msg_ok "Configured PHP"
+3
View File
@@ -60,6 +60,7 @@ REDIS_PORT=6379
# OIDC_ENFORCE_HTTPS=true
AGENT_BINARIES_DIR=/opt/patchmon/agents
SSG_CONTENT_DIR=/opt/patchmon/ssg-content
EOF
msg_ok "Configured PatchMon"
@@ -85,6 +86,8 @@ for arch in "${AGENT_NAME[@]}"; do
done
msg_ok "Fetched PatchMon agent binaries"
fetch_and_deploy_gh_release "ssg-content" "ComplianceAsCode/content" "prebuild" "latest" "/opt/patchmon/ssg-content" "scap-security-guide-*.tar.gz"
msg_info "Creating service"
cat <<EOF >/etc/systemd/system/patchmon-server.service
[Unit]