prosody?
2 files changed, 38 insertions, 1 deletions
diff --git a/host/Rory-ovh/services/nginx/rory.gay/root.nix b/host/Rory-ovh/services/nginx/rory.gay/root.nix
index 2f491cf..895ae77 100755
--- a/host/Rory-ovh/services/nginx/rory.gay/root.nix
+++ b/host/Rory-ovh/services/nginx/rory.gay/root.nix
@@ -3,7 +3,7 @@
enableACME = !config.virtualisation.isVmVariant;
addSSL = !config.virtualisation.isVmVariant;
root = "/data/nginx/html_rory_gay";
- extraConfig = ''autoindex on;'';
+ extraConfig = "autoindex on;";
locations."= /.well-known/matrix/server".extraConfig = ''
more_set_headers 'Content-Type application/json';
@@ -46,4 +46,28 @@
}
}';
'';
+
+ locations."= /.well-known/host-meta".extraConfig = ''
+ more_set_headers 'Content-Type application/json';
+ more_set_headers 'Access-Control-Allow-Origin *';
+ return 200 '<?xml version='1.0' encoding='utf-8'?>
+ <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
+ <Link rel="urn:xmpp:alt-connections:websocket"
+ href="wss://xmpp.rory.gay/ws" />
+ </XRD>';
+ '';
+ locations."= /.well-known/host-meta.json".extraConfig = ''
+ more_set_headers 'Content-Type application/json';
+ more_set_headers 'Access-Control-Allow-Origin *';
+ return 200 '${
+ builtins.toJSON {
+ links = [
+ {
+ rel = "urn:xmpp:alt-connections:websocket";
+ href = "wss://xmpp.rory.gay/ws";
+ }
+ ];
+ }
+ }';
+ '';
}
diff --git a/host/Rory-ovh/services/prosody.nix b/host/Rory-ovh/services/prosody.nix
new file mode 100644
index 0000000..53743a4
--- /dev/null
+++ b/host/Rory-ovh/services/prosody.nix
@@ -0,0 +1,13 @@
+{ lib, pkgs, ... }:
+{
+ services.prosody = {
+ enable = true;
+ virtualhosts."rory.gay" = {
+ enabled = true;
+ domain = "rory.gay";
+ };
+ admins = [
+ "emma@rory.gay"
+ ];
+ };
+}
|