element call
This commit is contained in:
parent
0a9d28abdb
commit
e322553c02
5 changed files with 134 additions and 22 deletions
|
@ -1,6 +1,40 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
services.caddy.virtualHosts."call.henryhiles.com". extraConfig = ''
|
pkgs,
|
||||||
root * ${pkgs.element-call}
|
config,
|
||||||
file_server
|
...
|
||||||
'';
|
}: {
|
||||||
|
services = {
|
||||||
|
lk-jwt-service = {
|
||||||
|
enable = true;
|
||||||
|
livekit = {
|
||||||
|
keyFile = config.age.secrets."livekitKeys.age".path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
livekit = {
|
||||||
|
enable = true;
|
||||||
|
keyFile = config.age.secrets."livekitKeys.age".path;
|
||||||
|
};
|
||||||
|
|
||||||
|
caddy.virtualHosts."call.henryhiles.com".extraConfig = ''
|
||||||
|
root * ${pkgs.element-call}
|
||||||
|
route {
|
||||||
|
respond /config.json `${builtins.toJSON {
|
||||||
|
default_server_config = {
|
||||||
|
"m.homeserver" = {
|
||||||
|
"base_url" = "https://matrix.henryhiles.com";
|
||||||
|
"server_name" = "henryhiles.com";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
livekit.livekit_service_url = "https://call.henryhiles.com";
|
||||||
|
}}` 200
|
||||||
|
|
||||||
|
reverse_proxy /livekit/sfu 127.0.0.1:7880
|
||||||
|
reverse_proxy /livekit/jwt 127.0.0.1:8080
|
||||||
|
|
||||||
|
try_files {path} {path}/ /index.html
|
||||||
|
file_server
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{config, ...}: {
|
|
||||||
services.livekit = {
|
|
||||||
enable = true;
|
|
||||||
keyFile = config.age.secrets."livekitKeys.age".path;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
cfg = config.services.livekit;
|
cfg = config.services.livekit;
|
||||||
in {
|
in {
|
||||||
meta.maintainers = with lib.maintainers; [quadradical];
|
meta.maintainers = [lib.maintainers.quadradical];
|
||||||
options.services.livekit = {
|
options.services.livekit = {
|
||||||
enable = lib.mkEnableOption "Livekit SFU";
|
enable = lib.mkEnableOption "Livekit SFU";
|
||||||
package = lib.mkPackageOption pkgs "livekit" {};
|
package = lib.mkPackageOption pkgs "livekit" {};
|
||||||
|
|
|
@ -1 +1,85 @@
|
||||||
{}
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.services.lk-jwt-service;
|
||||||
|
in {
|
||||||
|
meta.maintainers = [lib.maintainers.quadradical];
|
||||||
|
options.services.lk-jwt-service = {
|
||||||
|
enable = lib.mkEnableOption "Enable lk-jwt-service";
|
||||||
|
package = lib.mkPackageOption pkgs "lk-jwt-service" {};
|
||||||
|
|
||||||
|
livekit = {
|
||||||
|
url = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "127.0.0.1";
|
||||||
|
description = "The URL that livekit runs on, prefixed with `ws://`.";
|
||||||
|
};
|
||||||
|
|
||||||
|
keyFile = lib.mkOption {
|
||||||
|
type = lib.types.path;
|
||||||
|
description = ''
|
||||||
|
Path to a file showing LiveKit keys, where you must declare some of: `LIVEKIT_KEY`, `LIVEKIT_SECRET`, `LIVEKIT_KEY_FROM_FILE`, `LIVEKIT_SECRET_FROM_FILE`, and/or `LIVEKIT_KEY_FILE`.
|
||||||
|
For more information see <https://github.com/element-hq/lk-jwt-service>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
default = 8080;
|
||||||
|
description = "Port that lk-jwt-service should run on";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
systemd.services.lk-jwt-service = {
|
||||||
|
description = "Minimal service to issue LiveKit JWTs for MatrixRTC";
|
||||||
|
documentation = ["https://github.com/element-hq/lk-jwt-service"];
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
wants = ["network-online.target"];
|
||||||
|
after = ["network-online.target"];
|
||||||
|
environment.LIVEKIT_URL = cfg.livekit.url;
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
EnvironmentFile = cfg.livekit.keyFile;
|
||||||
|
DynamicUser = true;
|
||||||
|
User = "lk-jwt-service";
|
||||||
|
LockPersonality = true;
|
||||||
|
MemoryDenyWriteExecute = true;
|
||||||
|
ProtectClock = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectHostname = true;
|
||||||
|
ProtectKernelLogs = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
PrivateDevices = true;
|
||||||
|
PrivateMounts = true;
|
||||||
|
PrivateUsers = true;
|
||||||
|
RestrictAddressFamilies = [
|
||||||
|
"AF_INET"
|
||||||
|
"AF_INET6"
|
||||||
|
];
|
||||||
|
RestrictNamespaces = true;
|
||||||
|
RestrictRealtime = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
SystemCallArchitectures = "native";
|
||||||
|
SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
"~@privileged"
|
||||||
|
"~@resources"
|
||||||
|
];
|
||||||
|
CapabilityBoundingSet = [
|
||||||
|
"CAP_NET_BIND_SERVICE"
|
||||||
|
"CAP_NET_RAW"
|
||||||
|
];
|
||||||
|
ExecStart = "${cfg.package}/bin/lk-jwt-service";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 5;
|
||||||
|
UMask = "077";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE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
||||||
4eCoK2abkca64ADUKzvYYjc0AfWMUqCGVIeXY1ZvQZ1g
|
eperXjPRidTlQlApidQ5jCKMuXQJ/O0nuUHO7Gxob8QMSWMFbIyXSL0=
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue