Compare commits

...

2 Commits

Author SHA1 Message Date
push-app-to-main[bot]
453bc75e8a Add erpnext (ct) 2026-04-21 21:45:46 +00:00
community-scripts-pr-app[bot]
14655ff6a4 Update CHANGELOG.md (#13918)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-21 13:47:51 +00:00
3 changed files with 161 additions and 0 deletions

View File

@@ -463,6 +463,10 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- Domain-Locker: Update dependencies [@tremor021](https://github.com/tremor021) ([#13901](https://github.com/community-scripts/ProxmoxVE/pull/13901))
- homelable: fix install failure by correcting password-reset chmod target [@Copilot](https://github.com/Copilot) ([#13894](https://github.com/community-scripts/ProxmoxVE/pull/13894))
- #### ✨ New Features
- FileFlows: Update dependencies [@tremor021](https://github.com/tremor021) ([#13917](https://github.com/community-scripts/ProxmoxVE/pull/13917))
## 2026-04-20
### 🆕 New Scripts

49
ct/erpnext.sh Normal file
View File

@@ -0,0 +1,49 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: community-scripts
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/frappe/erpnext
APP="ERPNext"
var_tags="${var_tags:-erp;business;accounting}"
var_cpu="${var_cpu:-4}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-20}"
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 /opt/frappe-bench ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ERPNext"
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; cd /opt/frappe-bench && bench update --reset'
msg_ok "Updated ERPNext"
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}"
echo -e "${INFO}${YW} Credentials:${CL}"
echo -e "${TAB}${BGN}Username: Administrator${CL}"
echo -e "${TAB}${BGN}Password: see ~/erpnext.creds${CL}"

108
install/erpnext-install.sh Normal file
View File

@@ -0,0 +1,108 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/frappe/erpnext
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
git \
sudo \
build-essential \
python3-dev \
libffi-dev \
libssl-dev \
redis-server \
nginx \
supervisor \
fail2ban \
xvfb \
libfontconfig1 \
libxrender1 \
fontconfig \
libjpeg-dev \
libmariadb-dev \
python3-pip
msg_ok "Installed Dependencies"
NODE_VERSION="24" NODE_MODULE="yarn" setup_nodejs
UV_PYTHON="3.13" setup_uv
setup_mariadb
msg_info "Configuring MariaDB for ERPNext"
cat <<EOF >/etc/mysql/mariadb.conf.d/50-erpnext.cnf
[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
[client]
default-character-set=utf8mb4
EOF
$STD systemctl restart mariadb
msg_ok "Configured MariaDB for ERPNext"
msg_info "Installing wkhtmltopdf"
WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb"
$STD curl -fsSL -o /tmp/wkhtmltox.deb "$WKHTMLTOPDF_URL"
$STD apt install -y /tmp/wkhtmltox.deb
rm -f /tmp/wkhtmltox.deb
msg_ok "Installed wkhtmltopdf"
msg_info "Installing Frappe Bench"
useradd -m -s /bin/bash frappe
chown frappe:frappe /opt
echo "frappe ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/frappe
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; uv tool install frappe-bench'
msg_ok "Installed Frappe Bench"
msg_info "Initializing Frappe Bench"
ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
DB_ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASS}'; FLUSH PRIVILEGES;"
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; cd /opt && bench init --frappe-branch version-15 frappe-bench'
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; cd /opt/frappe-bench && bench get-app erpnext --branch version-15'
$STD sudo -u frappe bash -c "export PATH=\"\$HOME/.local/bin:\$PATH\"; cd /opt/frappe-bench && bench new-site site1.local --db-root-username root --db-root-password \"$DB_ROOT_PASS\" --admin-password \"$ADMIN_PASS\" --install-app erpnext --set-default"
msg_ok "Initialized Frappe Bench"
msg_info "Configuring ERPNext"
cat <<EOF >/opt/frappe-bench/.env
ADMIN_PASSWORD=${ADMIN_PASS}
DB_ROOT_PASSWORD=${DB_ROOT_PASS}
SITE_NAME=site1.local
EOF
{
echo "ERPNext Credentials"
echo "=================="
echo "Admin Username: Administrator"
echo "Admin Password: ${ADMIN_PASS}"
echo "DB Root Password: ${DB_ROOT_PASS}"
echo "Site Name: site1.local"
} >~/erpnext.creds
$STD systemctl enable --now redis-server
msg_ok "Configured ERPNext"
msg_info "Setting up Production"
BENCH_PY="/home/frappe/.local/share/uv/tools/frappe-bench/bin/python"
$STD sudo -u frappe bash -c "curl -fsSL https://bootstrap.pypa.io/get-pip.py | \"${BENCH_PY}\""
$STD sudo -u frappe bash -c 'export PATH="$HOME/.local/bin:$PATH"; uv tool install ansible'
ln -sf /home/frappe/.local/bin/ansible* /usr/local/bin/
$STD bash -c 'export PATH="/home/frappe/.local/bin:$PATH"; cd /opt/frappe-bench && bench setup production frappe --yes'
ln -sf /opt/frappe-bench/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf
$STD supervisorctl reread
$STD supervisorctl update
$STD systemctl enable --now supervisor
msg_ok "Set up Production"
motd_ssh
customize
cleanup_lxc