mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-05-15 16:20:25 +00:00
odoo (#4477)
* 'Add new script' * Update ct/odoo.sh Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> * Update odoo.sh --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
This commit is contained in:
parent
e24636133d
commit
b4d98b1dd2
6
ct/headers/odoo
Normal file
6
ct/headers/odoo
Normal file
@ -0,0 +1,6 @@
|
||||
____ __
|
||||
/ __ \____/ /___ ____
|
||||
/ / / / __ / __ \/ __ \
|
||||
/ /_/ / /_/ / /_/ / /_/ /
|
||||
\____/\__,_/\____/\____/
|
||||
|
71
ct/odoo.sh
Normal file
71
ct/odoo.sh
Normal file
@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/odoo/odoo
|
||||
|
||||
APP="Odoo"
|
||||
var_tags="${var_tags:-erp}"
|
||||
var_disk="${var_disk:-6}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /etc/odoo/odoo.conf ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit 1
|
||||
fi
|
||||
RELEASE=$(curl -fsSL https://nightly.odoo.com/ | grep -oE 'href="[0-9]+\.[0-9]+/nightly"' | head -n1 | cut -d'"' -f2 | cut -d/ -f1)
|
||||
LATEST_VERSION=$(curl -fsSL "https://nightly.odoo.com/${RELEASE}/nightly/deb/" |
|
||||
grep -oP "odoo_${RELEASE}\.\d+_all\.deb" |
|
||||
sed -E "s/odoo_(${RELEASE}\.[0-9]+)_all\.deb/\1/" |
|
||||
sort -V |
|
||||
tail -n1)
|
||||
|
||||
if [[ "${LATEST_VERSION}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
msg_info "Stopping ${APP} service"
|
||||
systemctl stop odoo
|
||||
msg_ok "Stopped ${APP}"
|
||||
|
||||
msg_info "Updating ${APP} to ${LATEST_VERSION}"
|
||||
curl -fsSL https://nightly.odoo.com/${RELEASE}/nightly/deb/odoo_${RELEASE}.latest_all.deb -o /opt/odoo.deb
|
||||
$STD apt install -y /opt/odoo.deb
|
||||
echo "$LATEST_VERSION" >/opt/${APP}_version.txt
|
||||
msg_ok "Updated ${APP} to ${LATEST_VERSION}"
|
||||
|
||||
msg_info "Starting ${APP} service"
|
||||
systemctl start odoo
|
||||
msg_ok "Started ${APP}"
|
||||
|
||||
msg_info "Cleaning Up"
|
||||
rm -f /opt/odoo.deb
|
||||
msg_ok "Cleaned"
|
||||
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at ${LATEST_VERSION}"
|
||||
fi
|
||||
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}:8069${CL}"
|
40
frontend/public/json/odoo.json
Normal file
40
frontend/public/json/odoo.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "Odoo",
|
||||
"slug": "odoo",
|
||||
"categories": [
|
||||
25
|
||||
],
|
||||
"date_created": "2025-05-14",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8069,
|
||||
"documentation": "https://www.odoo.com/en_EN/page/docs",
|
||||
"website": "https://www.odoo.com/",
|
||||
"logo": "https://raw.githubusercontent.com/selfhst/icons/refs/heads/main/svg/odoo.svg",
|
||||
"config_path": "/etc/odoo/odoo.conf",
|
||||
"description": "Odoo is a comprehensive open-source business platform made up of modular apps that cover key areas such as CRM, accounting, inventory, sales, project management, HR, helpdesk, and e-commerce. All modules are tightly integrated, allowing businesses to fully digitize and automate their workflows. Its modular design makes it suitable for both small companies and large enterprises, with flexibility to adapt to different industries. Odoo combines user-friendliness with powerful functionality, offering a unified solution for managing a wide range of business operations.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/odoo.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 6,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": "admin",
|
||||
"password": "admin"
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Database Credentials: `cat ~/odoo.creds`",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
74
install/odoo-install.sh
Normal file
74
install/odoo-install.sh
Normal file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||
# Source: https://github.com/odoo/odoo
|
||||
|
||||
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 \
|
||||
build-essential \
|
||||
make
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
RELEASE=$(curl -fsSL https://nightly.odoo.com/ | grep -oE 'href="[0-9]+\.[0-9]+/nightly"' | head -n1 | cut -d'"' -f2 | cut -d/ -f1)
|
||||
LATEST_VERSION=$(curl -fsSL "https://nightly.odoo.com/${RELEASE}/nightly/deb/" |
|
||||
grep -oP "odoo_${RELEASE}\.\d+_all\.deb" |
|
||||
sed -E "s/odoo_(${RELEASE}\.[0-9]+)_all\.deb/\1/" |
|
||||
sort -V |
|
||||
tail -n1)
|
||||
|
||||
msg_info "Setup Odoo $RELEASE"
|
||||
curl -fsSL https://nightly.odoo.com/${RELEASE}/nightly/deb/odoo_${RELEASE}.latest_all.deb -o /opt/odoo.deb
|
||||
$STD apt install -y /opt/odoo.deb
|
||||
msg_ok "Setup Odoo $RELEASE"
|
||||
|
||||
msg_info "Setup PostgreSQL Database"
|
||||
DB_NAME="odoo"
|
||||
DB_USER="odoo_usr"
|
||||
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
||||
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME;"
|
||||
$STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS';"
|
||||
$STD sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER;"
|
||||
$STD sudo -u postgres psql -c "ALTER DATABASE $DB_NAME OWNER TO $DB_USER;"
|
||||
$STD sudo -u postgres psql -c "ALTER USER $DB_USER WITH SUPERUSER;"
|
||||
{
|
||||
echo "Odoo-Credentials"
|
||||
echo -e "Odoo Database User: $DB_USER"
|
||||
echo -e "Odoo Database Password: $DB_PASS"
|
||||
echo -e "Odoo Database Name: $DB_NAME"
|
||||
} >>~/odoo.creds
|
||||
msg_ok "Setup PostgreSQL"
|
||||
|
||||
msg_info "Configuring Odoo"
|
||||
sed -i \
|
||||
-e "s|^;*db_host *=.*|db_host = localhost|" \
|
||||
-e "s|^;*db_port *=.*|db_port = 5432|" \
|
||||
-e "s|^;*db_user *=.*|db_user = $DB_USER|" \
|
||||
-e "s|^;*db_password *=.*|db_password = $DB_PASS|" \
|
||||
/etc/odoo/odoo.conf
|
||||
$STD sudo -u odoo odoo -c /etc/odoo/odoo.conf -d odoo -i base --stop-after-init
|
||||
systemctl restart odoo
|
||||
echo "${LATEST_VERSION}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Configured Odoo"
|
||||
|
||||
msg_info "Restarting Odoo"
|
||||
|
||||
msg_ok "Restarted Odoo"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -f /opt/odoo.deb
|
||||
$STD apt-get autoremove
|
||||
$STD apt-get autoclean
|
||||
msg_ok "Cleaned"
|
Loading…
x
Reference in New Issue
Block a user