Skip to content

Commit 4fe05d0

Browse files
ITSM-NG (#5615)
* 'Add new script' * Update itsm-ng-install.sh * Update itsm-ng-install.sh --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Slaviša Arežina <[email protected]>
1 parent 7b5dd6c commit 4fe05d0

File tree

4 files changed

+156
-0
lines changed

4 files changed

+156
-0
lines changed

ct/headers/itsm-ng

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_______________ __ ___ _ ________
2+
/ _/_ __/ ___// |/ / / | / / ____/
3+
/ / / / \__ \/ /|_/ /_____/ |/ / / __
4+
_/ / / / ___/ / / / /_____/ /| / /_/ /
5+
/___/ /_/ /____/_/ /_/ /_/ |_/\____/
6+

ct/itsm-ng.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Florianb63
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://itsm-ng.com/
7+
8+
APP="ITSM-NG"
9+
var_tags="${var_tags:-asset-management;foss}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-10}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -f /etc/itsm-ng/config_db.php ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit 1
30+
fi
31+
32+
msg_info "Updating ${APP} LXC"
33+
$STD apt-get update
34+
$STD apt-get -y upgrade
35+
msg_ok "Updated Successfully"
36+
37+
exit
38+
}
39+
40+
start
41+
build_container
42+
description
43+
44+
msg_ok "Completed Successfully!\n"
45+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
46+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
47+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"

frontend/public/json/itsm-ng.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/itsm-ng-install.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Florianb63
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://itsm-ng.com/
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
setup_mariadb
17+
18+
msg_info "Setting up database"
19+
DB_NAME=itsmng_db
20+
DB_USER=itsmng
21+
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
22+
mariadb-tzinfo-to-sql /usr/share/zoneinfo | mariadb mysql
23+
mariadb -u root -e "CREATE DATABASE $DB_NAME;"
24+
mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
25+
mariadb -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost';"
26+
mariadb -u root -e "GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
27+
{
28+
echo "ITSM-NG Database Credentials"
29+
echo "Database: $DB_NAME"
30+
echo "Username: $DB_USER"
31+
echo "Password: $DB_PASS"
32+
} >>~/itsmng_db.creds
33+
msg_ok "Set up database"
34+
35+
msg_info "Setup ITSM-NG Repository"
36+
curl -fsSL http://deb.itsm-ng.org/pubkey.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/itsm-ng-keyring.gpg
37+
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
38+
$STD apt-get update
39+
msg_ok "Setup ITSM-NG Repository"
40+
41+
msg_info "Installing ITSM-NG"
42+
$STD apt install -y itsm-ng
43+
cd /usr/share/itsm-ng
44+
$STD php bin/console db:install --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --no-interaction
45+
$STD a2dissite 000-default.conf
46+
echo "* * * * * php /usr/share/itsm-ng/front/cron.php" | crontab -
47+
msg_ok "Installed ITSM-NG"
48+
49+
msg_info "Configuring PHP"
50+
PHP_VERSION=$(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$' | head -n 1)
51+
PHP_INI="/etc/php/$PHP_VERSION/apache2/php.ini"
52+
sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 20M/' $PHP_INI
53+
sed -i 's/^post_max_size = .*/post_max_size = 20M/' $PHP_INI
54+
sed -i 's/^max_execution_time = .*/max_execution_time = 60/' $PHP_INI
55+
sed -i 's/^[;]*max_input_vars *=.*/max_input_vars = 5000/' "$PHP_INI"
56+
sed -i 's/^memory_limit = .*/memory_limit = 256M/' $PHP_INI
57+
sed -i 's/^;\?\s*session.cookie_httponly\s*=.*/session.cookie_httponly = On/' $PHP_INI
58+
systemctl restart apache2
59+
msg_ok "Configured PHP"
60+
61+
motd_ssh
62+
customize
63+
64+
msg_info "Cleaning up"
65+
rm -rf /usr/share/itsm-ng/install
66+
$STD apt-get -y autoremove
67+
$STD apt-get -y autoclean
68+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)