From 379d04ffed053eb49ed60d03c9701bf3826ee003 Mon Sep 17 00:00:00 2001 From: Jesse Date: Tue, 27 Aug 2019 08:58:00 -0400 Subject: [PATCH 1/3] adding jellyfin --- README.md | 3 +- docs/applications/jellyfin.md | 71 +++++++++++++++++++++++++ docs/configuration/application_ports.md | 2 + group_vars/all.yml.dist | 17 ++++++ nas.yml | 4 ++ tasks/jellyfin.yml | 31 +++++++++++ templates/traefik/traefik.toml | 1 + 7 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 docs/applications/jellyfin.md create mode 100644 tasks/jellyfin.yml diff --git a/README.md b/README.md index 11ff3f88..8ea53f78 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Ansible config and a bunch of Docker containers. * A BitTorrent client * A Usenet downloader * Various media management tools - Sonarr, Sickchill, CouchPotato, Radarr -* Media streaming via Plex or Emby +* Media streaming via Plex, Emby or Jellyfin * Music streaming with Airsonic * An RSS newsfeed reader - Miniflux * A Dropbox replacement via Nextcloud @@ -43,6 +43,7 @@ Ansible config and a bunch of Docker containers. * [Heimdall](https://heimdall.site/) - Home server dashboard * [InfluxDB](https://github.com/influxdata/influxdb) - Time series database used for stats collection * [Jackett](https://github.com/Jackett/Jackett) - API Support for your favorite torrent trackers +* [Jellyfin](https://jellyfin.github.io) - The Free Software Media System * [MiniDlna](https://sourceforge.net/projects/minidlna/) - simple media server which is fully compliant with DLNA/UPnP-AV clients * [Miniflux](https://miniflux.app/) - An RSS news reader * [Mosquitto](https://mosquitto.org) - An open source MQTT broker diff --git a/docs/applications/jellyfin.md b/docs/applications/jellyfin.md new file mode 100644 index 00000000..ece01435 --- /dev/null +++ b/docs/applications/jellyfin.md @@ -0,0 +1,71 @@ +# Jellyfin + +Homepage: [https://jellyfin.github.io/](https://jellyfin.github.io/) + +Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps. Jellyfin is descended from Emby's 3.5.2 release and ported to the .NET Core framework to enable full cross-platform support. There are no strings attached, no premium licenses or features, and no hidden agendas: just a team who want to build something better and work together to achieve it. We welcome anyone who is interested in joining us in our quest! + +Note that [Plex](https://www.plex.tv/), also included in Ansible-NAS, has a very +similar functionality. + +## Usage + +Set `jellyfin_enabled: true` in your `group_vars/all.yml` file. There are further +parameters you can edit such as `movies_root` and `tv_root` lower down. + +## Specific Configuration + +The jellyfin web interface can be found at port 8896 (http) or 8928 (https, if +configured) of your NAS. + +By default, Ansible-NAS gives jellyfin read/write access to the folders where your +movies and TV shows are stored. To change this to read-only, edit the following +lines in `all.yml`: + +``` + jellyfin_movies_permissions: "rw" + jellyfin_tv_permissions: "rw" +``` + +so that they end in `ro` instead of `rw`. Note that jellyfin will not be able to +delete files then, which might be exactly what you want. However, you will not +have the option to store cover art in the related folders. Always leave the +configuration directory read/write. + +## File system considerations + +Movie and TV show files are almost alway very large and pre-compressed. If you +are using a specialized filesystem such as ZFS for bulk storage, you'll want to +set the parameters accordingly. The [ZFS configuration +documentation](../zfs/zfc_configuration.md) has an example of this. + + +## Naming movies and TV shows + +jellyfin is very fussy about how movies and TV shows must be named to enable +automatic downloads of cover art and metadata. In short, movie files should +follow how movies are listed in the [IMDb](https://www.imdb.com/), including the +year of publication: + +``` + movies/Bride of Frankenstein (1935).mp4 +``` + +Note the spaces. You should probably remove colons and other special characters. + +TV shows require a folder structure with the name of the series - again if +possible with the year of publication - followed by sub-folders for the +individual seasons. For example, the first episode of the first season of +the original "Doctor Who" could be stored as: + +``` + tv/Doctor Who (1963)/Season 1/Doctor Who - s01e01.mp4 +``` + +The [TVDB](https://www.thetvdb.com/) is one source for the exact names of TV +shows. + +Unfortunately, there are number of special cases, especially related to split +movies and older series. See the [movie +naming](https://github.com/MediaBrowser/Wiki/wiki/Movie%20naming) and [TV +naming](https://github.com/MediaBrowser/Wiki/wiki/TV-naming) guides for further +information. \ No newline at end of file diff --git a/docs/configuration/application_ports.md b/docs/configuration/application_ports.md index f0f8e848..7e86ef58 100644 --- a/docs/configuration/application_ports.md +++ b/docs/configuration/application_ports.md @@ -19,6 +19,8 @@ By default, applications can be found on the ports listed below. | Guacamole | 8090 | | | Heimdall | 10080 | | | Jackett | 9117 | | +| Jellyfin | 8896 | HTTP | +| Jellyfin | 8928 | HTTPS | | MiniDLNA | 8201 | | | Miniflux | 8070 | | | Mosquitto | 1883 | MQTT | diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 1a1ca01c..4a81c540 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -27,6 +27,9 @@ tautulli_enabled: false # Emby emby_enabled: false +# Jellyfin +jellyfin_enabled: false + # minidlna minidlna_enabled: false @@ -575,3 +578,17 @@ wallabag_data_directory: "{{ docker_home }}/wallabag" ### mosquitto_available_externally: "false" mosquitto_data_directory: "{{ docker_home }}/mosquitto" + +### +### Jellyfin +### +# If you're paranoid, set permissions to "ro" so jellyfin won't ever be able to +# delete your files +jellyfin_available_externally: "false" +jellyfin_config_directory: "{{ docker_home }}/jellyfin/config" +jellyfin_movies_directory: "{{ movies_root }}" +jellyfin_movies_permissions: "rw" +jellyfin_tv_directory: "{{ tv_root }}" +jellyfin_tv_permissions: "rw" +jellyfin_user_id: 0 +jellyfin_group_id: 0 \ No newline at end of file diff --git a/nas.yml b/nas.yml index c351ca5e..04d4909b 100644 --- a/nas.yml +++ b/nas.yml @@ -171,3 +171,7 @@ - import_tasks: tasks/mosquitto.yml when: (mosquitto_enabled | default(False)) tags: mosquitto + + - import_tasks: tasks/jellyfin.yml + when: (jellyfin_enabled | default(False)) + tags: jellyfin \ No newline at end of file diff --git a/tasks/jellyfin.yml b/tasks/jellyfin.yml new file mode 100644 index 00000000..9e10eaa2 --- /dev/null +++ b/tasks/jellyfin.yml @@ -0,0 +1,31 @@ +- name: Create Jellyfin Directories + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ jellyfin_config_directory }}" + +- name: Jellyfin Docker Container + docker_container: + name: jellyfin + image: linuxserver/jellyfin + pull: true + volumes: + - "{{ jellyfin_config_directory }}:/config:rw" + - "{{ jellyfin_movies_directory }}:/movies:{{ jellyfin_movies_permissions }}" + - "{{ jellyfin_tv_directory }}:/tv:{{ jellyfin_tv_permissions }}" + ports: + - "8896:8096" # HTTP port + - "8928:8920" # HTTPS port + network_mode: host + env: + TZ: "{{ ansible_nas_timezone }}" + PUID: "{{ jellyfin_user_id }}" + PGID: "{{ jellyfin_group_id }}" + restart_policy: unless-stopped + memory: 1g + labels: + traefik.backend: "jellyfin" + traefik.frontend.rule: "Host:jellyfin.{{ ansible_nas_domain }}" + traefik.enable: "{{ jellyfin_available_externally }}" + traefik.port: "8896" \ No newline at end of file diff --git a/templates/traefik/traefik.toml b/templates/traefik/traefik.toml index c22832eb..071c9bb4 100644 --- a/templates/traefik/traefik.toml +++ b/templates/traefik/traefik.toml @@ -191,6 +191,7 @@ onDemand = false # create certificate when container is created "guacamole.{{ ansible_nas_domain }}", "heimdall.{{ ansible_nas_domain }}", "jackett.{{ ansible_nas_domain }}", + "jellyfin.{{ ansible_nas_domain }}", "miniflux.{{ ansible_nas_domain }}", "netdata.{{ ansible_nas_domain }}", "nextcloud.{{ ansible_nas_domain }}", From f529da775376ce8b23e5d9b20ba75ede16371fdc Mon Sep 17 00:00:00 2001 From: Jesse Date: Tue, 27 Aug 2019 09:02:20 -0400 Subject: [PATCH 2/3] adding jellyfin --- group_vars/all.yml.dist | 2 +- nas.yml | 3 ++- tasks/jellyfin.yml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 4a81c540..91d97f08 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -591,4 +591,4 @@ jellyfin_movies_permissions: "rw" jellyfin_tv_directory: "{{ tv_root }}" jellyfin_tv_permissions: "rw" jellyfin_user_id: 0 -jellyfin_group_id: 0 \ No newline at end of file +jellyfin_group_id: 0 diff --git a/nas.yml b/nas.yml index 04d4909b..5a01e886 100644 --- a/nas.yml +++ b/nas.yml @@ -174,4 +174,5 @@ - import_tasks: tasks/jellyfin.yml when: (jellyfin_enabled | default(False)) - tags: jellyfin \ No newline at end of file + tags: jellyfin + \ No newline at end of file diff --git a/tasks/jellyfin.yml b/tasks/jellyfin.yml index 9e10eaa2..e387d4e8 100644 --- a/tasks/jellyfin.yml +++ b/tasks/jellyfin.yml @@ -28,4 +28,5 @@ traefik.backend: "jellyfin" traefik.frontend.rule: "Host:jellyfin.{{ ansible_nas_domain }}" traefik.enable: "{{ jellyfin_available_externally }}" - traefik.port: "8896" \ No newline at end of file + traefik.port: "8896" + \ No newline at end of file From 59579a52e9485962469c3c04ce9bd8a543feb12a Mon Sep 17 00:00:00 2001 From: Jesse Date: Tue, 27 Aug 2019 09:12:26 -0400 Subject: [PATCH 3/3] adding jellyfin --- nas.yml | 1 - tasks/jellyfin.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/nas.yml b/nas.yml index 5a01e886..3da67195 100644 --- a/nas.yml +++ b/nas.yml @@ -175,4 +175,3 @@ - import_tasks: tasks/jellyfin.yml when: (jellyfin_enabled | default(False)) tags: jellyfin - \ No newline at end of file diff --git a/tasks/jellyfin.yml b/tasks/jellyfin.yml index e387d4e8..057f157b 100644 --- a/tasks/jellyfin.yml +++ b/tasks/jellyfin.yml @@ -29,4 +29,3 @@ traefik.frontend.rule: "Host:jellyfin.{{ ansible_nas_domain }}" traefik.enable: "{{ jellyfin_available_externally }}" traefik.port: "8896" - \ No newline at end of file