Compare commits

..

No commits in common. "8cffd00f862e016f54b43a6ab949345a4215b505" and "7267a6609bfd0a6152e7f57b3a0ee3b074fefea1" have entirely different histories.

3 changed files with 13 additions and 11 deletions

View File

@ -7,7 +7,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m
# App Default Values # App Default Values
APP="GLPI" APP="GLPI"
var_tags="asset-management;foss" var_tags="assat-management;foss"
var_cpu="2" var_cpu="2"
var_ram="2048" var_ram="2048"
var_disk="10" var_disk="10"

View File

@ -45,11 +45,13 @@ msg_ok "Set up database"
msg_info "Installing GLPi" msg_info "Installing GLPi"
cd /opt cd /opt
RELEASE=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') RELEASE=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
echo "${RELEASE}" >"/opt/${APP}_version.txt"
wget -q "https://github.com/glpi-project/glpi/releases/download/${RELEASE}/glpi-${RELEASE}.tgz" wget -q "https://github.com/glpi-project/glpi/releases/download/${RELEASE}/glpi-${RELEASE}.tgz"
tar -xzvf glpi-${RELEASE}.tgz $STD tar -xzvf glpi-${RELEASE}.tgz
cd /opt/glpi cd /opt/glpi
$STD php bin/console db:install --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --no-interaction $STD php bin/console db:install --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --no-interaction
echo "${RELEASE}" >"/opt/${APP}_version.txt" rm -rf /opt/glpi/install
msg_ok "Installed GLPi" msg_ok "Installed GLPi"
msg_info "Setting Downstream file" msg_info "Setting Downstream file"
@ -100,7 +102,7 @@ find /var/log/glpi -type f -exec chmod 0644 {} \;
find /var/log/glpi -type d -exec chmod 0755 {} \; find /var/log/glpi -type d -exec chmod 0755 {} \;
msg_ok "Configured Folder and File Permissions" msg_ok "Configured Folder and File Permissions"
msg_info "Setup Service" msg_info "Setting VirtualHost"
cat <<EOF >/etc/apache2/sites-available/glpi.conf cat <<EOF >/etc/apache2/sites-available/glpi.conf
<VirtualHost *:80> <VirtualHost *:80>
ServerName localhost ServerName localhost
@ -119,16 +121,17 @@ cat <<EOF >/etc/apache2/sites-available/glpi.conf
CustomLog \${APACHE_LOG_DIR}/glpi_access.log combined CustomLog \${APACHE_LOG_DIR}/glpi_access.log combined
</VirtualHost> </VirtualHost>
EOF EOF
$STD a2dissite 000-default.conf $STD a2dissite 000-default.conf
$STD a2enmod rewrite $STD a2enmod rewrite
$STD a2ensite glpi.conf $STD a2ensite glpi.conf
msg_ok "Setup Service" msg_ok "Configured VirtualHost"
msg_info "Setup Cronjob" msg_info "Setting Automatic Actions"
(crontab -l 2>/dev/null; echo "* * * * * php /opt/glpi/front/cron.php") | crontab - (crontab -l 2>/dev/null; echo "* * * * * php /opt/glpi/front/cron.php") | crontab -
msg_ok "Setup Cronjob" msg_ok "Configured Automatic Actions"
msg_info "Update PHP Params" msg_info "Changing parameters in php.ini"
PHP_VERSION=$(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$' | head -n 1) PHP_VERSION=$(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$' | head -n 1)
PHP_INI="/etc/php/$PHP_VERSION/apache2/php.ini" PHP_INI="/etc/php/$PHP_VERSION/apache2/php.ini"
sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 20M/' $PHP_INI sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 20M/' $PHP_INI
@ -138,13 +141,12 @@ sed -i 's/^max_input_vars = .*/max_input_vars = 5000/' $PHP_INI
sed -i 's/^memory_limit = .*/memory_limit = 256M/' $PHP_INI sed -i 's/^memory_limit = .*/memory_limit = 256M/' $PHP_INI
sed -i 's/^;\?\s*session.cookie_httponly\s*=.*/session.cookie_httponly = On/' $PHP_INI sed -i 's/^;\?\s*session.cookie_httponly\s*=.*/session.cookie_httponly = On/' $PHP_INI
systemctl restart apache2 systemctl restart apache2
msg_ok "Update PHP Params" msg_ok "Changed parameters in php.ini"
motd_ssh motd_ssh
customize customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -rf /opt/glpi/install
rm -rf /opt/glpi-${RELEASE}.tgz rm -rf /opt/glpi-${RELEASE}.tgz
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean

View File

@ -4,7 +4,7 @@
"categories": [ "categories": [
0 0
], ],
"date_created": "2025-01-06", "date_created": "2025-01-02",
"type": "ct", "type": "ct",
"updateable": false, "updateable": false,
"privileged": false, "privileged": false,