aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/configuration/server/prosody/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/configuration/server/prosody/default.nix')
-rw-r--r--infra/libkookie/configuration/server/prosody/default.nix73
1 files changed, 73 insertions, 0 deletions
diff --git a/infra/libkookie/configuration/server/prosody/default.nix b/infra/libkookie/configuration/server/prosody/default.nix
new file mode 100644
index 000000000000..aeee20431a74
--- /dev/null
+++ b/infra/libkookie/configuration/server/prosody/default.nix
@@ -0,0 +1,73 @@
+{ config, pkgs, ... }:
+
+{
+ users.users.prosody.extraGroups = [ "tls" ];
+
+ networking.firewall.allowedTCPPorts = [ 5222 5223 5269 5280 5281 ];
+
+ services.prosody = let
+ ssl = {
+ cert = "/var/lib/acme/spacekookie.de/fullchain.pem";
+ key = "/var/lib/acme/spacekookie.de/key.pem";
+ };
+ in {
+ enable = true;
+ admins = [ "kookie@spacekookie.de" ];
+ modules = {
+ bosh = true;
+ carbons = true;
+ http_files = true;
+ mam = true;
+ pep = true;
+ proxy65 = true;
+ register = true;
+ websocket = true;
+ };
+ extraModules = ["vcard_legacy"];
+ inherit ssl;
+ virtualHosts."spacekookie.de" = {
+ domain = "spacekookie.de";
+ # extraConfig = ''
+ # http_host = "xmpp.spacekookie.de"
+ # '';
+ enabled = true;
+ inherit ssl;
+ };
+
+ # Move this to brook module
+ virtualHosts."guest-xmpp.spacekookie.de" = {
+ enabled = true;
+ domain = "guest-xmpp.spacekookie.de";
+ inherit ssl;
+ extraConfig = ''
+ authentication = "anonymous"
+ http_host = "guest-xmpp.spacekookie.de";
+ '';
+ };
+
+ package = pkgs.prosody.override {
+ withCommunityModules = [ "http_upload" "smacks" "csi" "conversejs"
+ "cloud_notify" "bookmarks" "vcard_muc" ];
+ };
+ muc = [{
+ domain = "rooms.spacekookie.de";
+ name = "muc";
+ extraConfig = ''
+ restrict_room_creation = "local"
+ modules_enabled = { "muc_mam" }
+ muc_log_by_default = true
+ muc_log_presences = false
+ log_all_rooms = false
+ muc_log_expires_after = "12w"
+ muc_log_cleanup_interval = 4 * 60 * 60
+ '';
+ }];
+ uploadHttp = {
+ domain = "xmpp.spacekookie.de";
+ uploadFileSizeLimit = "512 * 1024 * 1024"; # 512MB
+ };
+ extraConfig = ''
+ legacy_ssl_ports = { 5223 }
+ '';
+ };
+}