unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Lassieur" <clement@lassieur.org>
To: 29425@debbugs.gnu.org
Subject: [bug#29425] [PATCH 6/6] services: prosody: Allow to add raw content to the config file.
Date: Fri, 24 Nov 2017 17:52:27 +0100	[thread overview]
Message-ID: <20171124165227.5743-6-clement@lassieur.org> (raw)
In-Reply-To: <20171124165227.5743-1-clement@lassieur.org>

* 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

  parent reply	other threads:[~2017-11-24 16:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Clément Lassieur [this message]
2017-11-24 21:50     ` [bug#29425] [PATCH 6/6] services: prosody: Allow to add raw content to the config file 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171124165227.5743-6-clement@lassieur.org \
    --to=clement@lassieur.org \
    --cc=29425@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).