fix naming again
This commit is contained in:
1
mopidy/.mdlrc
Normal file
1
mopidy/.mdlrc
Normal file
@@ -0,0 +1 @@
|
||||
rules "~MD024"
|
||||
66
mopidy/.yamllint
Normal file
66
mopidy/.yamllint
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
rules:
|
||||
braces:
|
||||
level: error
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 1
|
||||
min-spaces-inside-empty: -1
|
||||
max-spaces-inside-empty: -1
|
||||
brackets:
|
||||
level: error
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 0
|
||||
min-spaces-inside-empty: -1
|
||||
max-spaces-inside-empty: -1
|
||||
colons:
|
||||
level: error
|
||||
max-spaces-before: 0
|
||||
max-spaces-after: 1
|
||||
commas:
|
||||
level: error
|
||||
max-spaces-before: 0
|
||||
min-spaces-after: 1
|
||||
max-spaces-after: 1
|
||||
comments:
|
||||
level: error
|
||||
require-starting-space: true
|
||||
min-spaces-from-content: 2
|
||||
comments-indentation:
|
||||
level: error
|
||||
document-end:
|
||||
level: error
|
||||
present: false
|
||||
document-start:
|
||||
level: error
|
||||
present: true
|
||||
empty-lines:
|
||||
level: error
|
||||
max: 1
|
||||
max-start: 0
|
||||
max-end: 1
|
||||
hyphens:
|
||||
level: error
|
||||
max-spaces-after: 1
|
||||
indentation:
|
||||
level: error
|
||||
spaces: 2
|
||||
indent-sequences: true
|
||||
check-multi-line-strings: false
|
||||
key-duplicates:
|
||||
level: error
|
||||
line-length:
|
||||
ignore: |
|
||||
.github/support.yml
|
||||
level: warning
|
||||
max: 120
|
||||
allow-non-breakable-words: true
|
||||
allow-non-breakable-inline-mappings: true
|
||||
new-line-at-end-of-file:
|
||||
level: error
|
||||
new-lines:
|
||||
level: error
|
||||
type: unix
|
||||
trailing-spaces:
|
||||
level: error
|
||||
truthy:
|
||||
level: error
|
||||
161
mopidy/DOCS.md
Normal file
161
mopidy/DOCS.md
Normal file
@@ -0,0 +1,161 @@
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
|
||||
Mopidy plays music from local disk, Youtube, Spotify, SoundCloud, Google Play Music,
|
||||
and more. You edit the playlist from any phone, tablet, or computer using a
|
||||
range of MPD and web clients.
|
||||
|
||||
## Installation
|
||||
|
||||
The installation of this add-on is pretty straightforward and not different in
|
||||
comparison to installing any other Home Assistant add-on.
|
||||
|
||||
1. Search for the "Mopidy" add-on in the Home Assistant add-on store
|
||||
and install it.
|
||||
1. Install the "Mopidy" add-on.
|
||||
1. Start the "Mopidy" add-on.
|
||||
1. Check the logs of the "Mopidy" add-on to see if everything went well.
|
||||
|
||||
## Configuration
|
||||
|
||||
**Note**: _Remember to restart the add-on when the configuration is changed._
|
||||
|
||||
Example add-on configuration:
|
||||
|
||||
```yaml
|
||||
settings:
|
||||
- name: soundcloud/auth_token
|
||||
value: 1-1111-1111-11eeaswdf23
|
||||
- name: spotify/username
|
||||
value: your@email.com
|
||||
- name: spotify/password
|
||||
value: thesupersecretpassword
|
||||
- name: spotify/client_id
|
||||
value: spotify-client-id
|
||||
- name: spotify/client_secret
|
||||
value: spotify-client-secret=
|
||||
- name: gmusic/username
|
||||
value: username
|
||||
- name: gmusic/password
|
||||
value: thesupersecretpassword
|
||||
- name: gmusic/deviceid
|
||||
value: yodeviceid
|
||||
- name: youtube/enabled
|
||||
value: "true"
|
||||
- name: file/enabled
|
||||
value: "true"
|
||||
- name: file/media_dirs
|
||||
value: /share/mopidy/media
|
||||
system_packages: []
|
||||
python_packages: []
|
||||
```
|
||||
|
||||
### Option: `settings`
|
||||
|
||||
This option allows you to tweak every aspect of Mopidy by setting
|
||||
configuration options. See the example at the start of this chapter
|
||||
to get an idea of how the configuration looks.
|
||||
|
||||
For more information about using these settings, see the official Mopidy
|
||||
documentation:
|
||||
|
||||
<https://docs.mopidy.com/en/latest/config/>
|
||||
|
||||
**Note**: _This option support secrets, e.g., `!secret spotify_password`._
|
||||
|
||||
### Option: `system_packages`
|
||||
|
||||
Allows you to specify additional [Debian packages][debian-packages] to
|
||||
be installed in your shell environment (e.g., Python, PHP, Go).
|
||||
|
||||
**Note**: _Adding many packages will result in a longer start-up
|
||||
time for the add-on._
|
||||
|
||||
### Option: `python_packages`
|
||||
|
||||
Allows you to specify additional [Python packages][python-packages] to be
|
||||
installed to your Mopidy setup (e.g., `PyMySQL`. `Requests`, `Pillow`).
|
||||
|
||||
**Note**: _Adding many packages will result in a longer start-up time
|
||||
for the add-on._
|
||||
|
||||
### Option: `leave_front_door_open`
|
||||
|
||||
Adding this option to the add-on configuration allows you to disable
|
||||
authentication on the Mopidy by setting it to `true`.
|
||||
|
||||
**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!_
|
||||
|
||||
## Changelog & Releases
|
||||
|
||||
This repository keeps a change log using [GitHub's releases][releases]
|
||||
functionality.
|
||||
|
||||
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 [Home Assistant Community 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.
|
||||
|
||||
## Authors & contributors
|
||||
|
||||
The original setup of this repository is by [Bram Mittendorff][brammittendorff],
|
||||
[Franck Nijhof][frenck] and [Robbert Müller][mjrider].
|
||||
|
||||
For a full list of all authors and contributors,
|
||||
check [the contributor's page][contributors].
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-2022 Bram Mittendorff, Franck Nijhof, Robbert Müller
|
||||
|
||||
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.
|
||||
|
||||
[brammittendorff]: https://github.com/brammittendorff
|
||||
[contributors]: https://github.com/hassio-addons/addon-mopidy/graphs/contributors
|
||||
[debian-packages]: https://packages.debian.org
|
||||
[discord-ha]: https://discord.gg/c5DvZ4e
|
||||
[discord]: https://discord.me/hassioaddons
|
||||
[forum]: https://community.home-assistant.io/?u=frenck
|
||||
[frenck]: https://github.com/frenck
|
||||
[issue]: https://github.com/hassio-addons/addon-mopidy/issues
|
||||
[mjrider]: https://github.com/mjrider
|
||||
[python-packages]: https://pypi.org
|
||||
[reddit]: https://reddit.com/r/homeassistant
|
||||
[releases]: https://github.com/hassio-addons/addon-mopidy/releases
|
||||
[semver]: http://semver.org/spec/v2.0.0
|
||||
106
mopidy/Dockerfile
Executable file
106
mopidy/Dockerfile
Executable file
@@ -0,0 +1,106 @@
|
||||
ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64:4.2.2
|
||||
# hadolint ignore=DL3006
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
# Set shell
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Copy Python requirements file
|
||||
COPY requirements.txt /tmp/
|
||||
|
||||
# Setup base
|
||||
RUN \
|
||||
apt-get update \
|
||||
\
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
dirmngr=2.2.12-1+deb10u1 \
|
||||
gpg-agent=2.2.12-1+deb10u1 \
|
||||
gpg=2.2.12-1+deb10u1 \
|
||||
nginx=1.14.2-2+deb10u4 \
|
||||
git=1:2.20.1-2+deb10u3 \
|
||||
\
|
||||
&& curl -L https://apt.mopidy.com/mopidy.gpg | apt-key add - \
|
||||
&& curl -L https://apt.mopidy.com/mopidy.list -o /etc/apt/sources.list.d/mopidy.list \
|
||||
\
|
||||
&& apt-get update \
|
||||
\
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
libffi-dev=3.2.1-9 \
|
||||
libxml2-dev=2.9.4+dfsg1-7+deb10u2 \
|
||||
libxslt1-dev=1.1.32-2.2~deb10u1 \
|
||||
libasound2-dev=1.1.8-1 \
|
||||
libspotify12=12.1.51-1 \
|
||||
libspotify-dev=12.1.51-1 \
|
||||
zlib1g-dev=1:1.2.11.dfsg-1 \
|
||||
build-essential=12.6 \
|
||||
python3-dev=3.7.3-1 \
|
||||
python3-gi=3.30.4-1 \
|
||||
python3-gst-1.0=1.14.4-1+b1 \
|
||||
gstreamer1.0-alsa=1.14.4-2+deb10u1 \
|
||||
gstreamer1.0-plugins-bad=1.14.4-1+deb10u2 \
|
||||
gstreamer1.0-plugins-good=1.14.4-1+deb10u1 \
|
||||
gstreamer1.0-plugins-ugly=1.14.4-1+deb10u1 \
|
||||
gstreamer1.0-pulseaudio=1.14.4-1+deb10u1 \
|
||||
\
|
||||
&& curl https://bootstrap.pypa.io/get-pip.py | python3 \
|
||||
&& pip3 install --no-cache-dir -r /tmp/requirements.txt \
|
||||
\
|
||||
&& find /usr/local/lib/python3.7/ -type d -name tests -depth -exec rm -rf {} \; \
|
||||
&& find /usr/local/lib/python3.7/ -type d -name test -depth -exec rm -rf {} \; \
|
||||
&& find /usr/local/lib/python3.7/ -name __pycache__ -depth -exec rm -rf {} \; \
|
||||
&& find /usr/local/lib/python3.7/ -name "*.pyc" -depth -exec rm -f {} \; \
|
||||
\
|
||||
&& apt-get purge -y --auto-remove \
|
||||
dirmngr \
|
||||
gpg-agent \
|
||||
gpg \
|
||||
git \
|
||||
libffi-dev \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
zlib1g-dev \
|
||||
build-essential \
|
||||
gcc \
|
||||
python-dev \
|
||||
dpkg-dev \
|
||||
gcc-7 \
|
||||
&& rm -fr \
|
||||
/var/{cache,log}/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/root/.cache \
|
||||
&& find /tmp/ -mindepth 1 -delete
|
||||
|
||||
# Move access.log to stdout and error.log to stderr
|
||||
RUN mkdir -p /var/log/nginx && ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
|
||||
|
||||
# Copy root filesystem
|
||||
COPY rootfs /
|
||||
|
||||
# Build arguments
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_DESCRIPTION
|
||||
ARG BUILD_NAME
|
||||
ARG BUILD_REF
|
||||
ARG BUILD_REPOSITORY
|
||||
ARG BUILD_VERSION
|
||||
|
||||
# Labels
|
||||
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="Bram Mittendorff, Franck Nijhof, Robbert Müller" \
|
||||
org.opencontainers.image.title="${BUILD_NAME}" \
|
||||
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
|
||||
org.opencontainers.image.vendor="Home Assistant Community Add-ons" \
|
||||
org.opencontainers.image.authors="Bram Mittendorff, Franck Nijhof, Robbert Müller" \
|
||||
org.opencontainers.image.licenses="MIT" \
|
||||
org.opencontainers.image.url="https://addons.community" \
|
||||
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}
|
||||
21
mopidy/LICENSE.md
Normal file
21
mopidy/LICENSE.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# MIT License
|
||||
|
||||
Copyright (c) 2019-2022 Bram Mittendorff, Franck Nijhof, Robbert Müller
|
||||
|
||||
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.
|
||||
100
mopidy/README.md
Normal file
100
mopidy/README.md
Normal file
@@ -0,0 +1,100 @@
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
|
||||
[![GitHub Release][releases-shield]][releases]
|
||||
![Project Stage][project-stage-shield]
|
||||
[![License][license-shield]](LICENSE.md)
|
||||
|
||||
[![Github Actions][github-actions-shield]][github-actions]
|
||||
![Project Maintenance][maintenance-shield]
|
||||
[![GitHub Activity][commits-shield]][commits]
|
||||
|
||||
[![Discord][discord-shield]][discord]
|
||||
[![Community Forum][forum-shield]][forum]
|
||||
|
||||
[![Sponsor Frenck via GitHub Sponsors][github-sponsors-shield]][github-sponsors]
|
||||
|
||||
[![Support Frenck on Patreon][patreon-shield]][patreon]
|
||||
|
||||

|
||||
|
||||
Mopidy is an extensible music server.
|
||||
|
||||
## About
|
||||
|
||||
Mopidy plays music from local disk, Youtube, Spotify, SoundCloud, Google Play Music,
|
||||
and more. You edit the playlist from any phone, tablet, or computer using a
|
||||
range of MPD and web clients.
|
||||
|
||||
## Support
|
||||
|
||||
Got questions?
|
||||
|
||||
You have several options to get them answered:
|
||||
|
||||
- The [Home Assistant Community 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.
|
||||
|
||||
## Authors & contributors
|
||||
|
||||
The original setup of this repository is by [Bram Mittendorff][brammittendorff],
|
||||
[Franck Nijhof][frenck] and [Robbert Müller][mjrider].
|
||||
|
||||
For a full list of all authors and contributors,
|
||||
check [the contributor's page][contributors].
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-2022 Bram Mittendorff, Franck Nijhof, Robbert Müller
|
||||
|
||||
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.
|
||||
|
||||
[brammittendorff]: https://github.com/brammittendorff
|
||||
[commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-mopidy.svg
|
||||
[commits]: https://github.com/hassio-addons/addon-mopidy/commits/main
|
||||
[contributors]: https://github.com/hassio-addons/addon-mopidy/graphs/contributors
|
||||
[discord-ha]: https://discord.gg/c5DvZ4e
|
||||
[discord-shield]: https://img.shields.io/discord/478094546522079232.svg
|
||||
[discord]: https://discord.me/hassioaddons
|
||||
[docs]: https://github.com/hassio-addons/addon-mopidy/blob/main/mopidy/DOCS.md
|
||||
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
|
||||
[forum]: https://community.home-assistant.io/?u=frenck
|
||||
[frenck]: https://github.com/frenck
|
||||
[github-actions-shield]: https://github.com/hassio-addons/addon-mopidy/workflows/CI/badge.svg
|
||||
[github-actions]: https://github.com/hassio-addons/addon-mopidy/actions
|
||||
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
|
||||
[github-sponsors]: https://github.com/sponsors/frenck
|
||||
[issue]: https://github.com/hassio-addons/addon-mopidy/issues
|
||||
[license-shield]: https://img.shields.io/github/license/hassio-addons/addon-mopidy.svg
|
||||
[maintenance-shield]: https://img.shields.io/maintenance/yes/2022.svg
|
||||
[mjrider]: https://github.com/mjrider
|
||||
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
|
||||
[patreon]: https://www.patreon.com/frenck
|
||||
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
|
||||
[reddit]: https://reddit.com/r/homeassistant
|
||||
[releases-shield]: https://img.shields.io/github/release/hassio-addons/addon-mopidy.svg
|
||||
[releases]: https://github.com/hassio-addons/addon-mopidy/releases
|
||||
[repository]: https://github.com/hassio-addons/repository
|
||||
3
mopidy/build.yaml
Normal file
3
mopidy/build.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
build_from:
|
||||
amd64: ghcr.io/hassio-addons/debian-base/amd64:4.2.2
|
||||
40
mopidy/config.yaml
Normal file
40
mopidy/config.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
name: Mopidy
|
||||
version: dev
|
||||
slug: mopidy
|
||||
panel_icon: mdi:music-circle
|
||||
description: Mopidy is an extensible music server
|
||||
url: https://github.com/hassio-addons/addon-mopidy
|
||||
ingress: true
|
||||
ingress_entry: iris/
|
||||
ingress_stream: true
|
||||
arch:
|
||||
- amd64
|
||||
auth_api: true
|
||||
audio: true
|
||||
ports:
|
||||
6600/tcp: 6600
|
||||
5555/udp: 5555
|
||||
80/tcp: null
|
||||
ports_description:
|
||||
6600/tcp: Mopidy
|
||||
5555/udp: Autoaudiosink
|
||||
80/tcp: Web interface (Not required for Ingress)
|
||||
map:
|
||||
- config
|
||||
- share:rw
|
||||
- ssl
|
||||
options:
|
||||
system_packages: []
|
||||
python_packages: []
|
||||
settings: []
|
||||
schema:
|
||||
log_level: list(trace|debug|info|notice|warning|error|fatal)?
|
||||
system_packages:
|
||||
- str
|
||||
python_packages:
|
||||
- str
|
||||
settings:
|
||||
- name: str
|
||||
value: str
|
||||
leave_front_door_open: bool?
|
||||
BIN
mopidy/icon.png
Normal file
BIN
mopidy/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
BIN
mopidy/images/screenshot.png
Normal file
BIN
mopidy/images/screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
BIN
mopidy/logo.png
Normal file
BIN
mopidy/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
10
mopidy/requirements.txt
Normal file
10
mopidy/requirements.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
Mopidy==3.2.0
|
||||
Pykka==3.0.2
|
||||
Mopidy-Local==3.2.1
|
||||
Mopidy-AlsaMixer==2.0.1
|
||||
Mopidy-Spotify==4.1.1
|
||||
Mopidy-Iris==3.62.0
|
||||
Mopidy-SoundCloud==3.0.1
|
||||
Mopidy-GMusic==4.0.1
|
||||
Mopidy-Youtube==3.5
|
||||
Mopidy-MPD==3.2.0
|
||||
10
mopidy/rootfs/etc/cont-init.d/folders.sh
Normal file
10
mopidy/rootfs/etc/cont-init.d/folders.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
# Ensures needed folder exists.
|
||||
# ==============================================================================
|
||||
readonly MEDIA_DIR="/share/mopidy/media"
|
||||
|
||||
if ! bashio::fs.directory_exists "${MEDIA_DIR}"; then
|
||||
mkdir -p "${MEDIA_DIR}" || bashio::exit.nok "Could not create media folder: ${MEDIA_DIR}"
|
||||
fi
|
||||
27
mopidy/rootfs/etc/cont-init.d/nginx.sh
Normal file
27
mopidy/rootfs/etc/cont-init.d/nginx.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
# Configures NGINX
|
||||
# ==============================================================================
|
||||
|
||||
# Generate Ingress configuration
|
||||
bashio::var.json \
|
||||
interface "$(bashio::addon.ip_address)" \
|
||||
entry "$(bashio::addon.ingress_entry)" \
|
||||
| tempio \
|
||||
-template /etc/nginx/templates/ingress.gtpl \
|
||||
-out /etc/nginx/servers/ingress.conf
|
||||
|
||||
# Generate direct access configuration, if enabled.
|
||||
if bashio::var.has_value "$(bashio::addon.port 80)"; then
|
||||
bashio::config.require.ssl
|
||||
bashio::var.json \
|
||||
certfile "$(bashio::config 'certfile')" \
|
||||
keyfile "$(bashio::config 'keyfile')" \
|
||||
leave_front_door_open "^$(bashio::config 'leave_front_door_open')" \
|
||||
port "^$(bashio::addon.port 80)" \
|
||||
ssl "^$(bashio::config 'ssl')" \
|
||||
| tempio \
|
||||
-template /etc/nginx/templates/direct.gtpl \
|
||||
-out /etc/nginx/servers/direct.conf
|
||||
fi
|
||||
22
mopidy/rootfs/etc/cont-init.d/packages.sh
Normal file
22
mopidy/rootfs/etc/cont-init.d/packages.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
# Install user configured/requested packages
|
||||
# ==============================================================================
|
||||
|
||||
if bashio::config.has_value 'system_packages'; then
|
||||
apt update \
|
||||
|| bashio::exit.nok 'Failed updating Ubuntu packages repository indexes'
|
||||
|
||||
for package in $(bashio::config 'system_packages'); do
|
||||
apt install -y "$package" \
|
||||
|| bashio::exit.nok "Failed installing package ${package}"
|
||||
done
|
||||
fi
|
||||
|
||||
if bashio::config.has_value 'python_packages'; then
|
||||
for package in $(bashio::config 'python_packages'); do
|
||||
pip install "$package" \
|
||||
|| bashio::exit.nok "Failed installing package ${package}"
|
||||
done
|
||||
fi
|
||||
43
mopidy/rootfs/etc/mopidy/mopidy.conf
Normal file
43
mopidy/rootfs/etc/mopidy/mopidy.conf
Normal file
@@ -0,0 +1,43 @@
|
||||
[core]
|
||||
cache_dir = /data/cache
|
||||
config_dir = /etc/mopidy
|
||||
data_dir = /data/mopidy
|
||||
max_tracklist_length = 10000
|
||||
restore_state = false
|
||||
|
||||
[logging]
|
||||
color = true
|
||||
console_format = %(levelname)-8s %(message)s
|
||||
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
|
||||
debug_file = /proc/1/fd/1
|
||||
config_file =
|
||||
|
||||
[audio]
|
||||
mixer = software
|
||||
mixer_volume =
|
||||
output = autoaudiosink
|
||||
buffer_time =
|
||||
|
||||
[http]
|
||||
hostname = 127.0.0.1
|
||||
port = 4478
|
||||
|
||||
[mpd]
|
||||
hostname = 0.0.0.0
|
||||
|
||||
[local]
|
||||
media_dir = /share/mopidy/media
|
||||
library = sqlite
|
||||
scan_flush_threshold = 100
|
||||
|
||||
[stream]
|
||||
enabled = true
|
||||
protocols =
|
||||
http
|
||||
https
|
||||
mms
|
||||
rtmp
|
||||
rtmps
|
||||
rtsp
|
||||
timeout = 5000
|
||||
metadata_blacklist =
|
||||
96
mopidy/rootfs/etc/nginx/includes/mime.types
Normal file
96
mopidy/rootfs/etc/nginx/includes/mime.types
Normal file
@@ -0,0 +1,96 @@
|
||||
types {
|
||||
text/html html htm shtml;
|
||||
text/css css;
|
||||
text/xml xml;
|
||||
image/gif gif;
|
||||
image/jpeg jpeg jpg;
|
||||
application/javascript js;
|
||||
application/atom+xml atom;
|
||||
application/rss+xml rss;
|
||||
|
||||
text/mathml mml;
|
||||
text/plain txt;
|
||||
text/vnd.sun.j2me.app-descriptor jad;
|
||||
text/vnd.wap.wml wml;
|
||||
text/x-component htc;
|
||||
|
||||
image/png png;
|
||||
image/svg+xml svg svgz;
|
||||
image/tiff tif tiff;
|
||||
image/vnd.wap.wbmp wbmp;
|
||||
image/webp webp;
|
||||
image/x-icon ico;
|
||||
image/x-jng jng;
|
||||
image/x-ms-bmp bmp;
|
||||
|
||||
font/woff woff;
|
||||
font/woff2 woff2;
|
||||
|
||||
application/java-archive jar war ear;
|
||||
application/json json;
|
||||
application/mac-binhex40 hqx;
|
||||
application/msword doc;
|
||||
application/pdf pdf;
|
||||
application/postscript ps eps ai;
|
||||
application/rtf rtf;
|
||||
application/vnd.apple.mpegurl m3u8;
|
||||
application/vnd.google-earth.kml+xml kml;
|
||||
application/vnd.google-earth.kmz kmz;
|
||||
application/vnd.ms-excel xls;
|
||||
application/vnd.ms-fontobject eot;
|
||||
application/vnd.ms-powerpoint ppt;
|
||||
application/vnd.oasis.opendocument.graphics odg;
|
||||
application/vnd.oasis.opendocument.presentation odp;
|
||||
application/vnd.oasis.opendocument.spreadsheet ods;
|
||||
application/vnd.oasis.opendocument.text odt;
|
||||
application/vnd.openxmlformats-officedocument.presentationml.presentation
|
||||
pptx;
|
||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||
xlsx;
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
||||
docx;
|
||||
application/vnd.wap.wmlc wmlc;
|
||||
application/x-7z-compressed 7z;
|
||||
application/x-cocoa cco;
|
||||
application/x-java-archive-diff jardiff;
|
||||
application/x-java-jnlp-file jnlp;
|
||||
application/x-makeself run;
|
||||
application/x-perl pl pm;
|
||||
application/x-pilot prc pdb;
|
||||
application/x-rar-compressed rar;
|
||||
application/x-redhat-package-manager rpm;
|
||||
application/x-sea sea;
|
||||
application/x-shockwave-flash swf;
|
||||
application/x-stuffit sit;
|
||||
application/x-tcl tcl tk;
|
||||
application/x-x509-ca-cert der pem crt;
|
||||
application/x-xpinstall xpi;
|
||||
application/xhtml+xml xhtml;
|
||||
application/xspf+xml xspf;
|
||||
application/zip zip;
|
||||
|
||||
application/octet-stream bin exe dll;
|
||||
application/octet-stream deb;
|
||||
application/octet-stream dmg;
|
||||
application/octet-stream iso img;
|
||||
application/octet-stream msi msp msm;
|
||||
|
||||
audio/midi mid midi kar;
|
||||
audio/mpeg mp3;
|
||||
audio/ogg ogg;
|
||||
audio/x-m4a m4a;
|
||||
audio/x-realaudio ra;
|
||||
|
||||
video/3gpp 3gpp 3gp;
|
||||
video/mp2t ts;
|
||||
video/mp4 mp4;
|
||||
video/mpeg mpeg mpg;
|
||||
video/quicktime mov;
|
||||
video/webm webm;
|
||||
video/x-flv flv;
|
||||
video/x-m4v m4v;
|
||||
video/x-mng mng;
|
||||
video/x-ms-asf asx asf;
|
||||
video/x-ms-wmv wmv;
|
||||
video/x-msvideo avi;
|
||||
}
|
||||
15
mopidy/rootfs/etc/nginx/includes/proxy_params.conf
Normal file
15
mopidy/rootfs/etc/nginx/includes/proxy_params.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
proxy_http_version 1.1;
|
||||
proxy_ignore_client_abort off;
|
||||
proxy_read_timeout 86400s;
|
||||
proxy_redirect off;
|
||||
proxy_send_timeout 86400s;
|
||||
proxy_max_temp_file_size 0;
|
||||
|
||||
proxy_set_header Accept-Encoding "";
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
6
mopidy/rootfs/etc/nginx/includes/server_params.conf
Normal file
6
mopidy/rootfs/etc/nginx/includes/server_params.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
root /dev/null;
|
||||
server_name $hostname;
|
||||
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Robots-Tag none;
|
||||
8
mopidy/rootfs/etc/nginx/includes/ssl_params.conf
Normal file
8
mopidy/rootfs/etc/nginx/includes/ssl_params.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_prefer_server_ciphers off;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets off;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
3
mopidy/rootfs/etc/nginx/includes/upstream.conf
Normal file
3
mopidy/rootfs/etc/nginx/includes/upstream.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
upstream backend {
|
||||
server 127.0.0.1:4478;
|
||||
}
|
||||
47
mopidy/rootfs/etc/nginx/nginx.conf
Normal file
47
mopidy/rootfs/etc/nginx/nginx.conf
Normal file
@@ -0,0 +1,47 @@
|
||||
# Run nginx in foreground.
|
||||
daemon off;
|
||||
|
||||
# This is run inside Docker.
|
||||
user root;
|
||||
|
||||
# Pid storage location.
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
# Set number of worker processes.
|
||||
worker_processes 1;
|
||||
|
||||
# Enables the use of JIT for regular expressions to speed-up their processing.
|
||||
pcre_jit on;
|
||||
|
||||
# Write error log to the add-on log.
|
||||
error_log /proc/1/fd/1 error;
|
||||
|
||||
# Load allowed environment vars
|
||||
env SUPERVISOR_TOKEN;
|
||||
|
||||
# Max num of simultaneous connections by a worker process.
|
||||
events {
|
||||
worker_connections 512;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/includes/mime.types;
|
||||
|
||||
access_log off;
|
||||
client_max_body_size 4G;
|
||||
default_type application/octet-stream;
|
||||
gzip on;
|
||||
keepalive_timeout 65;
|
||||
sendfile on;
|
||||
server_tokens off;
|
||||
tcp_nodelay on;
|
||||
tcp_nopush on;
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
include /etc/nginx/includes/upstream.conf;
|
||||
include /etc/nginx/servers/*.conf;
|
||||
}
|
||||
1
mopidy/rootfs/etc/nginx/servers/.gitkeep
Normal file
1
mopidy/rootfs/etc/nginx/servers/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
Without requirements or design, programming is the art of adding bugs to an empty text file. (Louis Srygley)
|
||||
36
mopidy/rootfs/etc/nginx/templates/direct.gtpl
Normal file
36
mopidy/rootfs/etc/nginx/templates/direct.gtpl
Normal file
@@ -0,0 +1,36 @@
|
||||
server {
|
||||
{{ if not .ssl }}
|
||||
listen {{ .port }} default_server;
|
||||
{{ else }}
|
||||
listen {{ .port }} default_server ssl http2;
|
||||
{{ end }}
|
||||
|
||||
include /etc/nginx/includes/server_params.conf;
|
||||
include /etc/nginx/includes/proxy_params.conf;
|
||||
|
||||
{{ if .ssl }}
|
||||
include /etc/nginx/includes/ssl_params.conf;
|
||||
|
||||
ssl_certificate /ssl/{{ .certfile }};
|
||||
ssl_certificate_key /ssl/{{ .keyfile }};
|
||||
{{ end }}
|
||||
|
||||
{{ if not .leave_front_door_open }}
|
||||
location = /authentication {
|
||||
internal;
|
||||
proxy_pass http://supervisor/auth;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header X-Supervisor-Token "{{ env "SUPERVISOR_TOKEN" }}";
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
location / {
|
||||
{{ if not .leave_front_door_open }}
|
||||
auth_request /authentication;
|
||||
auth_request_set $auth_status $upstream_status;
|
||||
{{ end }}
|
||||
|
||||
proxy_pass http://backend;
|
||||
}
|
||||
}
|
||||
19
mopidy/rootfs/etc/nginx/templates/ingress.gtpl
Normal file
19
mopidy/rootfs/etc/nginx/templates/ingress.gtpl
Normal file
@@ -0,0 +1,19 @@
|
||||
server {
|
||||
listen {{ .interface }}:8099 default_server;
|
||||
|
||||
include /etc/nginx/includes/server_params.conf;
|
||||
include /etc/nginx/includes/proxy_params.conf;
|
||||
|
||||
location / {
|
||||
allow 172.30.32.2;
|
||||
deny all;
|
||||
|
||||
proxy_pass http://backend/;
|
||||
sub_filter_once off;
|
||||
sub_filter_types *;
|
||||
sub_filter '/iris/' '{{ .entry }}/iris/';
|
||||
sub_filter '/mopidy/ws' '{{ .entry }}/mopidy/ws';
|
||||
sub_filter 'href="manifest.json">' 'href="manifest.json" crossorigin="use-credentials">';
|
||||
sub_filter 'document.body.appendChild(js);' 'document.body.appendChild(js); (function() { var wait=function(){let t=document.querySelector(".sidebar__menu__item");t?t.click():setTimeout(function(){wait()},100)};wait(); })();';
|
||||
}
|
||||
}
|
||||
9
mopidy/rootfs/etc/services.d/mopidy/finish
Normal file
9
mopidy/rootfs/etc/services.d/mopidy/finish
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
# Take down the S6 supervision tree when Mopidy fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
19
mopidy/rootfs/etc/services.d/mopidy/run
Normal file
19
mopidy/rootfs/etc/services.d/mopidy/run
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
# Runs the Mopidy
|
||||
# ==============================================================================
|
||||
declare -a options
|
||||
|
||||
bashio::log.info "Starting Mopidy..."
|
||||
|
||||
for var in $(bashio::config 'settings|keys'); do
|
||||
name=$(bashio::config "settings[${var}].name")
|
||||
value=$(bashio::config "settings[${var}].value")
|
||||
bashio::log.info "Setting ${name} to ${value}"
|
||||
|
||||
options+=(-o "${name}=${value}")
|
||||
done
|
||||
|
||||
# Run Mopidy
|
||||
exec mopidy --config /etc/mopidy/mopidy.conf "${options[@]}"
|
||||
10
mopidy/rootfs/etc/services.d/nginx/finish
Normal file
10
mopidy/rootfs/etc/services.d/nginx/finish
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
# Take down the S6 supervision tree when Nginx fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
|
||||
12
mopidy/rootfs/etc/services.d/nginx/run
Normal file
12
mopidy/rootfs/etc/services.d/nginx/run
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Mopidy
|
||||
# Runs the Nginx daemon
|
||||
# ==============================================================================
|
||||
declare -a options
|
||||
|
||||
# Wait for Mopidy to become available
|
||||
bashio::net.wait_for 4478
|
||||
|
||||
bashio::log.info "Starting NGinx..."
|
||||
exec nginx "${options[@]}"
|
||||
Reference in New Issue
Block a user