This commit is contained in:
Slaviša Arežina
2025-08-22 20:17:32 +02:00
committed by GitHub
parent c207d65b1b
commit e72f248918
2 changed files with 8 additions and 19 deletions

View File

@@ -14,13 +14,10 @@ network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
apache2 \
libapache2-mod-php \
php8.2 php8.2-{fpm,curl,cli,mysql,gd,intl,imap,apcu,pspell,tidy,xmlrpc,mbstring,gmp,xml,ldap,common,snmp} \
php-pear
$STD apt-get install -y php-pear
msg_ok "Installed Dependencies"
PHP_VERSION="8.2" PHP_APACHE="YES" PHP_FPM="YES" PHP_MODULE="mysql,imap,apcu,pspell,tidy,xmlrpc,gmp,ldap,common,snmp" setup_php
setup_mariadb
msg_info "Setting up MariaDB"
@@ -38,11 +35,9 @@ $STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUS
} >>~/phpipam.creds
msg_ok "Set up MariaDB"
fetch_and_deploy_gh_release "phpipam" "phpipam/phpipam" "prebuild" "latest" "/opt/phpipam" "phpipam-v*.zip"
msg_info "Installing phpIPAM"
RELEASE=$(curl -fsSL https://api.github.com/repos/phpipam/phpipam/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
cd /opt
curl -fsSL "https://github.com/phpipam/phpipam/releases/download/v${RELEASE}/phpipam-v${RELEASE}.zip" -o "phpipam-v${RELEASE}.zip"
$STD unzip "phpipam-v${RELEASE}.zip"
$STD mariadb -u root "${DB_NAME}" </opt/phpipam/db/SCHEMA.sql
cp /opt/phpipam/config.dist.php /opt/phpipam/config.php
sed -i -e "s/\(\$disable_installer = \).*/\1true;/" \
@@ -51,7 +46,6 @@ sed -i -e "s/\(\$disable_installer = \).*/\1true;/" \
-e "s/\(\$db\['name'\] = \).*/\1'$DB_NAME';/" \
/opt/phpipam/config.php
sed -i '/max_execution_time/s/= .*/= 600/' /etc/php/8.2/apache2/php.ini
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed phpIPAM"
msg_info "Creating Service"
@@ -79,7 +73,6 @@ motd_ssh
customize
msg_info "Cleaning up"
rm -rf "/opt/phpipam-v${RELEASE}.zip"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"