diff --git a/ct/itsmng.sh b/ct/itsmng.sh new file mode 100644 index 00000000..b0117b05 --- /dev/null +++ b/ct/itsmng.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: Florianb63 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://itsm-ng.com/ + +APP="itsmng" +var_tags="${var_tags:-asset-management;foss}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-10}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /etc/itsm-ng/config_db.php ]]; then + msg_error "No ${APP} Installation Found!" + exit 1 + fi + + msg_info "Updating ${APP} LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated Successfully" + + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" diff --git a/frontend/public/json/itsmng.json b/frontend/public/json/itsmng.json new file mode 100644 index 00000000..fe7339b0 --- /dev/null +++ b/frontend/public/json/itsmng.json @@ -0,0 +1,35 @@ +{ + "name": "ITSMNG", + "slug": "itsmng", + "categories": [ + 25 + ], + "date_created": "2025-06-20", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 80, + "documentation": "https://wiki.itsm-ng.org/en/home", + "website": "https://itsm-ng.com", + "logo": "https://itsm-ng.com/web/image/website/1/logo/ITSM-NG", + "config_path": "/etc/itsm-ng", + "description": "ITSM-NG is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.", + "install_methods": [ + { + "type": "default", + "script": "ct/itsmng.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 10, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": "itsm", + "password": "itsm" + }, + "notes": [] +} diff --git a/install/itsmng-install.sh b/install/itsmng-install.sh new file mode 100644 index 00000000..2879d1ca --- /dev/null +++ b/install/itsmng-install.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: Florianb63 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://itsm-ng.com/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +setup_mariadb + +msg_info "Installing Repository" +curl -fsSL http://deb.itsm-ng.org/pubkey.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/itsm-ng-keyring.gpg +echo "deb http://deb.itsm-ng.org/$(. /etc/os-release && echo "$ID")/ $(. /etc/os-release && echo "$VERSION_CODENAME") main" > /etc/apt/sources.list.d/itsm-ng.list +$STD apt update +msg_ok "Installed Repository" + +msg_info "Installing ITSM-NG" +$STD apt install -y itsm-ng +msg_ok "Installed ITSM-NG" + +msg_info "Setting up database" +DB_NAME=itsmng_db +DB_USER=itsmng +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +mariadb-tzinfo-to-sql /usr/share/zoneinfo | mysql mysql +mariadb -u root -e "CREATE DATABASE $DB_NAME;" +mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" +mariadb -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost';" +mariadb -u root -e "GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" +{ + echo "ITSM-NG Database Credentials" + echo "Database: $DB_NAME" + echo "Username: $DB_USER" + echo "Password: $DB_PASS" +} >>~/itsmng_db.creds +msg_ok "Set up database" + +msg_info "Installing ITSM-NG" +cd /usr/share/itsm-ng +$STD php bin/console db:install --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --no-interaction +msg_ok "Installed ITSM-NG" + +msg_info "Configuring webserver" +$STD a2dissite 000-default.conf +msg_ok "Setup Service" + +msg_info "Setup Cronjob" +echo "* * * * * php /usr/share/itsm-ng/front/cron.php" | crontab - +msg_ok "Setup Cronjob" + +msg_info "Update PHP Params" +PHP_VERSION=$(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$' | head -n 1) +PHP_INI="/etc/php/$PHP_VERSION/apache2/php.ini" +sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 20M/' $PHP_INI +sed -i 's/^post_max_size = .*/post_max_size = 20M/' $PHP_INI +sed -i 's/^max_execution_time = .*/max_execution_time = 60/' $PHP_INI +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/^;\?\s*session.cookie_httponly\s*=.*/session.cookie_httponly = On/' $PHP_INI +systemctl restart apache2 +msg_ok "Update PHP Params" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf /usr/share/itsm-ng/install +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"