Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Commit 74a0324

Browse files
authored
docs: add instructions for the nixos jitsi module (#344)
1 parent b5ff8d8 commit 74a0324

File tree

1 file changed

+97
-14
lines changed

1 file changed

+97
-14
lines changed

README.md

Lines changed: 97 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,28 @@ docker run \
3232

3333
### Docker Compose
3434

35-
````yaml
35+
```yaml
3636
# docker-compose.yaml
3737

3838
# ...
3939

4040
services:
41-
4241
# ...
4342

4443
jitsi-openid:
4544
image: ghcr.io/marcelcoding/jitsi-openid:latest
4645
restart: always
4746
environment:
48-
- 'JITSI_SECRET=SECURE_SECRET' # <- shared with jitsi (JWT_APP_SECRET -> see .env from jitsi),
47+
- "JITSI_SECRET=SECURE_SECRET" # <- shared with jitsi (JWT_APP_SECRET -> see .env from jitsi),
4948
# secret to sign jwt tokens
50-
- 'JITSI_URL=https://meet.example.com' # <- external url of jitsi
51-
- 'JITSI_SUB=meet.example.com' # <- shared with jitsi (JWT_APP_ID -> see .env from jitsi),
49+
- "JITSI_URL=https://meet.example.com" # <- external url of jitsi
50+
- "JITSI_SUB=meet.example.com" # <- shared with jitsi (JWT_APP_ID -> see .env from jitsi),
5251
# id of jitsi
53-
- 'ISSUER_URL=https://id.example.com' # <- base URL of your OpenID Connect provider
52+
- "ISSUER_URL=https://id.example.com" # <- base URL of your OpenID Connect provider
5453
# Keycloak: https://id.example.com/auth/realms/<realm>
55-
- 'BASE_URL=https://auth.meet.example.com' # <- base URL of this application
56-
- 'CLIENT_ID=meet.example.com' # <- OpenID Connect Client ID
57-
- 'CLIENT_SECRET=SECURE_SECRET' # <- OpenID Connect Client secret
54+
- "BASE_URL=https://auth.meet.example.com" # <- base URL of this application
55+
- "CLIENT_ID=meet.example.com" # <- OpenID Connect Client ID
56+
- "CLIENT_SECRET=SECURE_SECRET" # <- OpenID Connect Client secret
5857
# - 'ACR_VALUES=password email' # <- OpenID Context Authentication Context Requirements,
5958
# space seperated list of allowed actions (OPTIONAL), see
6059
# https://github.com/MarcelCoding/jitsi-openid/issues/122
@@ -66,10 +65,9 @@ services:
6665
# - 'GROUP=example' # <- Value for the 'group' field in the token
6766
# default: ''
6867
ports:
69-
- '3000:3000'
70-
68+
- "3000:3000"
7169
# ...
72-
````
70+
```
7371

7472
To generate the `JITSI_SECRET` you can use one of the following command:
7573

@@ -129,7 +127,7 @@ services.jitsi-openid = {
129127

130128
If you have problems understating this have a look here: https://github.com/MarcelCoding/jitsi-openid/issues/80
131129

132-
````bash
130+
```bash
133131
# for more information see:
134132
# https://github.com/jitsi/docker-jitsi-meet/blob/master/env.example
135133

@@ -155,7 +153,92 @@ JWT_ACCEPTED_AUDIENCES=jitsi
155153
# jitsi-openid should redirect the user after a successfully authentication
156154
# !! it is recommend to use ALWAYS https e.g. using a reverse proxy !!
157155
TOKEN_AUTH_URL=https://auth.meet.example.com/room/{room}
158-
````
156+
```
157+
158+
### Jitsi Configuration NixOS
159+
160+
The following NixOS config shows how to use JWT Auth with the jitsi NixOS module.
161+
The necessary steps where extracted form [docker-jitsi-meet](https://github.com/jitsi/docker-jitsi-meet):
162+
163+
```nix
164+
{
165+
pkgs,
166+
config,
167+
...
168+
}:
169+
170+
let
171+
hostName = "meet.example.com";
172+
ssoHostName = "auth-meet.example.com";
173+
ssoPort = 3000;
174+
ssoAddress = "127.0.0.1";
175+
cfg = config.services.jitsi-meet;
176+
in
177+
{
178+
networking.firewall.allowedUDPPorts = [ 10000 ]; # required for more then 2 participants
179+
180+
# this assumes jitsi openid is already running on the server on port 3000
181+
# you could run it with e.g. virtualisation.oci-containers.containers
182+
services.nginx.virtualHosts.${ssoHostName} = {
183+
forceSSL = true;
184+
enableACME = true;
185+
locations = {
186+
"/" = {
187+
proxyPass = "http://${ssoAddress}:${toString ssoPort}";
188+
};
189+
};
190+
};
191+
192+
nixpkgs.config.permittedInsecurePackages = [
193+
"jitsi-meet-1.0.8043"
194+
];
195+
196+
services.jitsi-meet = {
197+
enable = true;
198+
199+
hostName = hostName;
200+
nginx = {
201+
enable = true;
202+
};
203+
secureDomain = {
204+
enable = true;
205+
authentication = "token";
206+
};
207+
208+
config = {
209+
tokenAuthUrl = "https://${ssoHostName}/room/{room}";
210+
};
211+
};
212+
213+
services.prosody = {
214+
extraModules = [
215+
"token_verification"
216+
];
217+
218+
extraConfig = ''
219+
asap_accepted_issuers = "jitsi"
220+
asap_accepted_audiences = "jitsi"
221+
'';
222+
223+
virtualHosts.${cfg.hostName} = {
224+
# a secure secret should be used for production
225+
extraConfig = ''
226+
app_secret = "insecure_secret"
227+
app_id = "jitsi"
228+
'';
229+
};
230+
};
231+
232+
systemd.services.prosody = {
233+
environment = {
234+
# the token_verification module has some more lua dependencies
235+
LUA_PATH = "${pkgs.lua52Packages.basexx}/share/lua/5.2/?.lua;${pkgs.lua52Packages.cjson}/share/lua/5.2/?.lua;${pkgs.lua52Packages.luaossl}/share/lua/5.2/?.lua;${pkgs.lua52Packages.inspect}/share/lua/5.2/?.lua";
236+
LUA_CPATH = "${pkgs.lua52Packages.cjson}/lib/lua/5.2/?.so;${pkgs.lua52Packages.luaossl}/lib/lua/5.2/?.so";
237+
};
238+
};
239+
240+
}
241+
```
159242

160243
### Jitsi JWTs
161244

0 commit comments

Comments
 (0)