From 56a0703c690e39b9f81f039dd66fbf73575aeab5 Mon Sep 17 00:00:00 2001 From: op Date: Fri, 1 Apr 2022 14:47:53 +0000 Subject: [PATCH] update net/prosody to 0.12 changelog: https://blog.prosody.im/prosody-0.12.0-released/ Original diff from Lucas, thank you! tweaks/ok sthen@ --- net/prosody/Makefile | 18 ++++-- net/prosody/distinfo | 4 +- .../patches/patch-core_certmanager_lua | 4 +- .../patch-plugins_mod_admin_socket_lua | 16 +++++ .../patches/patch-prosody_cfg_lua_dist | 10 ++-- net/prosody/patches/patch-util-src_pposix_c | 10 ++-- .../patches/patch-util_adminstream_lua | 16 +++++ net/prosody/patches/patch-util_prosodyctl_lua | 17 ++++-- net/prosody/pkg/PLIST | 58 ++++++++++++++++--- 9 files changed, 122 insertions(+), 31 deletions(-) create mode 100644 net/prosody/patches/patch-plugins_mod_admin_socket_lua create mode 100644 net/prosody/patches/patch-util_adminstream_lua diff --git a/net/prosody/Makefile b/net/prosody/Makefile index 111da98c218..f723ce6d950 100644 --- a/net/prosody/Makefile +++ b/net/prosody/Makefile @@ -1,5 +1,5 @@ COMMENT = communications server for Jabber/XMPP written in Lua -DISTNAME = prosody-0.11.13 +DISTNAME = prosody-0.12.0 CATEGORIES = net HOMEPAGE = https://prosody.im/ @@ -11,20 +11,22 @@ MASTER_SITES = https://prosody.im/downloads/source/ PERMIT_PACKAGE = Yes MODULES = lang/lua -MODLUA_VERSION = 5.2 +MODLUA_VERSION = 5.3 -MODLUA_RUN_DEPENDS += databases/luadbi \ - devel/lua-bitop \ +MODLUA_RUN_DEPENDS += converters/luastruct \ + databases/luadbi \ devel/luafs \ + devel/luarocks \ + net/luaunbound \ security/luasec \ textproc/luaexpat -LIB_DEPENDS = devel/libidn +LIB_DEPENDS = textproc/icu4c # fails, depends on busted not yet in NO_TEST = Yes TEST_DEPENDS = ${MODLUA_RUN_DEPENDS} -WANTLIB += crypto idn +WANTLIB += crypto icudata icui18n icuuc CONFIGURE_STYLE = simple CONFIGURE_ARGS += --prefix="${PREFIX}" \ @@ -34,6 +36,7 @@ CONFIGURE_ARGS += --prefix="${PREFIX}" \ --with-lua-include="${MODLUA_INCL_DIR}" \ --lua-version="${MODLUA_VERSION}" \ --no-example-certs \ + --idn-library=icu \ --c-compiler="${CC}" \ --linker="${CC}" \ --ldflags="-L/usr/lib -L${LOCALBASE}/lib -shared" \ @@ -47,6 +50,9 @@ pre-configure: cd ${WRKSRC}; sed -i -e 's,^#!/usr/bin/env lua,#!${MODLUA_BIN},' -e \ 's,^lua ,${MODLUA_BIN} ,' prosody prosodyctl +post-patch: + ${SUBST_CMD} ${WRKSRC}/util/prosodyctl.lua + post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/prosody ${INSTALL_DATA} ${WRKSRC}/README \ diff --git a/net/prosody/distinfo b/net/prosody/distinfo index 1259a781183..4c568d96106 100644 --- a/net/prosody/distinfo +++ b/net/prosody/distinfo @@ -1,2 +1,2 @@ -SHA256 (prosody-0.11.13.tar.gz) = OcYbNGoJtRJbYEy5aeFCBsu8uGyBFW/8a6LWJSfPBDI= -SIZE (prosody-0.11.13.tar.gz) = 439816 +SHA256 (prosody-0.12.0.tar.gz) = dS/zIBXaxWX8NBfCGWryaJccNY7gZuUfXZEkE1gNiJo= +SIZE (prosody-0.12.0.tar.gz) = 610330 diff --git a/net/prosody/patches/patch-core_certmanager_lua b/net/prosody/patches/patch-core_certmanager_lua index 77b129d2659..9a2584e6469 100644 --- a/net/prosody/patches/patch-core_certmanager_lua +++ b/net/prosody/patches/patch-core_certmanager_lua @@ -1,7 +1,7 @@ Index: core/certmanager.lua --- core/certmanager.lua.orig +++ core/certmanager.lua -@@ -110,7 +110,7 @@ end +@@ -202,7 +202,7 @@ end -- Built-in defaults local core_defaults = { @@ -9,4 +9,4 @@ Index: core/certmanager.lua + cafile = "/etc/ssl/cert.pem"; depth = 9; protocol = "tlsv1+"; - verify = (ssl_x509 and { "peer", "client_once", }) or "none"; + verify = "none"; diff --git a/net/prosody/patches/patch-plugins_mod_admin_socket_lua b/net/prosody/patches/patch-plugins_mod_admin_socket_lua new file mode 100644 index 00000000000..38933741801 --- /dev/null +++ b/net/prosody/patches/patch-plugins_mod_admin_socket_lua @@ -0,0 +1,16 @@ +Upstream fix for older LuaSocket +ref: https://hg.prosody.im/timber/rev/55590a970de7 + +Index: plugins/mod_admin_socket.lua +--- plugins/mod_admin_socket.lua.orig ++++ plugins/mod_admin_socket.lua +@@ -2,6 +2,9 @@ module:set_global(); + + local have_unix, unix = pcall(require, "socket.unix"); + ++if have_unix and type(unix) == "function" then ++ unix = { stream = unix }; ++end + if not have_unix or type(unix) ~= "table" then + module:log_status("error", "LuaSocket unix socket support not available or incompatible, ensure it is up to date"); + return; diff --git a/net/prosody/patches/patch-prosody_cfg_lua_dist b/net/prosody/patches/patch-prosody_cfg_lua_dist index c71921bfdef..2b8227c237d 100644 --- a/net/prosody/patches/patch-prosody_cfg_lua_dist +++ b/net/prosody/patches/patch-prosody_cfg_lua_dist @@ -12,10 +12,10 @@ Index: prosody.cfg.lua.dist +-- Enable POSIX-only options +pidfile = "/var/prosody/prosody.pid" + - -- Enable use of libevent for better performance under high load - -- For more information see: https://prosody.im/doc/libevent - --use_libevent = true -@@ -164,8 +171,8 @@ archive_expires_after = "1w" -- Remove archived messag + -- This option allows you to specify additional locations where Prosody + -- will search first for modules. For additional modules you can install, see + -- the community module repository at https://modules.prosody.im/ +@@ -183,8 +190,8 @@ archive_expires_after = "1w" -- Remove archived messag -- Logging configuration -- For advanced logging see https://prosody.im/doc/logging log = { @@ -24,5 +24,5 @@ Index: prosody.cfg.lua.dist + info = "/var/prosody/prosody.log"; -- Change 'info' to 'debug' for verbose logging + error = "/var/prosody/prosody.err"; -- "*syslog"; -- Uncomment this for logging to syslog - -- "*console"; -- Log to the console, useful for debugging with daemonize=false + -- "*console"; -- Log to the console, useful for debugging when running in the foreground } diff --git a/net/prosody/patches/patch-util-src_pposix_c b/net/prosody/patches/patch-util-src_pposix_c index 9ac79eba76c..c322044f7c0 100644 --- a/net/prosody/patches/patch-util-src_pposix_c +++ b/net/prosody/patches/patch-util-src_pposix_c @@ -3,9 +3,9 @@ Define _BSD_SOURCE to make initgroups(3) visible Index: util-src/pposix.c --- util-src/pposix.c.orig +++ util-src/pposix.c -@@ -33,6 +33,11 @@ - #ifndef _POSIX_C_SOURCE - #define _POSIX_C_SOURCE 200809L +@@ -31,6 +31,11 @@ + #define _DARWIN_C_SOURCE + #endif #endif +#if defined(__OpenBSD__) +#ifndef _BSD_SOURCE @@ -13,5 +13,5 @@ Index: util-src/pposix.c +#endif +#endif - #include - #include + #if ! defined(__FreeBSD__) + #ifndef _POSIX_C_SOURCE diff --git a/net/prosody/patches/patch-util_adminstream_lua b/net/prosody/patches/patch-util_adminstream_lua new file mode 100644 index 00000000000..c8ef1ce104e --- /dev/null +++ b/net/prosody/patches/patch-util_adminstream_lua @@ -0,0 +1,16 @@ +Upstream fix for older LuaSocket +ref: https://hg.prosody.im/timber/rev/55590a970de7 + +Index: util/adminstream.lua +--- util/adminstream.lua.orig ++++ util/adminstream.lua +@@ -139,6 +139,9 @@ end + + local function new_connection(socket_path, listeners) + local have_unix, unix = pcall(require, "socket.unix"); ++ if have_unix and type(unix) == "function" then ++ unix = { stream = unix }; ++ end + if type(unix) ~= "table" then + have_unix = false; + end diff --git a/net/prosody/patches/patch-util_prosodyctl_lua b/net/prosody/patches/patch-util_prosodyctl_lua index b1fc216f944..898f056da4a 100644 --- a/net/prosody/patches/patch-util_prosodyctl_lua +++ b/net/prosody/patches/patch-util_prosodyctl_lua @@ -1,12 +1,21 @@ Index: util/prosodyctl.lua --- util/prosodyctl.lua.orig +++ util/prosodyctl.lua -@@ -240,7 +240,7 @@ local function start(source_dir) +@@ -180,7 +180,7 @@ local function start(source_dir, lua) if not source_dir then - os.execute("./prosody -D"); + os.execute(lua .. "./prosody -D"); else -- os.execute(source_dir.."/../../bin/prosody -D"); -+ os.execute(source_dir.."/../../sbin/prosody -D"); +- os.execute(lua .. source_dir.."/../../bin/prosody -D"); ++ os.execute(lua .. source_dir.."/../../sbin/prosody -D"); end return true; end +@@ -221,7 +221,7 @@ local render_cli = interpolation.new("%b{}", function + + local function call_luarocks(operation, mod, server) + local dir = prosody.paths.installer; +- local ok, _, code = os.execute(render_cli("luarocks --lua-version={luav} {op} --tree={dir} {server&--server={server}} {mod?}", { ++ local ok, _, code = os.execute(render_cli("luarocks-${MODLUA_VERSION} --lua-version={luav} {op} --tree={dir} {server&--server={server}} {mod?}", { + dir = dir; op = operation; mod = mod; server = server; luav = _VERSION:match("5%.%d"); + })); + if type(ok) == "number" then code = ok; end diff --git a/net/prosody/pkg/PLIST b/net/prosody/pkg/PLIST index 42607a1e7c9..1d413540010 100644 --- a/net/prosody/pkg/PLIST +++ b/net/prosody/pkg/PLIST @@ -5,6 +5,7 @@ lib/prosody/ lib/prosody/core/ lib/prosody/core/certmanager.lua lib/prosody/core/configmanager.lua +lib/prosody/core/features.lua lib/prosody/core/hostmanager.lua lib/prosody/core/loggingmanager.lua lib/prosody/core/moduleapi.lua @@ -22,27 +23,38 @@ lib/prosody/modules/adhoc/ lib/prosody/modules/adhoc/adhoc.lib.lua lib/prosody/modules/adhoc/mod_adhoc.lua lib/prosody/modules/mod_admin_adhoc.lua +lib/prosody/modules/mod_admin_shell.lua +lib/prosody/modules/mod_admin_socket.lua lib/prosody/modules/mod_admin_telnet.lua lib/prosody/modules/mod_announce.lua lib/prosody/modules/mod_auth_anonymous.lua -lib/prosody/modules/mod_auth_cyrus.lua lib/prosody/modules/mod_auth_insecure.lua lib/prosody/modules/mod_auth_internal_hashed.lua lib/prosody/modules/mod_auth_internal_plain.lua +lib/prosody/modules/mod_auth_ldap.lua +lib/prosody/modules/mod_authz_internal.lua lib/prosody/modules/mod_blocklist.lua +lib/prosody/modules/mod_bookmarks.lua lib/prosody/modules/mod_bosh.lua lib/prosody/modules/mod_c2s.lua lib/prosody/modules/mod_carbons.lua lib/prosody/modules/mod_component.lua +lib/prosody/modules/mod_cron.lua lib/prosody/modules/mod_csi.lua lib/prosody/modules/mod_csi_simple.lua lib/prosody/modules/mod_debug_sql.lua lib/prosody/modules/mod_dialback.lua lib/prosody/modules/mod_disco.lua +lib/prosody/modules/mod_external_services.lua lib/prosody/modules/mod_groups.lua lib/prosody/modules/mod_http.lua lib/prosody/modules/mod_http_errors.lua +lib/prosody/modules/mod_http_file_share.lua lib/prosody/modules/mod_http_files.lua +lib/prosody/modules/mod_http_openmetrics.lua +lib/prosody/modules/mod_invites.lua +lib/prosody/modules/mod_invites_adhoc.lua +lib/prosody/modules/mod_invites_register.lua lib/prosody/modules/mod_iq.lua lib/prosody/modules/mod_lastactivity.lua lib/prosody/modules/mod_legacyauth.lua @@ -52,6 +64,7 @@ lib/prosody/modules/mod_mam/mamprefs.lib.lua lib/prosody/modules/mod_mam/mamprefsxml.lib.lua lib/prosody/modules/mod_mam/mod_mam.lua lib/prosody/modules/mod_message.lua +lib/prosody/modules/mod_mimicking.lua lib/prosody/modules/mod_motd.lua lib/prosody/modules/mod_muc_mam.lua lib/prosody/modules/mod_muc_unique.lua @@ -72,13 +85,13 @@ lib/prosody/modules/mod_register.lua lib/prosody/modules/mod_register_ibr.lua lib/prosody/modules/mod_register_limits.lua lib/prosody/modules/mod_roster.lua -lib/prosody/modules/mod_s2s/ -lib/prosody/modules/mod_s2s/mod_s2s.lua -lib/prosody/modules/mod_s2s/s2sout.lib.lua +lib/prosody/modules/mod_s2s.lua lib/prosody/modules/mod_s2s_auth_certs.lua +lib/prosody/modules/mod_s2s_bidi.lua lib/prosody/modules/mod_saslauth.lua lib/prosody/modules/mod_scansion_record.lua lib/prosody/modules/mod_server_contact_info.lua +lib/prosody/modules/mod_smacks.lua lib/prosody/modules/mod_stanza_debug.lua lib/prosody/modules/mod_storage_internal.lua lib/prosody/modules/mod_storage_memory.lua @@ -87,6 +100,9 @@ lib/prosody/modules/mod_storage_sql.lua lib/prosody/modules/mod_storage_xep0227.lua lib/prosody/modules/mod_time.lua lib/prosody/modules/mod_tls.lua +lib/prosody/modules/mod_tokenauth.lua +lib/prosody/modules/mod_tombstones.lua +lib/prosody/modules/mod_turn_external.lua lib/prosody/modules/mod_unknown.lua lib/prosody/modules/mod_uptime.lua lib/prosody/modules/mod_user_account_management.lua @@ -101,6 +117,7 @@ lib/prosody/modules/mod_windows.lua lib/prosody/modules/muc/ lib/prosody/modules/muc/config_form_sections.lib.lua lib/prosody/modules/muc/description.lib.lua +lib/prosody/modules/muc/hats.lib.lua lib/prosody/modules/muc/hidden.lib.lua lib/prosody/modules/muc/history.lib.lua lib/prosody/modules/muc/language.lib.lua @@ -111,8 +128,10 @@ lib/prosody/modules/muc/moderated.lib.lua lib/prosody/modules/muc/muc.lib.lua lib/prosody/modules/muc/name.lib.lua lib/prosody/modules/muc/occupant.lib.lua +lib/prosody/modules/muc/occupant_id.lib.lua lib/prosody/modules/muc/password.lib.lua lib/prosody/modules/muc/persistent.lib.lua +lib/prosody/modules/muc/presence_broadcast.lib.lua lib/prosody/modules/muc/register.lib.lua lib/prosody/modules/muc/request.lib.lua lib/prosody/modules/muc/subject.lib.lua @@ -121,51 +140,67 @@ lib/prosody/modules/muc/whois.lib.lua lib/prosody/net/ lib/prosody/net/adns.lua lib/prosody/net/connect.lua -lib/prosody/net/connlisteners.lua lib/prosody/net/cqueues.lua lib/prosody/net/dns.lua lib/prosody/net/http/ lib/prosody/net/http.lua lib/prosody/net/http/codes.lua +lib/prosody/net/http/errors.lua +lib/prosody/net/http/files.lua lib/prosody/net/http/parser.lua lib/prosody/net/http/server.lua lib/prosody/net/httpserver.lua lib/prosody/net/resolvers/ lib/prosody/net/resolvers/basic.lua +lib/prosody/net/resolvers/chain.lua lib/prosody/net/resolvers/manual.lua lib/prosody/net/resolvers/service.lua lib/prosody/net/server.lua lib/prosody/net/server_epoll.lua lib/prosody/net/server_event.lua lib/prosody/net/server_select.lua +lib/prosody/net/stun.lua +lib/prosody/net/unbound.lua lib/prosody/net/websocket/ lib/prosody/net/websocket.lua lib/prosody/net/websocket/frames.lua lib/prosody/prosody.version lib/prosody/util/ lib/prosody/util/adhoc.lua +lib/prosody/util/adminstream.lua +lib/prosody/util/argparse.lua lib/prosody/util/array.lua lib/prosody/util/async.lua +lib/prosody/util/bit${MODLUA_DEP_VERSION}.lua +lib/prosody/util/bitcompat.lua lib/prosody/util/cache.lua lib/prosody/util/caps.lua @so lib/prosody/util/compat.so lib/prosody/util/dataforms.lua lib/prosody/util/datamanager.lua +lib/prosody/util/datamapper.lua lib/prosody/util/datetime.lua lib/prosody/util/dbuffer.lua lib/prosody/util/debug.lua lib/prosody/util/dependencies.lua +lib/prosody/util/dns.lua +lib/prosody/util/dnsregistry.lua @so lib/prosody/util/encodings.so lib/prosody/util/envload.lua +lib/prosody/util/error.lua lib/prosody/util/events.lua lib/prosody/util/filters.lua lib/prosody/util/format.lua lib/prosody/util/gc.lua @so lib/prosody/util/hashes.so +lib/prosody/util/hashring.lua lib/prosody/util/helpers.lua lib/prosody/util/hex.lua lib/prosody/util/hmac.lua lib/prosody/util/http.lua +lib/prosody/util/human/ +lib/prosody/util/human/io.lua +lib/prosody/util/human/units.lua lib/prosody/util/id.lua lib/prosody/util/import.lua lib/prosody/util/indexedbheap.lua @@ -174,10 +209,14 @@ lib/prosody/util/ip.lua lib/prosody/util/iterators.lua lib/prosody/util/jid.lua lib/prosody/util/json.lua +lib/prosody/util/jsonpointer.lua +lib/prosody/util/jsonschema.lua +lib/prosody/util/jwt.lua lib/prosody/util/logger.lua lib/prosody/util/mercurial.lua lib/prosody/util/multitable.lua @so lib/prosody/util/net.so +lib/prosody/util/openmetrics.lua lib/prosody/util/openssl.lua lib/prosody/util/paths.lua lib/prosody/util/pluginloader.lua @@ -185,7 +224,11 @@ lib/prosody/util/pluginloader.lua @so lib/prosody/util/pposix.so lib/prosody/util/presence.lua lib/prosody/util/promise.lua +lib/prosody/util/prosodyctl/ lib/prosody/util/prosodyctl.lua +lib/prosody/util/prosodyctl/cert.lua +lib/prosody/util/prosodyctl/check.lua +lib/prosody/util/prosodyctl/shell.lua lib/prosody/util/pubsub.lua lib/prosody/util/queue.lua lib/prosody/util/random.lua @@ -195,15 +238,14 @@ lib/prosody/util/rsm.lua lib/prosody/util/sasl/ lib/prosody/util/sasl.lua lib/prosody/util/sasl/anonymous.lua -lib/prosody/util/sasl/digest-md5.lua lib/prosody/util/sasl/external.lua lib/prosody/util/sasl/plain.lua lib/prosody/util/sasl/scram.lua -lib/prosody/util/sasl_cyrus.lua lib/prosody/util/serialization.lua lib/prosody/util/session.lua lib/prosody/util/set.lua @so lib/prosody/util/signal.so +lib/prosody/util/smqueue.lua lib/prosody/util/sql.lua lib/prosody/util/sslconfig.lua lib/prosody/util/stanza.lua @@ -211,6 +253,7 @@ lib/prosody/util/startup.lua lib/prosody/util/statistics.lua lib/prosody/util/statsd.lua @so lib/prosody/util/strbitop.so +@so lib/prosody/util/struct.so @so lib/prosody/util/table.so lib/prosody/util/template.lua lib/prosody/util/termcolours.lua @@ -224,6 +267,7 @@ lib/prosody/util/x509.lua lib/prosody/util/xml.lua lib/prosody/util/xmppstream.lua lib/prosody/util/xpcall.lua +lib/prosody/util/xtemplate.lua @man man/man1/prosodyctl.1 sbin/prosody sbin/prosodyctl