Add Maintainerr addon

This commit is contained in:
Pierre
2026-03-05 15:59:21 +01:00
parent 991c90398b
commit c4374e2c90
10 changed files with 394 additions and 0 deletions

8
maintainerr/CHANGELOG.md Normal file
View File

@@ -0,0 +1,8 @@
# Changelog
## 3.0.1
- Initial release of Maintainerr addon
- Based on upstream image `ghcr.io/maintainerr/maintainerr:3.0.1`
- Persistent data stored in HA addon config directory
- Supports amd64 and aarch64 architectures

135
maintainerr/Dockerfile Normal file
View File

@@ -0,0 +1,135 @@
#============================#
# ALEXBELGIUM'S DOCKERFILE #
#============================#
# _.------.
# _.-` ('>.-`"""-.
# '.--'` _'` _ .--.)
# -' '-.-';` `
# ' - _.' ``'--.
# '---` .-'""`
# /`
#=== Home Assistant Addon ===#
# ARGs used in FROM must be declared before any FROM instruction
ARG BUILD_UPSTREAM="3.0.1"
############################
# 0) Tools stage #
############################
# Build a small payload with gosu (for privilege dropping) and its shared libs
FROM alpine:3.22 AS ha_tools
RUN apk add --no-cache \
gosu \
pax-utils
RUN set -eux; \
mkdir -p /out; \
for bin in /usr/bin/gosu; do \
mkdir -p "/out$(dirname "$bin")"; \
cp -a "$bin" "/out$bin"; \
lddtree -l "$bin" | while read -r dep; do \
case "$dep" in \
/lib/ld-musl-*.so.1) \
continue ;; \
/*) \
mkdir -p "/out$(dirname "$dep")"; \
cp -a "$dep" "/out$(dirname "$dep")/"; \
;; \
esac; \
done; \
done
#################
# 1 Build Image #
#################
ARG BUILD_FROM
ARG BUILD_VERSION
FROM ghcr.io/maintainerr/maintainerr:${BUILD_UPSTREAM}
##################
# 2 Modify Image #
##################
USER root
# Bring in gosu from tools stage
COPY --from=ha_tools /out/ /
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
RUN find /. -type f \( -name "*.sh" \) -print -exec chmod +x {} \;
# Install bashio standalone
RUN BASHIO_VERSION="0.14.3" && \
mkdir -p /tmp/bashio && \
curl -f -L -s -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
# Modules
ARG MODULES="00-banner.sh 01-custom_script.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
################
# 4 Entrypoint #
################
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/bashio-standalone.sh" "/usr/local/lib/bashio-standalone.sh"
RUN chmod 0755 /usr/local/lib/bashio-standalone.sh
# Use our wrapper as entrypoint (replaces original /opt/app/start.sh)
ENTRYPOINT ["/entrypoint.sh"]
############
# 5 Labels #
############
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
ARG BUILD_REF
ARG BUILD_REPOSITORY
ARG BUILD_VERSION
ENV BUILD_VERSION="${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 Healthcheck #
#################
ENV HEALTH_PORT="6246" \
HEALTH_URL=""
HEALTHCHECK \
--interval=5s \
--retries=5 \
--start-period=60s \
--timeout=25s \
CMD curl -A "HealthCheck: Docker/1.0" -s -f "http://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}" &>/dev/null || exit 1

43
maintainerr/README.md Normal file
View File

@@ -0,0 +1,43 @@
# Home Assistant Add-on: Maintainerr
_"Looks and smells like Overseerr, does the opposite."_
Maintainerr is a rule-based media management tool for your Plex, Jellyfin, or Emby ecosystem. It creates smart collections based on configurable rules (watched status, age, ratings, ...) and can optionally delete unwatched content to keep your library clean.
## About
Maintainerr integrates with:
- **Plex / Jellyfin / Emby** — media server
- **Sonarr / Radarr** — to remove media files
- **Overseerr / Jellyseerr** — to reset requests
- **Tautulli** — for advanced watch statistics
## Installation
1. Add the repository to Home Assistant.
2. Install the **Maintainerr** add-on.
3. Start the add-on.
4. Open the Web UI on port `6246`.
## Configuration
| Option | Description |
|--------|-------------|
| `TZ` | Timezone (e.g. `Europe/Paris`). Defaults to `Europe/London`. |
| `env_vars` | Extra environment variables passed to the container. |
### Available extra env vars
| Variable | Default | Description |
|----------|---------|-------------|
| `UI_PORT` | `6246` | Change the listening port |
| `BASE_PATH` | _(empty)_ | Serve under a URL subpath |
## Data
Persistent data (database, configuration) is stored in the HA addon config directory and survives add-on updates and reinstalls.
## Support
- [Maintainerr upstream project](https://github.com/maintainerr/maintainerr)
- [Addon repository issues](https://github.com/alexbelgium/hassio-addons/issues)

66
maintainerr/apparmor.txt Normal file
View File

@@ -0,0 +1,66 @@
#include <tunables/global>
profile maintainerr_addon flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
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,
}

6
maintainerr/build.json Normal file
View File

@@ -0,0 +1,6 @@
{
"build_from": {
"aarch64": "ghcr.io/maintainerr/maintainerr:latest",
"amd64": "ghcr.io/maintainerr/maintainerr:latest"
}
}

91
maintainerr/config.yaml Normal file
View File

@@ -0,0 +1,91 @@
arch:
- aarch64
- amd64
description:
Rule-based media cleanup tool for Plex, Jellyfin and Emby. Creates collections and optionally deletes unwatched content.
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/nvme0
- /dev/nvme0n1
- /dev/nvme0n1p1
- /dev/nvme0n1p2
- /dev/nvme0n1p3
- /dev/nvme1n1
- /dev/nvme1n1p1
- /dev/nvme1n1p2
- /dev/nvme1n1p3
- /dev/nvme2n1
- /dev/nvme2n1p1
- /dev/nvme2n1p2
- /dev/nvme2n3p3
- /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/maintainerr-{arch}
ingress: true
ingress_stream: true
init: false
panel_icon: mdi:movie-search
map:
- addon_config:rw
name: Maintainerr
options:
env_vars: []
TZ: Europe/London
ports:
6246/tcp: 6246
ports_description:
6246/tcp: Web interface
schema:
env_vars:
- name: match(^[A-Za-z0-9_]+$)
value: str?
TZ: str?
slug: maintainerr
url: https://github.com/alexbelgium/hassio-addons/tree/master/maintainerr
version: "3.0.1"
webui: "[PROTO:ssl]://[HOST]:[PORT:6246]"

BIN
maintainerr/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
maintainerr/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -0,0 +1,37 @@
#!/bin/bash
# shellcheck shell=bash
set -e
###############################################################################
# Home Assistant Addon entrypoint for Maintainerr
# Runs cont-init.d scripts then drops privileges and starts the app.
###############################################################################
# ─── Source standalone bashio if available ───────────────────────────────────
if [ -f /usr/local/lib/bashio-standalone.sh ]; then
# shellcheck disable=SC1091
source /usr/local/lib/bashio-standalone.sh
fi
# ─── Run cont-init.d scripts ─────────────────────────────────────────────────
if [ -d /etc/cont-init.d ]; then
for script in /etc/cont-init.d/*.sh; do
[ -f "$script" ] || continue
echo "[Maintainerr] Running init script: $script"
# Use bash directly (no S6 with-contenv available)
bash "$script"
done
fi
# ─── Setup persistent data directory ─────────────────────────────────────────
# /opt/data is a Docker VOLUME in the upstream image and cannot be removed.
# Maintainerr supports the DATA_DIR env var to redirect data storage.
DATA_DIR="/addon_configs/maintainerr"
echo "[Maintainerr] Setting up data directory: $DATA_DIR"
mkdir -p "$DATA_DIR"
chown -R node:node "$DATA_DIR"
export DATA_DIR
# ─── Start Maintainerr as unprivileged node user ─────────────────────────────
echo "[Maintainerr] Starting application on port ${UI_PORT:-6246}..."
exec gosu node /opt/app/start.sh

8
maintainerr/updater.json Normal file
View File

@@ -0,0 +1,8 @@
{
"last_update": "2026-03-03",
"repository": "alexbelgium/hassio-addons",
"slug": "maintainerr",
"source": "github",
"upstream_repo": "maintainerr/maintainerr",
"upstream_version": "3.0.1"
}