refactor(mqttx): convert from LXC to addon

MQTTX Web is a static browser-based MQTT client with no backend.
Makes more sense as an addon installable into any existing container
than as a dedicated LXC.

Addon installs into /opt/mqttx, builds web/ with yarn, serves via
Nginx on configurable port (default 8095). Supports install/update/uninstall.
This commit is contained in:
CanbiZ (MickLesk)
2026-04-07 10:03:30 +02:00
parent 6eaca2bec7
commit de7c99ea8c
4 changed files with 136 additions and 149 deletions

View File

@@ -1,60 +0,0 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/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/emqx/MQTTX
APP="MQTTX Web"
var_tags="${var_tags:-mqtt;iot;messaging}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
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 /opt/mqttx ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "mqttx" "emqx/MQTTX"; then
msg_info "Stopping Nginx"
systemctl stop nginx
msg_ok "Stopped Nginx"
msg_info "Updating MQTTX Web"
fetch_and_deploy_gh_release "mqttx" "emqx/MQTTX" "tarball" "latest" "/opt/mqttx"
cd /opt/mqttx/web
$STD yarn install --frozen-lockfile
$STD yarn build
msg_ok "Updated MQTTX Web"
msg_info "Starting Nginx"
systemctl start nginx
msg_ok "Started Nginx"
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}:80${CL}"