From 420398889eb341505ea1573861329c87a06b8236 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 9 Sep 2024 20:21:53 +0200 Subject: [PATCH] nixos/matrix-appservice-irc: allow disabling media lifetime Posting media URLs to IRC that vanish, when they can be refetched from the remote server they were originated from is not great UX. --- nixos/modules/services/matrix/appservice-irc.nix | 5 ++++- nixos/tests/matrix/appservice-irc.nix | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/matrix/appservice-irc.nix b/nixos/modules/services/matrix/appservice-irc.nix index df12998ab156..ac8d4250b9ac 100644 --- a/nixos/modules/services/matrix/appservice-irc.nix +++ b/nixos/modules/services/matrix/appservice-irc.nix @@ -147,10 +147,13 @@ in { ''; }; ttlSeconds = lib.mkOption { - type = ints.positive; + type = ints.unsigned; default = 3600; + example = 0; description = '' Lifetime in seconds, that generated URLs stay valid. + + Set the lifetime to 0 to prevent URLs from becoming invalid. ''; }; bindPort = lib.mkOption { diff --git a/nixos/tests/matrix/appservice-irc.nix b/nixos/tests/matrix/appservice-irc.nix index 2c556ec37fc5..41a6b005064f 100644 --- a/nixos/tests/matrix/appservice-irc.nix +++ b/nixos/tests/matrix/appservice-irc.nix @@ -84,7 +84,10 @@ aliasTemplate = "#irc_$CHANNEL"; }; }; - mediaProxy.publicUrl = "http://localhost:11111/media"; + mediaProxy = { + publicUrl = "http://localhost:11111/media"; + ttl = 0; + }; }; }; };