Skip to content

Commit e4ec0e4

Browse files
GLPI: fix version 11 (#8238)
* Update glpi-install.sh Updated PHP 8.2 to PHP 8.4; Adjusted the database configuration for GLPI 11.0.1 and I hope this configuration will be the same for future GLPI versions. * Update glpi-install.sh Added setup_mariadb * Update glpi-install.sh * Update glpi-install.sh --------- Co-authored-by: Slaviša Arežina <[email protected]>
1 parent 1fd132e commit e4ec0e4

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

install/glpi-install.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ msg_info "Installing Dependencies"
1717
$STD apt-get install -y \
1818
git \
1919
apache2 \
20-
php8.2-{apcu,cli,common,curl,gd,imap,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \
20+
php8.4-{apcu,cli,common,curl,gd,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \
2121
php-cas \
2222
libapache2-mod-php
2323
msg_ok "Installed Dependencies"
@@ -43,12 +43,11 @@ msg_ok "Set up database"
4343

4444
msg_info "Installing GLPi"
4545
cd /opt
46-
#RELEASE=$(curl -fsSL https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
47-
curl -fsSL "https://github.com/glpi-project/glpi/releases/download/10.0.20/glpi-10.0.20.tgz" -o "glpi-10.0.20.tgz"
48-
$STD tar -xzvf glpi-10.0.20.tgz
46+
RELEASE=$(curl -fsSL https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
47+
curl -fsSL "https://github.com/glpi-project/glpi/releases/download/${RELEASE}/glpi-${RELEASE}.tgz" -o $(basename "https://github.com/glpi-project/glpi/releases/download/${RELEASE}/glpi-${RELEASE}.tgz")
48+
$STD tar -xzvf glpi-${RELEASE}.tgz
4949
cd /opt/glpi
50-
$STD php bin/console db:install --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --no-interaction
51-
echo "10.0.20" >/opt/${APPLICATION}_version.txt
50+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
5251
msg_ok "Installed GLPi"
5352

5453
msg_info "Setting Downstream file"
@@ -83,6 +82,18 @@ define('GLPI_LOG_DIR', '/var/log/glpi');
8382
EOF
8483
msg_ok "Configured Downstream file"
8584

85+
msg_info "Configuring GLPI Database"
86+
$STD /usr/bin/php /opt/glpi/bin/console db:install \
87+
--db-host=localhost \
88+
--db-name=$DB_NAME \
89+
--db-user=$DB_USER \
90+
--db-password=$DB_PASS \
91+
--default-language=en_US \
92+
--no-interaction \
93+
--allow-superuser \
94+
--force
95+
msg_ok "Configured GLPI Database"
96+
8697
msg_info "Setting Folder and File Permissions"
8798
chown root:root /opt/glpi/ -R
8899
chown www-data:www-data /etc/glpi -R
@@ -144,7 +155,7 @@ customize
144155

145156
msg_info "Cleaning up"
146157
rm -rf /opt/glpi/install
147-
rm -rf /opt/glpi-10.0.20.tgz
158+
rm -rf /opt/glpi-${RELEASE}.tgz
148159
$STD apt-get -y autoremove
149160
$STD apt-get -y autoclean
150161
msg_ok "Cleaned"

0 commit comments

Comments
 (0)