diff --git a/ct/minthcm.sh b/ct/minthcm.sh new file mode 100644 index 000000000..c6f4c689f --- /dev/null +++ b/ct/minthcm.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 minthcm +# Author: MintHCM +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/minthcm/minthcm + +APP="MintHCM" +var_tags="${var_tags:-hcm}" +var_disk="${var_disk:-20}" +var_cpu="${var_cpu:-4}" +var_ram="${var_ram:-4096}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /var/www/MintHCM ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_error "Currently we don't provide an update function for this ${APP}." + 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/minthcm.json b/frontend/public/json/minthcm.json new file mode 100644 index 000000000..dcc1527ef --- /dev/null +++ b/frontend/public/json/minthcm.json @@ -0,0 +1,40 @@ +{ + "name": "MintHCM", + "slug": "minthcm", + "categories": [ + 25 + ], + "date_created": "2025-12-12", + "type": "ct", + "updateable": false, + "privileged": false, + "interface_port": 80, + "documentation": "https://wiki.minthcm.org/", + "config_path": "/var/www/MintHCM", + "website": "https://minthcm.org/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/minthcm.webp", + "description": "MintCHM is a free and open-source tool for Human Capital Management. Main features: recruitment, time management, onboarding & offboarding, calendar, leave management, resources booking, travel & expenses, workplace management, analytics, roles & permissions management, job descriptions, employer branding, employee profiles, competences & skills, employment history, employee evaluations.", + "install_methods": [ + { + "type": "default", + "script": "ct/minthcm.sh", + "resources": { + "cpu": 4, + "ram": 4096, + "hdd": 20, + "os": "debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": "admin", + "password": "minthcm" + }, + "notes": [ + { + "text": "Database credentials are stored in ~/minthcm.creds", + "type": "info" + } + ] +} diff --git a/install/minthcm-install.sh b/install/minthcm-install.sh new file mode 100644 index 000000000..a6eed1129 --- /dev/null +++ b/install/minthcm-install.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 minthcm +# Author: MintHCM +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/minthcm/minthcm +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" + +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +PHP_APACHE="YES" PHP_VERSION="8.2" PHP_MODULE="mysql,cli,redis" PHP_FPM="YES" setup_php +setup_composer + +msg_info "Enabling Apache modules (rewrite, headers)" +$STD a2enmod rewrite +$STD a2enmod headers +msg_ok "Enabled Apache modules (rewrite, headers)" + +fetch_and_deploy_gh_release "MintHCM" "minthcm/minthcm" "tarball" "latest" "/var/www/MintHCM" + +msg_info "Configuring MintHCM" +mkdir -p /etc/php/${PHP_VERSION}/mods-available +cp /var/www/MintHCM/docker/config/000-default.conf /etc/apache2/sites-available/000-default.conf +cp /var/www/MintHCM/docker/config/php-minthcm.ini /etc/php/${PHP_VERSION}/mods-available/php-minthcm.ini +mkdir -p "/etc/php/${PHP_VERSION}/cli/conf.d" "/etc/php/${PHP_VERSION}/apache2/conf.d" +ln -s "/etc/php/${PHP_VERSION}/mods-available/php-minthcm.ini" "/etc/php/${PHP_VERSION}/cli/conf.d/20-minthcm.ini" +ln -s "/etc/php/${PHP_VERSION}/mods-available/php-minthcm.ini" "/etc/php/${PHP_VERSION}/apache2/conf.d/20-minthcm.ini" +chown -R www-data:www-data /var/www/MintHCM +find /var/www/MintHCM -type d -exec chmod 755 {} \; +find /var/www/MintHCM -type f -exec chmod 644 {} \; +mkdir -p /var/www/script +cp /var/www/MintHCM/docker/script/generate_config.php /var/www/script/generate_config.php +cp /var/www/MintHCM/docker/.env /var/www/script/.env +chown -R www-data:www-data /var/www/script +msg_ok "Configured MintHCM" + +msg_info "Restarting Apache2" +$STD systemctl restart apache2 +msg_ok "Restarted Apache2" + +msg_info "Setting up Elasticsearch" +setup_deb822_repo \ + "elasticsearch" \ + "https://artifacts.elastic.co/GPG-KEY-elasticsearch" \ + "https://artifacts.elastic.co/packages/7.x/apt" \ + "stable" \ + "main" +$STD apt install -y elasticsearch +echo "-Xms2g" >>/etc/elasticsearch/jvm.options +echo "-Xmx2g" >>/etc/elasticsearch/jvm.options +$STD /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment -b +systemctl enable -q --now elasticsearch +msg_ok "Set up Elasticsearch" + +setup_mariadb +msg_info "Setting up MariaDB" +$STD mariadb -u root -e "SET GLOBAL sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'"; +msg_ok "Set up MariaDB" + +msg_info "Configuring Database" +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +$STD mariadb -u root -e "CREATE USER 'minthcm'@'localhost' IDENTIFIED BY '${DB_PASS}';" +$STD mariadb -u root -e "GRANT ALL ON *.* TO 'minthcm'@'localhost'; FLUSH PRIVILEGES;" +sed -i 's/^DB_HOST=.*/DB_HOST=localhost/' /var/www/script/.env +sed -i 's/^DB_USER=.*/DB_USER=minthcm/' /var/www/script/.env +sed -i "s/^DB_PASS=.*/DB_PASS=${DB_PASS}/" /var/www/script/.env +sed -i 's/^ELASTICSEARCH_HOST=.*/ELASTICSEARCH_HOST=localhost/' /var/www/script/.env +msg_ok "Configured MariaDB" +{ + echo "MintHCM DB Credentials" + echo "MariaDB User: minthcm" + echo "MariaDB Password: $DB_PASS" +} >>~/minthcm.creds + +msg_info "Generating configuration file" +set -a +source /var/www/script/.env +set +a +php /var/www/script/generate_config.php +msg_ok "Generated configuration file" + +msg_info "Installing MintHCM" +cd /var/www/MintHCM && su -s /bin/bash -c 'php /var/www/MintHCM/MintCLI install < /var/www/MintHCM/configMint4' www-data +printf "* * * * * cd /var/www/MintHCM/legacy; php -f cron.php > /dev/null 2>&1\n" > /var/spool/cron/crontabs/www-data +service cron start +rm -f /var/www/MintHCM/configMint4 +msg_ok "Installed MintHCM" + +motd_ssh +customize +cleanup_lxc