add nginx proxy to jellyfin

This commit is contained in:
Franzi 2023-09-24 16:48:19 +02:00
parent 361bb6a563
commit 4084e764e4
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 36 additions and 5 deletions

View file

@ -13,6 +13,11 @@ defaults = {
},
},
},
'backups': {
'paths': {
f'/var/lib/jellyfin/{x}' for x in ('data', 'metadata', 'plugins', 'root')
},
},
'icinga2_api': {
'transmission': {
'services': {
@ -26,13 +31,27 @@ defaults = {
@metadata_reactor.provides(
'firewall/port_rules',
'nginx/vhosts/jellyfin',
)
def firewall(metadata):
def nginx(metadata):
if not node.has_bundle('nginx'):
raise DoNotRunAgain
if 'jellyfin' not in metadata.get('nginx/vhosts', {}):
return {}
return {
'firewall': {
'port_rules': {
'8096': atomic(metadata.get('jellyfin/restrict-to', {'*'})),
'nginx': {
'vhosts': {
'jellyfin': {
'do_not_add_content_security_headers': True,
'locations': {
'/': {
'target': 'http://127.0.0.1:8096',
'websockets': True,
},
},
},
},
},
}

View file

@ -27,6 +27,9 @@ _acme-challenge.home IN CNAME _acme-challenge.home.kunbox.net.le.kunbox.net.
; aurto, keep old name
aurto IN CNAME aurto.htz-cloud
; stuff running at home
jellyfin.home IN CNAME nas.home
; Mail servers
mta-sts IN CNAME carlene

View file

@ -17,6 +17,7 @@ nodes['home.nas'] = {
},
'groups': {
'debian-bullseye',
'webserver',
},
'metadata': {
'interfaces': {
@ -135,6 +136,14 @@ nodes['home.nas'] = {
},
},
},
'nginx': {
'vhosts': {
'jellyfin': {
'domain': 'jellyfin.home.kunbox.net',
'ssl': '_.home.kunbox.net',
},
},
},
'rsyslogd': {
'restrict-to': {
'home',