diff --git a/kometa/CHANGELOG.md b/kometa/CHANGELOG.md new file mode 100644 index 000000000..e69de29bb diff --git a/kometa/Dockerfile b/kometa/Dockerfile new file mode 100644 index 000000000..07291ab54 --- /dev/null +++ b/kometa/Dockerfile @@ -0,0 +1,120 @@ +#============================# +# ALEXBELGIUM'S DOCKERFILE # +#============================# +# _.------. +# _.-` ('>.-`"""-. +# '.--'` _'` _ .--.) +# -' '-.-';` ` +# ' - _.' ``'--. +# '---` .-'""` +# /` +#=== Home Assistant Addon ===# + +################# +# 1 Build Image # +################# + +ARG BUILD_FROM +ARG BUILD_VERSION +FROM ${BUILD_FROM} + +################## +# 2 Modify Image # +################## + +# Set S6 wait time +ENV S6_CMD_WAIT_FOR_SERVICES=1 \ + S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \ + S6_SERVICES_GRACETIME=0 + + +ENV HOME=/config/addons_config/kometa + +# Image specific modifications +RUN \ + # Add template config.yaml + mkdir /templates \ + && curl -f -L -s -S "https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/master/config/config.yml.template" -o /templates/config.yml + +# Global LSIO modifications +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_lsio.sh" "/ha_lsio.sh" +ARG CONFIGLOCATION="/config/addons_config/kometa" +RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGLOCATION"; fi && rm /ha_lsio.sh + +################## +# 3 Install apps # +################## + +# Add rootfs +COPY rootfs/ / + +# Uses /bin for compatibility purposes +# hadolint ignore=DL4005 +RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; fi && \ + if [ ! -f /bin/bash ] && [ -f /usr/bin/bash ]; then ln -s /usr/bin/bash /bin/bash; fi + +# Modules +ARG MODULES="00-banner.sh 01-custom_script.sh 00-global_var.sh" + +# Automatic modules download +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automodules.sh" "/ha_automodules.sh" +RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh + +# Manual apps +ENV PACKAGES="" + +# Automatic apps & bashio +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh" +RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps.sh + +################ +# 4 Entrypoint # +################ + +# Add entrypoint +ENV S6_STAGE2_HOOK=/ha_entrypoint.sh +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint.sh" "/ha_entrypoint.sh" + +# Entrypoint modifications +ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_entrypoint_modif.sh" "/ha_entrypoint_modif.sh" +RUN chmod 777 /ha_entrypoint.sh /ha_entrypoint_modif.sh && /ha_entrypoint_modif.sh && rm /ha_entrypoint_modif.sh + +# +#WORKDIR / +#ENTRYPOINT [ "/usr/bin/env" ] +#CMD [ "/ha_entrypoint.sh" ] +#SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +############ +# 5 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} + +#################### +# 6 HealthcheckNOT # +#################### diff --git a/kometa/README.md b/kometa/README.md new file mode 100644 index 000000000..a32292d92 --- /dev/null +++ b/kometa/README.md @@ -0,0 +1,81 @@ +# Home assistant add-on: Kometa + +[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium) +[![Donate][paypal-badge]](https://www.paypal.com/donate/?hosted_button_id=DZFULJZTP3UQA) + +![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fplex_meta_manager%2Fconfig.json) +![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fplex_meta_manager%2Fconfig.json) +![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fplex_meta_manager%2Fconfig.json) + +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c6cf10bdbba45ecb202d7f579b5be0e)](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade) +[![GitHub Super-Linter](https://img.shields.io/github/actions/workflow/status/alexbelgium/hassio-addons/weekly-supelinter.yaml?label=Lint%20code%20base)](https://github.com/alexbelgium/hassio-addons/actions/workflows/weekly-supelinter.yaml) +[![Builder](https://img.shields.io/github/actions/workflow/status/alexbelgium/hassio-addons/onpush_builder.yaml?label=Builder)](https://github.com/alexbelgium/hassio-addons/actions/workflows/onpush_builder.yaml) + +[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20(no%20paypal)-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white +[paypal-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20with%20Paypal-0070BA?logo=paypal&style=flat&logoColor=white + +_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_ + +[![Stargazers repo roster for @alexbelgium/hassio-addons](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.github/stars2.svg)](https://github.com/alexbelgium/hassio-addons/stargazers) + +![downloads evolution](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/kometa/stats.png) + +## About + +--- + +[Kometa](https://kometa.wiki/en/latest/) is a Python 3 script that can be continuously run using YAML configuration files to update on a schedule the metadata of the movies, shows, and collections in your libraries as well as automatically build collections based on various methods all detailed in the wiki. + +This addon is based on the docker image https://github.com/linuxserver/docker-kometa + +## Installation + +--- + +The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on. + +1. Add my add-ons repository to your home assistant instance (in supervisor addons store at top right, or click button below if you have configured my HA) + [![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Falexbelgium%2Fhassio-addons) +1. Install this add-on. +1. Click the `Save` button to store your configuration. +1. Set the add-on options to your preferences +1. Start the add-on. +1. Check the logs of the add-on to see if everything went well. +1. Open the webUI and adapt the software options + +## Configuration + +There is a [walkthrough](https://github.com/Kometa-Team/Kometa#setting-up-the-initial-config-file) available to help get you up and running. +For more information see the [official wiki](https://github.com/Kometa-Team/Kometa). + +Options can be configured through two ways : + +- Addon options + +```yaml +PUID: 1000 #for UserID - see below for explanation +PGID: 1000 #for GroupID - see below for explanation +TZ: Europe/London #Specify a timezone to use EG Europe/London. +KOMETA_CONFIG: /config/addons_config/kometa/config/config.yml #Specify a custom config file to use. +KOMETA_TIME: 03:00 #Comma-separated list of times to update each day. Format: HH:MM. +KOMETA_RUN: False #Set to True to run without the scheduler. +KOMETA_TEST: False #Set to True to run in debug mode with only collections that have test: true. +KOMETA_NO_MISSING: False #Set to True to run without any of the missing movie/show functions. +``` + +- Config.yaml (advanced usage) + +Additional variables can be set as ENV variables by adding them in the config.yaml in the location defined in your addon options according to this guide : https://github.com/alexbelgium/hassio-addons/wiki/Add%E2%80%90ons-feature-:-add-env-variables + + +The complete list of ENV variables can be seen here : https://kometa.wiki/en/latest/kometa/environmental/ + +## Support + +Create an issue on github + +## Illustration + +--- + +![illustration](https://dausruddin.com/wp-content/uploads/2020/05/plex-meta-manager-v3-1024x515.png) diff --git a/kometa/apparmor.txt b/kometa/apparmor.txt new file mode 100644 index 000000000..c690a3a41 --- /dev/null +++ b/kometa/apparmor.txt @@ -0,0 +1,66 @@ +#include + +profile kometa_addon flags=(attach_disconnected,mediate_deleted) { + #include + + capability, + file, + signal, + mount, + umount, + remount, + network udp, + network tcp, + network dgram, + network stream, + network inet, + network inet6, + network netlink raw, + network unix dgram, + + capability setgid, + capability setuid, + capability sys_admin, + capability dac_read_search, + # capability dac_override, + # capability sys_rawio, + +# S6-Overlay + /init ix, + /run/{s6,s6-rc*,service}/** ix, + /package/** ix, + /command/** ix, + /run/{,**} rwk, + /dev/tty rw, + /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/fuse mrwkl, + /dev/sda1 mrwkl, + /dev/sdb1 mrwkl, + /dev/nvme0 mrwkl, + /dev/nvme1 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/kometa/build.json b/kometa/build.json new file mode 100644 index 000000000..4a5799854 --- /dev/null +++ b/kometa/build.json @@ -0,0 +1,10 @@ +{ + "build_from": { + "aarch64": "lscr.io/linuxserver/kometa:arm64v8-latest", + "amd64": "lscr.io/linuxserver/kometa:amd64-latest", + "armv7": "lscr.io/linuxserver/kometa:arm32v7-1.19.0" + }, + "codenotary": { + "signer": "alexandrep.github@gmail.com" + } +} diff --git a/kometa/config.json b/kometa/config.json new file mode 100644 index 000000000..9acec221e --- /dev/null +++ b/kometa/config.json @@ -0,0 +1,99 @@ +{ + "arch": [ + "aarch64", + "amd64", + "armv7" + ], + "codenotary": "alexandrep.github@gmail.com", + "description": "Python script to update metadata information for movies, shows, and collections as well as automatically build collections", + "devices": [ + "/dev/dri", + "/dev/dri/card0", + "/dev/dri/card1", + "/dev/dri/renderD128", + "/dev/vchiq", + "/dev/video10", + "/dev/video11", + "/dev/video12", + "/dev/video13", + "/dev/video14", + "/dev/video15", + "/dev/video16", + "/dev/ttyUSB0", + "/dev/sda", + "/dev/sdb", + "/dev/sdc", + "/dev/sdd", + "/dev/sde", + "/dev/sdf", + "/dev/sdg", + "/dev/nvme", + "/dev/nvme0n1p1", + "/dev/nvme0n1p2", + "/dev/nvme0n1p3", + "/dev/nvme1n1p1", + "/dev/nvme1n1p2", + "/dev/nvme1n1p3", + "/dev/nvme2n1p1", + "/dev/nvme2n1p2", + "/dev/nvme3n1p3", + "/dev/mmcblk", + "/dev/fuse", + "/dev/sda1", + "/dev/sdb1", + "/dev/sdc1", + "/dev/sdd1", + "/dev/sde1", + "/dev/sdf1", + "/dev/sdg1", + "/dev/sda2", + "/dev/sdb2", + "/dev/sdc2", + "/dev/sdd2", + "/dev/sde2", + "/dev/sdf2", + "/dev/sdg2", + "/dev/sda3", + "/dev/sdb3", + "/dev/sda4", + "/dev/sdb4", + "/dev/sda5", + "/dev/sda6", + "/dev/sda7", + "/dev/sda8", + "/dev/nvme0", + "/dev/nvme1", + "/dev/nvme2" + ], + "image": "ghcr.io/alexbelgium/kometa-{arch}", + "init": false, + "map": [ + "config:rw", + "share:rw", + "media:rw" + ], + "name": "Kometa", + "options": { + "PGID": 0, + "KOMETA_CONFIG": "/config/addons_config/kometa/config.yml", + "PUID": 0 + }, + "privileged": [ + "SYS_ADMIN", + "DAC_READ_SEARCH" + ], + "schema": { + "PGID": "int", + "KOMETA_CONFIG": "str", + "KOMETA_NO_MISSING": "bool?", + "KOMETA_RUN": "bool?", + "KOMETA_TEST": "bool?", + "KOMETA_TIME": "str?", + "PUID": "int", + "TZ": "str?" + }, + "slug": "kometa", + "udev": true, + "url": "https://github.com/alexbelgium/hassio-addons/tree/master/kometa", + "version": "2.0.2" +} diff --git a/kometa/icon.png b/kometa/icon.png new file mode 100644 index 000000000..be9b3999a Binary files /dev/null and b/kometa/icon.png differ diff --git a/kometa/logo.png b/kometa/logo.png new file mode 100644 index 000000000..ed667fe3a Binary files /dev/null and b/kometa/logo.png differ diff --git a/kometa/rootfs/etc/cont-init.d/20-configuration.sh b/kometa/rootfs/etc/cont-init.d/20-configuration.sh new file mode 100755 index 000000000..22072d57c --- /dev/null +++ b/kometa/rootfs/etc/cont-init.d/20-configuration.sh @@ -0,0 +1,32 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash +set -e + +# Where is the config +CONFIGSOURCE=$(bashio::config "KOMETA_CONFIG") + +################## +# Create folders # +################## + +PUID=$(bashio::config 'PUID') +PGID=$(bashio::config 'PGID') + +if [ ! -d "$(dirname "${CONFIGSOURCE}")" ]; then + echo "Creating $(dirname "${CONFIGSOURCE}")" + mkdir -p "$(dirname "${CONFIGSOURCE}")" +fi + +chown -R "$PUID":"$PGID" "$(dirname "${CONFIGSOURCE}")" + +################### +# Set config.yaml # +################### + +# Check if config file is there, or create one from template +if [ -f "$CONFIGSOURCE" ]; then + bashio::log.info "Using config file found in $CONFIGSOURCE" +else + cp /templates/config.yml "$(dirname "${CONFIGSOURCE}")" + bashio::log.warning "No config file, creating one from template. Please correct the config.yml file before restarting the addon !" +fi diff --git a/plex_meta_manager/stats.png b/kometa/stats.png similarity index 100% rename from plex_meta_manager/stats.png rename to kometa/stats.png diff --git a/kometa/updater.json b/kometa/updater.json new file mode 100644 index 000000000..a92ee40f5 --- /dev/null +++ b/kometa/updater.json @@ -0,0 +1,8 @@ +{ + "last_update": "27-04-2024", + "repository": "alexbelgium/hassio-addons", + "slug": "kometa", + "source": "github", + "upstream_repo": "linuxserver/docker-kometa", + "upstream_version": "2.0.2" +} diff --git a/plex_meta_manager/CHANGELOG.md b/zzz_plex_meta_manager/CHANGELOG.md similarity index 100% rename from plex_meta_manager/CHANGELOG.md rename to zzz_plex_meta_manager/CHANGELOG.md diff --git a/plex_meta_manager/Dockerfile b/zzz_plex_meta_manager/Dockerfile similarity index 100% rename from plex_meta_manager/Dockerfile rename to zzz_plex_meta_manager/Dockerfile diff --git a/plex_meta_manager/README.md b/zzz_plex_meta_manager/README.md similarity index 97% rename from plex_meta_manager/README.md rename to zzz_plex_meta_manager/README.md index deada238a..0d769a469 100644 --- a/plex_meta_manager/README.md +++ b/zzz_plex_meta_manager/README.md @@ -1,4 +1,5 @@ ## ⚠ Open Issue : [🐛 [Plex Meta Manager] is now Kometa (opened 2024-04-27)](https://github.com/alexbelgium/hassio-addons/issues/1357) by [@bruvv](https://github.com/bruvv) +# ⚠️ It is recommended to use Kometa addon (https://github.com/alexbelgium/hassio-addons) instead of this. ⚠️ # Home assistant add-on: Plex-meta-manager [![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium) diff --git a/plex_meta_manager/apparmor.txt b/zzz_plex_meta_manager/apparmor.txt similarity index 100% rename from plex_meta_manager/apparmor.txt rename to zzz_plex_meta_manager/apparmor.txt diff --git a/plex_meta_manager/build.json b/zzz_plex_meta_manager/build.json similarity index 100% rename from plex_meta_manager/build.json rename to zzz_plex_meta_manager/build.json diff --git a/plex_meta_manager/config.json b/zzz_plex_meta_manager/config.json similarity index 100% rename from plex_meta_manager/config.json rename to zzz_plex_meta_manager/config.json diff --git a/plex_meta_manager/icon.png b/zzz_plex_meta_manager/icon.png similarity index 100% rename from plex_meta_manager/icon.png rename to zzz_plex_meta_manager/icon.png diff --git a/plex_meta_manager/logo.png b/zzz_plex_meta_manager/logo.png similarity index 100% rename from plex_meta_manager/logo.png rename to zzz_plex_meta_manager/logo.png diff --git a/plex_meta_manager/rootfs/etc/cont-init.d/20-configuration.sh b/zzz_plex_meta_manager/rootfs/etc/cont-init.d/20-configuration.sh similarity index 100% rename from plex_meta_manager/rootfs/etc/cont-init.d/20-configuration.sh rename to zzz_plex_meta_manager/rootfs/etc/cont-init.d/20-configuration.sh diff --git a/zzz_plex_meta_manager/stats.png b/zzz_plex_meta_manager/stats.png new file mode 100644 index 000000000..6104ccc98 Binary files /dev/null and b/zzz_plex_meta_manager/stats.png differ diff --git a/plex_meta_manager/updater.json b/zzz_plex_meta_manager/updater.json similarity index 100% rename from plex_meta_manager/updater.json rename to zzz_plex_meta_manager/updater.json