mirror of
https://github.com/RGBCube/ncc
synced 2025-07-30 11:37:44 +00:00
Fix well-known and use Element
This commit is contained in:
parent
ebcedfc97d
commit
ec6ba9527d
1 changed files with 9 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ config, ulib, ... }: with ulib;
|
{ config, ulib, pkgs, ... }: with ulib;
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
|
@ -6,12 +6,12 @@ let
|
||||||
chatDomain = "chat.${domain}";
|
chatDomain = "chat.${domain}";
|
||||||
|
|
||||||
wellKnownResponse = data: ''
|
wellKnownResponse = data: ''
|
||||||
add_header Content-Type application/json;
|
default_type application/json;
|
||||||
add_header Access-Control-Allow-Origin *;
|
add_header Access-Control-Allow-Origin *;
|
||||||
return 200 '${builtins.toJSON data}';
|
return 200 '${builtins.toJSON data}';
|
||||||
'';
|
'';
|
||||||
|
|
||||||
clientConfig."m.homeserver".base_url = chatDomain;
|
clientConfig."m.homeserver".base_url = "https://${chatDomain}";
|
||||||
serverConfig."m.server" = "${chatDomain}:443";
|
serverConfig."m.server" = "${chatDomain}:443";
|
||||||
|
|
||||||
synapsePort = 8001;
|
synapsePort = 8001;
|
||||||
|
@ -126,8 +126,12 @@ in serverSystemConfiguration {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = domain;
|
useACMEHost = domain;
|
||||||
|
|
||||||
locations."/".proxyPass = "http://[::]:${toString config.services.site.port}/404";
|
locations."/".root = pkgs.element-web.override {
|
||||||
locations."/assets".proxyPass = "http://[::]:${toString config.services.site.port}/assets";
|
conf = {
|
||||||
|
default_server_name = chatDomain;
|
||||||
|
sso_redirect_options.immediate = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
locations."= /.well-known/matrix/client".extraConfig = wellKnownResponse clientConfig;
|
locations."= /.well-known/matrix/client".extraConfig = wellKnownResponse clientConfig;
|
||||||
locations."= /.well-known/matrix/server".extraConfig = wellKnownResponse serverConfig;
|
locations."= /.well-known/matrix/server".extraConfig = wellKnownResponse serverConfig;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue