diff --git a/bazaar/CHANGELOG.md b/bazaar/CHANGELOG.md new file mode 100644 index 000000000..efa646bfb --- /dev/null +++ b/bazaar/CHANGELOG.md @@ -0,0 +1,4 @@ +## 3.0.2.4552 + +- Update to latest version from linuxserver/docker-bazarr +- Enables PUID/GUID options diff --git a/bazaar/Dockerfile b/bazaar/Dockerfile new file mode 100644 index 000000000..736d2bbe4 --- /dev/null +++ b/bazaar/Dockerfile @@ -0,0 +1,28 @@ +ARG BUILD_FROM +ARG BUILD_VERSION +ARG BUILD_UPSTREAM="0.9.4" +FROM ${BUILD_FROM}${BUILD_UPSTREAM} + + +RUN curl -J -L -o /tmp/bashio.tar.gz \ + "https://github.com/hassio-addons/bashio/archive/v0.7.1.tar.gz" \ + && mkdir /tmp/bashio \ + && tar zxvf \ + /tmp/bashio.tar.gz \ + --strip 1 -C /tmp/bashio \ + \ + && mv /tmp/bashio/lib /usr/lib/bashio \ + && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ + && rm -fr /tmp/bashio.tar.gz + +# use /data instead of /config for hass.io environment +RUN sed -i "s|/config|/config/bazarr|g" /etc/services.d/bazarr/run \ + && sed -i "s|/config|/config/bazarr|g" /etc/cont-init.d/30-config \ + \ + # 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 + +# copy local files +COPY root/ / diff --git a/bazaar/README.md b/bazaar/README.md new file mode 100644 index 000000000..74cdf8593 --- /dev/null +++ b/bazaar/README.md @@ -0,0 +1,35 @@ +# Home assistant add-on: bazarr + +![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 version, addition of OCR + +- Inital version : https://github.com/petersendev/hassio-addons + +[bazarr](https://github.com/bazarr/bazarr) - A fork of bazarr to work with movies like Couchpotato. + +This addon is based on the [docker image](https://github.com/linuxserver/docker-bazarr) 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 `:7878`. + +[repository]: https://github.com/petersendev/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 diff --git a/bazaar/apparmor.txt b/bazaar/apparmor.txt new file mode 100644 index 000000000..8878326e4 --- /dev/null +++ b/bazaar/apparmor.txt @@ -0,0 +1,48 @@ +#include + +profile bazarr_addon flags=(attach_disconnected,mediate_deleted) { + #include + + 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/* 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, + +} diff --git a/bazaar/build.json b/bazaar/build.json new file mode 100644 index 000000000..56fb57a5c --- /dev/null +++ b/bazaar/build.json @@ -0,0 +1,8 @@ +{ + "build_from": { + "armhf": "linuxserver/bazarr:arm32v7-version-v", + "armv7": "linuxserver/bazarr:arm32v7-version-v", + "aarch64": "linuxserver/bazarr:arm64v8-version-v", + "amd64": "linuxserver/bazarr:amd64-version-v" + } +} diff --git a/bazaar/config.json b/bazaar/config.json new file mode 100644 index 000000000..ac15b8749 --- /dev/null +++ b/bazaar/config.json @@ -0,0 +1,43 @@ +{ + "name": "Bazarr NAS", + "version": "0.9.4", + "upstream": "0.9.4", + "slug": "bazarr_nas", + "description": "Companion application to Sonarr and Radarr to download subtitles", + "url": "https://github.com/alexbelgium/hassio-addons", + "startup": "services", + "arch": ["aarch64", "amd64", "armv7", "armhf"], + "ports": { + "6767/tcp": 6767 + }, + "ports_description": { + "6767/tcp": "web interface" + }, + "map": ["config:rw", "share:rw", "media:rw", "ssl"], + "privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"], + "full_access": true, + "webui": "http://[HOST]:[PORT:6767]", + "boot": "auto", + "environment": { + "PUID": "0", + "PGID": "0" + }, + "options": { + "PUID": 0, + "PGID": 0, + "localdisks": ["sda1"], + "networkdisks": "", + "cifsusername": "", + "cifspassword": "" + }, + "schema": { + "PUID": "int", + "PGID": "int", + "TZ": "str?", + "localdisks": ["str"], + "networkdisks": "str", + "cifsusername": "str", + "cifspassword": "str" + }, + "snapshot_exclude": ["**/Backups/*", "**/logs/*", "**/MediaCover/*"] +} diff --git a/bazaar/icon.png b/bazaar/icon.png new file mode 100644 index 000000000..cfc65fe9a Binary files /dev/null and b/bazaar/icon.png differ diff --git a/bazaar/logo.png b/bazaar/logo.png new file mode 100644 index 000000000..cfc65fe9a Binary files /dev/null and b/bazaar/logo.png differ diff --git a/bazaar/root/etc/cont-init.d/00-ha-env b/bazaar/root/etc/cont-init.d/00-ha-env new file mode 100644 index 000000000..3b3e69246 --- /dev/null +++ b/bazaar/root/etc/cont-init.d/00-ha-env @@ -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 \ No newline at end of file diff --git a/bazaar/root/etc/cont-init.d/20-folders b/bazaar/root/etc/cont-init.d/20-folders new file mode 100644 index 000000000..73e1f22de --- /dev/null +++ b/bazaar/root/etc/cont-init.d/20-folders @@ -0,0 +1,19 @@ +#!/usr/bin/with-contenv bash + +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/downloads ]; then + echo "Creating /share/downloads" + mkdir -p /share/downloads + chown -R abc:abc /share/downloads +fi + +if [ ! -d /config/bazarr ]; then + echo "Creating /config/bazarr" + mkdir -p /config/bazarr + chown -R abc:abc /config/bazarr +fi diff --git a/bazaar/root/etc/cont-init.d/50-mounts b/bazaar/root/etc/cont-init.d/50-mounts new file mode 100644 index 000000000..e7fb49d35 --- /dev/null +++ b/bazaar/root/etc/cont-init.d/50-mounts @@ -0,0 +1,43 @@ +#!/usr/bin/with-contenv bashio +bashio::log.info 'Mounting external hdd...' + +# Mount local Share if configured and if Protection Mode is active +if bashio::config.has_value 'localdisks'; then + MOREDISKS=$(bashio::config 'localdisks') + bashio::log.info "Local Disks mounting.. ${MOREDISKS}" && \ + for disk in $MOREDISKS + 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!" + done || \ + bashio::log.warning "Protection mode is ON. Unable to mount local drives!" +fi + +# Mount CIFS Share if configured and if Protection Mode is active +if bashio::config.has_value 'networkdisks'; then + MOREDISKS=$(bashio::config 'networkdisks') + CIFS_USERNAME=$(bashio::config 'cifsusername') + CIFS_PASSWORD=$(bashio::config 'cifspassword') + bashio::log.info "Network Disks mounting.. ${MOREDISKS}" && \ + for disk in $MOREDISKS + do + bashio::log.info "Mount ${disk}" + mkdir -p /share/storagecifs && \ + if [ ! -d /storage/storagecifs ]; then + echo "Creating /storage/storagecifs" + mkdir -p /storage/storagecifs + chown -R abc:abc /storage/storagecifs + fi + + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD $disk /storage/storagecifs && \ + bashio::log.info "Success!" + done || \ + bashio::log.warning "Protection mode is ON. Unable to mount external drives!" +fi diff --git a/jackett/CHANGELOG.md b/jackett/CHANGELOG.md new file mode 100644 index 000000000..00a0a750c --- /dev/null +++ b/jackett/CHANGELOG.md @@ -0,0 +1,4 @@ +## 3.0.2.4552 + +- Update to latest version from linuxserver/docker-jackett +- Enables PUID/GUID options diff --git a/jackett/Dockerfile b/jackett/Dockerfile new file mode 100644 index 000000000..50ccc6fa3 --- /dev/null +++ b/jackett/Dockerfile @@ -0,0 +1,28 @@ +ARG BUILD_FROM +ARG BUILD_VERSION +ARG BUILD_UPSTREAM="0.17.946" +FROM ${BUILD_FROM}${BUILD_UPSTREAM} + + +RUN curl -J -L -o /tmp/bashio.tar.gz \ + "https://github.com/hassio-addons/bashio/archive/v0.7.1.tar.gz" \ + && mkdir /tmp/bashio \ + && tar zxvf \ + /tmp/bashio.tar.gz \ + --strip 1 -C /tmp/bashio \ + \ + && mv /tmp/bashio/lib /usr/lib/bashio \ + && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ + && rm -fr /tmp/bashio.tar.gz + +# use /data instead of /config for hass.io environment +RUN sed -i "s|/config|/config/jackett|g" /etc/services.d/jackett/run \ + && sed -i "s|/config|/config/jackett|g" /etc/cont-init.d/30-config \ + \ + # 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 + +# copy local files +COPY root/ / diff --git a/jackett/README.md b/jackett/README.md new file mode 100644 index 000000000..a1292cf4f --- /dev/null +++ b/jackett/README.md @@ -0,0 +1,35 @@ +# Home assistant add-on: jackett + +![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 version, addition of OCR + +- Inital version : https://github.com/petersendev/hassio-addons + +[jackett](https://github.com/jackett/jackett) - A fork of jackett to work with movies like Couchpotato. + +This addon is based on the [docker image](https://github.com/linuxserver/docker-jackett) 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 `:7878`. + +[repository]: https://github.com/petersendev/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 diff --git a/jackett/apparmor.txt b/jackett/apparmor.txt new file mode 100644 index 000000000..9e180360c --- /dev/null +++ b/jackett/apparmor.txt @@ -0,0 +1,48 @@ +#include + +profile jackett_addon flags=(attach_disconnected,mediate_deleted) { + #include + + 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/* 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, + +} diff --git a/jackett/build.json b/jackett/build.json new file mode 100644 index 000000000..801a1627c --- /dev/null +++ b/jackett/build.json @@ -0,0 +1,8 @@ +{ + "build_from": { + "armhf": "linuxserver/jackett:arm32v7-version-v", + "armv7": "linuxserver/jackett:arm32v7-version-v", + "aarch64": "linuxserver/jackett:arm64v8-version-v", + "amd64": "linuxserver/jackett:amd64-version-v" + } +} diff --git a/jackett/config.json b/jackett/config.json new file mode 100644 index 000000000..dbbeff7e0 --- /dev/null +++ b/jackett/config.json @@ -0,0 +1,43 @@ +{ + "name": "Jackett NAS", + "version": "0.17.946", + "upstream": "0.17.946", + "slug": "jackett_nas", + "description": "translates queries from apps (Sonarr, SickRage, CouchPotato, Mylar, etc) into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software", + "url": "https://github.com/alexbelgium/hassio-addons", + "startup": "services", + "arch": ["aarch64", "amd64", "armv7", "armhf"], + "ports": { + "9117/tcp": 9117 + }, + "ports_description": { + "9117/tcp": "web interface" + }, + "map": ["config:rw", "share:rw", "media:rw", "ssl"], + "privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"], + "full_access": true, + "webui": "http://[HOST]:[PORT:9117]", + "boot": "auto", + "environment": { + "PUID": "0", + "PGID": "0" + }, + "options": { + "PUID": 0, + "PGID": 0, + "localdisks": ["sda1"], + "networkdisks": "", + "cifsusername": "", + "cifspassword": "" + }, + "schema": { + "PUID": "int", + "PGID": "int", + "TZ": "str?", + "localdisks": ["str"], + "networkdisks": "str", + "cifsusername": "str", + "cifspassword": "str" + }, + "snapshot_exclude": ["**/Backups/*", "**/logs/*", "**/MediaCover/*"] +} diff --git a/jackett/icon.png b/jackett/icon.png new file mode 100644 index 000000000..cfc65fe9a Binary files /dev/null and b/jackett/icon.png differ diff --git a/jackett/logo.png b/jackett/logo.png new file mode 100644 index 000000000..cfc65fe9a Binary files /dev/null and b/jackett/logo.png differ diff --git a/jackett/root/etc/cont-init.d/00-ha-env b/jackett/root/etc/cont-init.d/00-ha-env new file mode 100644 index 000000000..3b3e69246 --- /dev/null +++ b/jackett/root/etc/cont-init.d/00-ha-env @@ -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 \ No newline at end of file diff --git a/jackett/root/etc/cont-init.d/20-folders b/jackett/root/etc/cont-init.d/20-folders new file mode 100644 index 000000000..0a8112e46 --- /dev/null +++ b/jackett/root/etc/cont-init.d/20-folders @@ -0,0 +1,19 @@ +#!/usr/bin/with-contenv bash + +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/downloads ]; then + echo "Creating /share/downloads" + mkdir -p /share/downloads + chown -R abc:abc /share/downloads +fi + +if [ ! -d /config/jackett ]; then + echo "Creating /config/jackett" + mkdir -p /config/jackett + chown -R abc:abc /config/jackett +fi diff --git a/jackett/root/etc/cont-init.d/50-mounts b/jackett/root/etc/cont-init.d/50-mounts new file mode 100644 index 000000000..e7fb49d35 --- /dev/null +++ b/jackett/root/etc/cont-init.d/50-mounts @@ -0,0 +1,43 @@ +#!/usr/bin/with-contenv bashio +bashio::log.info 'Mounting external hdd...' + +# Mount local Share if configured and if Protection Mode is active +if bashio::config.has_value 'localdisks'; then + MOREDISKS=$(bashio::config 'localdisks') + bashio::log.info "Local Disks mounting.. ${MOREDISKS}" && \ + for disk in $MOREDISKS + 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!" + done || \ + bashio::log.warning "Protection mode is ON. Unable to mount local drives!" +fi + +# Mount CIFS Share if configured and if Protection Mode is active +if bashio::config.has_value 'networkdisks'; then + MOREDISKS=$(bashio::config 'networkdisks') + CIFS_USERNAME=$(bashio::config 'cifsusername') + CIFS_PASSWORD=$(bashio::config 'cifspassword') + bashio::log.info "Network Disks mounting.. ${MOREDISKS}" && \ + for disk in $MOREDISKS + do + bashio::log.info "Mount ${disk}" + mkdir -p /share/storagecifs && \ + if [ ! -d /storage/storagecifs ]; then + echo "Creating /storage/storagecifs" + mkdir -p /storage/storagecifs + chown -R abc:abc /storage/storagecifs + fi + + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD $disk /storage/storagecifs && \ + bashio::log.info "Success!" + done || \ + bashio::log.warning "Protection mode is ON. Unable to mount external drives!" +fi diff --git a/sonaar/CHANGELOG.md b/sonaar/CHANGELOG.md new file mode 100644 index 000000000..b13d4e3ad --- /dev/null +++ b/sonaar/CHANGELOG.md @@ -0,0 +1,4 @@ +## 3.0.2.4552 + +- Update to latest version from linuxserver/docker-sonarr +- Enables PUID/GUID options diff --git a/sonaar/Dockerfile b/sonaar/Dockerfile new file mode 100644 index 000000000..cf57bb5e6 --- /dev/null +++ b/sonaar/Dockerfile @@ -0,0 +1,28 @@ +ARG BUILD_FROM +ARG BUILD_VERSION +ARG BUILD_UPSTREAM="3.0.6.1196" +FROM ${BUILD_FROM}${BUILD_UPSTREAM} + + +RUN curl -J -L -o /tmp/bashio.tar.gz \ + "https://github.com/hassio-addons/bashio/archive/v0.7.1.tar.gz" \ + && mkdir /tmp/bashio \ + && tar zxvf \ + /tmp/bashio.tar.gz \ + --strip 1 -C /tmp/bashio \ + \ + && mv /tmp/bashio/lib /usr/lib/bashio \ + && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ + && rm -fr /tmp/bashio.tar.gz + +# use /data instead of /config for hass.io environment +RUN sed -i "s|/config|/config/sonarr|g" /etc/services.d/sonarr/run \ + && sed -i "s|/config|/config/sonarr|g" /etc/cont-init.d/30-config \ + \ + # 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 + +# copy local files +COPY root/ / diff --git a/sonaar/README.md b/sonaar/README.md new file mode 100644 index 000000000..6f03776e6 --- /dev/null +++ b/sonaar/README.md @@ -0,0 +1,35 @@ +# Home assistant add-on: sonarr + +![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 version, addition of OCR + +- Inital version : https://github.com/petersendev/hassio-addons + +[sonarr](https://github.com/sonarr/sonarr) - A fork of Sonarr to work with movies like Couchpotato. + +This addon is based on the [docker image](https://github.com/linuxserver/docker-sonarr) 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 `:7878`. + +[repository]: https://github.com/petersendev/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 diff --git a/sonaar/apparmor.txt b/sonaar/apparmor.txt new file mode 100644 index 000000000..4c0eded04 --- /dev/null +++ b/sonaar/apparmor.txt @@ -0,0 +1,48 @@ +#include + +profile sonarr_addon flags=(attach_disconnected,mediate_deleted) { + #include + + 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/* 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, + +} diff --git a/sonaar/build.json b/sonaar/build.json new file mode 100644 index 000000000..1cb2edda4 --- /dev/null +++ b/sonaar/build.json @@ -0,0 +1,8 @@ +{ + "build_from": { + "armhf": "linuxserver/sonarr:arm32v7-version-", + "armv7": "linuxserver/sonarr:arm32v7-version-", + "aarch64": "linuxserver/sonarr:arm64v8-version-", + "amd64": "linuxserver/sonarr:amd64-version-" + } +} diff --git a/sonaar/config.json b/sonaar/config.json new file mode 100644 index 000000000..f114dcc46 --- /dev/null +++ b/sonaar/config.json @@ -0,0 +1,43 @@ +{ + "name": "Sonarr NAS", + "version": "3.0.6.1196", + "upstream": "3.0.6.1196", + "slug": "sonarr_nas", + "description": "Can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. ", + "url": "https://github.com/alexbelgium/hassio-addons", + "startup": "services", + "arch": ["aarch64", "amd64", "armv7", "armhf"], + "ports": { + "8989/tcp": 8989 + }, + "ports_description": { + "8989/tcp": "web interface" + }, + "map": ["config:rw", "share:rw", "media:rw", "ssl"], + "privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"], + "full_access": true, + "webui": "http://[HOST]:[PORT:8989]", + "boot": "auto", + "environment": { + "PUID": "0", + "PGID": "0" + }, + "options": { + "PUID": 0, + "PGID": 0, + "localdisks": ["sda1"], + "networkdisks": "", + "cifsusername": "", + "cifspassword": "" + }, + "schema": { + "PUID": "int", + "PGID": "int", + "TZ": "str?", + "localdisks": ["str"], + "networkdisks": "str", + "cifsusername": "str", + "cifspassword": "str" + }, + "snapshot_exclude": ["**/Backups/*", "**/logs/*", "**/MediaCover/*"] +} diff --git a/sonaar/icon.png b/sonaar/icon.png new file mode 100644 index 000000000..cfc65fe9a Binary files /dev/null and b/sonaar/icon.png differ diff --git a/sonaar/logo.png b/sonaar/logo.png new file mode 100644 index 000000000..cfc65fe9a Binary files /dev/null and b/sonaar/logo.png differ diff --git a/sonaar/root/etc/cont-init.d/00-ha-env b/sonaar/root/etc/cont-init.d/00-ha-env new file mode 100644 index 000000000..3b3e69246 --- /dev/null +++ b/sonaar/root/etc/cont-init.d/00-ha-env @@ -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 \ No newline at end of file diff --git a/sonaar/root/etc/cont-init.d/20-folders b/sonaar/root/etc/cont-init.d/20-folders new file mode 100644 index 000000000..17b3689df --- /dev/null +++ b/sonaar/root/etc/cont-init.d/20-folders @@ -0,0 +1,19 @@ +#!/usr/bin/with-contenv bash + +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/downloads ]; then + echo "Creating /share/downloads" + mkdir -p /share/downloads + chown -R abc:abc /share/downloads +fi + +if [ ! -d /config/sonarr ]; then + echo "Creating /config/sonarr" + mkdir -p /config/sonarr + chown -R abc:abc /config/sonarr +fi diff --git a/sonaar/root/etc/cont-init.d/50-mounts b/sonaar/root/etc/cont-init.d/50-mounts new file mode 100644 index 000000000..e7fb49d35 --- /dev/null +++ b/sonaar/root/etc/cont-init.d/50-mounts @@ -0,0 +1,43 @@ +#!/usr/bin/with-contenv bashio +bashio::log.info 'Mounting external hdd...' + +# Mount local Share if configured and if Protection Mode is active +if bashio::config.has_value 'localdisks'; then + MOREDISKS=$(bashio::config 'localdisks') + bashio::log.info "Local Disks mounting.. ${MOREDISKS}" && \ + for disk in $MOREDISKS + 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!" + done || \ + bashio::log.warning "Protection mode is ON. Unable to mount local drives!" +fi + +# Mount CIFS Share if configured and if Protection Mode is active +if bashio::config.has_value 'networkdisks'; then + MOREDISKS=$(bashio::config 'networkdisks') + CIFS_USERNAME=$(bashio::config 'cifsusername') + CIFS_PASSWORD=$(bashio::config 'cifspassword') + bashio::log.info "Network Disks mounting.. ${MOREDISKS}" && \ + for disk in $MOREDISKS + do + bashio::log.info "Mount ${disk}" + mkdir -p /share/storagecifs && \ + if [ ! -d /storage/storagecifs ]; then + echo "Creating /storage/storagecifs" + mkdir -p /storage/storagecifs + chown -R abc:abc /storage/storagecifs + fi + + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD $disk /storage/storagecifs && \ + bashio::log.info "Success!" + done || \ + bashio::log.warning "Protection mode is ON. Unable to mount external drives!" +fi