unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#29425] Prosody patches
@ 2017-11-24 16:48 Clément Lassieur
  2017-11-24 16:52 ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Clément Lassieur
  0 siblings, 1 reply; 17+ messages in thread
From: Clément Lassieur @ 2017-11-24 16:48 UTC (permalink / raw)
  To: 29425; +Cc: Rutger Helling

Patches 1 to 3 are related to the Prosody 0.10 update.  I'll push them
with Rutger's patch
(https://lists.gnu.org/archive/html/guix-patches/2017-11/txtZP9gLpmpSr.txt).

Patches 4 to 6 are unrelated improvements to the service.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop.
  2017-11-24 16:48 [bug#29425] Prosody patches Clément Lassieur
@ 2017-11-24 16:52 ` Clément Lassieur
  2017-11-24 16:52   ` [bug#29425] [PATCH 2/6] gnu: prosody: Add lua5.1-bitop to inputs Clément Lassieur
                     ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Clément Lassieur @ 2017-11-24 16:52 UTC (permalink / raw)
  To: 29425

* gnu/packages/lua.scm (lua5.1-bitop): New variable.
---
 gnu/packages/lua.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index c8bc4ef85..8aec6374f 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -446,3 +446,26 @@ Grammars (PEGs).")
      "Lua BitOp is a C extension module for Lua which adds bitwise operations
 on numbers.")
     (license license:expat)))
+
+(define-public lua5.1-bitop
+  (package
+    (inherit lua5.2-bitop)
+    (name "lua5.1-bitop")
+    ;; XXX: The arguments field is almost an exact copy of the field in
+    ;; "lua5.2-bitop", except for the version string, which was derived from
+    ;; "lua-5.2" and now is taken from "lua-5.1".  See this discussion for
+    ;; context:
+    ;; http://lists.gnu.org/archive/html/guix-devel/2017-01/msg02048.html
+    (arguments
+     `(#:test-target "test"
+       #:make-flags
+       (list "INSTALL=install -pD"
+             (string-append "INSTALLPATH=printf "
+                            (assoc-ref %outputs "out")
+                            "/lib/lua/"
+                            ,(version-major+minor (package-version lua-5.1))
+                            "/bit/bit.so"))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure))))
+    (inputs `(("lua", lua-5.1)))))
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 2/6] gnu: prosody: Add lua5.1-bitop to inputs.
  2017-11-24 16:52 ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Clément Lassieur
