Initial introduction of Tautulli (#1)

* initial

* Add .gitlab-ci.yml

* Remove NGINX config and move SSL and auth to Tautulli

* Update License

* added deps cleanup

* Add config as RO to support !secret

* Minor text update

* Removed TODO
This commit is contained in:
Joakim Sørensen 2018-08-28 20:20:02 +02:00 committed by GitHub
parent ee1d15141f
commit 345130998f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 1022 additions and 1 deletions

428
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,428 @@
---
image: docker:latest
variables:
ADDON_GITHUB_REPO: hassio-addons/addon-tautulli
ADDON_SLUG: tautulli
ADDON_TARGET: tautulli
DOCKER_DRIVER: overlay2
DOCKER_HUB_ORG: hassioaddons
stages:
- preflight
- build
- scan
- deploy
- manifest
- publish
# Generic DIND template
.dind: &dind
before_script:
- docker info
services:
- name: docker:dind
command: ["--experimental"]
# Generic preflight template
.preflight: &preflight
stage: preflight
tags:
- preflight
# Generic build template
.build: &build
<<: *dind
stage: build
before_script:
- docker info
- |
if [ "$(apk --print-arch)" = "amd64" ]; then
docker run --rm --privileged hassioaddons/qemu-user-static:latest
fi
- |
echo "${CI_JOB_TOKEN}" | docker login \
--username gitlab-ci-token \
--password-stdin \
registry.gitlab.com
- docker pull "registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:cache" || true
script:
- |
docker build \
--build-arg "BUILD_FROM=${FROM}" \
--build-arg "BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ")" \
--build-arg "BUILD_ARCH=${ADDON_ARCH}" \
--build-arg "BUILD_REF=${CI_COMMIT_SHA}" \
--build-arg "BUILD_VERSION=${CI_COMMIT_TAG:-${CI_COMMIT_SHA:0:7}}" \
--cache-from "registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:cache" \
--tag \
"registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:${CI_COMMIT_SHA}" \
"${ADDON_TARGET}"
- |
docker push \
"registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:${CI_COMMIT_SHA}"
# Generic scan template
.scan: &scan
<<: *dind
stage: scan
allow_failure: true
before_script:
- docker info
- docker run -d --name db arminc/clair-db:latest
- docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:v2.0.1
- apk add -U curl ca-certificates
- |
curl \
--silent \
--show-error \
--location \
--fail \
--retry 3 \
--output /usr/bin/clair-scanner \
https://github.com/arminc/clair-scanner/releases/download/v8/clair-scanner_linux_amd64
- chmod +x /usr/bin/clair-scanner
- touch clair-whitelist.yml
- echo "Waiting for Clair to start"
- |
while ! nc -z docker 6060; do
sleep 1
WAIT=$((${WAIT} + 1))
if [ "${WAIT}" -gt 30 ]; then
echo "Error > Timeout waiting for Clair to start"
exit 1
fi
done
- docker pull "registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:${CI_COMMIT_SHA}"
script:
- |
clair-scanner \
-c http://docker:6060 \
--ip $(hostname -i) \
-w clair-whitelist.yml \
"registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:${CI_COMMIT_SHA}"
tags:
- scan
# Generic deploy template
.deploy: &deploy
<<: *dind
stage: deploy
before_script:
- docker info
- docker pull "registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:${CI_COMMIT_SHA}"
- |
echo "${CI_JOB_TOKEN}" | docker login \
--username gitlab-ci-token \
--password-stdin \
registry.gitlab.com
- |
echo "${DOCKER_PASSWORD}" | docker login \
--username "${DOCKER_LOGIN}" \
--password-stdin
script:
- |
docker tag \
"registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:${CI_COMMIT_SHA}" \
"registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:cache"
- docker push "registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:cache"
- TAG="${CI_COMMIT_TAG#v}"
- TAG="${TAG:-${CI_COMMIT_SHA:0:7}}"
- |
docker tag \
"registry.gitlab.com/${CI_PROJECT_PATH}/${ADDON_ARCH}:${CI_COMMIT_SHA}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:${ADDON_ARCH}-${TAG}"
- |
docker push \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:${ADDON_ARCH}-${TAG}"
tags:
- deploy
only:
- master
- /^v\d+\.\d+\.\d+(?:-(?:beta|rc)(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?)?$/
except:
- /^(?!master).+@/
# Generic manifest template
.manifest: &manifest
<<: *dind
stage: manifest
before_script:
- mkdir -p ~/.docker
- echo '{"experimental":"enabled"}' > ~/.docker/config.json
- docker info
- |
echo "${DOCKER_PASSWORD}" | docker login \
--username "${DOCKER_LOGIN}" \
--password-stdin
script:
- TAG="${TAG#v}"
- TAG="${TAG:-${CI_COMMIT_SHA:0:7}}"
- REF="${CI_COMMIT_TAG#v}"
- REF="${REF:-${CI_COMMIT_SHA:0:7}}"
- |
docker manifest create \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:${TAG}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:aarch64-${REF}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:amd64-${REF}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:armhf-${REF}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:i386-${REF}"
- |
docker manifest annotate \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:${TAG}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:aarch64-${REF}" \
--os=linux \
--arch=arm64 \
--variant=v8
- |
docker manifest annotate \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:${TAG}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:amd64-${REF}" \
--os=linux \
--arch=amd64
- |
docker manifest annotate \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:${TAG}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:armhf-${REF}" \
--os=linux \
--arch=arm \
--variant=v6
- |
docker manifest annotate \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:${TAG}" \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:i386-${REF}" \
--os=linux \
--arch=386
- |
docker manifest push \
"${DOCKER_HUB_ORG}/${ADDON_SLUG}:${TAG}"
tags:
- manifest
except:
- /^(?!master).+@/
# Generic publish template
.publish: &publish
stage: publish
image:
name: hassioaddons/repository-updater:latest
entrypoint: [""]
script:
- |
repository-updater \
--token "${GITHUB_TOKEN}" \
--repository "${REPOSITORY}" \
--addon "${ADDON_GITHUB_REPO}"
tags:
- publish
except:
- /^(?!master).+@/
# Preflight jobs
hadolint:
<<: *preflight
image: hadolint/hadolint:latest-debian
before_script:
- hadolint --version
script:
- hadolint "${ADDON_TARGET}/Dockerfile"
shellcheck:
<<: *preflight
image:
name: koalaman/shellcheck-alpine:stable
entrypoint: [""]
before_script:
- shellcheck --version
- apk --no-cache add grep
- |
find . -type f -print0 | \
xargs -0 sed -i 's:#!/usr/bin/with-contenv bash:#!/bin/bash:g'
script:
- |
for file in $(grep -IRl "#\!\(/usr/bin/env \|/bin/\)" --exclude-dir ".git" "${ADDON_TARGET}"); do
if ! shellcheck $file; then
export FAILED=1
else
echo "$file OK"
fi
done
if [ "${FAILED}" = "1" ]; then
exit 1
fi
yamllint:
<<: *preflight
image: sdesbure/yamllint
before_script:
- yamllint --version
script:
- yamllint .
jsonlint:
<<: *preflight
image: sahsu/docker-jsonlint
before_script:
- jsonlint --version || true
script:
- |
for file in $(find . -type f -name "*.json"); do
if ! jsonlint -q $file; then
export FAILED=1
else
echo "$file OK"
fi
done
if [ "${FAILED}" = "1" ]; then
exit 1
fi
markdownlint:
<<: *preflight
image:
name: ruby:alpine
entrypoint: [""]
before_script:
- gem install mdl
- mdl --version
script:
- mdl --style all --warnings .
# Build Jobs
build:armhf:
<<: *build
variables:
ADDON_ARCH: armhf
FROM: hassioaddons/base-armhf:2.1.2
tags:
- build
- armhf
build:aarch64:
<<: *build
variables:
ADDON_ARCH: aarch64
FROM: hassioaddons/base-aarch64:2.1.2
tags:
- build
- aarch64
build:i386:
<<: *build
variables:
ADDON_ARCH: i386
FROM: hassioaddons/base-i386:2.1.2
tags:
- build
- i386
build:amd64:
<<: *build
variables:
ADDON_ARCH: amd64
FROM: hassioaddons/base-amd64:2.1.2
tags:
- build
- amd64
# Scan jobs
clair:armhf:
<<: *scan
variables:
ADDON_ARCH: armhf
clair:aarch64:
<<: *scan
variables:
ADDON_ARCH: aarch64
clair:i386:
<<: *scan
variables:
ADDON_ARCH: i386
clair:amd64:
<<: *scan
variables:
ADDON_ARCH: amd64
# Deploy jobs
deploy:armhf:
<<: *deploy
variables:
ADDON_ARCH: armhf
deploy:aarch64:
<<: *deploy
variables:
ADDON_ARCH: aarch64
deploy:i386:
<<: *deploy
variables:
ADDON_ARCH: i386
deploy:amd64:
<<: *deploy
variables:
ADDON_ARCH: amd64
# Manifest jobs
manifest:sha:
<<: *manifest
only:
- master
manifest:version:
<<: *manifest
variables:
TAG: "${CI_COMMIT_TAG}"
only:
- /^v\d+\.\d+\.\d+(?:-(?:beta|rc)(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?)?$/
manifest:stable:
<<: *manifest
variables:
TAG: latest
only:
- /^v\d+\.\d+\.\d+(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?$/
manifest:beta:
<<: *manifest
variables:
TAG: beta
only:
- /^v\d+\.\d+\.\d+(?:-(?:beta|rc)(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?)?$/
manifest:edge:
<<: *manifest
variables:
TAG: edge
only:
- master
# Publish jobs
publish:stable:
<<: *publish
variables:
REPOSITORY: hassio-addons/repository
only:
- /^v\d+\.\d+\.\d+(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?$/
environment:
name: stable
publish:beta:
<<: *publish
variables:
REPOSITORY: hassio-addons/repository-beta
only:
- /^v\d+\.\d+\.\d+(?:-(?:beta|rc)(?:(?:(?:\+|\.)?[a-zA-Z0-9]+)*)?)?$/
environment:
name: beta
publish:edge:
<<: *publish
variables:
REPOSITORY: hassio-addons/repository-edge
only:
- master
environment:
name: edge

View file

@ -1,6 +1,6 @@
# MIT License
Copyright (c) 2018 Franck Nijhof
Copyright (c) 2018 Joakim Sørensen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

275
README.md Normal file
View file

@ -0,0 +1,275 @@
# Community Hass.io Add-ons: Tautulli
[![GitHub Release][releases-shield]][releases]
![Project Stage][project-stage-shield]
[![License][license-shield]](LICENSE.md)
[![GitLab CI][gitlabci-shield]][gitlabci]
![Project Maintenance][maintenance-shield]
[![GitHub Activity][commits-shield]][commits]
[![Bountysource][bountysource-shield]][bountysource]
[![Discord][discord-shield]][discord]
[![Community Forum][forum-shield]][forum]
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
Monitor and get statistics from your Plex server.
## About
Tautulli is an application that you can run alongside your Plex Media Server to monitor activity and track various statistics. Most importantly, these statistics include what has been watched, who watched it, when and where they watched it, and how it was watched. All statistics are presented in a nice and clean interface with many tables and graphs, which makes it easy to brag about your server to everyone else.
## 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 our Hass.io add-ons repository][repository] to your Hass.io instance.
1. Install the "Tautulli" add-on.
1. Start the "Tautulli" add-on
1. Check the logs of the "Tautulli" add-on to see if everything went well.
1. Click "OPEN WEB UI" to open the Tautulli website and folow the wizard to get it autorized with your Plex server.
**NOTE**: Starting the add-on might take a couple of minutes (especially the
first time starting the add-on).
**NOTE**: Do not add this repository to Hass.io, please use:
`https://github.com/hassio-addons/repository`.
## Docker status
![Supports armhf Architecture][armhf-shield]
![Supports aarch64 Architecture][aarch64-shield]
![Supports amd64 Architecture][amd64-shield]
![Supports i386 Architecture][i386-shield]
[![Docker Layers][layers-shield]][microbadger]
[![Docker Pulls][pulls-shield]][dockerhub]
## Configuration
**Note**: _Remember to restart the add-on when the configuration is changed._
Example add-on configuration:
```json
{
"log_level": "info",
"username": "MarryPoppins",
"password": "Supercalifragilisticexpialidocious",
"ssl": true,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"ipv6": false
}
```
**Note**: _This is just an example, don't copy and past it! Create your own!_
### Option: `log_level`
The `log_level` option controls the level of log output by the addon and can
be changed to be more or less verbose, which might be useful when you are
dealing with an unknown issue. Possible values are:
- `trace`: Show every detail, like all called internal functions.
- `debug`: Shows detailed debug information.
- `info`: Normal (usually) interesting events.
- `warning`: Exceptional occurrences that are not errors.
- `error`: Runtime errors that do not require immediate action.
- `fatal`: Something went terribly wrong. Add-on becomes unusable.
Please note that each level automatically includes log messages from a
more severe level, e.g., `debug` also shows `info` messages. By default,
the `log_level` is set to `info`, which is the recommended setting unless
you are troubleshooting.
### Option: `username`
Username for authenticating with the Tautulli interface. Leaving the username
field empty, will disable the authentication mechanism entirely.
Setting a username/password can be added as an extra line of defense,
to prevent users of using your installation for themselves.
This option is HIGHLY recommended in case you expose this add-on to the outside
world.
**Note**: _This option support secrets, e.g., `!secret tautulli_username`._
### Option: `password`
Password for authenticating with Tautulli interface.
**Note**: _This option support secrets, e.g., `!secret tautulli_password`._
### Option: `ssl`
Enables/Disables SSL (HTTPS) on the web interface of Tautulli. Set it `true`
to enable it, `false` otherwise.
### Option: `certfile`
The certificate file to use for SSL.
**Note**: _The file MUST be stored in `/ssl/`, which is the default for Hass.io_
### Option: `keyfile`
The private key file to use for SSL.
**Note**: _The file MUST be stored in `/ssl/`, which is the default for Hass.io_
### Option: `ipv6`
Set this option too `false` to disable IPv6 support.
### Option: `i_like_to_be_pwned`
Adding this option to the add-on configuration allows to you bypass the
HaveIBeenPwned password requirement by setting it to `true`.
**Note**: _We STRONGLY suggest picking a stronger/safer password instead of
using this option! USE AT YOUR OWN RISK!_
### Option: `leave_front_door_open`
Adding this option to the add-on configuration allows you to disable
authentication on the Web Terminal by setting it to `true` and leaving the
username and password empty.
**Note**: _We STRONGLY suggest, not to use this, even if this add-on is
only exposed to your internal network. USE AT YOUR OWN RISK!_
## Embedding into Home Assistant
It is possible to embed Tautulli directly into Home Assistant, allowing you to
access your Tautulli through the Home Assistant frontend.
Home Assistant provides the `panel_iframe` component, for these purposes.
Example configuration:
```yaml
panel_iframe:
tautulli:
title: Tautulli
icon: mdi:tautulli
url: http://addres.to.your.hass.io:8181
```
## Changelog & Releases
This repository keeps a change log using [GitHub's releases][releases]
functionality. The format of the log is based on
[Keep a Changelog][keepchangelog].
Releases are based on [Semantic Versioning][semver], and use the format
of ``MAJOR.MINOR.PATCH``. In a nutshell, the version will be incremented
based on the following:
- ``MAJOR``: Incompatible or major changes.
- ``MINOR``: Backwards-compatible new features and enhancements.
- ``PATCH``: Backwards-compatible bugfixes and package updates.
## Support
Got questions?
You have several options to get them answered:
- The [Community Hass.io Add-ons Discord chat server][discord] for add-on
support and feature requests.
- The [Home Assistant Discord chat server][discord-ha] for general Home
Assistant discussions and questions.
- The Home Assistant [Community Forum][forum].
- Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit]
You could also [open an issue here][issue] GitHub.
## Contributing
This is an active open-source project. We are always open to people who want to
use the code or contribute to it.
We have set up a separate document containing our
[contribution guidelines](CONTRIBUTING.md).
Thank you for being involved! :heart_eyes:
## Authors & contributors
The original setup of this repository is by [Joakim Sørensen][ludeeus].
For a full list of all authors and contributors,
check [the contributor's page][contributors].
## We have got some Hass.io add-ons for you
Want some more functionality to your Hass.io Home Assistant instance?
We have created multiple add-ons for Hass.io. For a full list, check out
our [GitHub Repository][repository].
## License
MIT License
Copyright (c) 2018 Joakim Sørensen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[anchore-shield]: https://anchore.io/service/badges/image/67d1185473090e99d5ac5e1bb4d1aa2295117a9bd3d7abbf8cd8a71e331c8388
[anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Funifi%3Alatest
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[bountysource-shield]: https://img.shields.io/bountysource/team/hassio-addons/activity.svg
[bountysource]: https://www.bountysource.com/teams/hassio-addons/issues
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
[buymeacoffee]: https://www.buymeacoffee.com/ludeeus
[commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-tautulli.svg
[commits]: https://github.com/hassio-addons/addon-tautulli/commits/master
[contributors]: https://github.com/hassio-addons/addon-tautulli/graphs/contributors
[discord-ha]: https://discord.gg/c5DvZ4e
[discord-shield]: https://img.shields.io/discord/478094546522079232.svg
[discord]: https://discord.me/hassioaddons
[dockerhub]: https://hub.docker.com/r/hassioaddons/tautulli
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
[forum]: https://community.home-assistant.io/
[ludeeus]: https://github.com/ludeeus
[gitlabci-shield]: https://gitlab.com/hassio-addons/addon-tautulli/badges/master/pipeline.svg
[gitlabci]: https://gitlab.com/hassio-addons/addon-tautulli/pipelines
[home-assistant]: https://home-assistant.io
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg
[issue]: https://github.com/hassio-addons/addon-tautulli/issues
[keepchangelog]: http://keepachangelog.com/en/1.0.0/
[layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/tautulli.svg
[license-shield]: https://img.shields.io/github/license/hassio-addons/addon-tautulli.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2018.svg
[microbadger]: https://microbadger.com/images/hassioaddons/tautulli
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
[pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/tautulli.svg
[reddit]: https://reddit.com/r/homeassistant
[releases-shield]: https://img.shields.io/github/release/hassio-addons/addon-tautulli.svg
[releases]: https://github.com/hassio-addons/addon-tautulli/releases
[repository]: https://github.com/hassio-addons/repository
[semver]: http://semver.org/spec/v2.0.0.htm

67
tautulli/.README.j2 Normal file
View file

@ -0,0 +1,67 @@
# Community Hass.io Add-ons: Tautulli
[![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield]
[![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum]
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
Monitoring and tracking tool for Plex Media Server.
## About
Tautulli is an application that you can run alongside your Plex Media Server to monitor activity and track various statistics. Most importantly, these statistics include what has been watched, who watched it, when and where they watched it, and how it was watched. All statistics are presented in a nice and clean interface with many tables and graphs, which makes it easy to brag about your server to everyone else.
[Click here for the full documentation][docs]
{% if channel == "edge" %}
## WARNING! THIS IS AN EDGE VERSION!
This Hass.io Add-ons repository contains edge builds of add-ons. Edge builds
add-ons are based upon the latest development version.
- They may not work at all.
- They might stop working at any time.
- They could have a negative impact on your system.
This repository was created for:
- Anybody willing to test.
- Anybody interested in trying out upcoming add-ons or add-on features.
- Developers.
If you are more interested in stable releases of our add-ons:
<https://github.com/hassio-addons/repository>
{% endif %}
{% if channel == "beta" %}
## WARNING! THIS IS A BETA VERSION!
This Hass.io Add-ons repository contains beta releases of add-ons.
- They might stop working at any time.
- They could have a negative impact on your system.
This repository was created for:
- Anybody willing to test.
- Anybody interested in trying out upcoming add-ons or add-on features.
If you are more interested in stable releases of our add-ons:
<https://github.com/hassio-addons/repository>
{% endif %}
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
[buymeacoffee]: https://www.buymeacoffee.com/ludeeus
[discord-shield]: https://img.shields.io/discord/330944238910963714.svg
[discord]: https://discord.gg/c5DvZ4e
[docs]: {{ repo }}/blob/{{ version }}/README.md
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
[forum]: https://community.home-assistant.io
[maintenance-shield]: https://img.shields.io/maintenance/yes/2018.svg
[project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg
[release-shield]: https://img.shields.io/badge/version-{{ version }}-blue.svg
[release]: {{ repo }}/tree/{{ version }}
[screenshot]: https://github.com/hassio-addons/addon-tautulli/raw/master/images/screenshot.png

64
tautulli/Dockerfile Normal file
View file

@ -0,0 +1,64 @@
ARG BUILD_FROM=hassioaddons/base:2.1.2
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Sets working directory
WORKDIR /opt
# Setup base
RUN \
apk add --no-cache --virtual .build-dependencies \
g++=6.4.0-r8 \
gcc=6.4.0-r8 \
make=4.2.1-r2 \
python2-dev=2.7.15-r1 \
libffi-dev=3.2.1-r4 \
libressl-dev=2.7.4-r0 \
&& apk add --no-cache \
git=2.18.0-r0 \
python2=2.7.15-r1 \
py2-pip=10.0.1-r0 \
wget=1.19.5-r0 \
&& pip install --no-cache-dir -U \
pip==18.0 \
&& pip install --no-cache-dir -U \
plexapi==3.0.6 \
pycryptodomex==3.6.6 \
crudini==0.9 \
PyOpenSSL==18.0.0 \
&& git clone --branch "v2.1.18" --depth=1 \
https://github.com/Tautulli/Tautulli.git /opt \
&& apk del --purge .build-dependencies \
&& find /usr/lib/python2.7/ -type d -name tests -depth -exec rm -rf {} \; \
&& find /usr/lib/python2.7/ -type d -name test -depth -exec rm -rf {} \; \
&& find /usr/lib/python2.7/ -name __pycache__ -depth -exec rm -rf {} \;
# Copy root filesystem
COPY rootfs /
# Build arugments
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION
# Labels
LABEL \
io.hass.name="Tautulli" \
io.hass.description="Monitoring and tracking tool for Plex Media Server." \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="Joakim Sørensen @ludeeus <ludeeus@gmail.com>" \
org.label-schema.description="Monitoring and tracking tool for Plex Media Server." \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="Tautulli" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://addons.community" \
org.label-schema.usage="https://github.com/hassio-addons/addon-tautulli/tree/master/README.md" \
org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="https://github.com/hassio-addons/addon-tautulli" \
org.label-schema.vendor="Community Hass.io Add-ons"

9
tautulli/build.json Normal file
View file

@ -0,0 +1,9 @@
{
"build_from": {
"aarch64": "hassioaddons/base-aarch64:2.1.2",
"amd64": "hassioaddons/base-amd64:2.1.2",
"armhf": "hassioaddons/base-armhf:2.1.2",
"i386": "hassioaddons/base-i386:2.1.2"
},
"args": {}
}

47
tautulli/config.json Normal file
View file

@ -0,0 +1,47 @@
{
"name": "Tautulli",
"version": "dev",
"slug": "tautulli",
"description": "Monitoring and tracking tool for Plex Media Server",
"url": "https://github.com/hassio-addons/addon-tautulli/tree/master/README.md",
"webui": "[PROTO:ssl]://[HOST]:[PORT:8181]",
"startup": "services",
"arch": [
"aarch64",
"amd64",
"armhf",
"i386"
],
"boot": "auto",
"hassio_api": true,
"homeassistant_api": false,
"host_network": false,
"ports": {
"8181/tcp": 8181
},
"map": [
"config",
"ssl"
],
"options": {
"log_level": "info",
"username": "",
"password": "",
"ssl": true,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
},
"schema": {
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)",
"username": "str",
"password": "str",
"ssl": "bool",
"certfile": "str",
"keyfile": "str",
"i_like_to_be_pwned": "bool?",
"leave_front_door_open": "bool?"
},
"environment": {
"LOG_FORMAT": "{LEVEL}: {MESSAGE}"
}
}

BIN
tautulli/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
tautulli/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View file

@ -0,0 +1,51 @@
#!/usr/bin/with-contenv bash
# ==============================================================================
# Community Hass.io Add-ons: Tautulli
# This files check if all user configuration requirements are met
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
# Require username / password
if ! hass.config.has_value 'username' \
&& ! ( \
hass.config.exists 'leave_front_door_open' \
&& hass.config.true 'leave_front_door_open' \
);
then
hass.die 'You need to set a username!'
fi
if ! hass.config.has_value 'password' \
&& ! ( \
hass.config.exists 'leave_front_door_open' \
&& hass.config.true 'leave_front_door_open' \
);
then
hass.die 'You need to set a password!';
fi
# Require a secure password
if hass.config.has_value 'password' \
&& ! hass.config.is_safe_password 'password'; then
hass.die "Please choose a different password, this one is unsafe!"
fi
# Check SSL requirements, if enabled
if hass.config.true 'ssl'; then
if ! hass.config.has_value 'certfile'; then
hass.die 'SSL is enabled, but no certfile was specified'
fi
if ! hass.config.has_value 'keyfile'; then
hass.die 'SSL is enabled, but no keyfile was specified'
fi
if ! hass.file_exists "/ssl/$(hass.config.get 'certfile')"; then
hass.die 'The configured certfile is not found'
fi
if ! hass.file_exists "/ssl/$(hass.config.get 'keyfile')"; then
hass.die 'The configured keyfile is not found'
fi
fi

View file

@ -0,0 +1,56 @@
#!/usr/bin/with-contenv bash
# ==============================================================================
# Community Hass.io Add-ons: Tautulli
# Preparing configuration for Tautulli
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
CONFIG=/data/config.ini
# If config.ini does not exist, create it.
if ! hass.file_exists "/data/config.ini"; then
hass.log.info "Creating default configuration..."
crudini --set "$CONFIG" General week_start_monday 1
crudini --set "$CONFIG" General update_show_changelog 0
crudini --set "$CONFIG" General first_run_complete 0
crudini --set "$CONFIG" General check_github 0
crudini --set "$CONFIG" General check_github_on_startup 0
crudini --set "$CONFIG" Advanced system_analytics 0
fi
hass.log.info "Updating running configuration..."
# Temporrary changing config.ini to be valid during additions
## This has to be done because Tautulli added a ini header with [[header]]
sed -i "s/\\[\\[get_file_sizes_hold\\]\\]/\\[get_file_sizes_hold\\]/" "$CONFIG"
# Update SSL info in configuration
if hass.config.true 'ssl'; then
hass.log.info "Ensure SSL is active in the configuration..."
crudini --set "$CONFIG" General enable_https 1
crudini --set "$CONFIG" General https_cert_chain "\"/ssl/$(hass.config.get 'certfile')\""
crudini --set "$CONFIG" General https_cert "\"/ssl/$(hass.config.get 'certfile')\""
crudini --set "$CONFIG" General https_key "\"/ssl/$(hass.config.get 'keyfile')\""
else
hass.log.info "Ensure SSL is not active in the configuration..."
crudini --set "$CONFIG" General enable_https 0
crudini --set "$CONFIG" General https_cert_chain "\"\""
crudini --set "$CONFIG" General https_cert "\"\""
crudini --set "$CONFIG" General https_key "\"\""
fi
# Update username and password in configuration
if hass.config.has_value 'username' && hass.config.has_value 'password'; then
hass.log.info "Ensure authentication is enabled in the configuration..."
crudini --set "$CONFIG" General http_username "\"$(hass.config.get 'username')\""
crudini --set "$CONFIG" General http_password "\"$(hass.config.get 'password')\""
else
hass.log.info "Ensure authentication is not enabled in the configuration..."
crudini --set "$CONFIG" General http_username "\"\""
crudini --set "$CONFIG" General http_password "\"\""
fi
# Changing config.ini back.
## This has to be done because Tautulli added a ini header with [[header]]
sed -i "s/\\[get_file_sizes_hold\\]/\\[\\[get_file_sizes_hold\\]\\]/" "$CONFIG"

View file

@ -0,0 +1,9 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Community Hass.io Add-ons: Tautulli
# Take down the S6 supervision tree when Tautulli fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
s6-svscanctl -t /var/run/s6/services

View file

@ -0,0 +1,15 @@
#!/usr/bin/with-contenv bash
# ==============================================================================
# Community Hass.io Add-ons: Tautulli
# Runs Tautulli
# ==============================================================================
# shellcheck disable=SC1091
source /usr/lib/hassio-addons/base.sh
# Start Tautulli
hass.log.info "Starting Tautulli..."
exec \
python /opt/Tautulli.py \
--datadir /data \
--nolaunch \
-p 8181