Refactor: HiveMQ (#6313)
This commit is contained in:
parent
253c4f4f5b
commit
7051dfeea7
@ -9,7 +9,7 @@
|
|||||||
"updateable": false,
|
"updateable": false,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 1883,
|
"interface_port": 1883,
|
||||||
"documentation": null,
|
"documentation": "https://github.com/hivemq/hivemq-community-edition/wiki",
|
||||||
"website": "https://www.hivemq.com/",
|
"website": "https://www.hivemq.com/",
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/hivemq.webp",
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/hivemq.webp",
|
||||||
"config_path": "/opt/hivemq/conf/config.xml",
|
"config_path": "/opt/hivemq/conf/config.xml",
|
||||||
|
@ -13,34 +13,26 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing OpenJDK"
|
JAVA_VERSION="21" setup_java
|
||||||
curl -fsSL "https://packages.adoptium.net/artifactory/api/gpg/key/public" | gpg --dearmor >/etc/apt/trusted.gpg.d/adoptium.gpg
|
fetch_and_deploy_gh_release "hivemq" "hivemq/hivemq-community-edition" "prebuild" "latest" "/opt/hivemq" "hivemq-ce-*.zip"
|
||||||
echo 'deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/adoptium.gpg] https://packages.adoptium.net/artifactory/deb bookworm main' >/etc/apt/sources.list.d/adoptium.list
|
|
||||||
$STD apt-get update
|
|
||||||
$STD apt-get install -y temurin-17-jre
|
|
||||||
msg_ok "Installed OpenJDK"
|
|
||||||
|
|
||||||
msg_info "Installing HiveMQ CE"
|
msg_info "Configuring HiveMQ CE"
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/hivemq/hivemq-community-edition/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
|
||||||
curl -fsSL "https://github.com/hivemq/hivemq-community-edition/releases/download/${RELEASE}/hivemq-ce-${RELEASE}.zip" -o "hivemq-ce-${RELEASE}.zip"
|
|
||||||
$STD unzip hivemq-ce-${RELEASE}.zip
|
|
||||||
mkdir -p /opt/hivemq
|
|
||||||
mv hivemq-ce-${RELEASE}/* /opt/hivemq
|
|
||||||
useradd -d /opt/hivemq hivemq
|
useradd -d /opt/hivemq hivemq
|
||||||
chown -R hivemq:hivemq /opt/hivemq
|
chown -R hivemq:hivemq /opt/hivemq
|
||||||
chmod +x /opt/hivemq/bin/run.sh
|
chmod +x /opt/hivemq/bin/run.sh
|
||||||
cp /opt/hivemq/bin/init-script/hivemq.service /etc/systemd/system/hivemq.service
|
cp /opt/hivemq/bin/init-script/hivemq.service /etc/systemd/system/hivemq.service
|
||||||
rm /opt/hivemq/conf/config.xml
|
rm /opt/hivemq/conf/config.xml
|
||||||
mv /opt/hivemq/conf/examples/configuration/config-sample-tcp-and-websockets.xml /opt/hivemq/conf/config.xml
|
mv /opt/hivemq/conf/examples/configuration/config-sample-tcp-and-websockets.xml /opt/hivemq/conf/config.xml
|
||||||
|
msg_ok "Configured HiveMQ CE"
|
||||||
|
|
||||||
|
msg_info "Starting service"
|
||||||
systemctl enable -q --now hivemq
|
systemctl enable -q --now hivemq
|
||||||
msg_ok "Installed HiveMQ CE"
|
msg_ok "Service started"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -rf hivemq-ce-${RELEASE}.zip
|
|
||||||
rm -rf ../hivemq-ce-${RELEASE}
|
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
$STD apt-get -y autoclean
|
$STD apt-get -y autoclean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user