<div dir="ltr">Please ignore this as it starts a new thread. Apologies for the noise.<div><br></div><div>Dushara</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 October 2017 at 09:08, Dushara Jayasinghe <span dir="ltr"><<a href="mailto:nidujay@gmail.com" target="_blank">nidujay@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As stated by the upstream developers, Prosody only supports<br>
lua-5.1 or luajit (which is a lua-5.1 interpreter):<br>
<br>
> Response from zash at <a href="http://zash.se" rel="noreferrer" target="_blank">zash.se</a>:<br>
><br>
>> I pegged the package to lua 5,1 based on the contents of the<br>
>> INSTALL file. Is this a hard requirement?<br>
><br>
> Up until Prosody 0.9 Lua 5.1 is required. However LuaJIT<br>
> implements Lua 5.1 so it works.<br>
<br>
The license terms are not very consistent: the source files all<br>
state to be "MIT/X11 licensed" and defer to the COPYING file for<br>
details, but that file only has the text for the MIT license.<br>
Thus, we believe the license to be MIT/X11, as stated in the source<br>
files.<br>
<br>
This installs the base system with certificates for two domains:<br>
localhost and <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a><br>
<br>
The default runtime configuration is tweaked during installation<br>
to properly setup logging and pid-file directories.<br>
<br>
Prosody doesn't like being executed as root, and thus the daemon<br>
is executed as the user prosody. The startup script creates the<br>
pid file write location with appropriate permissions.<br>
<br>
Signed-off-by: Dushara Jayasinghe <<a href="mailto:nidujay@gmail.com">nidujay@gmail.com</a>><br>
Reviewed-by: "Yann E. MORIN" <<a href="mailto:yann.morin.1998@free.fr">yann.morin.1998@free.fr</a>><br>
---<br>
Chanes v2 -> v3:<br>
  - Create prosody group for patch file<br>
  - Use pidfile in service termination<br>
  - Remove superfluous _SOURCE line (Suggested by Yann E. Morin)<br>
<br>
 DEVELOPERS                      |   3 +<br>
 package/Config.in               |   1 +<br>
 package/prosody/Config.in       |  18 ++++<br>
 package/prosody/S50prosody      |  44 ++++++++++<br>
 package/prosody/prosody.cfg.<wbr>lua | 184 ++++++++++++++++++++++++++++++<wbr>++++++++++<br>
 package/prosody/prosody.hash    |   5 ++<br>
 package/prosody/<a href="http://prosody.mk" rel="noreferrer" target="_blank">prosody.mk</a>      |  69 +++++++++++++++<br>
 7 files changed, 324 insertions(+)<br>
 create mode 100644 package/prosody/Config.in<br>
 create mode 100644 package/prosody/S50prosody<br>
 create mode 100644 package/prosody/prosody.cfg.<wbr>lua<br>
 create mode 100644 package/prosody/prosody.hash<br>
 create mode 100644 package/prosody/<a href="http://prosody.mk" rel="noreferrer" target="_blank">prosody.mk</a><br>
<br>
diff --git a/DEVELOPERS b/DEVELOPERS<br>
index f3944e2..c415ef9 100644<br>
--- a/DEVELOPERS<br>
+++ b/DEVELOPERS<br>
@@ -485,6 +485,9 @@ F:  package/nss-pam-ldapd/<br>
 F:     package/sp-oops-extract/<br>
 F:     package/unscd/<br>
<br>
+N:     Dushara Jayasinghe <<a href="mailto:nidujay@gmail.com">nidujay@gmail.com</a>><br>
+F:     package/prosody/<br>
+<br>
 N:     Ed Swierk <<a href="mailto:eswierk@skyportsystems.com">eswierk@skyportsystems.com</a>><br>
 F:     package/xxhash/<br>
