diff mod_ogp/README.markdown @ 4483:c4f11a4b5ac7

mod_ogp: Add the ability to whitelist domains
author JC Brand <jc@opkode.com>
date Tue, 02 Mar 2021 13:36:10 +0100
parents 205e50fdcebc
children 6813a00878ea
line wrap: on
line diff
--- a/mod_ogp/README.markdown	Tue Mar 02 12:04:14 2021 +0100
+++ b/mod_ogp/README.markdown	Tue Mar 02 13:36:10 2021 +0100
@@ -6,13 +6,25 @@
 If it finds any, it sends a [XEP-0422 fastening](https://xmpp.org/extensions/xep-0422.html) applied to the original message that looks like:
 
 ```
-    <message id="example" from="chatroom@chatservice.example" to="chatroom@chatservice.example">
-        <apply-to xmlns="urn:xmpp:fasten:0" id="origin-id-X">
-            <meta xmlns="http://www.w3.org/1999/xhtml" property="og:title" content="The Rock"/>
-            <meta xmlns="http://www.w3.org/1999/xhtml" property="og:url" content="https://www.imdb.com/title/tt0117500/"/>
-            <meta xmlns="http://www.w3.org/1999/xhtml" property="og:image" content="https://ia.media-imdb.com/images/rock.jpg"/>
-        </apply-to>
-    </message>
+<message id="example" from="chatroom@muc.example.org" to="chatroom@muc.example.org">
+<apply-to xmlns="urn:xmpp:fasten:0" id="origin-id-X">
+<meta xmlns="http://www.w3.org/1999/xhtml" property="og:title" content="The Rock"/>
+<meta xmlns="http://www.w3.org/1999/xhtml" property="og:url" content="https://www.imdb.com/title/tt0117500/"/>
+<meta xmlns="http://www.w3.org/1999/xhtml" property="og:image" content="https://ia.media-imdb.com/images/rock.jpg"/>
+</apply-to>
+</message>
 ```
 
 The module is intentionally simple in the sense that it is basically a transport for https://ogp.me/
+
+Configuration
+-------------
+
+You can present a whitelist of domains for which OGP metadata will be fetched
+via the `ogp_domain_whitelist` setting.
+
+For example:
+
+    Component "muc.example.org" "muc"
+      modules_enabled = { "ogp" }
+      ogp_domain_whitelist = { "prosody.im" }