From 66999b55abfe93fcd144846e0bf8ca52e5baee6d Mon Sep 17 00:00:00 2001 From: Alexandre Date: Sat, 4 Dec 2021 16:11:15 +0100 Subject: [PATCH] improvements --- emby/README.md | 12 +++++++ emby/config.json | 1 + jellyfin/CHANGELOG.md | 1 + jellyfin/README.md | 24 ++++++++------ jellyfin/config.json | 2 ++ .../root/etc/cont-init.d/92-local_mounts.sh | 32 +++++++++++++++++++ plex/README.md | 20 +++++++++--- plex/config.json | 1 + 8 files changed, 80 insertions(+), 13 deletions(-) create mode 100644 jellyfin/root/etc/cont-init.d/92-local_mounts.sh diff --git a/emby/README.md b/emby/README.md index 12761b9b4..d1920e4d2 100644 --- a/emby/README.md +++ b/emby/README.md @@ -26,6 +26,18 @@ This addon is based on the [docker image](https://github.com/linuxserver/docker- Webui can be found at `:8096`. +```yaml +GUID: user +GPID: user +TZ: timezone +localdisks: sda1 #put the hardware name of your drive to mount separated by commas, or its label. Ex: sda1, sdb1, MYNAS... +networkdisks: "//SERVER/SHARE" # optional, list of smb servers to mount, separated by commas +cifsusername: "username" # optional, smb username, same for all smb shares +cifspassword: "password" # optional, smb password +cifsdomain: "domain" # optional, allow setting the domain for the smb share +silent: true #suppresses debug messages +``` + ## Installation The installation of this add-on is pretty straightforward and not different in diff --git a/emby/config.json b/emby/config.json index c1eb4ceea..1be10e1ae 100644 --- a/emby/config.json +++ b/emby/config.json @@ -77,6 +77,7 @@ "networkdisks": "str?", "cifsusername": "str?", "cifspassword": "str?", + "cifsdomain": "str?", "smbv1": "bool?", "silent": "bool?" }, diff --git a/jellyfin/CHANGELOG.md b/jellyfin/CHANGELOG.md index 23d206078..afc167a9b 100644 --- a/jellyfin/CHANGELOG.md +++ b/jellyfin/CHANGELOG.md @@ -1,3 +1,4 @@ +- Add local mount (see readmeĆ  - Added watchdog feature - Allow mounting of devices up to sdg2 - Improve SMB mount code to v1.5 ; accepts several network disks separated by commas (//123.12.12.12/share,//123.12.12.12/hello) that are mount to /mnt/$sharename diff --git a/jellyfin/README.md b/jellyfin/README.md index b7d2e7b91..9ef54b8c6 100644 --- a/jellyfin/README.md +++ b/jellyfin/README.md @@ -13,15 +13,25 @@ _Thanks to everyone having starred my repo! To star it click on the image below, ## About -Forked to add latest beta versions, smb and local hdd mount. - -- Inital version : https://github.com/petersendev/hassio-addons -- CIFS code : https://github.com/dianlight/hassio-addons - [jellyfin](https://jellyfin.media/) organizes video, music, live TV, and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices. This container is packaged as a standalone jellyfin Media Server. This addon is based on the [docker image](https://github.com/linuxserver/docker-jellyfin) from linuxserver.io. +## Configuration + +Webui can be found at `:8096`. + +```yaml +GUID: user +GPID: user +TZ: timezone +localdisks: sda1 #put the hardware name of your drive to mount separated by commas, or its label. Ex: sda1, sdb1, MYNAS... +networkdisks: "//SERVER/SHARE" # optional, list of smb servers to mount, separated by commas +cifsusername: "username" # optional, smb username, same for all smb shares +cifspassword: "password" # optional, smb password +cifsdomain: "domain" # optional, allow setting the domain for the smb share +``` + ## Installation The installation of this add-on is pretty straightforward and not different in @@ -34,10 +44,6 @@ comparison to installing any other Hass.io add-on. 1. Check the logs of the add-on to see if everything went well. 1. Carefully configure the add-on to your preferences, see the official documentation for for that. -## Configuration - -Webui can be found at `:8096`. - [smb-shield]: https://img.shields.io/badge/SMB--green?style=plastic.svg [repository]: https://github.com/alexbelgium/hassio-addons [aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg diff --git a/jellyfin/config.json b/jellyfin/config.json index 5e343857b..0702ca78f 100644 --- a/jellyfin/config.json +++ b/jellyfin/config.json @@ -67,9 +67,11 @@ "PUID": "int", "PGID": "int", "TZ": "str?", + "localdisks": "str?", "networkdisks": "str?", "cifsusername": "str?", "cifspassword": "str?", + "cifsdomain": "str?", "smbv1": "bool?" }, "slug": "jellyfin", diff --git a/jellyfin/root/etc/cont-init.d/92-local_mounts.sh b/jellyfin/root/etc/cont-init.d/92-local_mounts.sh new file mode 100644 index 000000000..0920d68bd --- /dev/null +++ b/jellyfin/root/etc/cont-init.d/92-local_mounts.sh @@ -0,0 +1,32 @@ +#!/usr/bin/with-contenv bashio + +###################### +# MOUNT LOCAL SHARES # +###################### + +# Mount local Share if configured +if bashio::config.has_value 'localdisks'; then + + MOREDISKS=$(bashio::config 'localdisks') + echo "Local Disks mounting..." + + # Separate comma separated values + for disk in ${MOREDISKS//,/ }; do + + # Mount by device as default + devpath=/dev + + # Mount as label + [ ${disk:0:2} != "sd" ] && devpath=/dev/disk/by-label + + # Creates dir + mkdir -p /mnt/$disk + chown -R $(id -u):$(id -g) /mnt/$disk + # Legacy mounting : mount to share if still exists (avoid breaking changes) + [ -d /share/$disk ] && mount $devpath/$disk /share/$disk || true + # Mount + mount $devpath/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) + + done + +fi diff --git a/plex/README.md b/plex/README.md index eb8358ecc..e12e9b7f3 100644 --- a/plex/README.md +++ b/plex/README.md @@ -22,6 +22,22 @@ Forked to add latest beta versions, smb and local hdd mount. This addon is based on the [docker image](https://github.com/linuxserver/docker-plex) from linuxserver.io. +## Configuration + +Webui can be found at `:8096`. + +```yaml +GUID: user +GPID: user +TZ: timezone +claim: claim code for plex server # see https://github.com/linuxserver/docker-plex +localdisks: sda1 #put the hardware name of your drive to mount separated by commas, or its label. Ex: sda1, sdb1, MYNAS... +networkdisks: "//SERVER/SHARE" # optional, list of smb servers to mount, separated by commas +cifsusername: "username" # optional, smb username, same for all smb shares +cifspassword: "password" # optional, smb password +cifsdomain: "domain" # optional, allow setting the domain for the smb share +``` + ## Installation The installation of this add-on is pretty straightforward and not different in @@ -34,10 +50,6 @@ comparison to installing any other Hass.io add-on. 1. Check the logs of the add-on to see if everything went well. 1. Carefully configure the add-on to your preferences, see the official documentation for for that. -## Configuration - -Webui can be found at `:8096`. - [smb-shield]: https://img.shields.io/badge/SMB--green?style=plastic.svg [repository]: https://github.com/alexbelgium/hassio-addons [aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg diff --git a/plex/config.json b/plex/config.json index 7673fff5b..9206bb69d 100644 --- a/plex/config.json +++ b/plex/config.json @@ -94,6 +94,7 @@ "networkdisks": "str?", "cifsusername": "str?", "cifspassword": "str?", + "cifsdomain": "str?", "smbv1": "bool?" }, "slug": "plex_nas",