<br>
diff --git a/package/Config.in b/package/Config.in<br>
index a21c5f0..4291d97 100644<br>
--- a/package/Config.in<br>
+++ b/package/Config.in<br>
@@ -1716,6 +1716,7 @@ endif<br>
        source "package/pptp-linux/Config.in"<br>
        source "package/privoxy/Config.in"<br>
        source "package/proftpd/Config.in"<br>
+       source "package/prosody/Config.in"<br>
        source "package/proxychains-ng/<wbr>Config.in"<br>
        source "package/ptpd/Config.in"<br>
        source "package/ptpd2/Config.in"<br>
diff --git a/package/prosody/Config.in b/package/prosody/Config.in<br>
new file mode 100644<br>
index 0000000..77eeb85<br>
--- /dev/null<br>
+++ b/package/prosody/Config.in<br>
@@ -0,0 +1,18 @@<br>
+config BR2_PACKAGE_PROSODY<br>
+       bool "prosody"<br>
+       depends on BR2_PACKAGE_LUA_5_1 || BR2_PACKAGE_LUAJIT<br>
+       select BR2_PACKAGE_LUAEXPAT # runtime<br>
+       select BR2_PACKAGE_LUASEC # runtime<br>
+       select BR2_PACKAGE_LUASOCKET # runtime<br>
+       select BR2_PACKAGE_OPENSSL<br>
+       select BR2_PACKAGE_LIBIDN<br>
+       select BR2_PACKAGE_LUAFILESYSTEM # runtime<br>
+       help<br>
+         Prosody is a modern XMPP communication server. It aims to be<br>
+         easy to set up and configure, and efficient with system<br>
+         resources.<br>
+<br>
+         <a href="https://prosody.im" rel="noreferrer" target="_blank">https://prosody.im</a><br>
+<br>
+comment "prosody needs the lua interpreter"<br>
+       depends on !BR2_PACKAGE_LUA_5_1 && !BR2_PACKAGE_LUAJIT<br>
diff --git a/package/prosody/S50prosody b/package/prosody/S50prosody<br>
new file mode 100644<br>
index 0000000..84913a5<br>
--- /dev/null<br>
+++ b/package/prosody/S50prosody<br>
@@ -0,0 +1,44 @@<br>
+#! /bin/sh<br>
+<br>
+NAME=prosody<br>
+DAEMON=/usr/bin/$NAME<br>
+<br>
+# This must match the pidfile field in<br>
+# /etc/prosody/prosody.cfg.lua<br>
+<br>
+PIDDIR=/var/run/$NAME<br>
+PIDFILE=$PIDDIR/$NAME.pid<br>
+<br>
+# Gracefully exit if the package has been removed.<br>
+test -x $DAEMON || exit 0<br>
+<br>
+case "$1" in<br>
+  start)<br>
+    printf "Starting $NAME: "<br>
+    mkdir -p $PIDDIR<br>
+    chown $NAME:$NAME $PIDDIR<br>
+    start-stop-daemon -S -q -o -x $DAEMON -c $NAME<br>
+    [ $? = 0 ] && echo "OK" || echo "FAIL"<br>
+    ;;<br>
+  stop)<br>
+    printf "Stopping $NAME: "<br>
+    # The standard method of identifying the name doesn't<br>
+    # work as the process name is lua. So use the pidfile<br>
+    # which is created by the service itself as a match<br>
+    # criteria when stopping the service<br>
+    start-stop-daemon -K -q -o -p "$PIDFILE"<br>
+    [ $? = 0 ] && echo "OK" || echo "FAIL"<br>
+    ;;<br>
+  restart|reload)<br>
+    echo "Restarting $NAME: "<br>
+    $0 stop<br>
+    sleep 1<br>
+    $0 start<br>
+    ;;<br>
+  *)<br>
+    echo "Usage: $0 {start|stop|restart|reload}" >&2<br>
+    exit 1<br>
+    ;;<br>
+esac<br>
+<br>
+exit 0<br>
diff --git a/package/prosody/prosody.cfg.<wbr>lua b/package/prosody/prosody.cfg.<wbr>lua<br>
new file mode 100644<br>
index 0000000..8329c0a<br>
--- /dev/null<br>
+++ b/package/prosody/prosody.cfg.<wbr>lua<br>
@@ -0,0 +1,184 @@<br>
+-- Prosody Example Configuration File<br>
+--<br>
+-- Information on configuring Prosody can be found on our<br>
+-- website at <a href="http://prosody.im/doc/configure" rel="noreferrer" target="_blank">http://prosody.im/doc/<wbr>configure</a><br>
+--<br>
+-- Tip: You can check that the syntax of this file is correct<br>
+-- when you have finished by running: luac -p prosody.cfg.lua<br>
+-- If there are any errors, it will let you know what and where<br>
+-- they are, otherwise it will keep quiet.<br>
+--<br>
+-- The only thing left to do is rename this file to remove the .dist ending, and fill in the<br>
+-- blanks. Good luck, and happy Jabbering!<br>
+<br>
+<br>
+---------- Server-wide settings ----------<br>
+-- Settings in this section apply to the whole server and are the default settings<br>
+-- for any virtual hosts<br>
+<br>
+-- This is a (by default, empty) list of accounts that are admins<br>
+-- for the server. Note that you must create the accounts separately<br>
+-- (see <a href="http://prosody.im/doc/creating_accounts" rel="noreferrer" target="_blank">http://prosody.im/doc/<wbr>creating_accounts</a> for info)<br>
+-- Example: admins = { "<a href="mailto:user1@example.com">user1@example.com</a>", "<a href="mailto:user2@example.net">user2@example.net</a>" }<br>
+admins = { }<br>
+<br>
+-- Enable use of libevent for better performance under high load<br>
+-- For more information see: <a href="http://prosody.im/doc/libevent" rel="noreferrer" target="_blank">http://prosody.im/doc/libevent</a><br>
+--use_libevent = true;<br>
+<br>
+-- This is the list of modules Prosody will load on startup.<br>
+-- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.<br>
+-- Documentation on modules can be found at: <a href="http://prosody.im/doc/modules" rel="noreferrer" target="_blank">http://prosody.im/doc/modules</a><br>
+modules_enabled = {<br>
+<br>
+       -- Generally required<br>
+               "roster"; -- Allow users to have a roster. Recommended ;)<br>
+               "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.<br>
+               "tls"; -- Add support for secure TLS on c2s/s2s connections<br>
+               "dialback"; -- s2s dialback support<br>
+               "disco"; -- Service discovery<br>
+<br>
+       -- Not essential, but recommended<br>
+               "private"; -- Private XML storage (for room bookmarks, etc.)<br>
+               "vcard"; -- Allow users to set vCards<br>
+<br>
+       -- These are commented by default as they have a performance impact<br>
+               --"privacy"; -- Support privacy lists<br>
+               --"compression"; -- Stream compression<br>
+<br>
+       -- Nice to have<br>
+               "version"; -- Replies to server version requests<br>
+               "uptime"; -- Report how long server has been running<br>
+               "time"; -- Let others know the time here on this server<br>
+               "ping"; -- Replies to XMPP pings with pongs<br>
+               "pep"; -- Enables users to publish their mood, activity, playing music and more<br>
+               "register"; -- Allow users to register on this server using a client and change passwords<br>
+<br>
+       -- Admin interfaces<br>
+               "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands<br>
+               --"admin_telnet"; -- Opens telnet console interface on localhost port 5582<br>
+<br>
+       -- HTTP modules<br>
+               --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"<br>
+               --"http_files"; -- Serve static files from a directory over HTTP<br>
+<br>
+       -- Other specific functionality<br>
+               "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.<br>
+               --"groups"; -- Shared roster support<br>
+               --"announce"; -- Send announcement to all online users<br>
+               --"welcome"; -- Welcome users who register accounts<br>
+               --"watchregistrations"; -- Alert admins of registrations<br>
+               --"motd"; -- Send a message to users when they log in<br>
+               --"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.<br>
+};<br>
+<br>
+-- These modules are auto-loaded, but should you want<br>
+-- to disable them then uncomment them here:<br>
+modules_disabled = {<br>
+       -- "offline"; -- Store offline messages<br>
+       -- "c2s"; -- Handle client connections<br>
+       -- "s2s"; -- Handle server-to-server connections<br>
+};<br>
+<br>
+-- Disable account creation by default, for security<br>
+-- For more information see <a href="http://prosody.im/doc/creating_accounts" rel="noreferrer" target="_blank">http://prosody.im/doc/<wbr>creating_accounts</a><br>
+allow_registration = false;<br>
+<br>
+-- These are the SSL/TLS-related settings. If you don't want<br>
+-- to use SSL/TLS, you may comment or remove this<br>
+ssl = {<br>
+       key = "certs/localhost.key";<br>
+       certificate = "certs/localhost.crt";<br>
+}<br>
+<br>
+-- Force clients to use encrypted connections? This option will<br>
+-- prevent clients from authenticating unless they are using encryption.<br>
+<br>
+c2s_require_encryption = false<br>
+<br>
+-- Force certificate authentication for server-to-server connections?<br>
+-- This provides ideal security, but requires servers you communicate<br>
+-- with to support encryption AND present valid, trusted certificates.<br>
+-- NOTE: Your version of LuaSec must support certificate verification!<br>
+-- For more information see <a href="http://prosody.im/doc/s2s#security" rel="noreferrer" target="_blank">http://prosody.im/doc/s2s#<wbr>security</a><br>
+<br>
+s2s_secure_auth = false<br>
+<br>
+-- Many servers don't support encryption or have invalid or self-signed<br>
+-- certificates. You can list domains here that will not be required to<br>
+-- authenticate using certificates. They will be authenticated using DNS.<br>
+<br>
+--s2s_insecure_domains = { "<a href="http://gmail.com" rel="noreferrer" target="_blank">gmail.com</a>" }<br>
+<br>
+-- Even if you leave s2s_secure_auth disabled, you can still require valid<br>
+-- certificates for some domains by specifying a list here.<br>
+<br>
+--s2s_secure_domains = { "<a href="http://jabber.org" rel="noreferrer" target="_blank">jabber.org</a>" }<br>
+<br>
+-- Select the authentication backend to use. The 'internal' providers<br>
+-- use Prosody's configured data storage to store the authentication data.<br>
+-- To allow Prosody to offer secure authentication mechanisms to clients, the<br>
+-- default provider stores passwords in plaintext. If you do not trust your<br>
+-- server please see <a href="http://prosody.im/doc/modules/mod_auth_internal_hashed" rel="noreferrer" target="_blank">http://prosody.im/doc/modules/<wbr>mod_auth_internal_hashed</a><br>
+-- for information about using the hashed backend.<br>
+<br>
+authentication = "internal_plain"<br>
+<br>
+-- Select the storage backend to use. By default Prosody uses flat files<br>
+-- in its configured data directory, but it also supports more backends<br>
+-- through modules. An "sql" backend is included by default, but requires<br>
+-- additional dependencies. See <a href="http://prosody.im/doc/storage" rel="noreferrer" target="_blank">http://prosody.im/doc/storage</a> for more info.<br>
+<br>
+--storage = "sql" -- Default is "internal"<br>
+<br>
+-- For the "sql" backend, you can uncomment *one* of the below to configure:<br>
+--sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.<br>
+--sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }<br>
+--sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }<br>
+<br>
+-- Logging configuration<br>
+-- For advanced logging see <a href="http://prosody.im/doc/logging" rel="noreferrer" target="_blank">http://prosody.im/doc/logging</a><br>
+log = {<br>
+       -- info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging<br>
+       -- error = "prosody.err";<br>
+       "*syslog"; -- Logging to syslog<br>
+       -- "*console"; -- Log to the console, useful for debugging with daemonize=false<br>
+}<br>
+<br>
+pidfile = "/var/run/prosody/prosody.pid"<br>
+<br>
+----------- Virtual hosts -----------<br>
+-- You need to add a VirtualHost entry for each domain you wish Prosody to serve.<br>
+-- Settings under each VirtualHost entry apply *only* to that host.<br>
+<br>
+VirtualHost "localhost"<br>
+<br>
+VirtualHost "<a href="http://example.com" rel="noreferrer" target="_blank">example.com</a>"<br>
+       -- Assign this host a certificate for TLS, otherwise it would use the one<br>
+       -- set in the global section (if any).<br>
+       -- Note that old-style SSL on port 5223 only supports one certificate, and will always<br>
+       -- use the global one.<br>
+       ssl = {<br>
+               key = "certs/example.com.key";<br>
+               certificate = "certs/example.com.crt";<br>
+       }<br>
+<br>
+------ Components ------<br>
+-- You can specify components to add hosts that provide special services,<br>
+-- like multi-user conferences, and transports.<br>
+-- For more information on components, see <a href="http://prosody.im/doc/components" rel="noreferrer" target="_blank">http://prosody.im/doc/<wbr>components</a><br>
+<br>
+---Set up a MUC (multi-user chat) room server on <a href="http://conference.example.com" rel="noreferrer" target="_blank">conference.example.com</a>:<br>
+--Component "<a href="http://conference.example.com" rel="noreferrer" target="_blank">conference.example.com</a>" "muc"<br>
+<br>
+-- Set up a SOCKS5 bytestream proxy for server-proxied file transfers:<br>
+--Component "<a href="http://proxy.example.com" rel="noreferrer" target="_blank">proxy.example.com</a>" "proxy65"<br>
+<br>
+---Set up an external component (default component port is 5347)<br>
+--<br>
+-- External components allow adding various services, such as gateways/<br>
+-- transports to other networks like ICQ, MSN and Yahoo. For more info<br>
+-- see: <a href="http://prosody.im/doc/components#adding_an_external_component" rel="noreferrer" target="_blank">http://prosody.im/doc/<wbr>components#adding_an_external_<wbr>component</a><br>
+--<br>
+--Component "<a href="http://gateway.example.com" rel="noreferrer" target="_blank">gateway.example.com</a>"<br>
+--     component_secret = "password"<br>
diff --git a/package/prosody/prosody.hash b/package/prosody/prosody.hash<br>
new file mode 100644<br>
index 0000000..38942ea<br>
--- /dev/null<br>
+++ b/package/prosody/prosody.hash<br>
@@ -0,0 +1,5 @@<br>
+# Hashes from: <a href="https://prosody.im/downloads/source/{MD5,SHA1,SHA256,SHA512}SUMS
+md5" rel="noreferrer" target="_blank">https://prosody.im/downloads/<wbr>source/{MD5,SHA1,SHA256,<wbr>SHA512}SUMS<br>
+md5</a>    d743adea6cfbaacc3a24cc0c3928bb<wbr>1b  prosody-0.9.12.tar.gz<br>
+sha1   1ee224263a5b3d67960e12edbbe6b2<wbr>f16b95d147  prosody-0.9.12.tar.gz<br>
+sha256 1a59a322b71928a21985522aa00d0e<wbr>ab3552208d7bf9ecb318542a1b2fee<wbr>3e8d  prosody-0.9.12.tar.gz<br>
+sha512 e87b5f3b3e327722cec9d8d0470684<wbr>e2ec2788a1c5ae623c4f505a00572e<wbr>f21f65afe84cd5b7de47d6a65fe887<wbr>2506fe34e5e8886e20979ff8471066<wbr>9857ca76  prosody-0.9.12.tar.gz<br>
diff --git a/package/prosody/<a href="http://prosody.mk" rel="noreferrer" target="_blank">prosody.mk</a> b/package/prosody/<a href="http://prosody.mk" rel="noreferrer" target="_blank">prosody.mk</a><br>
new file mode 100644<br>
index 0000000..f7a325b<br>
--- /dev/null<br>
+++ b/package/prosody/<a href="http://prosody.mk" rel="noreferrer" target="_blank">prosody.mk</a><br>
@@ -0,0 +1,69 @@<br>
+#############################<wbr>##############################<wbr>#####################<br>
+#<br>
+# prosody<br>
+#<br>
+#############################<wbr>##############################<wbr>#####################<br>
+<br>
+PROSODY_VERSION = 0.9.12<br>
+PROSODY_SITE = <a href="https://prosody.im/downloads/source" rel="noreferrer" target="_blank">https://prosody.im/downloads/<wbr>source</a><br>
+PROSODY_LICENSE = MIT<br>
+PROSODY_LICENSE_FILES = COPYING<br>
+PROSODY_DEPENDENCIES = openssl libidn<br>
+<br>
+ifeq ($(BR2_PACKAGE_LUA_5_1),y)<br>
+PROSODY_DEPENDENCIES += lua<br>
+endif<br>
+<br>
+ifeq ($(BR2_PACKAGE_LUAJIT),y)<br>
+PROSODY_DEPENDENCIES += luajit<br>
+endif<br>
+<br>
+define PROSODY_CONFIGURE_CMDS<br>
+       cd $(@D) && \<br>
+               $(TARGET_CONFIGURE_OPTS) \<br>
+               ./configure --prefix=/usr \<br>
+               --c-compiler=$(TARGET_CC) \<br>
+               --cflags="$(TARGET_CFLAGS)" \<br>
+               --linker=$(TARGET_CC) \<br>
+               --ldflags="$(TARGET_LDFLAGS) -shared" \<br>
+               --sysconfdir=/etc/prosody \<br>
+               --with-lua=$(STAGING_DIR)/usr<br>
+endef<br>
+<br>
+define PROSODY_BUILD_CMDS<br>
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)<br>
+endef<br>
+<br>
+define PROSODY_INSTALL_TARGET_CMDS<br>
+       $(TARGET_MAKE_ENV) $(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install<br>
+endef<br>
+<br>
+define PROSODY_INSTALL_INIT_SYSV<br>
+       $(INSTALL) -D -m 0755 package/prosody/S50prosody \<br>
+               $(TARGET_DIR)/etc/init.d/<wbr>S50prosody<br>
+endef<br>
+<br>
+define PROSODY_USERS<br>
+       prosody -1 prosody -1 * - - - Prosody user<br>
+endef<br>
+<br>
+# make install installs a Makefile and meta data to generate certs<br>
+define PROSODY_REMOVE_CERT_GENERATOR<br>
+       rm -f $(TARGET_DIR)/etc/prosody/<wbr>certs/Makefile<br>
+       rm -f $(TARGET_DIR)/etc/prosody/<wbr>certs/*.cnf<br>
+endef<br>
+<br>
+PROSODY_POST_INSTALL_TARGET_<wbr>HOOKS += PROSODY_REMOVE_CERT_GENERATOR<br>
+<br>
+# 1. Enable posix functionality<br>
+# 2. Log to syslog<br>
+# 3. Specify pid file write location<br>
+# 4. Enable virtual host <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a><br>
+define PROSODY_TWEAK_DEFAULT_CONF<br>
+       $(INSTALL) -D package/prosody/prosody.cfg.<wbr>lua \<br>
+               $(TARGET_DIR)/etc/prosody/<wbr>prosody.cfg.lua<br>
+endef<br>
+<br>
+PROSODY_POST_INSTALL_TARGET_<wbr>HOOKS += PROSODY_TWEAK_DEFAULT_CONF<br>
+<br>
+$(eval $(generic-package))<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.4<br>
<br>
</font></span></blockquote></div><br></div>