From 96de496bdda45a33b400fab51bb874b0acd8a2b0 Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+sourcephile-nix@sourcephile.fr>
Date: Fri, 22 Apr 2022 01:53:25 +0200
Subject: [PATCH] prosody: update to 0.12

---
 hosts/losurdo/networking/wireless.nix |  4 ++--
 hosts/mermet/prosody.nix              | 12 ++++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/hosts/losurdo/networking/wireless.nix b/hosts/losurdo/networking/wireless.nix
index e6fd02a..0c96250 100644
--- a/hosts/losurdo/networking/wireless.nix
+++ b/hosts/losurdo/networking/wireless.nix
@@ -10,8 +10,8 @@ networking.interfaces.${iface} = {
 };
 # Fix to set the address before starting dhcpd4.service
 systemd.services."network-addresses-${iface}" = {
-  before = ["network.target" "hostapd.service"];
-  wantedBy = ["network.target" "hostapd.service"];
+  bindsTo = [ "hostapd.service"];
+  wantedBy = ["network.target"];
 };
 boot.kernel.sysctl."net.ipv6.conf.${iface}.addr_gen_mode" = 1;
 networking.nftables.ruleset = ''
diff --git a/hosts/mermet/prosody.nix b/hosts/mermet/prosody.nix
index 41b3068..d8db93a 100644
--- a/hosts/mermet/prosody.nix
+++ b/hosts/mermet/prosody.nix
@@ -82,6 +82,7 @@ services.prosody = {
     proxy65 = false;
   };
   extraModules = [
+    "turn_external"
     "turncredentials"
     #"net_multiplex"
     #"extdisco"
@@ -109,6 +110,12 @@ services.prosody = {
     turncredentials_host = "turn.${domain}"
     turncredentials_port = 3478
     turncredentials_secret = "${lib.removeSuffix "\n" (builtins.readFile (inputs.secrets + "/coturn/static-auth-secret"))}";
+
+    turn_external_secret = "${lib.removeSuffix "\n" (builtins.readFile (inputs.secrets + "/coturn/static-auth-secret"))}"
+    turn_external_host = ""turn.${domain}"
+    turn_external_port = 3478
+    turn_external_ttl = 86400
+
     smacks_enabled_s2s = true;
     smacks_s2s_resend = true;
 
@@ -125,6 +132,11 @@ services.prosody = {
 
     Component "biboumi.${domain}"
       component_secret = "useless-secret-on-loopback"
+
+    Component "tmp.${domain}" "http_file_share"
+      http_file_share_size_limit = 16*1024*1024 -- 16 MiB
+      http_file_share_daily_quota = 100*1024*1024 -- 100 MiB per day per user
+      http_file_share_global_quota = 1024*1024*1024 -- 1 GiB total
   '';
   #ports = {80};
   #ssl_ports = {443};
-- 
2.47.2