From c5031e646205f79825b7ef4b85f69caf9dd64620 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Sun, 18 Jan 2026 15:09:14 +0100 Subject: [PATCH] ThingsBoard (#10904) * Add thingsboard (ct) * fix * Fix cat command for ThingsBoard configuration * Fix syntax for writing to thingsboard.conf --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- ct/thingsboard.sh | 57 +++++++++++++++++++++++++++ frontend/public/json/thingsboard.json | 48 ++++++++++++++++++++++ install/thingsboard-install.sh | 51 ++++++++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 ct/thingsboard.sh create mode 100644 frontend/public/json/thingsboard.json create mode 100644 install/thingsboard-install.sh diff --git a/ct/thingsboard.sh b/ct/thingsboard.sh new file mode 100644 index 000000000..095ff3be3 --- /dev/null +++ b/ct/thingsboard.sh @@ -0,0 +1,57 @@ +#!/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: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/thingsboard/thingsboard + +APP="ThingsBoard" +var_tags="${var_tags:-iot;platform}" +var_cpu="${var_cpu:-4}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-10}" +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 /usr/share/thingsboard ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "thingsboard" "thingsboard/thingsboard"; then + msg_info "Stopping Service" + systemctl stop thingsboard + msg_ok "Stopped Service" + + fetch_and_deploy_gh_release "thingsboard" "thingsboard/thingsboard" "binary" "latest" "/tmp" "thingsboard-*.deb" + + msg_info "Running Database Upgrade" + $STD /usr/share/thingsboard/bin/install/upgrade.sh + msg_ok "Ran Database Upgrade" + + msg_info "Starting Service" + systemctl start thingsboard + msg_ok "Started Service" + msg_ok "Updated successfully!" + 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}:8080${CL}" diff --git a/frontend/public/json/thingsboard.json b/frontend/public/json/thingsboard.json new file mode 100644 index 000000000..5f38ad3ad --- /dev/null +++ b/frontend/public/json/thingsboard.json @@ -0,0 +1,48 @@ +{ + "name": "ThingsBoard", + "slug": "thingsboard", + "categories": [ + 7 + ], + "date_created": "2026-01-14", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8080, + "documentation": "https://thingsboard.io/docs/", + "website": "https://thingsboard.io/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/thingsboard.webp", + "config_path": "/etc/thingsboard/conf/thingsboard.conf", + "description": "ThingsBoard is an open-source IoT platform for data collection, processing, visualization, and device management. It enables device connectivity via industry standard IoT protocols - MQTT, CoAP and HTTP and supports both cloud and on-premises deployments.", + "install_methods": [ + { + "type": "default", + "script": "ct/thingsboard.sh", + "resources": { + "cpu": 4, + "ram": 4096, + "hdd": 10, + "os": "debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": "sysadmin@thingsboard.org", + "password": "sysadmin" + }, + "notes": [ + { + "text": "Please allow up to 90 seconds for the Web UI to start", + "type": "info" + }, + { + "text": "Additional demo accounts: tenant@thingsboard.org / tenant and customer@thingsboard.org / customer", + "type": "info" + }, + { + "text": "Change passwords for all accounts in the account profile page after first login", + "type": "warning" + } + ] +} diff --git a/install/thingsboard-install.sh b/install/thingsboard-install.sh new file mode 100644 index 000000000..d81dd27ec --- /dev/null +++ b/install/thingsboard-install.sh @@ -0,0 +1,51 @@ +#!/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/thingsboard/thingsboard + +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 \ + libharfbuzz0b \ + fontconfig \ + fonts-dejavu-core +msg_ok "Installed Dependencies" + +JAVA_VERSION="17" setup_java +PG_VERSION="16" setup_postgresql +PG_DB_NAME="thingsboard_db" PG_DB_USER="thingsboard" setup_postgresql_db +fetch_and_deploy_gh_release "thingsboard" "thingsboard/thingsboard" "binary" "latest" "/tmp" "thingsboard-*.deb" + +msg_info "Configuring ThingsBoard" +cat </etc/thingsboard/conf/thingsboard.conf +# DB Configuration +export DATABASE_TS_TYPE=sql +export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/${PG_DB_NAME} +export SPRING_DATASOURCE_USERNAME=${PG_DB_USER} +export SPRING_DATASOURCE_PASSWORD=${PG_DB_PASS} +# Specify partitioning size for timestamp key-value storage. Allowed values: DAYS, MONTHS, YEARS, INDEFINITE. +export SQL_POSTGRES_TS_KV_PARTITIONING=MONTHS +EOF +systemctl daemon-reload +msg_ok "Configured ThingsBoard" + +msg_info "Running ThingsBoard Installation Script" +$STD /usr/share/thingsboard/bin/install/install.sh --loadDemo +msg_ok "Ran Installation Script" + +msg_info "Starting ThingsBoard Service" +systemctl enable -q --now thingsboard +msg_ok "Started ThingsBoard Service" + +motd_ssh +customize +cleanup_lxc