This commit is contained in:
2021-06-29 12:37:08 +03:00
commit 12fdc96d20
282 changed files with 13627 additions and 0 deletions

94
emby/CHANGELOG.md Normal file
View File

@@ -0,0 +1,94 @@
## 4.6.3.0 (19-06-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.2.0 (04-06-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.1.0 (25-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.51 (23-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.51 (23-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.51 (23-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.51 (23-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.50 (20-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.48 (19-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.47 (18-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.46 (15-05-2021)
- Update to latest version from linuxserver/docker-emby
- Add banner to log
## 4.6.0.45 (13-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.44 (12-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.43 (04-05-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.41 (28-04-2021)
- Update to latest version from linuxserver/docker-emby
## 4.6.0.40
- Update to latest version from linuxserver/docker-emby
## 4.6.0.39
- Update to latest version from linuxserver/docker-emby
## 4.6.0.38
- Update to latest version from linuxserver/docker-emby
## 4.6.0.37
- Update to latest version from linuxserver/docker-emby
## 4.6.0.36
- Update to latest version from linuxserver/docker-emby
## 4.6.0.35
- Update to latest version from linuxserver/docker-emby
## 4.6.0.34
- Update to latest version from linuxserver/docker-emby
## 4.6.0.33
- Update to latest version from linuxserver/docker-emby
## 4.6.0.32
- Update to latest version from linuxserver/docker-emby
## 4.6.0.31
- Update to latest version from linuxserver/docker-emby
## 4.6.0.30
- Update to latest version from linuxserver/docker-emby
## 4.6.0.29
- Update to latest version from linuxserver/docker-emby
## 4.6.0.28
- Update to latest version from linuxserver/docker-emby
## 4.6.0.26
- Update to latest version from linuxserver/docker-emby
- Enables PUID/GUID options
- New feature : mount smb share in protected mode
- New feature : mount multiple smb shares
- New config/feature : mount smbv1
- Changed path : changed smb mount path from /storage/externalcifs to /mnt/$NAS name
- Removed feature : ability to remove protection and mount local hdd, to increase the addon score

80
emby/Dockerfile Normal file
View File

