thingsboard

This commit is contained in:
CanbiZ 2026-01-14 13:01:56 +01:00
parent 17d04e2d1d
commit fa295d9194
3 changed files with 156 additions and 0 deletions

57
ct/thingsboard.sh Normal file
View File

@ -0,0 +1,57 @@
#!/usr/bin/env bash
source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/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 "Database Upgraded"
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}"

View File

@ -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"
}
]
}

View File

@ -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/ProxmoxVED/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 <<EOF
# 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