shell: fix nixos-enter
[sourcephile-nix.git] / hosts / mermet / prosody.nix
index 16d32ba56c599f554abf252a497a277ad47e5ac7..f5ec68639309a0fcc0f6a72a52d6cc8dc4b86d34 100644 (file)
@@ -89,10 +89,35 @@ in
           proxy65_acl = [ domain ];
         };
       };
+      "pubsub.${domain}" = {
+        module = "pubsub";
+        settings = {
+          modules_enabled = [
+            #"pubsub_alertmanager"
+            "pubsub_feeds"
+            #"pubsub_github"
+            "pubsub_summary"
+            "pubsub_text_interface"
+          ];
+          admins = { };
+          autocreate_on_subscribe = false;
+          autocreate_on_publish = false;
+          pubsub_max_items = 256;
+          pubsub_summary_templates = {
+            "http://www.w3.org/2005/Atom" = "{summary|or{{author/name|and{{author/name} posted }}{title}}}";
+          };
+        };
+      };
       "salons.${domain}" = {
         module = "muc";
         settings = {
-          modules_enabled = [ "vcard_muc" ];
+          modules_enabled = [
+            "http_muc_log"
+            "muc_mam"
+            "vcard_muc"
+            #"muc_log"
+            #"muc_log_http"
+          ];
           name = "Prosody Chatrooms";
           restrict_room_creation = "local";
           max_history_messages = 42;
@@ -107,6 +132,19 @@ in
           muc_room_default_change_subject = true;
           muc_room_default_history_length = 42;
           muc_room_default_language = "fr";
+
+          # mod_muc_mam
+          muc_log_by_default = true;
+          muc_log_presences = false;
+          log_all_rooms = false;
+          muc_log_expires_after = "1w";
+          muc_log_cleanup_interval = 4 * 60 * 60;
+          # mod_http_muc_log
+          http_muc_log_show_images = true;
+          #http_muc_log_default_view = "latest";
+          http_muc_log_list_order = [
+            "test@salons.${domain}"
+          ];
         };
       };
       "tmp.${domain}" = {
@@ -129,6 +167,7 @@ in
       admins = [
         "julm@${domain}"
       ];
+      site_name = "soucephile.fr";
       contact_info = {
         #abuse = [ "mailto:abuse@${domain}", "xmpp:abuse@${domain}" ];
         #admin = [ "mailto:admin@${domain}", "xmpp:admin@${domain}" ];
@@ -138,7 +177,8 @@ in
         #support = [ "http://${domain}/support.php", "xmpp:support@${domain}" ];
       };
 
-      allow_registration = false;
+      allow_registration = true;
+      registration_invite_only = true;
       authentication = "internal_hashed";
 
       # Listen only in IPv4 until hosting provider's IPv6 works well.
@@ -168,7 +208,7 @@ in
       disco_items = [
         [
           "biboumi.${domain}"
-          "Passerelle vers des serveurs IRC (Internet Relay Chat)"
+          "Gateway to IRC (Internet Relay Chat) servers"
         ]
       ];
 
@@ -179,31 +219,70 @@ in
         error = "*syslog";
       };
 
+      storage = {
+        archive = "xmlarchive";
+        muc_log = "xmlarchive";
+      };
+      # mod_mam
+      archive_expires_after = "3m"; # months
+      archive_cleanup_interval = 4 * 60 * 60;
+      default_archive_policy = "roster";
+
+      limits = {
+        c2s = {
+          rate = "3kb/s";
+          burst = "2s";
+        };
+        s2sin = {
+          rate = "10kb/s";
+          burst = "5s";
+        };
+      };
+
+      csi_important_payloads = {
+        # Anything in this namespace:
+        #"{urn:example:important-namespace}"
+        # Specific element name and namespace:
+        #"{urn:example:xmpp:priority}super-important"
+      };
+
+      feeds = {
+        code_gouv_fr = "https://code.gouv.fr/feed/feed.xml";
+        haskellweekly = "https://haskellweekly.news/newsletter.atom";
+        planet_jabber = "https://planet.jabber.org/atom.xml";
+        #prosody_blog = "http://blog.prosody.im/feed/atom.xml";
+      };
+
       modules_enabled = [
         "admin_shell"
         "announce"
         "blocklist"
-        "bookmark"
         #"cloud_notify_encrypted"
+        "csi_simple"
         #"extdisco"
         "groups"
+        "invites"
+        "invites_page"
+        "invites_register"
+        "limits"
         "motd"
-        #"muc_log"
-        #"muc_log_http"
         #"net_multiplex"
+        "register_apps"
         "server_contact_info"
+        #"throttle_presence"
         "turn_external"
-        #"turncredentials"
+        "vcard4"
         "watchregistrations"
         "welcome"
+        "storage_xmlarchive"
       ];
       modules_disabled = [
         "cloud_notify" # not encrypted even with OMEMO
-        #"proxy65"
-        "websocket"
-        "limits"
         "http_files"
         "http_upload"
+        #"proxy65"
+        "vcard_legacy"
+        "websocket"
       ];
 
       smacks_enabled_s2s = true;
@@ -215,9 +294,6 @@ in
       turn_external_port = 3478;
       turn_external_ttl = 86400;
 
-      # turncredentials_host = "turn.${domain}"
-      # turncredentials_port = 3478
-      # turncredentials_secret = "${coturn.static-auth-secret}";
       # http_files_dir = "/var/lib/prosody/files"
       # http_external_url = "https://tmp.${domain}:5281"
       # https_certificate = "/var/lib/acme/${domain}/fullchain.pem"
@@ -228,8 +304,18 @@ in
     };
     package = pkgs.prosody.override {
       withCommunityModules = [
-        "turncredentials"
+        "http_muc_log"
+        #"log_auth"
+        #"offline_email"
+        #"pubsub_alertmanager"
+        "pubsub_feeds"
+        #"pubsub_github"
+        "pubsub_summary"
+        "pubsub_text_interface"
+        "register_apps"
+        "invites_page"
         #"extdisco"
+        "storage_xmlarchive"
       ];
     };
   };