Skip to content

Commit b749119

Browse files
authored
New Script: Dolibarr (#2502)
* Add Dolibarr script * Moved mariadb into dependencies * Fixed updatable to true
1 parent 87c61de commit b749119

File tree

3 files changed

+133
-0
lines changed

3 files changed

+133
-0
lines changed

ct/dolibarr.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/Dolibarr/dolibarr/
7+
8+
APP="Dolibarr"
9+
var_tags="erp;accounting"
10+
var_cpu="1"
11+
var_ram="2048"
12+
var_disk="6"
13+
var_os="debian"
14+
var_version="12"
15+
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+
if [[ ! -d /usr/share/dolibarr ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
msg_error "To update ${APP}, use the applications web interface."
31+
exit
32+
}
33+
34+
start
35+
build_container
36+
description
37+
38+
msg_ok "Completed Successfully!\n"
39+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
40+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
41+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/dolibarr/install${CL}"

install/dolibarr-install.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Slaviša Arežina (tremor021)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/Dolibarr/dolibarr/
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+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
php-imap \
22+
debconf-utils \
23+
mariadb-server
24+
msg_ok "Installed Dependencies"
25+
26+
msg_info "Setting up Database"
27+
ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
28+
$STD sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$ROOT_PASS'); flush privileges;"
29+
{
30+
echo "Dolibarr DB Credentials"
31+
echo "MariaDB Root Password: $ROOT_PASS"
32+
} >> ~/dolibarr.creds
33+
msg_ok "Set up database"
34+
35+
msg_info "Setup Dolibarr"
36+
BASE="https://sourceforge.net/projects/dolibarr/files/Dolibarr%20installer%20for%20Debian-Ubuntu%20(DoliDeb)/"
37+
RELEASE=$(curl -s "$BASE" | grep -oP '(?<=/Dolibarr%20installer%20for%20Debian-Ubuntu%20%28DoliDeb%29/)[^/"]+' | head -n1)
38+
FILE=$(curl -s "${BASE}${RELEASE}/" | grep -oP 'dolibarr_[^"]+_all.deb' | head -n1)
39+
wget -q "https://netcologne.dl.sourceforge.net/project/dolibarr/Dolibarr%20installer%20for%20Debian-Ubuntu%20(DoliDeb)/${RELEASE}/${FILE}?viasf=1" -O "$FILE"
40+
echo "dolibarr dolibarr/reconfigure-webserver multiselect apache2" | debconf-set-selections
41+
$STD apt-get install ./$FILE -y
42+
$STD apt install -f
43+
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
44+
msg_ok "Setup Dolibarr"
45+
46+
motd_ssh
47+
customize
48+
49+
msg_info "Cleaning up"
50+
rm -rf ~/$FILE
51+
$STD apt-get autoremove
52+
$STD apt-get autoclean
53+
msg_ok "Cleaned"

json/dolibarr.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Dolibarr",
3+
"slug": "dolibarr",
4+
"categories": [
5+
25
6+
],
7+
"date_created": "2025-02-20",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 80,
12+
"documentation": "https://wiki.dolibarr.org/index.php?title=Home",
13+
"website": "https://www.dolibarr.org/",
14+
"logo": "https://wiki.dolibarr.org/images/5/51/Dolibarr_124x124_white.svg",
15+
"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.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/dolibarr.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 2048,
23+
"hdd": 6,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "Database credentials: `cat ~/dolibarr.creds`",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)