]> git.99rst.org Git - openwrt-packages.git/commitdiff
prosody: update to 13.0.6
authorAlexandru Ardelean <redacted>
Tue, 26 May 2026 11:15:12 +0000 (14:15 +0300)
committerAlexandru Ardelean <redacted>
Fri, 31 Jul 2026 06:46:08 +0000 (09:46 +0300)
0.12.x is EOL upstream and accumulating CVEs. Bump to the current
stable 13.0.6, which carries the fix from security advisory
2026-04-29 / prosody.im/security/advisory_735dd9d3 that first shipped
in 13.0.5.

Prosody 13 requires Lua >= 5.2 (configure rejects 5.1). Switch the
build and runtime to Lua 5.4 and depend on the new
luafilesystem5.4 / luaexpat5.4 / luasec5.4 / luasocket5.4 variants.
Drop the now-unused luabitop dependency: bit operations are built in
since Lua 5.3.

Other notes:
- configure now needs an explicit --lua-version=5.4 and --runwith=lua5.4
  because the wrapper script defaults to '/usr/bin/lua' (5.1 on OpenWrt).
- Install the new mod_debug_stanzas plugin directory. The commented-out
  fallbacks/*.lua install is dropped rather than revived: upstream's
  'make install' never copies that directory, and fallbacks/lxp.lua is
  Lua 5.1 code using module(), which does not even load on 5.4.
- util-src/hashes.c now calls EVP_blake2{s256,b512}(), which libopenssl
  does not provide unless OPENSSL_WITH_BLAKE2 is set, so compile those
  two hashes out when libcrypto lacks them. Selecting the symbol instead
  is not enough: the resulting util/hashes.so still fails to relocate
  against a stock libcrypto, and prosody aborts at startup. Only the
  COMPAT util.hmac table references them, and it tolerates nil entries.
- Install loader.lua. 13.x moved every internal require() to the
  'prosody.*' namespace, and loader.lua is what maps those names back
  onto the installed layout. It is the first file prosodyctl looks for,
  so both prosody and prosodyctl abort at startup without it.

Refs: https://github.com/openwrt/packages/issues/29252
Release notes: https://blog.prosody.im/prosody-13.0.6-released/
Security: https://prosody.im/security/advisory_735dd9d3/

Signed-off-by: Alexandru Ardelean <redacted>
net/prosody/Makefile
net/prosody/patches/010-hashes-optional-blake2.patch [new file with mode: 0644]

index cc6aee54166644a1674fca9f74e6d64e73d8411f..f4b3e650256fd482fe4ec24902b341b423d7332c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=prosody
-PKG_VERSION:=0.12.6
+PKG_VERSION:=13.0.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://prosody.im/downloads/source
-PKG_HASH:=e06db3cfa8811d0b9fa7713a3b430189f62a1f90e6a4940771b1e16ce64e8e44
+PKG_HASH:=ec696f9cf562c3af4a04b07d3fb36a1cedcc4e69a392fddcfc524bc67d93050f
 
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=MIT/X11
@@ -21,7 +21,7 @@ PKG_CPE_ID:=cpe:/a:prosody:prosody
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=lua/host
+PKG_BUILD_DEPENDS:=lua5.4/host
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -29,23 +29,24 @@ define Package/prosody
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=Instant Messaging
-  DEPENDS:=+luafilesystem +libidn +luaexpat +luasec +libopenssl +libidn +liblua +luabitop
+  DEPENDS:=+libidn +libopenssl +liblua5.4 +lua5.4 \
+           +luafilesystem5.4 +luaexpat5.4 +luasec5.4 +luasocket5.4
   TITLE:=XMPP server
   URL:=https://prosody.im/
   USERID:=prosody=54:prosody=54
 endef
 
 define Package/prosody/description
-  Prosody is an exciting new server for Jabber/XMPP
-  written in Lua. It aims to be easy to use, and light
-  on resources
+  Prosody is a modern XMPP/Jabber communication server, written in Lua.
+  It aims to be easy to set up and configure, and efficient with system
+  resources.
 endef
 
 define Package/prosody/conffiles
 /etc/prosody/prosody.cfg.lua
 endef
 
-TARGET_CFLAGS += $(FPIC)
+TARGET_CFLAGS += $(FPIC) -I$(STAGING_DIR)/usr/include/lua5.4
 TARGET_LDFLAGS += -shared
 
 MAKE_FLAGS += LD="$(TARGET_CC)" TARGET="../util/"
@@ -54,9 +55,12 @@ define Build/Configure
        # this is *NOT* GNU autoconf stuff
        (cd $(PKG_BUILD_DIR); ./configure \
                --prefix=/usr \
+               --ostype=linux \
+               --lua-version=5.4 \
                --with-lua="$(STAGING_DIR_HOSTPKG)" \
-               --with-lua-include="$(STAGING_DIR)/usr/include" \
+               --with-lua-include="$(STAGING_DIR)/usr/include/lua5.4" \
                --with-lua-lib="$(STAGING_DIR)/usr/lib" \
+               --runwith=lua5.4 \
                --idn-library=idn \
                --cflags="$(TARGET_CFLAGS)" \
                --ldflags="$(TARGET_LDFLAGS)" \
@@ -77,10 +81,10 @@ define Package/prosody/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/prosody{,ctl} $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/usr/lib/prosody
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/prosody.version $(1)/usr/lib/prosody/
+       # maps the 13.x "prosody.*" requires onto the installed layout
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/loader.lua $(1)/usr/lib/prosody/
        $(INSTALL_DIR) $(1)/usr/lib/prosody/core
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/core/*.lua $(1)/usr/lib/prosody/core/
-       #$(INSTALL_DIR) $(1)/usr/lib/prosody/fallbacks
-       #$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/fallbacks/*.lua $(1)/usr/lib/prosody/fallbacks/
        $(INSTALL_DIR) $(1)/usr/lib/prosody/modules
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/*.lua $(1)/usr/lib/prosody/modules/
        $(INSTALL_DIR) $(1)/usr/lib/prosody/modules/adhoc
@@ -91,8 +95,8 @@ define Package/prosody/install
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/mod_pubsub/*.lua $(1)/usr/lib/prosody/modules/mod_pubsub/
        $(INSTALL_DIR) $(1)/usr/lib/prosody/modules/mod_mam
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/mod_mam/*.lua $(1)/usr/lib/prosody/modules/mod_mam/
-       #$(INSTALL_DIR) $(1)/usr/lib/prosody/modules/storage
-       #$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/storage/*.lua $(1)/usr/lib/prosody/modules/storage/
+       $(INSTALL_DIR) $(1)/usr/lib/prosody/modules/mod_debug_stanzas
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/mod_debug_stanzas/*.lua $(1)/usr/lib/prosody/modules/mod_debug_stanzas/
        $(INSTALL_DIR) $(1)/usr/lib/prosody/net
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/net/*.lua $(1)/usr/lib/prosody/net/
        $(INSTALL_DIR) $(1)/usr/lib/prosody/net/http
@@ -110,23 +114,6 @@ define Package/prosody/install
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/human/*.lua $(1)/usr/lib/prosody/util/human/
        $(INSTALL_DIR) $(1)/usr/lib/prosody/util/prosodyctl
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/prosodyctl/*.lua $(1)/usr/lib/prosody/util/prosodyctl/
-       #$(CP) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/sasl/*.so $(1)/usr/lib/prosody/util/sasl/
-endef
-
-define Package/prosody/postinst
-#!/bin/sh
-[ -n "$${IPKG_INSTROOT}" ] || {
-       echo "Fixing lua with paxctl if needed!!!"
-       [ -f /sbin/paxctl ] && {
-               paxctl  -v /usr/bin/ > /dev/null  2>&1
-               [ $$? -ne 0 ] && {
-                       cp /usr/bin/lua /tmp
-                       paxctl -c -m /tmp/lua > /dev/null  2>&1
-                       cp -f /tmp/lua /usr/bin/lua
-               }
-       }
-       exit 0
-}
 endef
 
 $(eval $(call BuildPackage,prosody))
diff --git a/net/prosody/patches/010-hashes-optional-blake2.patch b/net/prosody/patches/010-hashes-optional-blake2.patch
new file mode 100644 (file)
index 0000000..9988036
--- /dev/null
@@ -0,0 +1,71 @@
+From ccc11ce4b039ac2fd775922e26010d64e59e7c47 Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <alex@shruggie.ro>
+Date: Tue, 26 May 2026 14:15:12 +0300
+Subject: [PATCH] prosody: build blake2 hashes only when OpenSSL has them
+
+util-src/hashes.c unconditionally registers blake2s256/blake2b512 and
+their HMAC variants, which fails to build against OpenSSL configured
+without BLAKE2. Guard them with OPENSSL_NO_BLAKE2 so the module builds
+either way.
+
+Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
+---
+ util-src/hashes.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/util-src/hashes.c
++++ b/util-src/hashes.c
+@@ -115,6 +115,7 @@ static int Lmd5(lua_State *L) {
+       return Levp_hash(L, EVP_md5());
+ }
++#ifndef OPENSSL_NO_BLAKE2
+ static int Lblake2s256(lua_State *L) {
+       return Levp_hash(L, EVP_blake2s256());
+ }
+@@ -122,6 +123,7 @@ static int Lblake2s256(lua_State *L) {
+ static int Lblake2b512(lua_State *L) {
+       return Levp_hash(L, EVP_blake2b512());
+ }
++#endif
+ static int Lsha3_256(lua_State *L) {
+       return Levp_hash(L, EVP_sha3_256());
+@@ -188,6 +190,7 @@ static int Lhmac_sha3_512(lua_State *L)
+       return Levp_hmac(L, EVP_sha3_512());
+ }
++#ifndef OPENSSL_NO_BLAKE2
+ static int Lhmac_blake2s256(lua_State *L) {
+       return Levp_hmac(L, EVP_blake2s256());
+ }
+@@ -195,6 +198,7 @@ static int Lhmac_blake2s256(lua_State *L
+ static int Lhmac_blake2b512(lua_State *L) {
+       return Levp_hmac(L, EVP_blake2b512());
+ }
++#endif
+ static int Levp_pbkdf2(lua_State *L, const EVP_MD *evp, size_t out_len) {
+@@ -292,8 +296,10 @@ static const luaL_Reg Reg[] = {
+       { "md5",                Lmd5            },
+       { "sha3_256",           Lsha3_256       },
+       { "sha3_512",           Lsha3_512       },
++#ifndef OPENSSL_NO_BLAKE2
+       { "blake2s256",         Lblake2s256     },
+       { "blake2b512",         Lblake2b512     },
++#endif
+       { "hmac_sha1",          Lhmac_sha1      },
+       { "hmac_sha224",        Lhmac_sha224    },
+       { "hmac_sha256",        Lhmac_sha256    },
+@@ -302,8 +308,10 @@ static const luaL_Reg Reg[] = {
+       { "hmac_md5",           Lhmac_md5       },
+       { "hmac_sha3_256",      Lhmac_sha3_256  },
+       { "hmac_sha3_512",      Lhmac_sha3_512  },
++#ifndef OPENSSL_NO_BLAKE2
+       { "hmac_blake2s256",    Lhmac_blake2s256        },
+       { "hmac_blake2b512",    Lhmac_blake2b512        },
++#endif
+       { "scram_Hi_sha1",      Lpbkdf2_sha1    }, /* COMPAT */
+       { "pbkdf2_hmac_sha1",   Lpbkdf2_sha1    },
+       { "pbkdf2_hmac_sha256", Lpbkdf2_sha256  },
git clone https://git.99rst.org/PROJECT