@ 2017-11-24 16:52   ` Clément Lassieur
  2017-11-24 21:48     ` Ludovic Courtès
  2017-11-24 16:52   ` [bug#29425] [PATCH 3/6] services: prosody: Adapt to Prosody 0.10.0 Clément Lassieur
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Clément Lassieur @ 2017-11-24 16:52 UTC (permalink / raw)
  To: 29425

It is required for mod_websocket on Lua 5.1 since Prosody 0.10.

* gnu/packages/messaging.scm (prosody)[inputs]: Add lua5.1-bitop.
---
 gnu/packages/messaging.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index a43924e3c..51f7c162c 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -709,6 +709,7 @@ a graphical desktop environment like GNOME.")
      `(("libidn" ,libidn)
        ("openssl" ,openssl)
        ("lua" ,lua-5.1)
+       ("lua5.1-bitop" ,lua5.1-bitop)
        ("lua5.1-expat" ,lua5.1-expat)
        ("lua5.1-socket" ,lua5.1-socket)
        ("lua5.1-filesystem" ,lua5.1-filesystem)
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 3/6] services: prosody: Adapt to Prosody 0.10.0.
  2017-11-24 16:52 ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Clément Lassieur
  2017-11-24 16:52   ` [bug#29425] [PATCH 2/6] gnu: prosody: Add lua5.1-bitop to inputs Clément Lassieur
@ 2017-11-24 16:52   ` Clément Lassieur
  2017-11-24 21:49     ` Ludovic Courtès
  2017-11-24 16:52   ` [bug#29425] [PATCH 4/6] services: prosody: Add support for http-external-url Clément Lassieur
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Clément Lassieur @ 2017-11-24 16:52 UTC (permalink / raw)
  To: 29425

* doc/guix.texi (Messaging Services): Add "mam" as a module example.  Document
'prosodyctl check'.  Replace 'prosodyctl cert request' with 'prosodyctl cert
import'.  Regenerate it.
* gnu/services/messaging.scm (serialize-module-list): Remove "posix" from the
default modules list because it is now automatically loaded.
(ssl-configuration)[key, certificate]: Remove them because they are now
automatically located.  Fix their docstrings.
(%default-modules-enabled): Add "carbons" and "blocklist".
(prosody-configuration)[certificates]: Set default directory from which
certificates/keys will be automatically located.
---
 doc/guix.texi              | 28 +++++++++++++++++++---------
 gnu/services/messaging.scm | 19 ++++++++++++++-----
 2 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 4f8453ebf..05aca9186 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13835,7 +13835,7 @@ record as in this example:
 @example
 (service prosody-service-type
          (prosody-configuration
-          (modules-enabled (cons "groups" %default-modules-enabled))
+          (modules-enabled (cons "groups" "mam" %default-modules-enabled))
           (int-components
            (list
             (int-component-configuration
@@ -13856,10 +13856,15 @@ By default, Prosody does not need much configuration.  Only one
 @code{virtualhosts} field is needed: it specifies the domain you wish
 Prosody to serve.
 
-Prosodyctl will help you generate X.509 certificates and keys:
+You can perform various sanity checks on the generated configuration
+with the @code{prosodyctl check} command.
+
+Prosodyctl will also help you to import certificates from the
+@code{letsencrypt} directory so that the @code{prosody} user can access
+them.  See @url{https://prosody.im/doc/letsencrypt}.
 
 @example
-prosodyctl cert request example.net
+prosodyctl --root cert import /etc/letsencrypt/live
 @end example
 
 The available configuration parameters follow.  Each parameter
@@ -13898,6 +13903,13 @@ paths in order.  See @url{http://prosody.im/doc/plugins_directory}.
 Defaults to @samp{()}.
 @end deftypevr
 
+@deftypevr {@code{prosody-configuration} parameter} file-name certificates
+Every virtual host and component needs a certificate so that clients and
+servers can securely verify its identity.  Prosody will automatically load
+certificates/keys from the directory specified here.
+Defaults to @samp{"/etc/prosody/certs"}.
+@end deftypevr
+
 @deftypevr {@code{prosody-configuration} parameter} string-list admins
 This is a list of accounts that are admins for the server.  Note that you
 must create the accounts separately.  See @url{http://prosody.im/doc/admins} and
@@ -13950,14 +13962,12 @@ Available @code{ssl-configuration} fields are:
 This determines what handshake to use.
 @end deftypevr
 
-@deftypevr {@code{ssl-configuration} parameter} file-name key
-Path to your private key file, relative to @code{/etc/prosody}.
-Defaults to @samp{"/etc/prosody/certs/key.pem"}.
+@deftypevr {@code{ssl-configuration} parameter} maybe-file-name key
+Path to your private key file.
 @end deftypevr
 
-@deftypevr {@code{ssl-configuration} parameter} file-name certificate
-Path to your certificate file, relative to @code{/etc/prosody}.
-Defaults to @samp{"/etc/prosody/certs/cert.pem"}.
+@deftypevr {@code{ssl-configuration} parameter} maybe-file-name certificate
+Path to your certificate file.
 @end deftypevr
 
 @deftypevr {@code{ssl-configuration} parameter} file-name capath
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 715d6181f..526ad5a41 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -160,7 +160,7 @@
 (define (module-list? val)
   (string-list? val))
 (define (serialize-module-list field-name val)
-  (serialize-string-list field-name (cons "posix" val)))
+  (serialize-string-list field-name val))
 (define-maybe module-list)
 
 (define (file-name? val)
@@ -203,12 +203,12 @@ just joined the room."))
    "This determines what handshake to use.")
 
   (key
-   (file-name "/etc/prosody/certs/key.pem")
-   "Path to your private key file, relative to @code{/etc/prosody}.")
+   (maybe-file-name 'disabled)
+   "Path to your private key file.")
 
   (certificate
-   (file-name "/etc/prosody/certs/cert.pem")
-   "Path to your certificate file, relative to @code{/etc/prosody}.")
+   (maybe-file-name 'disabled)
+   "Path to your certificate file.")
 
   (capath
    (file-name "/etc/ssl/certs")
@@ -271,7 +271,9 @@ can create such a file with:
     "tls"
     "dialback"
     "disco"
+    "carbons"
     "private"
+    "blocklist"
     "vcard"
     "version"
     "uptime"
@@ -321,6 +323,13 @@ can create such a file with:
 paths in order.  See @url{http://prosody.im/doc/plugins_directory}."
      global)
 
+    (certificates
+     (file-name "/etc/prosody/certs")
+     "Every virtual host and component needs a certificate so that clients and
+servers can securely verify its identity.  Prosody will automatically load
+certificates/keys from the directory specified here."
+     global)
+
     (admins
      (string-list '())
      "This is a list of accounts that are admins for the server.  Note that you
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 4/6] services: prosody: Add support for http-external-url.
  2017-11-24 16:52 ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Clément Lassieur
  2017-11-24 16:52   ` [bug#29425] [PATCH 2/6] gnu: prosody: Add lua5.1-bitop to inputs Clément Lassieur
  2017-11-24 16:52   ` [bug#29425] [PATCH 3/6] services: prosody: Adapt to Prosody 0.10.0 Clément Lassieur
@ 2017-11-24 16:52   ` Clément Lassieur
  2017-11-24 21:50     ` Ludovic Courtès
  2017-11-24 16:52   ` [bug#29425] [PATCH 5/6] services: prosody: Add support for http-max-content-size Clément Lassieur
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Clément Lassieur @ 2017-11-24 16:52 UTC (permalink / raw)
  To: 29425

* doc/guix.texi (Messaging Services): Update accordingly.
* gnu/services/messaging.scm (prosody-configuration)[http-external-url]: New
field.
---
 doc/guix.texi              | 13 ++++++++++---
 gnu/services/messaging.scm |  8 ++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 05aca9186..ad206b535 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14079,6 +14079,13 @@ File to write pid in.  See @url{http://prosody.im/doc/modules/mod_posix}.
 Defaults to @samp{"/var/run/prosody/prosody.pid"}.
 @end deftypevr
 
+@deftypevr {@code{prosody-configuration} parameter} maybe-string http-external-url
+Some modules expose their own URL in various ways.  This URL is built
+from the protocol, host and port used.  If Prosody sits behind a proxy, the
+public URL will be @code{http-external-url} instead.  See
+@url{https://prosody.im/doc/http#external_url}.
+@end deftypevr
+
 @deftypevr {@code{prosody-configuration} parameter} virtualhost-configuration-list virtualhosts
 A host in Prosody is a domain on which user accounts can be created.  For
 example if you want your users to have addresses like
@@ -14095,7 +14102,7 @@ See @url{http://prosody.im/doc/configure#virtual_host_settings}.
 
 Available @code{virtualhost-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-external-url}, plus:
 @deftypevr {@code{virtualhost-configuration} parameter} string domain
 Domain you wish Prosody to serve.
 @end deftypevr
@@ -14117,7 +14124,7 @@ Defaults to @samp{()}.
 
 Available @code{int-component-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-external-url}, plus:
 @deftypevr {@code{int-component-configuration} parameter} string hostname
 Hostname of the component.
 @end deftypevr
@@ -14170,7 +14177,7 @@ Defaults to @samp{()}.
 
 Available @code{ext-component-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-external-url}, plus:
 @deftypevr {@code{ext-component-configuration} parameter} string component-secret
 Password which the component will use to log in.
 @end deftypevr
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 526ad5a41..5a7b19605 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -436,6 +436,14 @@ by the GuixSD Prosody Service.  See @url{http://prosody.im/doc/logging}."
      "File to write pid in.  See @url{http://prosody.im/doc/modules/mod_posix}."
      global)
 
+    (http-external-url
+     (maybe-string 'disabled)
+     "Some modules expose their own URL in various ways.  This URL is built
+from the protocol, host and port used.  If Prosody sits behind a proxy, the
+public URL will be @code{http-external-url} instead.  See
+@url{https://prosody.im/doc/http#external_url}."
+     common)
+
     (virtualhosts
      (virtualhost-configuration-list
       (list (virtualhost-configuration
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 5/6] services: prosody: Add support for http-max-content-size.
  2017-11-24 16:52 ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Clément Lassieur
                     ` (2 preceding siblings ...)
  2017-11-24 16:52   ` [bug#29425] [PATCH 4/6] services: prosody: Add support for http-external-url Clément Lassieur
@ 2017-11-24 16:52   ` Clément Lassieur
  2017-11-24 21:50     ` Ludovic Courtès
  2017-11-24 16:52   ` [bug#29425] [PATCH 6/6] services: prosody: Allow to add raw content to the config file Clément Lassieur
  2017-11-24 21:48   ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Ludovic Courtès
  5 siblings, 1 reply; 17+ messages in thread
From: Clément Lassieur @ 2017-11-24 16:52 UTC (permalink / raw)
  To: 29425

* doc/guix.texi (Messaging Services): Update accordingly.
* gnu/services/messaging.scm (prosody-configuration)[http-max-content-size]:
New field.
---
 doc/guix.texi              | 10 +++++++---
 gnu/services/messaging.scm |  5 +++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ad206b535..957062e06 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14079,6 +14079,10 @@ File to write pid in.  See @url{http://prosody.im/doc/modules/mod_posix}.
 Defaults to @samp{"/var/run/prosody/prosody.pid"}.
 @end deftypevr
 
+@deftypevr {@code{prosody-configuration} parameter} maybe-non-negative-integer http-max-content-size
+Maximum allowed size of the HTTP body (in bytes).
+@end deftypevr
+
 @deftypevr {@code{prosody-configuration} parameter} maybe-string http-external-url
 Some modules expose their own URL in various ways.  This URL is built
 from the protocol, host and port used.  If Prosody sits behind a proxy, the
@@ -14102,7 +14106,7 @@ See @url{http://prosody.im/doc/configure#virtual_host_settings}.
 
 Available @code{virtualhost-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-external-url}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, plus:
 @deftypevr {@code{virtualhost-configuration} parameter} string domain
 Domain you wish Prosody to serve.
 @end deftypevr
@@ -14124,7 +14128,7 @@ Defaults to @samp{()}.
 
 Available @code{int-component-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-external-url}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, plus:
 @deftypevr {@code{int-component-configuration} parameter} string hostname
 Hostname of the component.
 @end deftypevr
@@ -14177,7 +14181,7 @@ Defaults to @samp{()}.
 
 Available @code{ext-component-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-external-url}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, plus:
 @deftypevr {@code{ext-component-configuration} parameter} string component-secret
 Password which the component will use to log in.
 @end deftypevr
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 5a7b19605..f348ca1a3 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -436,6 +436,11 @@ by the GuixSD Prosody Service.  See @url{http://prosody.im/doc/logging}."
      "File to write pid in.  See @url{http://prosody.im/doc/modules/mod_posix}."
      global)
 
+    (http-max-content-size
+     (maybe-non-negative-integer 'disabled)
+     "Maximum allowed size of the HTTP body (in bytes)."
+     common)
+
     (http-external-url
      (maybe-string 'disabled)
      "Some modules expose their own URL in various ways.  This URL is built
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 6/6] services: prosody: Allow to add raw content to the config file.
  2017-11-24 16:52 ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Clément Lassieur
                     ` (3 preceding siblings ...)
  2017-11-24 16:52   ` [bug#29425] [PATCH 5/6] services: prosody: Add support for http-max-content-size Clément Lassieur
@ 2017-11-24 16:52   ` Clément Lassieur
  2017-11-24 21:50     ` Ludovic Courtès
  2017-11-24 21:48   ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Ludovic Courtès
  5 siblings, 1 reply; 17+ messages in thread
From: Clément Lassieur @ 2017-11-24 16:52 UTC (permalink / raw)
  To: 29425

* doc/guix.texi (Messaging Services): Update accordingly.
* gnu/services/messaging.scm (prosody-configuration)[raw-content]: New field.
(raw-content?, serialize-raw-content): New procedures.
---
 doc/guix.texi              | 10 +++++++---
 gnu/services/messaging.scm | 13 ++++++++++++-
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 957062e06..dc2da7a45 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14106,7 +14106,7 @@ See @url{http://prosody.im/doc/configure#virtual_host_settings}.
 
 Available @code{virtualhost-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, @code{raw-content}, plus:
 @deftypevr {@code{virtualhost-configuration} parameter} string domain
 Domain you wish Prosody to serve.
 @end deftypevr
@@ -14128,7 +14128,7 @@ Defaults to @samp{()}.
 
 Available @code{int-component-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, @code{raw-content}, plus:
 @deftypevr {@code{int-component-configuration} parameter} string hostname
 Hostname of the component.
 @end deftypevr
@@ -14181,7 +14181,7 @@ Defaults to @samp{()}.
 
 Available @code{ext-component-configuration} fields are:
 
-all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, plus:
+all these @code{prosody-configuration} fields: @code{admins}, @code{use-libevent?}, @code{modules-enabled}, @code{modules-disabled}, @code{groups-file}, @code{allow-registration?}, @code{ssl}, @code{c2s-require-encryption?}, @code{s2s-require-encryption?}, @code{s2s-secure-auth?}, @code{s2s-insecure-domains}, @code{s2s-secure-domains}, @code{authentication}, @code{log}, @code{http-max-content-size}, @code{http-external-url}, @code{raw-content}, plus:
 @deftypevr {@code{ext-component-configuration} parameter} string component-secret
 Password which the component will use to log in.
 @end deftypevr
@@ -14201,6 +14201,10 @@ Interface Prosody listens on for component connections.
 Defaults to @samp{"127.0.0.1"}.
 @end deftypevr
 
+@deftypevr {@code{prosody-configuration} parameter} maybe-raw-content raw-content
+Raw content that will be added to the configuration file.
+@end deftypevr
+
 It could be that you just want to get a @code{prosody.cfg.lua}
 up and running.  In that case, you can pass an
 @code{opaque-prosody-configuration} record as the value of
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index f348ca1a3..b66d6ddb9 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -176,6 +176,12 @@
   (serialize-string-list field-name val))
 (define-maybe file-name)
 
+(define (raw-content? val)
+  (not (eq? val 'disabled)))
+(define (serialize-raw-content field-name val)
+  (format #t "~a" val))
+(define-maybe raw-content)
+
 (define-configuration mod-muc-configuration
   (name
    (string "Prosody Chatrooms")
@@ -533,7 +539,12 @@ See also @url{http://prosody.im/doc/modules/mod_muc}."
     (hostname
      (string (configuration-missing-field 'ext-component 'hostname))
      "Hostname of the component."
-     ext-component)))
+     ext-component)
+
+    (raw-content
+     (maybe-raw-content 'disabled)
+     "Raw content that will be added to the configuration file."
+     common)))
 
 ;; Serialize Virtualhost line first.
 (define (serialize-virtualhost-configuration config)
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop.
  2017-11-24 16:52 ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Clément Lassieur
                     ` (4 preceding siblings ...)
  2017-11-24 16:52   ` [bug#29425] [PATCH 6/6] services: prosody: Allow to add raw content to the config file Clément Lassieur
@ 2017-11-24 21:48   ` Ludovic Courtès
  2017-11-25  2:20     ` [bug#29425] [PATCH] " Clément Lassieur
  5 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2017-11-24 21:48 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 29425

Clément Lassieur <clement@lassieur.org> skribis:

> * gnu/packages/lua.scm (lua5.1-bitop): New variable.

[...]

> +(define-public lua5.1-bitop
> +  (package
> +    (inherit lua5.2-bitop)
> +    (name "lua5.1-bitop")
> +    ;; XXX: The arguments field is almost an exact copy of the field in
> +    ;; "lua5.2-bitop", except for the version string, which was derived from
> +    ;; "lua-5.2" and now is taken from "lua-5.1".  See this discussion for
> +    ;; context:
> +    ;; http://lists.gnu.org/archive/html/guix-devel/2017-01/msg02048.html
> +    (arguments
> +     `(#:test-target "test"
> +       #:make-flags
> +       (list "INSTALL=install -pD"
> +             (string-append "INSTALLPATH=printf "
> +                            (assoc-ref %outputs "out")
> +                            "/lib/lua/"
> +                            ,(version-major+minor (package-version lua-5.1))
> +                            "/bit/bit.so"))
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure))))

Maybe we could write:

  (define (lua-bitop lua)
    (package
      …))

  (define lua5.1-bitop (lua-bitop lua-5.1))
  (define lua5.2-bitop (lua-bitop lua-5.2))

?

If not, this patch LGTM.

Thank you,
Ludo’.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 2/6] gnu: prosody: Add lua5.1-bitop to inputs.
  2017-11-24 16:52   ` [bug#29425] [PATCH 2/6] gnu: prosody: Add lua5.1-bitop to inputs Clément Lassieur
@ 2017-11-24 21:48     ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2017-11-24 21:48 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 29425

Clément Lassieur <clement@lassieur.org> skribis:

> It is required for mod_websocket on Lua 5.1 since Prosody 0.10.
>
> * gnu/packages/messaging.scm (prosody)[inputs]: Add lua5.1-bitop.

OK.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 3/6] services: prosody: Adapt to Prosody 0.10.0.
  2017-11-24 16:52   ` [bug#29425] [PATCH 3/6] services: prosody: Adapt to Prosody 0.10.0 Clément Lassieur
@ 2017-11-24 21:49     ` Ludovic Courtès
  2017-11-25  2:22       ` Clément Lassieur
  0 siblings, 1 reply; 17+ messages in thread
From: Ludovic Courtès @ 2017-11-24 21:49 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 29425

Clément Lassieur <clement@lassieur.org> skribis:

> * doc/guix.texi (Messaging Services): Add "mam" as a module example.  Document
> 'prosodyctl check'.  Replace 'prosodyctl cert request' with 'prosodyctl cert
> import'.  Regenerate it.
> * gnu/services/messaging.scm (serialize-module-list): Remove "posix" from the
> default modules list because it is now automatically loaded.
> (ssl-configuration)[key, certificate]: Remove them because they are now
> automatically located.  Fix their docstrings.
> (%default-modules-enabled): Add "carbons" and "blocklist".
> (prosody-configuration)[certificates]: Set default directory from which
> certificates/keys will be automatically located.

LGTM.

I suppose the Prosody update should be applied before this one, right?

Ludo’.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 4/6] services: prosody: Add support for http-external-url.
  2017-11-24 16:52   ` [bug#29425] [PATCH 4/6] services: prosody: Add support for http-external-url Clément Lassieur
@ 2017-11-24 21:50     ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2017-11-24 21:50 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 29425

Clément Lassieur <clement@lassieur.org> skribis:

> * doc/guix.texi (Messaging Services): Update accordingly.
> * gnu/services/messaging.scm (prosody-configuration)[http-external-url]: New
> field.

OK!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 5/6] services: prosody: Add support for http-max-content-size.
  2017-11-24 16:52   ` [bug#29425] [PATCH 5/6] services: prosody: Add support for http-max-content-size Clément Lassieur
@ 2017-11-24 21:50     ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2017-11-24 21:50 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 29425

Clément Lassieur <clement@lassieur.org> skribis:

> * doc/guix.texi (Messaging Services): Update accordingly.
> * gnu/services/messaging.scm (prosody-configuration)[http-max-content-size]:
> New field.

OK!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 6/6] services: prosody: Allow to add raw content to the config file.
  2017-11-24 16:52   ` [bug#29425] [PATCH 6/6] services: prosody: Allow to add raw content to the config file Clément Lassieur
@ 2017-11-24 21:50     ` Ludovic Courtès
  0 siblings, 0 replies; 17+ messages in thread
From: Ludovic Courtès @ 2017-11-24 21:50 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 29425

Clément Lassieur <clement@lassieur.org> skribis:

> * doc/guix.texi (Messaging Services): Update accordingly.
> * gnu/services/messaging.scm (prosody-configuration)[raw-content]: New field.
> (raw-content?, serialize-raw-content): New procedures.

OK, thanks!

Ludo'.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH] gnu: Add lua5.1-bitop.
  2017-11-24 21:48   ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Ludovic Courtès
@ 2017-11-25  2:20     ` Clément Lassieur
  2017-11-25 16:24       ` Leo Famulari
  0 siblings, 1 reply; 17+ messages in thread
From: Clément Lassieur @ 2017-11-25  2:20 UTC (permalink / raw)
  To: 29425

* gnu/packages/lua.scm (lua5.1-bitop): New variable.
(make-lua-bitop): New procedure.
---
 gnu/packages/lua.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index c8bc4ef85..9708b6012 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -415,9 +415,9 @@ Grammars (PEGs).")
     (inputs `(("lua", lua-5.2)))))
 
 ;; Lua 5.3 is not supported.
-(define-public lua5.2-bitop
+(define (make-lua-bitop name lua)
   (package
-    (name "lua5.2-bitop")
+    (name name)
     (version "1.0.2")
     (source (origin
               (method url-fetch)
@@ -434,15 +434,21 @@ Grammars (PEGs).")
              (string-append "INSTALLPATH=printf "
                             (assoc-ref %outputs "out")
                             "/lib/lua/"
-                            ,(version-major+minor (package-version lua-5.2))
+                            ,(version-major+minor (package-version lua))
                             "/bit/bit.so"))
        #:phases
        (modify-phases %standard-phases
          (delete 'configure))))
-    (inputs `(("lua", lua-5.2)))
+    (inputs `(("lua", lua)))
     (home-page "http://bitop.luajit.org/index.html")
     (synopsis "Bitwise operations on numbers for Lua")
     (description
      "Lua BitOp is a C extension module for Lua which adds bitwise operations
 on numbers.")
     (license license:expat)))
+
+(define-public lua5.2-bitop
+  (make-lua-bitop "lua5.2-bitop" lua-5.2))
+
+(define-public lua5.1-bitop
+  (make-lua-bitop "lua5.1-bitop" lua-5.1))
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH 3/6] services: prosody: Adapt to Prosody 0.10.0.
  2017-11-24 21:49     ` Ludovic Courtès
@ 2017-11-25  2:22       ` Clément Lassieur
  0 siblings, 0 replies; 17+ messages in thread
From: Clément Lassieur @ 2017-11-25  2:22 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 29425

Ludovic Courtès <ludo@gnu.org> writes:

> Clément Lassieur <clement@lassieur.org> skribis:
>
>> * doc/guix.texi (Messaging Services): Add "mam" as a module example.  Document
>> 'prosodyctl check'.  Replace 'prosodyctl cert request' with 'prosodyctl cert
>> import'.  Regenerate it.
>> * gnu/services/messaging.scm (serialize-module-list): Remove "posix" from the
>> default modules list because it is now automatically loaded.
>> (ssl-configuration)[key, certificate]: Remove them because they are now
>> automatically located.  Fix their docstrings.
>> (%default-modules-enabled): Add "carbons" and "blocklist".
>> (prosody-configuration)[certificates]: Set default directory from which
>> certificates/keys will be automatically located.
>
> LGTM.
>
> I suppose the Prosody update should be applied before this one, right?

Yes.  Thank you for the review!

Clément

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH] gnu: Add lua5.1-bitop.
  2017-11-25  2:20     ` [bug#29425] [PATCH] " Clément Lassieur
@ 2017-11-25 16:24       ` Leo Famulari
  2017-11-26 14:18         ` Clément Lassieur
  0 siblings, 1 reply; 17+ messages in thread
From: Leo Famulari @ 2017-11-25 16:24 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 29425

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

On Sat, Nov 25, 2017 at 03:20:54AM +0100, Clément Lassieur wrote:
> * gnu/packages/lua.scm (lua5.1-bitop): New variable.
> (make-lua-bitop): New procedure.

Okay! Please add a comment about why we need all these different
lua-bitops :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#29425] [PATCH] gnu: Add lua5.1-bitop.
  2017-11-25 16:24       ` Leo Famulari
@ 2017-11-26 14:18         ` Clément Lassieur
  0 siblings, 0 replies; 17+ messages in thread
From: Clément Lassieur @ 2017-11-26 14:18 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 29425

Leo Famulari <leo@famulari.name> writes:

> On Sat, Nov 25, 2017 at 03:20:54AM +0100, Clément Lassieur wrote:
>> * gnu/packages/lua.scm (lua5.1-bitop): New variable.
>> (make-lua-bitop): New procedure.
>
> Okay! Please add a comment about why we need all these different
> lua-bitops :)

Thank you for the review!  I'll put a comment on the patch that updates
Prosody to 0.10 saying that Lua 5.1 is still recommended for production
usage.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-11-26 14:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-24 16:48 [bug#29425] Prosody patches Clément Lassieur
2017-11-24 16:52 ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Clément Lassieur
2017-11-24 16:52   ` [bug#29425] [PATCH 2/6] gnu: prosody: Add lua5.1-bitop to inputs Clément Lassieur
2017-11-24 21:48     ` Ludovic Courtès
2017-11-24 16:52   ` [bug#29425] [PATCH 3/6] services: prosody: Adapt to Prosody 0.10.0 Clément Lassieur
2017-11-24 21:49     ` Ludovic Courtès
2017-11-25  2:22       ` Clément Lassieur
2017-11-24 16:52   ` [bug#29425] [PATCH 4/6] services: prosody: Add support for http-external-url Clément Lassieur
2017-11-24 21:50     ` Ludovic Courtès
2017-11-24 16:52   ` [bug#29425] [PATCH 5/6] services: prosody: Add support for http-max-content-size Clément Lassieur
2017-11-24 21:50     ` Ludovic Courtès
2017-11-24 16:52   ` [bug#29425] [PATCH 6/6] services: prosody: Allow to add raw content to the config file Clément Lassieur
2017-11-24 21:50     ` Ludovic Courtès
2017-11-24 21:48   ` [bug#29425] [PATCH 1/6] gnu: Add lua5.1-bitop Ludovic Courtès
2017-11-25  2:20     ` [bug#29425] [PATCH] " Clément Lassieur
2017-11-25 16:24       ` Leo Famulari
2017-11-26 14:18         ` Clément Lassieur

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).