@@ -0,0 +1,80 @@
ARG BUILD_FROM
ARG BUILD_VERSION
ARG BUILD_UPSTREAM="4.6.3.0"
FROM ${BUILD_FROM}${BUILD_UPSTREAM}
ARG BASHIO_VERSION=0.13.0
ARG TEMPIO_VERSION=2021.01.0
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN \
################
# Install apps #
################
apt-get update \
&& apt-get install -y --no-install-recommends \
jq \
cifs-utils \
keyutils \
\
##################
# Install bashio #
##################
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \
\
/var/{cache,log}/* \
/var/lib/apt/lists/* \
\
#############################
# Allow UID and GID setting #
#############################
\
&& sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \
&& sed -i "s|chown abc:abc /config||g" /etc/cont-init.d/10-adduser \
\
###########
# FOLDERS #
###########
\
&& sed -i "s|/config|/emby|g" /etc/services.d/emby/run \
&& sed -i "s|/config|/emby|g" /etc/cont-init.d/30-config
# copy local files
COPY root/ /
### LABELS
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
ARG BUILD_REF
ARG BUILD_REPOSITORY
ARG BUILD_VERSION
LABEL \
io.hass.name="${BUILD_NAME}" \
io.hass.description="${BUILD_DESCRIPTION}" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.title="${BUILD_NAME}" \
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
org.opencontainers.image.vendor="Home Assistant Add-ons" \
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://github.com/alexbelgium" \
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}

38
emby/README.md Normal file
View File

@@ -0,0 +1,38 @@
# Home assistant add-on: emby
![Supports aarch64 Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield]
## 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
[emby](https://emby.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 emby Media Server.
This addon is based on the [docker image](https://github.com/linuxserver/docker-emby) from linuxserver.io.
## Installation
The installation of this add-on is pretty straightforward and not different in
comparison to installing any other Hass.io add-on.
1. [Add my Hass.io add-ons repository][repository] to your Hass.io instance.
1. Install this add-on.
1. Click the `Save` button to store your configuration.
1. Start the 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 `<your-ip>: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
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg

49
emby/apparmor.txt Normal file
View File

@@ -0,0 +1,49 @@
#include <tunables/global>
profile addon_db21ed7f_emby_nas flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
capability,
file,
mount,
umount,
remount,
capability setgid,
capability setuid,
capability sys_admin,
capability dac_read_search,
# capability dac_override,
# capability sys_rawio,
# S6-Overlay
/bin/** ix,
/usr/bin/** ix,
/usr/lib/bashio/** ix,
/etc/s6/** rix,
/run/s6/** rix,
/etc/services.d/** rwix,
/etc/cont-init.d/** rwix,
/etc/cont-finish.d/** rwix,
/init rix,
/var/run/** mrwkl,
/var/run/ mrwkl,
/dev/i2c-1 mrwkl,
# Files required
/dev/sda1 mrwkl,
/dev/sdb1 mrwkl,
/dev/mmcblk0p1 mrwkl,
/dev/ttyUSB0 mrwkl,
/dev/* mrwkl,
/tmp/** mrkwl,
# Data access
/data/** rw,
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
ptrace (trace,read) peer=docker-default,
# docker daemon confinement requires explict allow rule for signal
signal (receive) set=(kill,term) peer=/usr/bin/docker,
}

8
emby/build.json Normal file
View File

@@ -0,0 +1,8 @@
{
"build_from": {
"armv7": "linuxserver/emby:arm32v7-version-",
"armhf": "linuxserver/emby:arm32v7-version-",
"aarch64": "linuxserver/emby:arm64v8-version-",
"amd64": "linuxserver/emby:amd64-version-"
}
}

60
emby/config.json Normal file
View File

@@ -0,0 +1,60 @@
{
"name": "Emby NAS",
"version": "4.6.3.0",
"upstream": "4.6.3.0",
"slug": "emby_nas",
"description": "A Free Software Media System that puts you in control of managing and streaming your media.",
"url": "https://github.com/alexbelgium/hassio-addons",
"startup": "services",
"arch": [
"aarch64",
"amd64",
"armv7",
"armhf"
],
"ports": {
"8096/tcp": 8096,
"8920/tcp": null,
"7359/udp": null,
"1900/udp": null
},
"ports_description": {
"8096/tcp": "web interface",
"8920/tcp": "https web interface (optional)",
"7359/udp": "udp server discover (optional)",
"1900/udp": "dlna (optional)"
},
"map": [
"config:rw",
"share:rw",
"media:rw",
"ssl"
],
"webui": "http://[HOST]:[PORT:8096]",
"boot": "auto",
"apparmor": "true",
"privileged": [
"SYS_ADMIN",
"DAC_READ_SEARCH"
],
"devices": [
"/dev/ttyUSB0",
"/dev/*",
"/dev/sda1"
],
"full_access": true,
"options": {
"PUID": 0,
"PGID": 0
},
"schema": {
"PUID": "int",
"PGID": "int",
"TZ": "str?",
"localdisks": "str?",
"networkdisks": "str?",
"cifsusername": "str?",
"cifspassword": "str?",
"smbv1": "bool?"
}
}

BIN
emby/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
emby/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Base Images
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums or the Discord chat.'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bashio
for k in $(bashio::jq "${__BASHIO_ADDON_CONFIG}" 'keys | .[]'); do
printf "$(bashio::config $k)" > /var/run/s6/container_environment/$k
done

View File

@@ -0,0 +1,82 @@
#!/usr/bin/with-contenv bash
if [ ! -d /emby ]; then
echo "Creating /emby"
mkdir -p /emby
chown -R abc:abc /emby
fi
if [ ! -d /share/storage/tv ]; then
echo "Creating /share/storage/tv"
mkdir -p /share/storage/tv
chown -R abc:abc /share/storage/tv
fi
if [ ! -d /share/storage/movies ]; then
echo "Creating /share/storage/movies"
mkdir -p /share/storage/movies
chown -R abc:abc /share/storage/movies
fi
if [ ! -d /share/emby ]; then
echo "Creating /share/emby"
mkdir -p /share/emby
chown -R abc:abc /share/emby
fi
if [ ! -d /config/emby ]; then
echo "Creating /config/emby"
mkdir -p /config/emby
chown -R abc:abc /config/emby
fi
# links
if [ ! -d /emby/cache ]; then
echo "Creating link for /emby/cache"
mkdir -p /share/emby/cache
chown -R abc:abc /share/emby/cache
ln -s /share/emby/cache /emby/cache
fi
if [ ! -d /emby/config ]; then
echo "Creating link for /emby/config"
mkdir -p /config/emby
chown -R abc:abc /config/emby
ln -s /config/emby /emby/config
fi
if [ ! -d /emby/data ]; then
echo "Creating link for /emby/data"
mkdir -p /share/emby/data
chown -R abc:abc /share/emby/data
ln -s /share/emby/data /emby/data
fi
if [ ! -d /emby/logs ]; then
echo "Creating link for /emby/logs"
mkdir -p /share/emby/logs
chown -R abc:abc /share/emby/logs
ln -s /share/emby/logs /emby/logs
fi
if [ ! -d /emby/metadata ]; then
echo "Creating link for /emby/metadata"
mkdir -p /share/emby/metadata
chown -R abc:abc /share/emby/metadata
ln -s /share/emby/metadata /emby/metadata
fi
if [ ! -d /emby/plugins ]; then
echo "Creating link for /emby/plugins"
mkdir -p /share/emby/plugins
chown -R abc:abc /share/emby/plugins
ln -s /share/emby/plugins /emby/plugins
fi
if [ ! -d /emby/root ]; then
echo "Creating link for /emby/root"
mkdir -p /share/emby/root
chown -R abc:abc /share/emby/root
ln -s /share/emby/root /emby/root
fi

View File

@@ -0,0 +1,27 @@
#!/usr/bin/with-contenv bashio
######################
# MOUNT LOCAL SHARES #
######################
bashio::log.info 'Mounting external hdd...'
# Mount local Share if configured and if Protection Mode is active
if bashio::config.has_value 'localdisks'; then
bashio::require.unprotected
MOREDISKS=$(bashio::config 'localdisks')
bashio::log.info "Local Disks mounting.. ${MOREDISKS}" && \
for disk in ${MOREDISKS//,/ } # Separate comma separated values
do
bashio::log.info "Mount ${disk}"
mkdir -p /share/$disk && \
if [ ! -d /share/$disk ]; then
echo "Creating /share/$disk"
mkdir -p /share/$disk
chown -R abc:abc /share/$disk
fi
mount /dev/$disk /share/$disk && \
bashio::log.info "Success! Mounted to /nmt/$disk"
done || \
bashio::log.warning "Protection mode is ON. Unable to mount local drives!"
fi

View File

@@ -0,0 +1,62 @@
#!/usr/bin/with-contenv bashio
####################
# MOUNT SMB SHARES #
####################
if bashio::config.has_value 'networkdisks'; then
# Mount CIFS Share if configured and if Protection Mode is active
bashio::log.info 'Mounting smb share(s)...'
# Define variables
MOREDISKS=$(bashio::config 'networkdisks')
CIFS_USERNAME=$(bashio::config 'cifsusername')
CIFS_PASSWORD=$(bashio::config 'cifspassword')
MOUNTED=false
SMBVERS=""
SECVERS=""
if bashio::config.has_value 'cifsdomain'; then
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
else
DOMAIN=""
fi
# Mounting disks
for disk in ${MOREDISKS//,/ } # Separate comma separated values
do
# Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name
# Prepare mount point
mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname
#Tries to mount with default options
mount -t cifs -o rw,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false
# if Fail test different smb and sec versions
if [ $MOUNTED = false ]; then
for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN}"
do
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5"
do
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false
done
done
fi
# Messages
if [ $MOUNTED = true ]; then
#Test write permissions
touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw"
else
# message if still fail
bashio::log.fatal "Unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" # Mount share
bashio::log.fatal "Error read : $(<ERRORCODE)" # Mount share
rm ERRORCODE
fi
done
fi