mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 23:34:31 +04:00
nanomq: add new package
NanoMQ MQTT Broker (NanoMQ) is described by EMQX as "An ultra-lightweight and blazing-fast Messaging Broker/Bus for IoT Edge & SDV". Co-authored-by: George Sapkin <george@sapk.in> Co-authored-by: Tianling Shen <cnsztl@gmail.com> Signed-off-by: Andrew Yong <me@ndoo.sg>
This commit is contained in:
committed by
Tianling Shen
parent
3a204f5158
commit
ff71f64495
51
net/nanomq/Makefile
Normal file
51
net/nanomq/Makefile
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
#
|
||||||
|
# Copyright (C) 2025 Andrew Yong <me@ndoo.sg>
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=nanomq
|
||||||
|
PKG_VERSION:=0.24.5
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_URL:=https://github.com/nanomq/nanomq.git
|
||||||
|
PKG_SOURCE_VERSION:=$(PKG_VERSION)
|
||||||
|
PKG_MIRROR_HASH:=bd98194ee03032ccd5e1b7c2faf1e8bfff55b76a916550072070ac93e46e6460
|
||||||
|
|
||||||
|
PKG_LICENSE:=MIT
|
||||||
|
PKG_LICENSE_FILES:=LICENSE.txt
|
||||||
|
PKG_MAINTAINER:=Andrew Yong <me@ndoo.sg>
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(INCLUDE_DIR)/cmake.mk
|
||||||
|
|
||||||
|
CMAKE_OPTIONS+= \
|
||||||
|
-DBUILD_CLIENT=OFF
|
||||||
|
|
||||||
|
define Package/nanomq
|
||||||
|
SECTION:=net
|
||||||
|
CATEGORY:=Network
|
||||||
|
TITLE:=NanoMQ Broker
|
||||||
|
URL:=https://github.com/nanomq/nanomq
|
||||||
|
DEPENDS:=+libatomic
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/nanomq/description
|
||||||
|
An ultra-lightweight and blazing-fast Messaging Broker/Bus for IoT Edge & SDV
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/nanomq/conffiles
|
||||||
|
/etc/nanomq.conf
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/nanomq/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nanomq $(1)/usr/bin/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) ./files/nanomq.init $(1)/etc/init.d/nanomq
|
||||||
|
$(INSTALL_DIR) $(1)/etc
|
||||||
|
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/etc/nanomq.conf $(1)/etc/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,nanomq))
|
||||||
17
net/nanomq/files/nanomq.init
Normal file
17
net/nanomq/files/nanomq.init
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
#
|
||||||
|
# Copyright (C) 2025 Andrew Yong <me@ndoo.sg>
|
||||||
|
|
||||||
|
START=95
|
||||||
|
STOP=10
|
||||||
|
|
||||||
|
USE_PROCD=1
|
||||||
|
PROG=/usr/bin/nanomq
|
||||||
|
CONFIGFILE=/etc/nanomq.conf
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG" start --conf "$CONFIGFILE"
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
43
net/nanomq/patches/100-conf.patch
Normal file
43
net/nanomq/patches/100-conf.patch
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
--- a/etc/nanomq.conf
|
||||||
|
+++ b/etc/nanomq.conf
|
||||||
|
@@ -21,39 +21,13 @@ listeners.tcp {
|
||||||
|
bind = "0.0.0.0:1883"
|
||||||
|
}
|
||||||
|
|
||||||
|
-# listeners.ssl {
|
||||||
|
-# bind = "0.0.0.0:8883"
|
||||||
|
-# keyfile = "/etc/certs/key.pem"
|
||||||
|
-# certfile = "/etc/certs/cert.pem"
|
||||||
|
-# cacertfile = "/etc/certs/cacert.pem"
|
||||||
|
-# verify_peer = false
|
||||||
|
-# fail_if_no_peer_cert = false
|
||||||
|
-# }
|
||||||
|
-
|
||||||
|
listeners.ws {
|
||||||
|
bind = "0.0.0.0:8083/mqtt"
|
||||||
|
}
|
||||||
|
|
||||||
|
-http_server {
|
||||||
|
- port = 8081
|
||||||
|
- limit_conn = 2
|
||||||
|
- username = admin
|
||||||
|
- password = public
|
||||||
|
- auth_type = basic
|
||||||
|
- jwt {
|
||||||
|
- public.keyfile = "/etc/certs/jwt/jwtRS256.key.pub"
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
log {
|
||||||
|
- to = [file, console]
|
||||||
|
+ to = [console]
|
||||||
|
level = warn
|
||||||
|
- dir = "/tmp"
|
||||||
|
- file = "nanomq.log"
|
||||||
|
- rotation {
|
||||||
|
- size = 10MB
|
||||||
|
- count = 5
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
|
||||||
|
auth {
|
||||||
Reference in New Issue
Block a user