This commit is contained in:
parent
89c1059c9a
commit
1c8bc1d422
7 changed files with 35 additions and 99 deletions
|
|
@ -51,6 +51,7 @@ in
|
||||||
matrix = ns1;
|
matrix = ns1;
|
||||||
chat = ns1;
|
chat = ns1;
|
||||||
turn = ns1;
|
turn = ns1;
|
||||||
|
search = ns1;
|
||||||
};
|
};
|
||||||
|
|
||||||
TXT = [
|
TXT = [
|
||||||
|
|
@ -136,6 +137,11 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
domain = "roundcube.${domain}";
|
domain = "roundcube.${domain}";
|
||||||
};
|
};
|
||||||
|
searxng = {
|
||||||
|
enable = true;
|
||||||
|
domain = "search.${domain}";
|
||||||
|
port = 8888;
|
||||||
|
};
|
||||||
synapse = {
|
synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
element = {
|
element = {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
./prosody
|
./prosody
|
||||||
./redis
|
./redis
|
||||||
./roundcube
|
./roundcube
|
||||||
|
./searxng
|
||||||
./synapse
|
./synapse
|
||||||
./uptime-kuma
|
./uptime-kuma
|
||||||
./vaultwarden
|
./vaultwarden
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./firewall.nix
|
./network.nix
|
||||||
./nginx.nix
|
|
||||||
./options.nix
|
./options.nix
|
||||||
./service.nix
|
./service.nix
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (config.machine.prosody)
|
|
||||||
enable
|
|
||||||
;
|
|
||||||
in
|
|
||||||
with lib;
|
|
||||||
mkIf enable {
|
|
||||||
networking.firewall = {
|
|
||||||
allowedTCPPorts = [
|
|
||||||
# HTTP filer
|
|
||||||
80
|
|
||||||
443
|
|
||||||
|
|
||||||
# C2S
|
|
||||||
5222
|
|
||||||
5223
|
|
||||||
|
|
||||||
# S2S
|
|
||||||
5269
|
|
||||||
5270
|
|
||||||
|
|
||||||
# WebSockets / BOSH
|
|
||||||
5280
|
|
||||||
5281
|
|
||||||
]
|
|
||||||
++ concatLists (
|
|
||||||
with config.services.prosody;
|
|
||||||
[
|
|
||||||
httpPorts
|
|
||||||
httpsPorts
|
|
||||||
]
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
26
services/searxng/network.nix
Normal file
26
services/searxng/network.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.machine.searxng;
|
||||||
|
in
|
||||||
|
with lib;
|
||||||
|
mkIf enable {
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [ cfg.port ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts =
|
||||||
|
mkIf (cfg.domain != null) {
|
||||||
|
"${cfg.domain}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://[::1]:${toString cfg.port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (config.machine.prosody)
|
|
||||||
enable
|
|
||||||
domain
|
|
||||||
;
|
|
||||||
|
|
||||||
localhost = "http://localhost:5280";
|
|
||||||
in
|
|
||||||
with lib;
|
|
||||||
mkIf enable {
|
|
||||||
security.acme.certs."${domain}".extraDomainNames = [
|
|
||||||
"conference.${domain}"
|
|
||||||
"upload.${domain}"
|
|
||||||
];
|
|
||||||
users.groups.acme.members = [
|
|
||||||
"prosody"
|
|
||||||
];
|
|
||||||
services.nginx.virtualHosts =
|
|
||||||
with lib;
|
|
||||||
mkIf (domain != null) {
|
|
||||||
"${domain}".locations = {
|
|
||||||
"= /xmpp-websocket" = {
|
|
||||||
proxyPass = localhost;
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
"= /http-bind".proxyPass = localhost;
|
|
||||||
"/push".proxyPass = localhost;
|
|
||||||
"= /.well-known/host-meta".proxyPass = localhost;
|
|
||||||
"= /.well-known/host-meta.json".proxyPass = localhost;
|
|
||||||
};
|
|
||||||
"conference.${domain}" = {
|
|
||||||
http3 = true;
|
|
||||||
quic = true;
|
|
||||||
forceSSL = true;
|
|
||||||
kTLS = true;
|
|
||||||
useACMEHost = domain;
|
|
||||||
sslCertificate = "${config.security.acme.certs.${domain}.directory}/fullchain.pem";
|
|
||||||
sslCertificateKey = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
|
||||||
locations."/".proxyPass = localhost;
|
|
||||||
};
|
|
||||||
"upload.${domain}" = {
|
|
||||||
http3 = true;
|
|
||||||
quic = true;
|
|
||||||
forceSSL = true;
|
|
||||||
kTLS = true;
|
|
||||||
useACMEHost = domain;
|
|
||||||
sslCertificate = "${config.security.acme.certs.${domain}.directory}/fullchain.pem";
|
|
||||||
sslCertificateKey = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
|
||||||
locations."/".proxyPass = localhost;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -10,7 +10,7 @@ with lib;
|
||||||
};
|
};
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.port;
|
type = types.port;
|
||||||
default = 4000;
|
default = 8888;
|
||||||
description = "Listen port.";
|
description = "Listen port.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue