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:
@@ -1,49 +0,0 @@
|
||||
#!/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/emqx/MQTTX
|
||||
|
||||
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 \
|
||||
nginx
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
|
||||
|
||||
fetch_and_deploy_gh_release "mqttx" "emqx/MQTTX" "tarball" "latest" "/opt/mqttx"
|
||||
|
||||
msg_info "Building MQTTX Web"
|
||||
cd /opt/mqttx/web
|
||||
$STD yarn install --frozen-lockfile
|
||||
$STD yarn build
|
||||
msg_ok "Built MQTTX Web"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
cat <<'EOF' >/etc/nginx/sites-available/default
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
root /opt/mqttx/web/dist;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
systemctl restart nginx
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user