1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00

New Script: Dolibarr (#2502)

* Add Dolibarr script

* Moved mariadb into dependencies

* Fixed updatable to true
This commit is contained in:
Slaviša Arežina 2025-02-20 09:51:32 +01:00 committed by GitHub
parent 87c61de11e
commit b749119a1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 133 additions and 0 deletions

41
ct/dolibarr.sh Normal file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Dolibarr/dolibarr/
APP="Dolibarr"
var_tags="erp;accounting"
var_cpu="1"
var_ram="2048"
var_disk="6"
var_os="debian"
var_version="12"
var_unprivileged="1"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /usr/share/dolibarr ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_error "To update ${APP}, use the applications web interface."
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}/dolibarr/install${CL}"

View File

@ -0,0 +1,53 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Dolibarr/dolibarr/
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
sudo \
mc \
php-imap \
debconf-utils \
mariadb-server
msg_ok "Installed Dependencies"
msg_info "Setting up Database"
ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
$STD sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$ROOT_PASS'); flush privileges;"
{
echo "Dolibarr DB Credentials"
echo "MariaDB Root Password: $ROOT_PASS"
} >> ~/dolibarr.creds
msg_ok "Set up database"
msg_info "Setup Dolibarr"
BASE="https://sourceforge.net/projects/dolibarr/files/Dolibarr%20installer%20for%20Debian-Ubuntu%20(DoliDeb)/"
RELEASE=$(curl -s "$BASE" | grep -oP '(?<=/Dolibarr%20installer%20for%20Debian-Ubuntu%20%28DoliDeb%29/)[^/"]+' | head -n1)
FILE=$(curl -s "${BASE}${RELEASE}/" | grep -oP 'dolibarr_[^"]+_all.deb' | head -n1)
wget -q "https://netcologne.dl.sourceforge.net/project/dolibarr/Dolibarr%20installer%20for%20Debian-Ubuntu%20(DoliDeb)/${RELEASE}/${FILE}?viasf=1" -O "$FILE"
echo "dolibarr dolibarr/reconfigure-webserver multiselect apache2" | debconf-set-selections
$STD apt-get install ./$FILE -y
$STD apt install -f
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Setup Dolibarr"
motd_ssh
customize
msg_info "Cleaning up"
rm -rf ~/$FILE
$STD apt-get autoremove
$STD apt-get autoclean
msg_ok "Cleaned"

39
json/dolibarr.json Normal file
View File

@ -0,0 +1,39 @@
{
"name": "Dolibarr",
"slug": "dolibarr",
"categories": [
25
],
"date_created": "2025-02-20",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 80,
"documentation": "https://wiki.dolibarr.org/index.php?title=Home",
"website": "https://www.dolibarr.org/",
"logo": "https://wiki.dolibarr.org/images/5/51/Dolibarr_124x124_white.svg",
"description": "Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.",
"install_methods": [
{
"type": "default",
"script": "ct/dolibarr.sh",
"resources": {
"cpu": 1,
"ram": 2048,
"hdd": 6,
"os": "debian",
"version": "12"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "Database credentials: `cat ~/dolibarr.creds`",
"type": "info"
}
]
}