60 lines
2.5 KiB
Org Mode
60 lines
2.5 KiB
Org Mode
:PROPERTIES:
|
|
:ID: 20230220T204453.685476
|
|
:END:
|
|
#+TITLE: Jellyfin on the Wobserver
|
|
|
|
#+ARROYO_NIXOS_MODULE: nixos/jellyfin.nix
|
|
#+ARROYO_SYSTEM_ROLE: server
|
|
#+AUTO_TANGLE: t
|
|
|
|
#+begin_src nix :tangle ~/arroyo-nix/nixos/jellyfin.nix
|
|
{ lib, ... }:
|
|
|
|
{
|
|
services.jellyfin.enable = true;
|
|
# so that metadata etc are legible to syncthing and others; consider adding jellyfin user to a service group...
|
|
systemd.services.jellyfin.serviceConfig.UMask = lib.mkForce "0002";
|
|
services.nginx.virtualHosts."media.whatthefuck.computer" = {
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:8096";
|
|
extraConfig = ''
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Protocol $scheme;
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
|
|
# Disable buffering when the nginx proxy gets very resource heavy upon streaming
|
|
proxy_buffering off;
|
|
|
|
# COOP/COEP. Disable if you use external plugins/images/assets
|
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
|
|
|
# Permissions policy. May cause issues on some clients
|
|
add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), battery=(), bluetooth=(), camera=(), clipboard-read=(), display-capture=(), document-domain=(), encrypted-media=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), idle-detection=(), interest-cohort=(), keyboard-map=(), local-fonts=(), magnetometer=(), microphone=(), payment=(), publickey-credentials-get=(), serial=(), sync-xhr=(), usb=(), xr-spatial-tracking=()" always;
|
|
'';
|
|
};
|
|
|
|
locations."/socket" = {
|
|
proxyPass = "http://127.0.0.1:8096";
|
|
extraConfig = ''
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Protocol $scheme;
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
'';
|
|
};
|
|
};
|
|
# XXX: when this is not double-proxied this can be removed
|
|
networking.firewall.allowedTCPPorts = [ 8096 ];
|
|
}
|
|
#+end_src
|