Repository: bestlibre/hassio-addons Branch: master Commit: f264f719bbfc Files: 111 Total size: 121.9 KB Directory structure: gitextract_2c29ts7k/ ├── .travis.yml ├── README.md ├── aria2/ │ ├── Dockerfile │ ├── README.md │ ├── config.json │ └── run.sh ├── armhf-grafana-debian/ │ ├── README.md │ └── config_deactivated.json ├── base_debian/ │ ├── Dockerfile │ ├── build.json │ ├── config.json │ ├── qemu-aarch64-static │ └── qemu-arm-static ├── build.sh ├── caddy_proxy/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ ├── mustache.py │ ├── run.sh │ └── vhost.mustache ├── calibreweb/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ └── run.sh ├── calibreweb_comics/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ └── run.sh ├── certbot/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ └── run.sh ├── create_all.sh ├── create_hassio_addon.sh ├── grafana/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ ├── qemu-arm-static │ └── run_addon.sh ├── influxdb/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ ├── influxdb.conf │ ├── qemu-aarch64-static │ ├── qemu-arm-static │ └── run.sh ├── kanboard/ │ ├── Dockerfile │ ├── config.json │ └── run.sh ├── mopidy/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ ├── mopidy.conf │ └── run.sh ├── mopidy_alpine/ │ └── config.json ├── mopidy_cast/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ ├── mopidy_cast.conf │ └── run.sh ├── nextcloud/ │ ├── Dockerfile │ ├── build.json │ ├── config.json │ ├── qemu-aarch64-static │ ├── qemu-arm-static │ └── run_addon.sh ├── nginx_proxy/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── commons.conf │ ├── config.json │ ├── mustache.py │ ├── run.sh │ └── vhost.mustache ├── owserver/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ ├── owfs.conf │ └── run.sh ├── passbolt/ │ ├── Dockerfile │ ├── LICENSE │ ├── bin/ │ │ └── docker-entrypoint.sh │ ├── conf/ │ │ └── passbolt.conf │ └── config.json ├── python_exec/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ └── run.sh ├── repository.json ├── snapcastclient/ │ ├── Dockerfile │ ├── README.md │ ├── build.json │ ├── config.json │ └── run.sh ├── snapcastserver/ │ ├── Dockerfile │ ├── config.json │ └── run.sh └── syncthing/ ├── Dockerfile ├── README.md ├── config.json └── run.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .travis.yml ================================================ sudo: required services: - docker before_install: - sudo apt-get install jq - docker pull multiarch/qemu-user-static env: - ADDON="python_exec" - ADDON="mopidy mopidy_cast" - ADDON="influxdb" - ADDON="snapcastclient" - ADDON="snapcastserver" - ADDON="nginx_proxy" - ADDON="certbot" - ADDON="syncthing" - ADDON="caddy_proxy" - ADDON="grafana" - ADDON="calibreweb" - ADDON="calibreweb_comics" script: - docker login -u $DOCKER_USER -p $DOCKER_PASS - ./build.sh $ADDON ================================================ FILE: README.md ================================================ # hassio-addons [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons) Repository for hass.io addons. **WARNING** : I don't use hass anymore, I've switched to a pure docker installation. This addons are not realy active anymore. I will try to do some small maintenance for some of them when I use them in docker, but that's all. I will try to point to alternatives when possible. ## [Mopidy](https://github.com/bestlibre/hassio-addons/tree/master/mopidy) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-mopidy.svg)](https://microbadger.com/images/bestlibre/armhf-mopidy "Get your own version badge on microbadger.com") see https://github.com/kentloving/hassio-addons or https://github.com/assada/hassio-addons ## [Nginx Proxy](https://github.com/bestlibre/hassio-addons/tree/master/nginx_proxy) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-nginx-proxy.svg)](https://microbadger.com/images/bestlibre/armhf-nginx-proxy "Get your own version badge on microbadger.com") see https://github.com/hassio-addons/repository/tree/master/nginxproxymanager ## [Certbot](https://github.com/bestlibre/hassio-addons/tree/master/certbot) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-mopidy.svg)](https://microbadger.com/images/bestlibre/armhf-mopidy "Get your own version badge on microbadger.com") Ssl certificats creation/renewal with let's encrypt : not updated anymore ## [Caddy Proxy](https://github.com/bestlibre/hassio-addons/tree/master/caddy_proxy) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-caddy-proxy.svg)](https://microbadger.com/images/bestlibre/armhf-caddy-proxy "Get your own version badge on microbadger.com") Caddy proxy with multiple vhosts and automatic ssl : working but not updated anymore ## [Influxdb](https://github.com/bestlibre/hassio-addons/tree/master/influxdb) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-influxdb.svg)](https://microbadger.com/images/bestlibre/armhf-influxdb "Get your own version badge on microbadger.com") see https://github.com/hassio-addons/repository/tree/master/influxdb ## [Grafana](https://github.com/bestlibre/hassio-addons/tree/master/grafana) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-grafana.svg)](https://microbadger.com/images/bestlibre/armhf-grafana "Get your own version badge on microbadger.com") see https://github.com/hassio-addons/repository/tree/master/grafana ## [snapcastserver](https://github.com/bestlibre/hassio-addons/tree/master/snapcastserver) and [snapcastclient](https://github.com/bestlibre/hassio-addons/tree/master/snapcastclient) snapcast server and client for multi room audio : not updated anymore ## [Syncthing](https://github.com/bestlibre/hassio-addons/tree/master/syncthing) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-syncthing.svg)](https://microbadger.com/images/bestlibre/armhf-syncthing "Get your own version badge on microbadger.com") Syncthing synchronization service : working. ## [Owserver](https://github.com/bestlibre/hassio-addons/tree/master/owserver) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-owserver.svg)](https://microbadger.com/images/bestlibre/armhf-owserver "Get your own version badge on microbadger.com") One wire server : working. ## [Python Executor](https://github.com/bestlibre/hassio-addons/tree/master/python_exec) [![](https://images.microbadger.com/badges/version/bestlibre/armhf-python-exec.svg)](https://microbadger.com/images/bestlibre/armhf-python-exec "Get your own version badge on microbadger.com") Python executor : working. ## [Grafana for armhf](https://github.com/bestlibre/hassio-addons/tree/master/armhf-grafana-debian) Grafana server for armhf arch, debian based image : **deprecated**. ================================================ FILE: aria2/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_VERSION ARG BUILD_ARCH # Add env ENV LANG C.UTF-8 # Setup base RUN apk add --no-cache -U --virtual .build-deps \ git \ unzip \ wget \ && apk add --no-cache -U aria2 darkhttpd jq \ && mkdir /webui \ && git clone https://github.com/ziahamza/webui-aria2.git /tmp_webui \ && mv /tmp_webui/docs /webui/webui-aria2 \ && rm -rf /tmp_webui \ && mkdir /webui/ariang \ && cd /webui/ariang \ && wget -O ariang.zip https://github.com/mayswind/AriaNg/releases/download/1.2.1/AriaNg-1.2.1.zip \ && unzip ariang.zip \ && rm ariang.zip \ && apk del .build-deps COPY run.sh / COPY index.html /webui/ RUN chmod a+x /run.sh CMD [ "/run.sh" ] ================================================ FILE: aria2/README.md ================================================ # aria2 with webui for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-aria2.svg)](https://microbadger.com/images/bestlibre/armhf-aria2 "Get your own version badge on microbadger.com") ## Description This addon provide an [aria2](https://aria2.github.io/) with the [webui-aria2](https://github.com/ziahamza/webui-aria2) frontend container for hass.io. `rpc` is enabled and session are saved in `/data` ## Configuration ### downloads (str) Path to the directory used for download storage. Default to `/share/aria2` ### secret (str) Secret for rpc connection. Default to `123456789` ### options (list of dict) Additional options passed to aria2c. Must be entered as a list of dictionaries with this format : `{"name": "...", "value": "..."}` ================================================ FILE: aria2/config.json ================================================ { "name": "Aria2", "version": "0.6", "slug": "aria2", "description": "Aria2 download manager", "url": "https://github.com/bestlibre/hassio-addons/tree/master/aria2", "startup": "system", "arch": ["armhf", "amd64", "aarch64", "i386"], "boot": "auto", "image": "bestlibre/{arch}-aria2", "options": {"options":[]}, "schema": {"downloads": "str?", "secret": "str?", "options":[{"name": "str", "value": "str"}]}, "ports": {"6800/tcp": null, "8080/tcp": null, "8081/tcp": null}, "map": ["share:rw"], "webui": "http://[HOST]:[PORT:8080]" } ================================================ FILE: aria2/run.sh ================================================ #!/bin/bash set -e secret=$(jq -r '.secret // "123456789"' /data/options.json) downloads=$(jq -r '.downloads // "/share/aria2/"' /data/options.json) options=$(jq -r 'if .options then [.options[] | "--"+.name+"="+.value ] | join(" ") else "" end' /data/options.json) session_file=/data/aria.session if [ ! -f ${session_file} ]; then touch ${session_file} fi conf_file=/data/aria2.conf if [ ! -f ${conf_file} ]; then touch ${conf_file} fi darkhttpd /webui/ --port 8080 & #darkhttpd /webui/ariang --port 8081 & aria2c --rpc-allow-origin-all --enable-rpc --rpc-secret=${secret} --rpc-listen-all --save-session=${session_file} --input-file=${session_file} --save-session-interval=30 --dir=${downloads} --conf-path=${conf_file} ${options} ================================================ FILE: armhf-grafana-debian/README.md ================================================ **DEPRECATED ADDON : Use the [multiarch one](https://github.com/bestlibre/hassio-addons/tree/master/grafana) instead** # Grafana addon for hass.io on armhf This addon provide grafana for the armhf architecture (rpi 2 - 3). The docker image used is build by [f2git](https://hub.docker.com/r/fg2it/grafana-armhf). Environment variables are used to configure persistance volume to `/data` instead of `/var/lib/grafana`. I have tried to build a grafana addon based on alpine, but failed for lack of phantomjs support. ================================================ FILE: armhf-grafana-debian/config_deactivated.json ================================================ { "name": "Grafana_armonly", "version": "v4.3.2", "slug": "grafana_armonly", "image": "fg2it/grafana-armhf", "description": "**DEPRECATED ADDON : Use the [multiarch one](https://github.com/bestlibre/hassio-addons/tree/master/grafana) instead**", "url": "https://github.com/bestlibre/hassio-addons/tree/master/armhf_grafana_debian", "startup": "system", "boot": "auto", "ports": {"3000/tcp": 3000}, "environment": {"GF_PATHS_DATA":"/data", "GF_PATHS_PLUGINS":"/data/plugins"}, "arch": ["armhf"], "options": {}, "schema": {} } ================================================ FILE: base_debian/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_ARCH COPY qemu-arm-static /usr/bin/qemu-arm-static COPY qemu-aarch64-static /usr/bin/qemu-aarch64-static RUN if [ "$BUILD_ARCH" = "armhf" -o "$BUILD_ARCH" = "armv7" ]; then rm /usr/bin/qemu-aarch64-static;\ elif [ "$BUILD_ARCH" = "aarch64" ]; then rm /usr/bin/qemu-arm-static;\ fi ================================================ FILE: base_debian/build.json ================================================ { "build_from": { "armhf" : "arm32v7/debian:stretch", "armv7" : "arm32v7/debian:stretch", "aarch64": "arm64v8/debian:stretch" } } ================================================ FILE: base_debian/config.json ================================================ { "name": "debian base image", "version": "stretch", "slug": "debian_base", "boot": "auto", "startup": "system", "image": "bestlibre/{arch}-debian-base", "description": "Base debian image with qemu_static. Not really an addon perse. To be used to create addons", "url": "https://github.com/bestlibre/hassio-addons/tree/master/base_debian", "arch": ["armhf", "armv7","aarch64"], "options": {}, "schema": {} } ================================================ FILE: build.sh ================================================ #!/bin/bash set -ev archs="${ARCHS}" for addon in "$@"; do if [ -z ${TRAVIS_COMMIT_RANGE} ] || git diff --name-only ${TRAVIS_COMMIT_RANGE} | grep -v README.md | grep -q ${addon}; then if [ -z "$archs" ]; then archs=$(jq -r '.arch // ["armv7", "armhf", "amd64", "aarch64", "i386"] | [.[] | "--" + .] | join(" ")' ${addon}/config.json) fi docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock:ro -v ~/.docker:/root/.docker -v $(pwd)/${addon}:/data homeassistant/amd64-builder ${archs} -t /data --no-cache ${TEST} else echo "No change in commit range ${TRAVIS_COMMIT_RANGE}" fi done ================================================ FILE: caddy_proxy/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_VERSION ARG BUILD_ARCH # Add env ENV LANG C.UTF-8 # Setup base RUN apk add --no-cache -U --virtual .build-deps \ curl \ tar \ && apk add -U --no-cache \ jq \ python3 \ python3-dev \ && pip3 install -U pip \ && pip install pystache \ && CADDY_VERSION=v${BUILD_VERSION%-*} \ && if [ ${BUILD_ARCH} == "armhf" -o ${BUILD_ARCH} == "armv7" ]; then caddyarch=arm7;\ elif [ ${BUILD_ARCH} == "amd64" ]; then caddyarch=amd64;\ elif [ ${BUILD_ARCH} == "i386" ]; then caddyarch=386;\ elif [ ${BUILD_ARCH} == "aarch64" ]; then caddyarch=arm64;\ fi \ && caddyurl=https://github.com/mholt/caddy/releases/download/${CADDY_VERSION}/caddy_${CADDY_VERSION}_linux_${caddyarch}.tar.gz \ && echo $caddyurl \ && curl --silent --show-error --fail --location --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ "$caddyurl" \ | tar --no-same-owner -C /usr/local/bin/ -xz caddy \ && chmod 0755 /usr/local/bin/caddy \ && apk del .build-deps # Copy data COPY run.sh / COPY mustache.py / COPY vhost.mustache /templates/ RUN chmod a+x /run.sh RUN chmod a+x /mustache.py CMD [ "/run.sh" ] ================================================ FILE: caddy_proxy/README.md ================================================ # Caddy Proxy addon for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-caddy-proxy.svg)](https://microbadger.com/images/bestlibre/armhf-caddy-proxy "Get your own version badge on microbadger.com") ## Description This addon provide a [Caddy](https://caddyserver.com/) Proxy with multiple vhost support and automatic ssl (obtention and renewal). It should be a easier option than the nginx_proxy and certbot addons. The simplier way to use it is just to set your external address in the homeassistant field. ## Configuration ### homeassistant (str) This is a shortcut to set a proxy for homeassistant. If this option is set to "homeassistant.domain.tld" it will set a proxy from https://homeassistant.domain.tld to homeassistant:8123. ### vhosts (list of dict) This list describe all the virtual host to be proxified. It must be set to have a valid configuration but can be empty. #### vhost (string) Full hostname (ie myservice.domain.tld) #### port (string) Internal port (ie 8123 for homeassistant, 3000 for grafana) #### remote (str) Ip or url for the proxified server. If not set default to 172.17.0.1 (docker host). #### user (str) Username to be used with basicauth. `pwd` (see below) must also be set. #### pwd (str) Password to be used with basicauth. `user` (see above) must also be set. #### paths (list of str) This list describe all the subpath to be proxified, other that the root `/`. It must be set (if the `vhosts`list is not empty) to have a valid configuration but can be empty. Each string must have the following format : ``` : ``` with : - **path** (str): path to be proxify (ie `/api/`). - **remote** (str): Ip or url for the proxified server. Use `172.17.0.1` for the docker host. - **port** (str): Internal port. ### email (email) Email is the email address to use with which to generate a certificate with Let's Encrypt. ### staging (bool) Activate staging environment for letsencrypt. False by default. ### raw_config (list of str) Each string will be added to the caddy configuration file as a new line, after the domain proxified with the vhosts section. **BREAKING CHANGE** In previous version, this was a list of dict with an object of the form `{'line': str}`. The inderection was removed. ================================================ FILE: caddy_proxy/build.json ================================================ { "build_from": { "amd64": "homeassistant/amd64-base-python:3.7", "i386": "homeassistant/i386-base-python:3.7", "armhf": "homeassistant/armhf-base-python:3.7", "armv7": "homeassistant/armhf-base-python:3.7", "aarch64": "homeassistant/aarch64-base-python:3.7" } } ================================================ FILE: caddy_proxy/config.json ================================================ { "name": "Caddy Proxy", "version": "1.0.4", "slug": "caddy_proxy", "description": "Caddy Proxy for multiple VHOSTS with ssl", "url": "https://github.com/bestlibre/hassio-addons/tree/master/caddy_proxy", "startup": "system", "boot": "auto", "image": "bestlibre/{arch}-caddy-proxy", "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"], "options": { "homeassistant": "homeassistant.domain.tld", "vhosts": [], "raw_config": [], "email": null }, "schema": { "vhosts": [ {"vhost": "str", "remote": "str?", "port": "str", "directory": "str?", "paths": [ "str" ], "user": "str?", "pwd": "str?" } ], "email": "email", "disable_http_chalenge": "bool?", "staging": "bool?", "raw_config": ["str"], "homeassistant": "str?" }, "ports": {"80/tcp": 80, "443/tcp": 443}, "map": ["ssl:rw", "share:rw"] } ================================================ FILE: caddy_proxy/mustache.py ================================================ #!/bin/python3 import pystache import argparse import json import sys def render(template, data): if data == '-': context = json.load(sys.stdin) else: with open(data, 'r') as f: context = json.load(f) for vhost in context.get('vhosts'): if vhost.get('paths'): l = [{'path': line} for line in vhost.get('paths')] vhost['paths'] = l if context.get('raw_config'): l = [{'line': line} for line in context.get('raw_config')] context['raw_config'] = l renderer = pystache.Renderer(escape=lambda u: u) print(renderer.render_path(template, context)) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('template') parser.add_argument('data') args = parser.parse_args() render(args.template, args.data) ================================================ FILE: caddy_proxy/run.sh ================================================ #!/bin/bash set -e email=$(jq -r '.email' /data/options.json) https_only=$(jq -r 'if .disable_http_chalenge? then "-disable-http-challenge" else "" end' /data/options.json) staging=$(jq -r 'if .staging? then "-ca https://acme-staging-v02.api.letsencrypt.org/directory" else "" end' /data/options.json) homeassistant=$(jq -r '.homeassistant // empty' /data/options.json) if [ -f /tmp/caddy.conf ]; then rm /tmp/caddy.conf fi if [ -n "$homeassistant" ]; then echo "{\"vhosts\":[{\"vhost\":\"$homeassistant\", \"port\":\"8123\"}]}" | python3 /mustache.py /templates/vhost.mustache - >> /tmp/caddy.conf fi python3 /mustache.py /templates/vhost.mustache /data/options.json >> /tmp/caddy.conf mkdir -p /ssl/caddy export CADDYPATH=/ssl/caddy caddy -agree ${https_only} ${staging} -email "$email" -conf /tmp/caddy.conf ================================================ FILE: caddy_proxy/vhost.mustache ================================================ {{#vhosts}} {{vhost}} { {{#directory}} root {{directory}} {{/directory}} {{^directory}} {{#paths}} proxy {{path}} { transparent websocket } {{/paths}} proxy / {{#remote}}{{remote}}{{/remote}}{{^remote}}172.17.0.1{{/remote}}:{{port}} { transparent websocket } {{/directory}} {{#user}} {{#pwd}} basicauth / {{user}} {{pwd}} {{/pwd}} {{/user}} log stdout errors stdout } {{/vhosts}} {{#raw_config}} {{line}} {{/raw_config}} ================================================ FILE: calibreweb/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_VERSION ARG BUILD_ARCH # Add env ENV LANG C.UTF-8 # Setup base RUN apk add --no-cache -U --virtual .build-deps \ git \ && apk add -U --no-cache \ jq \ py-pip \ python \ python-dev \ && mkdir /cw \ && cd /cw \ && git clone https://github.com/janeczku/calibre-web.git .\ && pip install -r requirements.txt --target vendor # Copy data COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ================================================ FILE: calibreweb/README.md ================================================ # calibreweb for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-calibreweb.svg)](https://microbadger.com/images/bestlibre/armhf-calibreweb "Get your own version badge on microbadger.com") ## Description This addon provide a [calibreweb](https://github.com/janeczku/calibre-web) container for hass.io. ## Configuration There is no configuration. Follow the [Quick start](https://github.com/janeczku/calibre-web#quick-start) from calibreweb : - set the path to calibre (ie in `/share`) - use default admin/admin123 user passwd. ================================================ FILE: calibreweb/build.json ================================================ { "build_from": { "amd64": "homeassistant/amd64-base-python:3.7", "i386": "homeassistant/i386-base-python:3.7", "armhf": "homeassistant/armhf-base-python:3.7", "armv7": "homeassistant/armhf-base-python:3.7", "aarch64": "homeassistant/aarch64-base-python:3.7" } } ================================================ FILE: calibreweb/config.json ================================================ { "name": "Calibre Web", "version": "0.5", "slug": "calibre-web", "description": "Calibre web", "url": "https://github.com/bestlibre/hassio-addons/tree/master/bicbucstriim", "startup": "after", "boot": "auto", "image": "bestlibre/{arch}-calibre-web", "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"], "options": {}, "schema": {}, "ports": {"8083/tcp": null}, "map": ["share:rw"] } ================================================ FILE: calibreweb/run.sh ================================================ #!/bin/bash set -e python /cw/cps.py -p /data/cw.db ================================================ FILE: calibreweb_comics/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_VERSION ARG BUILD_ARCH # Add env ENV LANG C.UTF-8 # Setup base RUN apk add --no-cache -U --virtual .build-deps \ git \ && apk add -U --no-cache \ jq \ py-pip \ python \ python-dev \ && mkdir /cw \ && cd /cw \ && git clone https://github.com/janeczku/calibre-web.git .\ && pip install -r requirements.txt --target vendor # Copy data COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ================================================ FILE: calibreweb_comics/README.md ================================================ # calibreweb comics branch for hass.io Deprecated. The upstream branch was merged in calibre-web. ================================================ FILE: calibreweb_comics/build.json ================================================ { "build_from": { "amd64": "homeassistant/amd64-base-python:3.7", "i386": "homeassistant/i386-base-python:3.7", "armhf": "homeassistant/armhf-base-python:3.7", "armv7": "homeassistant/armhf-base-python:3.7", "aarch64": "homeassistant/aarch64-base-python:3.7" } } ================================================ FILE: calibreweb_comics/config.json ================================================ { "name": "Calibre Web Comics", "version": "0.2", "slug": "calibre-web-comics", "description": "Calibre web (Comics Server branch)", "url": "https://github.com/bestlibre/hassio-addons/tree/master/calibreweb", "startup": "after", "boot": "auto", "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"], "image": "bestlibre/{arch}-calibre-web-comics", "options": {}, "schema": {}, "ports": {"8083/tcp": null}, "map": ["share:rw"] } ================================================ FILE: calibreweb_comics/run.sh ================================================ #!/bin/bash set -e python /cw/cps.py -p /data/cw.db ================================================ FILE: certbot/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM # Add env ENV LANG C.UTF-8 # Setup base RUN apk add -U --no-cache jq py-future \ && apk add -U --no-cache --repository http://nl.alpinelinux.org/alpine/edge/community certbot # Copy data COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ================================================ FILE: certbot/README.md ================================================ # Certbot (let's encrypt) addon for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-certbot.svg)](https://microbadger.com/images/bestlibre/armhf-certbot "Get your own version badge on microbadger.com") ## Certificat creation and renewal for hass.io This addon is intented to be used with [nginx_proxy](https://github.com/bestlibre/hassio-addons/tree/master/nginx_proxy). It will obtain and renew if necessary the certificats from [Let's encrypt](https://letsencrypt.org/) with [certbot](https://certbot.eff.org/). It use the webroot plugin and need `DOMAIN/.well-known` directories to be served from `/ssl/wk`. [nginx_proxy](https://github.com/bestlibre/hassio-addons/tree/master/nginx_proxy) does this for you. The certificats are created in `/ssl/letsencrypt/live/$NAME/`for each certificat. ## Configuration ### email (email) Email address used for the registration ### ssl-only (bool) Option to use this addon in a situation where the certbot ``webroot`` plugin is not usable (ie no access on port 80). This option will anable the ``standalone`` plugin with the ``--preferred-challenges tls-sni`` option. Port 443 inside the addon is exposed as 10443 on the host. You can use the [nginx proxy addon](https://github.com/bestlibre/hassio-addons/tree/master/nginx_proxy) to proxify it back to 443. Some extra actions are needed to use this method, since you cannot proxify both the service behind a given virtual host and certbot at the same time : - modify the nginx_proxy configuration to proxify 443 to 10443, - start the certbot addon, - wait for the certificats to be created/renewed, - stop the addon, - revert the nginx conf ### certificats (list of objects) #### name (str) Certificat name, for directory creation. #### domains (str) List of domains to create/renew certificats, comma separated ### debug (bool) If set to true, certbot logs will be printed in the docker logs. ================================================ FILE: certbot/build.json ================================================ { "build_from": { "amd64": "homeassistant/amd64-base-python:3.7", "i386": "homeassistant/i386-base-python:3.7", "armhf": "homeassistant/armhf-base-python:3.7", "armv7": "homeassistant/armhf-base-python:3.7", "aarch64": "homeassistant/aarch64-base-python:3.7" } } ================================================ FILE: certbot/config.json ================================================ { "name": "Certbot", "version": "0.1.10", "slug": "certbot", "description": "Certbot compagnion for Nginx Proxy", "url": "https://github.com/bestlibre/hassio-addons/tree/master/certbot", "startup": "system", "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"], "boot": "auto", "image": "bestlibre/{arch}-certbot", "options": { "debug": false, "email": "email@domain.tld", "certificats":[{"name": "hass", "domains": "homeassistant.domain.tld" }], "ssl_only": false }, "schema": { "debug": "bool?", "email": "email", "certificats": [{"name": "str", "domains": "str"}], "ssl_only": "bool?" }, "map": ["ssl:rw"], "ports": {"443/tcp": 10443} } ================================================ FILE: certbot/run.sh ================================================ #!/bin/bash set -e CERT_DIR=/ssl/letsencrypt WORK_DIR=/data/workdir CONFIG_PATH=/data/options.json EMAIL=$(jq --raw-output ".email" $CONFIG_PATH) DEBUG=$(jq --raw-output ".debug // empty" $CONFIG_PATH) SSL_ONLY=$(jq --raw-output ".ssl_only // empty" $CONFIG_PATH) mkdir -p /ssl/wk if [ "${SSL_ONLY}" == "true" ]; then PLUGIN="--standalone --preferred-challenges tls-sni" else PLUGIN="--webroot -w /ssl/wk/" fi while true; do jq -r '.certificats[] | .name + " " + .domains' $CONFIG_PATH | while read name domains; do certbot certonly $PLUGIN --non-interactive --email "$EMAIL" --agree-tos --config-dir "$CERT_DIR" --work-dir "$WORK_DIR" --cert-name $name -d ${domains} if [ "$DEBUG" == "true" ]; then cat /var/log/letsencrypt/letsencrypt.log fi done sleep 1d done ================================================ FILE: create_all.sh ================================================ #!/bin/bash set -e for arch in "armhf" "aarch64" "i386" "amd64" "armv7" do ./create_hassio_addon.sh -a $arch "$@" & done wait ================================================ FILE: create_hassio_addon.sh ================================================ #!/bin/bash set -e BUILD_CONTAINER_NAME=hassio-addons-$$ DOCKER_PUSH="true" DOCKER_CACHE="true" DOCKER_WITH_LATEST="true" BRANCH=master REPOSITORY=https://github.com/home-assistant/hassio-addons cleanup() { echo "[INFO] Cleanup." # Stop docker container echo "[INFO] Cleaning up hassio-build container." docker stop $BUILD_CONTAINER_NAME 2> /dev/null || true docker rm --volumes $BUILD_CONTAINER_NAME 2> /dev/null || true if [ "$1" == "fail" ]; then exit 1 fi } trap 'cleanup fail' SIGINT SIGTERM help () { cat << EOF Script for hassio addon docker build create_hassio_addon [options] Options: -h, --help Display this help and exit. -r, --repository https://.../addons Set git repository to load addon from. -b, --branch branch_name Set git branch to load addon from. -l, --local /path/to/repository Load addon from a local folder -s, --slug addon_slug Name of folder/slug -a, --arch armhf|aarch64|i386|amd64 Arch for addon build. -t, --test Don't upload the build to docker hub. -n, --no-cache Disable build from cache EOF } # Parse arguments while [[ $# -gt 0 ]]; do key=$1 case $key in -h|--help) help exit 0 ;; -r|--repository) REPOSITORY=$2 shift ;; -b|--branch) BRANCH=$2 shift ;; -l|--local) LOCAL_REPOSITORY=$2 shift ;; -s|--slug) SLUG=$2 shift ;; -a|--arch) ARCH=$2 shift ;; -t|--test) DOCKER_PUSH="false" ;; -n|--no-cache) DOCKER_CACHE="false" ;; *) echo "[WARNING] $0 : Argument '$1' unknown. Ignoring." ;; esac shift done # Sanity checks if [ "$ARCH" != 'armhf' ] && [ "$ARCH" != 'aarch64' ] && [ "$ARCH" != 'i386' ] && [ "$ARCH" != 'amd64' ]; then echo "Error: $ARCH is not a supported platform for hassio-supervisor!" help exit 1 fi if [ -z "$SLUG" ]; then echo "[ERROR] please set a slug!" help exit 1 fi # Get the absolute script location pushd "$(dirname "$0")" > /dev/null 2>&1 SCRIPTPATH=$(pwd) popd > /dev/null 2>&1 BASE_IMAGE="homeassistant\/$ARCH-base:latest" BUILD_DIR=${BUILD_DIR:=$SCRIPTPATH} WORKSPACE=${BUILD_DIR:=$SCRIPTPATH}/hassio-supervisor-$ARCH ADDON_WORKSPACE=$WORKSPACE/$SLUG # setup docker echo "[INFO] Setup docker for addon" mkdir -p "$BUILD_DIR" mkdir -p "$WORKSPACE" if [ -z "$LOCAL_REPOSITORY" ]; then git clone "$REPOSITORY" "$WORKSPACE" cd "$WORKSPACE"; git checkout "$BRANCH" if [ ! -d "$ADDON_WORKSPACE" ]; then echo "Error: $ADDON not found inside Repo!" exit 1 fi else cp -r "$LOCAL_REPOSITORY/$SLUG" "$ADDON_WORKSPACE" fi # Init docker echo "[INFO] Setup dockerfile" sed -i "s/{arch}/${ARCH}/g" "$ADDON_WORKSPACE/config.json" DOCKER_TAG=$(jq --raw-output ".version" "$ADDON_WORKSPACE/config.json") UPSTREAM_VERSION=${DOCKER_TAG%-*} # If set custom image in file DOCKER_IMAGE=$(jq --raw-output ".image // empty" "$ADDON_WORKSPACE/config.json") # Replace hass.io vars sed -i "s/%%BASE_IMAGE%%/${BASE_IMAGE}/g" "$ADDON_WORKSPACE/Dockerfile" sed -i "s/#${ARCH}:FROM/FROM/g" "$ADDON_WORKSPACE/Dockerfile" sed -i "s/%%ARCH%%/${ARCH}/g" "$ADDON_WORKSPACE/Dockerfile" sed -i "s/%%UPSTREAM_VERSION%%/${UPSTREAM_VERSION}/g" "$ADDON_WORKSPACE/Dockerfile" echo "LABEL io.hass.version=\"$DOCKER_TAG\" io.hass.arch=\"$ARCH\" io.hass.type=\"addon\"" >> "$ADDON_WORKSPACE/Dockerfile" # Run build echo "[INFO] start docker build" docker stop $BUILD_CONTAINER_NAME 2> /dev/null || true docker rm --volumes $BUILD_CONTAINER_NAME 2> /dev/null || true docker run --rm \ -v "$ADDON_WORKSPACE":/docker \ -v ~/.docker:/root/.docker \ -e DOCKER_PUSH=$DOCKER_PUSH \ -e DOCKER_CACHE=$DOCKER_CACHE \ -e DOCKER_WITH_LATEST=$DOCKER_WITH_LATEST \ -e DOCKER_IMAGE="$DOCKER_IMAGE" \ -e DOCKER_TAG="$DOCKER_TAG" \ --name $BUILD_CONTAINER_NAME \ --privileged \ homeassistant/docker-build-env \ /run-docker.sh echo "[INFO] cleanup WORKSPACE" cd "$BUILD_DIR" rm -rf "$WORKSPACE" cleanup "okay" exit 0 ================================================ FILE: grafana/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM USER root ENV GOSU_VERSION 1.10 COPY qemu-arm-static /usr/bin/qemu-arm-static RUN if [ "$BUILD_ARCH" = "amd64" ]; then rm /usr/bin/qemu-arm-static; fi RUN set -ex \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ jq wget \ && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove wget \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache COPY run_addon.sh / RUN chmod a+x /run_addon.sh #USER grafana ENTRYPOINT [ "/run_addon.sh" ] ================================================ FILE: grafana/README.md ================================================ # Grafana addon for hass.io on armhf/amd64 This addon provide grafana for the armhf architecture (rpi 2 - 3) and amd64. The docker image used is build by [f2git](https://hub.docker.com/r/fg2it/grafana-armhf) for armhf and the [official image](https://hub.docker.com/r/grafana/grafana/) for amd64. The greatest common version is used. Environment variables are used to configure persistance volume to `/data` instead of `/var/lib/grafana`. I have tried to build a grafana addon based on alpine, but failed for lack of phantomjs support. ## env_var (dict) This variable can be used to set environment variables before launching grafana, and thus setting configuration variable. The list of variables is [here](http://docs.grafana.org/installation/configuration/). For exemple, to change the instance name: ``` python { "env_var": [ { "name": "GF_DEFAULT_INSTANCE_NAME", "value": "my-instance" } ] } ``` To install plugins, you can use the `GF_INSTALL_PLUGINS` variable ``` python { "env_var": [ { "name": "GF_INSTALL_PLUGINS", "value": "plugin1,plugin2" } ] } ``` ================================================ FILE: grafana/build.json ================================================ { "build_from": { "amd64" : "grafana/grafana:6.0.1", "armhf" : "grafana/grafana-arm32v7-linux:6.0.1", "armv7" : "grafana/grafana-arm32v7-linux:6.0.1", "aarch64" : "grafana/grafana-arm64v8-linux:6.0.1" } } ================================================ FILE: grafana/config.json ================================================ { "name": "Grafana Multiarch", "version": "6.0.1", "slug": "grafana_multiarch", "image": "bestlibre/{arch}-grafana", "description": "Grafana addon. Image based on upstream docker images. The version used is the greater common version between the official amd64 image and the f2git one for armhf", "url": "https://github.com/bestlibre/hassio-addons/tree/master/grafana", "startup": "system", "map": ["ssl"], "boot": "auto", "ports": {"3000/tcp": 3000}, "environment": {"GF_PATHS_DATA":"/data", "GF_PATHS_PLUGINS":"/data/plugins"}, "arch": ["armhf", "amd64", "armv7", "aarch64"], "options": {"env_var": []}, "schema": {"env_var":[{"name": "str", "value": "str"}]}, "webui": "http://[HOST]:[PORT:3000]" } ================================================ FILE: grafana/run_addon.sh ================================================ #!/bin/bash set -e eval $(jq --raw-output '.env_var | .[] | "export " + .name + "=\"" + .value + "\""' /data/options.json) chown -R grafana:grafana /data gosu grafana /run.sh ================================================ FILE: influxdb/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_ARCH ENV LANG C.UTF-8 COPY qemu-arm-static /usr/bin/qemu-arm-static COPY qemu-aarch64-static /usr/bin/qemu-aarch64-static RUN if [ "$BUILD_ARCH" = "armhf" -o "$BUILD_ARCH" = "armv7" ]; then rm /usr/bin/qemu-aarch64-static;\ elif [ "$BUILD_ARCH" = "aarch64" ]; then rm /usr/bin/qemu-arm-static;\ else\ rm /usr/bin/qemu-aarch64-static;\ rm /usr/bin/qemu-arm-static;\ fi RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ jq \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache COPY influxdb.conf /etc/influxdb/influxdb.conf # Copy data for add-on COPY run.sh / RUN chmod a+x /run.sh EXPOSE 8086 EXPOSE 8088 ENTRYPOINT [ "/run.sh" ] CMD ["influxd"] ================================================ FILE: influxdb/README.md ================================================ # InfluxDB server for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-influxdb.svg)](https://microbadger.com/images/bestlibre/armhf-influxdb "Get your own version badge on microbadger.com") ## Description This addon provide an influxdb database to [store data from homeassistant](https://home-assistant.io/components/influxdb/) and/or use it for [data retrieval](https://home-assistant.io/components/sensor.influxdb/). This a wrapper around the [official influxdb image](https://hub.docker.com/_/influxdb/). The data are stored in the addon /data volume. You can create a backup with the `influxd`command. See the documentation [here](https://docs.influxdata.com/influxdb/v1.2/administration/backup_and_restore/) and especialy the [remote backups section](https://docs.influxdata.com/influxdb/v1.2/administration/backup_and_restore/#remote-backups). To create the database on first run, you can use the [http api](https://docs.influxdata.com/influxdb/v1.3/guides/writing_data/) : ``` curl -i -XPOST http://hassio.local:8086/query --data-urlencode "q=CREATE DATABASE home_assistant" ``` If this doesn't work, try to replace ̀hassio.local` with your hassio IP. ## Configuration ### env_var (dict) This variable can be used to set environment variable before launching influxdb, and thus setting configuration variable. The list of variables is [here](https://docs.influxdata.com/influxdb/v1.3/administration/config). For exemple, to enable authentication : ``` python {"env_var": [{"name": "INFLUXDB_HTTP_AUTH_ENABLED", "value": "true"}]} ``` ================================================ FILE: influxdb/build.json ================================================ { "build_from": { "armhf" : "arm32v7/influxdb:1.7.4", "armv7" : "arm32v7/influxdb:1.7.4", "aarch64": "arm64v8/influxdb:1.7.4", "amd64" : "amd64/influxdb:1.7.4" } } ================================================ FILE: influxdb/config.json ================================================ { "name": "InfluxDb", "version": "1.7.4", "slug": "influxdb", "description": "InfluxDb server", "url": "https://github.com/bestlibre/hassio-addons/tree/master/influxdb", "startup": "system", "map": ["ssl"], "boot": "auto", "image": "bestlibre/{arch}-influxdb", "options": { "env_var": [{ "name": "INFLUXDB_BIND_ADDRESS", "value": ":8088" }] }, "schema": {"env_var":[{"name": "str", "value": "str"}]}, "ports": {"8086/tcp": 8086, "8088/tcp": 8088}, "arch": ["armhf", "amd64", "aarch64", "armv7"] } ================================================ FILE: influxdb/influxdb.conf ================================================ [meta] dir = "/data/influxdb/meta" [data] dir = "/data/influxdb/data" engine = "tsm1" wal-dir = "/data/influxdb/wal" ================================================ FILE: influxdb/run.sh ================================================ #!/bin/bash set -e eval $(jq --raw-output '.env_var | .[] | "export " + .name + "=\"" + .value + "\""' /data/options.json) /entrypoint.sh "$@" ================================================ FILE: kanboard/Dockerfile ================================================ FROM %%BASE_IMAGE%% ENV LANG C.UTF-8 ENV KANBOARD_VERSION 1.0.44 # Add Tini ENV TINI_VERSION v0.14.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-%%ARCH%% /tini RUN chmod +x /tini ENTRYPOINT ["/tini", "--"] RUN apk add -U --no-cache --virtual .build-deps unzip wget\ && apk add --no-cache nginx openssl php7 php7-fpm php7-pdo_sqlite php7-gd php7-json php7-ctype php7-session php7-mbstring php7-openssl php7-zip php7-zlib \ && cd /tmp \ && wget https://kanboard.net/kanboard-${KANBOARD_VERSION}.zip \ && unzip -d /var/www/ kanboard-${KANBOARD_VERSION}.zip \ && rm kanboard-${KANBOARD_VERSION}.zip \ && apk del .build-deps \ && echo "daemon off;" >> /etc/nginx/nginx.conf \ && rm /etc/nginx/conf.d/* \ && mkdir -p /run/nginx COPY config.php /var/www/kanboard/ COPY kanboard.conf /etc/nginx/conf.d/ # Copy data for add-on COPY run.sh / RUN chmod a+x /run.sh EXPOSE 80 CMD [ "/run.sh" ] ================================================ FILE: kanboard/config.json ================================================ { "name": "Kanboard", "version": "1.0.44", "slug": "kanboard", "description": "Kanboard", "url": "https://github.com/bestlibre/hassio-addons/tree/master/kanboard", "startup": "after", "boot": "auto", "image": "bestlibre/{arch}-kanboard", "options": {}, "schema": {}, "ports": {"80/tcp": 3380} } ================================================ FILE: kanboard/run.sh ================================================ #!/bin/bash set -e mkdir -p /data/data /data/plugins chown -R nobody:nobody /data/data /data/plugins php-fpm7 nginx ================================================ FILE: mopidy/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ENV LANG C.UTF-8 #Install mopidy RUN set -ex \ # Official Mopidy install for Debian/Ubuntu along with some extensions # (see https://docs.mopidy.com/en/latest/installation/debian/ ) && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ build-essential \ curl \ gcc \ gstreamer1.0-alsa \ gstreamer1.0-fluendo-mp3 \ gstreamer1.0-libav \ libxml2-dev \ libxslt-dev \ libz-dev \ jq \ python-crypto \ python-dev \ && curl -L https://apt.mopidy.com/mopidy.gpg -o /tmp/mopidy.gpg \ && curl -L https://apt.mopidy.com/mopidy.list -o /etc/apt/sources.list.d/mopidy.list \ && apt-key add /tmp/mopidy.gpg \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ jq mopidy mopidy-spotify mopidy-local-sqlite \ && curl -L https://bootstrap.pypa.io/get-pip.py | python - \ && pip install -U six oauth2client pyasn1 \ && pip install \ Mopidy-Moped \ Mopidy-GMusic \ Mopidy-Iris \ && apt-get purge --auto-remove -y \ curl \ gcc \ build-essential \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache COPY mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf # Copy data for add-on COPY run.sh / RUN chmod a+x /run.sh EXPOSE 6600 6680 CMD [ "/run.sh" ] ================================================ FILE: mopidy/README.md ================================================ # Mopidy addon for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-mopidy.svg)](https://microbadger.com/images/bestlibre/armhf-mopidy "Get your own version badge on microbadger.com") ## Audio player for Home Assistant This addon for hass.io add audio playing capability to the host. Mopidy is built with those extensions : - Mopidy-Moped - Mopidy-GMusic - Mopidy-Local-SQLite - Mopidy-Spotify - Mopidy-Iris The local media can be stored on /share (which allow an access through the samba addon). By default the directory for media is /share/mopidy/media. Since /share is read-only, the directory must be created from another addon or directly on the host. Mopidy listen on `6680` for http connection, and `6600` for mpd ones. This is a debian based addon since mopidy-spotify is not compatible with alpine. ## Configuration ### local_scan (bool) If it is set to true, a local scan is performed on startup. ### options (list of dict) The base configuration contains only : ```` [core] cache_dir = /data/mopidy/cache data_dir = /data/mopidy/data_dir [local] media_dir = /share/mopidy/media library = sqlite [m3u] playlists_dir = /share/mopidy/playlists [http] hostname = 0.0.0.0 [mpd] hostname = 0.0.0.0 ```` To add other options, or overwrite existing ones, you need to add them as elements in this list. Each item must be a dict with a "name" and a "value" element. They will be added on the mopidy call as -o name=value For exemple, to overwrite the media configuration to use share, ```` {"name": "local/media_dir", "value": "/share/media"} ```` will become ```` -o local/media_dir=/share/media ```` ## Google Music support To get the GMusic addon working add this to your options section: ```` { "name": "gmusic/username", "value": "YourUserName" }, { "name": "gmusic/password", "value": "ApplicationPassword" } ```` You can generate your application password as described [here](https://support.google.com/accounts/answer/185833?hl=en). Other options are available, check [the official doc](https://github.com/mopidy/mopidy-gmusic#configuration) for the complete list ## Spotify Support To get the Spotify addon working, before starting Mopidy, you must add your Spotify Premium username and password to your Mopidy configuration file and also visit https://www.mopidy.com/authenticate/#spotify to authorize this extension against your Spotify account: ```` { "name": "spotify/username", "value": "YourUserName" }, { "name": "spotify/password", "value": "ApplicationPassword" } ```` The following configuration values are available: ```` spotify/enabled: If the Spotify extension should be enabled or not. Defaults to true. spotify/username: Your Spotify Premium username. You must provide this. spotify/password: Your Spotify Premium password. You must provide this. spotify/client_id: Your Spotify application client id. You must provide this. spotify/client_secret: Your Spotify application secret key. You must provide this. spotify/bitrate: Audio bitrate in kbps. 96, 160, or 320. Defaults to 160. spotify/volume_normalization: Whether volume normalization is active or not. Defaults to true. spotify/timeout: Seconds before giving up waiting for search results, etc. Defaults to 10. spotify/allow_cache: Whether to allow caching. The cache is stored in a "spotify" directory within Mopidy's core/cache_dir. Defaults to true. spotify/allow_network: Whether to allow network access or not. Defaults to true. spotify/allow_playlists: Whether or not playlists should be exposed. Defaults to true. spotify/search_album_count: Maximum number of albums returned in search results. Number between 0 and 50. Defaults to 20. spotify/search_artist_count: Maximum number of artists returned in search results. Number between 0 and 50. Defaults to 10. spotify/search_track_count: Maximum number of tracks returned in search results. Number between 0 and 50. Defaults to 50. spotify/toplist_countries: Comma separated list of two letter ISO country codes to get toplists for. Defaults to blank, which is interpreted as all countries that Spotify is available in. spotify/private_session: Whether to use a private Spotify session. Turn on private session to disable sharing of played tracks with friends through the Spotify activity feed, Last.fm scrobbling, and Facebook. This only affects social sharing done by Spotify, not by other Mopidy extensions. Defaults to false. ```` ## Complete example This a working configuration example, with Google Music and local scan. ```` { "local_scan": true, "options": [ { "name": "local/media_dir", "value": "/share/mopidy/media" }, { "name": "m3u/playlists_dir", "value": "/share/mopidy/playlists/" }, { "name": "gmusic/username", "value": "MYUSER" }, { "name": "gmusic/password", "value": "MYPASSWORD" } ] } ```` ================================================ FILE: mopidy/build.json ================================================ { "build_from": { "armhf" : "bestlibre/armhf-debian-base:stretch", "armv7" : "bestlibre/armhf-debian-base:stretch", "aarch64": "bestlibre/aarch64-debian-base:stretch", "amd64" : "amd64/debian:stretch", "i386" : "i386/debian:stretch" } } ================================================ FILE: mopidy/config.json ================================================ { "name": "Mopidy", "version": "0.2.7", "slug": "mopidy", "description": "mopidy music server", "url": "https://github.com/bestlibre/hassio-addons/tree/master/mopidy", "startup": "application", "boot": "auto", "image": "bestlibre/{arch}-mopidy", "audio": true, "options": {"local_scan": true, "options": []}, "schema": { "local_scan": "bool?", "options": [{"name": "str", "value": "str"}] }, "devices": ["/dev/snd:/dev/snd:rwm"], "ports": {"6680/tcp": 6680, "6600/tcp": 6600}, "map": ["share"], "webui": "http://[HOST]:[PORT:6680]", "host_ipc": true, "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"] } ================================================ FILE: mopidy/mopidy.conf ================================================ [core] cache_dir = /data/mopidy/cache data_dir = /data/mopidy/data_dir [local] media_dir = /share/mopidy/media library = sqlite [m3u] playlists_dir = /share/mopidy/playlists [http] hostname = 0.0.0.0 [mpd] hostname = 0.0.0.0 ================================================ FILE: mopidy/run.sh ================================================ #!/bin/bash set -e local_scan=$(cat /data/options.json | jq -r '.local_scan // empty') options=$(cat /data/options.json | jq -r 'if .options then [.options[] | "-o "+.name+"="+.value ] | join(" ") else "" end') config="/var/lib/mopidy/.config/mopidy/mopidy.conf" if [ "$local_scan" == "true" ]; then mopidy --config $config $options local scan fi mopidy --config $config $options ================================================ FILE: mopidy_alpine/config.json ================================================ { "name": "Mopidy", "version": "0.1.2", "slug": "mopidy", "description": "mopidy music server", "url": "https://github.com/bestlibre/hassio-addons/tree/master/mopidy", "startup": "application", "boot": "auto", "image": "bestlibre/{arch}-mopidy", "options": {"local_scan": true}, "schema": { "local_scan": "bool", "options": [{"name": "str", "value": "str"}] }, "devices": ["/dev/snd:/dev/snd:rwm"], "ports": {"6680/tcp": 6680, "6600/tcp": 6600}, "map": ["share"], "webui": "http://[HOST]:[PORT:6680]" } ================================================ FILE: mopidy_cast/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM as BUILDER ARG BUILD_VERSION ARG BUILD_ARCH ENV SNAPCAST_VERSION 0.15.0 RUN set -ex \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ curl jq git build-essential libasound2-dev libvorbisidec-dev libvorbis-dev libflac-dev alsa-utils libavahi-client-dev avahi-daemon \ build-essential debhelper dh-make dh-systemd quilt fakeroot lintian \ && cd /tmp/ \ && git clone https://github.com/badaix/snapcast.git \ && cd snapcast \ && git checkout v${SNAPCAST_VERSION} \ && cd externals \ && git submodule update --init --recursive RUN cd /tmp/snapcast/server \ && make dpkg \ && mv $(ls ../snapserver*.deb) /snapserver.deb ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_ARCH ENV LANG C.UTF-8 COPY --from=BUILDER /snapserver.deb /tmp/ #Install snapcast-server RUN set -ex \ # Official Mopidy install for Debian/Ubuntu along with some extensions # (see https://docs.mopidy.com/en/latest/installation/debian/ ) && apt-get update \ && dpkg -i /tmp/snapserver.deb || DEBIAN_FRONTEND=noninteractive apt-get install -f -y\ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache COPY mopidy_cast.conf /var/lib/mopidy/.config/mopidy/mopidy_cast.conf # Copy data for add-on COPY run.sh / RUN chmod a+x /run.sh EXPOSE 6600 6680 1704 1705 CMD [ "/run.sh" ] ================================================ FILE: mopidy_cast/README.md ================================================ # Mopidy addon for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-mopidy-cast.svg)](https://microbadger.com/images/bestlibre/armhf-mopidy "Get your own version badge on microbadger.com") ## Audio player for Home Assistant This addon for hass.io add snapcast server to the [mopidy addon](https://github.com/bestlibre/hassio-addons/mopidy). See this addon for mopidy configuration. Both mopidy add mopidy_cast can be run on the same install. Look at the mopidy addon documentation for the configuration of this addon. Mopidy listen on `6681` for http connection, and `6601` for mpd ones. ================================================ FILE: mopidy_cast/build.json ================================================ { "build_from" : { "armhf" : "bestlibre/armhf-mopidy", "armv7" : "bestlibre/armv7-mopidy", "amd64" : "bestlibre/amd64-mopidy", "aarch64" : "bestlibre/aarch64-mopidy", "i386" : "bestlibre/i386-mopidy" } } ================================================ FILE: mopidy_cast/config.json ================================================ { "name": "Mopidy and Snapcast", "version": "0.2.7", "slug": "mopidy-cast", "description": "mopidy music server with snapcast server", "url": "https://github.com/bestlibre/hassio-addons/tree/master/mopidy_cast", "startup": "application", "boot": "auto", "image": "bestlibre/{arch}-mopidy-cast", "options": {"local_scan": true, "options": []}, "schema": { "local_scan": "bool?", "options": [{"name": "str", "value": "str"}] }, "devices": [], "ports": {"6680/tcp": 6681, "6600/tcp": 6601, "1704/tcp": 1704, "1705/tcp": 1705}, "map": ["share"], "arch": ["amd64", "armhf", "armv7"], "tmpfs": "size=10m,rw", "webui": "http://[HOST]:[PORT:6681]", "host_ipc": true } ================================================ FILE: mopidy_cast/mopidy_cast.conf ================================================ [audio] output = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmpfs/snapfifo ================================================ FILE: mopidy_cast/run.sh ================================================ #!/bin/bash set -e local_scan=$(cat /data/options.json | jq -r '.local_scan // empty') options=$(cat /data/options.json | jq -r 'if .options then [.options[] | "-o "+.name+"="+.value ] | join(" ") else "" end') config="/var/lib/mopidy/.config/mopidy/mopidy.conf:/var/lib/mopidy/.config/mopidy/mopidy_cast.conf" snapserver -s pipe:///tmpfs/snapfifo?name=default & if [ "$local_scan" == "true" ]; then mopidy --config $config $options local scan fi mopidy --config $config $options ================================================ FILE: nextcloud/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_ARCH COPY qemu-arm-static /usr/bin/qemu-arm-static COPY qemu-aarch64-static /usr/bin/qemu-aarch64-static RUN if [ "$BUILD_ARCH" = "armhf" ]; then rm /usr/bin/qemu-aarch64-static;\ elif [ "$BUILD_ARCH" = "aarch64" ]; then rm /usr/bin/qemu-arm-static;\ else\ rm /usr/bin/qemu-aarch64-static;\ rm /usr/bin/qemu-arm-static;\ fi RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ jq \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache RUN sed -i "s|/var/www|/data/www|g" /etc/apache2/sites-enabled/000-default.conf \ && sed -i "s|/var/www|/data/www|g" /etc/apache2/apache2.conf \ && sed -i "s|/var/www/html|/data/www/html|g" /entrypoint.sh \ && sed -i "s|/var/www/html|/data/www/html|g" /usr/src/nextcloud/config/autoconfig.php COPY run_addon.sh / RUN chmod a+x /run_addon.sh ENTRYPOINT [ "/run_addon.sh" ] CMD ["apache2-foreground"] ================================================ FILE: nextcloud/build.json ================================================ { "build_from": { "armhf" : "arm32v7/nextcloud:12.0.3", "aarch64": "arm64v8/nextcloud:12.0.3", "amd64" : "amd64/nextcloud:12.0.3", "i386" : "i386/nextcloud:12.0.3" } } ================================================ FILE: nextcloud/config.json ================================================ { "name": "Nextcloud", "version": "12.0.3", "slug": "nextcloud", "image": "bestlibre/{arch}-nextcloud", "description": "Nextcloud addon. Image based on upstream docker images. This is just a wrapper to pass environment variable to the container.", "url": "https://github.com/bestlibre/hassio-addons/tree/master/nextcloud", "startup": "system", "boot": "auto", "ports": {"80/tcp": null}, "environment": {}, "map": ["share:rw"], "options": {"env_var": [{"name": "NEXTCLOUD_DATA_DIR", "value": "/share/nextcloud/"}]}, "schema": {"env_var":[{"name": "str", "value": "str"}]} } ================================================ FILE: nextcloud/run_addon.sh ================================================ #!/bin/bash set -e HTML_DIR=/data/www/html if [ ! -d "${HTML_DIR}" ]; then mkdir -p "${HTML_DIR}" chown -R www-data:root "${HTML_DIR}" chmod -R g=u "${HTML_DIR}" fi SHARE_DIR=/share/nextcloud if [ ! -d "${SHARE_DIR}" ]; then mkdir -p "${SHARE_DIR}" chown -R www-data:root "${SHARE_DIR}" chmod -R g=u "${SHARE_DIR}" fi eval $(jq --raw-output '.env_var | .[] | "export " + .name + "=\"" + .value + "\""' /data/options.json) /entrypoint.sh "$@" ================================================ FILE: nginx_proxy/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM # Add env ENV LANG C.UTF-8 # Setup base RUN apk add --no-cache -U --virtual .build-deps \ build-base \ && apk add -U --no-cache \ libressl \ jq \ nginx \ python3 \ python3-dev \ && pip3 install -U pip \ && pip install pystache \ && apk del .build-deps # Copy data COPY run.sh / COPY mustache.py / COPY vhost.mustache /templates/ RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \ rm /etc/nginx/conf.d/* && \ mkdir -p /run/nginx COPY commons.conf /etc/nginx/conf.d/ RUN chmod a+x /run.sh RUN chmod a+x /mustache.py CMD [ "/run.sh" ] ================================================ FILE: nginx_proxy/README.md ================================================ # Nginx Proxy addon for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-nginx-proxy.svg)](https://microbadger.com/images/bestlibre/armhf-nginx-proxy "Get your own version badge on microbadger.com") ## Description This addon provide an Nginx Proxy with multiple vhost support and optional ssl. ## Configuration ### vhosts (list) This list describe all the virtual host to be proxified. #### vhost (string) Full hostname (ie homeassistant.domain.tld) #### port (string) Internal port (ie 8123 for homeassistant) #### default_server (bool) Configure this vhost to be the default is set to true. Must only be used once. #### remote (str) Ip or url for the proxified server. If not set default to 172.17.0.1 (docker host). #### remote_ssl (bool) If http or https should be used for the proxified server. Defaults to http. #### auth (str) Enables HTTP basic auth for a single user on a vhost. The string is dumped directly to a file and used as the auth_basic_user_file. See the documentation for [auth_basic_user_file](http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic_user_file) on how to format the value. #### certname (str) If not set, only http is proxified. If set, the template used for the vhosts force https. The key and certchain must be located in `/ssl/letsencrypt/live/${certname}/privkey.pem` and `/ssl/letsencrypt/live/${certname}/fullchain.pem`. A solution to obtain them is to used the [certbot addon](https://github.com/bestlibre/hassio-addons/tree/master/certbot). #### ssl_modern (bool) If certname is set, you can set this parameter to switch betwwen ssl profils. The profile are the ones defined by the [mozilla ssl config generator](https://mozilla.github.io/server-side-tls/ssl-config-generator/). Use the [modern one](https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility) is set to `true`, the [intermediate one](https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29) is set to `false`or not set. ## Usage example I proxyfy 4 services, 3 local to the pi, one on another host. My configs, for 4 subdomains, with two different certs (one for each physical hosts) are : ### nginx proxy : ```` { "vhosts": [ { "vhost": "sub1.redacted.tld", "default_server": true, "certname": "rpi", "port": "8123" }, { "vhost": "sub2.redacted.tld", "port": "3380", "default_server": false, "certname": "rpi" }, { "vhost": "sub3.redacted.tld", "certname": "rpi", "port": "3000" }, { "remote": "192.168.0.2", "vhost": "sub4.redacted.tld", "certname": "nas", "port": "443" } ] } ```` ### certbot : ```` { "email": "contact@redacted.tld", "certificats": [ { "domains": "sub1.redacted.tld,sub2.redacted.tld,sub3.redacted.tld", "name": "rpi" }, { "domains": "sub3.redacted.tld", "name": "nas" } ], "ssl_only": false } ```` ================================================ FILE: nginx_proxy/build.json ================================================ { "build_from": { "amd64": "homeassistant/amd64-base-python:3.7", "i386": "homeassistant/i386-base-python:3.7", "armhf": "homeassistant/armhf-base-python:3.7", "armv7": "homeassistant/armhf-base-python:3.7", "aarch64": "homeassistant/aarch64-base-python:3.7" } } ================================================ FILE: nginx_proxy/commons.conf ================================================ # If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the # scheme used to connect to this server map $http_x_forwarded_proto $proxy_x_forwarded_proto { default $http_x_forwarded_proto; '' $scheme; } # If we receive X-Forwarded-Port, pass it through; otherwise, pass along the # server port the client connected to map $http_x_forwarded_port $proxy_x_forwarded_port { default $http_x_forwarded_port; '' $server_port; } # If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any # Connection header that may have been passed to this server map $http_upgrade $proxy_connection { default upgrade; '' close; } # Set appropriate X-Forwarded-Ssl header map $scheme $proxy_x_forwarded_ssl { default off; https on; } gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; access_log off; # HTTP 1.1 support proxy_http_version 1.1; proxy_buffering off; proxy_set_header Host $http_host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $proxy_connection; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl; proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port; # Mitigate httpoxy attack (see README for details) proxy_set_header Proxy ""; # support long domain names server_names_hash_bucket_size 64; ================================================ FILE: nginx_proxy/config.json ================================================ { "name": "Nginx Proxy", "version": "0.1.14", "slug": "nginx_proxy", "description": "Nginx Proxy for multiple VHOSTS", "url": "https://github.com/bestlibre/hassio-addons/tree/master/nginx_proxy", "startup": "system", "boot": "auto", "image": "bestlibre/{arch}-nginx-proxy", "options": { "vhosts":[ {"vhost": "homeassistant.domain.tld", "port": "8123", "default_server": true} ] }, "schema": { "vhosts": [ {"vhost": "str", "remote": "str?", "remote_ssl": "bool?", "port": "str", "default_server": "bool?", "certname": "str?", "ssl_modern": "bool?", "auth": "str?", "max_body_size": "str?", "x-ha-access": "str?" } ] }, "ports": {"80/tcp": 80, "443/tcp": 443}, "map": ["ssl"], "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"] } ================================================ FILE: nginx_proxy/mustache.py ================================================ #!/bin/python3 import pystache import argparse import json import sys def render(template, data): if data == '-': context = json.load(sys.stdin) else: with open(data, 'r') as f: context = json.load(f) for vhost in context.get('vhosts'): if vhost.get('paths'): l = [{'path': line} for line in vhost.get('paths')] vhost['paths'] = l if context.get('raw_config'): l = [{'line': line} for line in context.get('raw_config')] context['raw_config'] = l renderer = pystache.Renderer(escape=lambda u: u) print(renderer.render_path(template, context)) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('template') parser.add_argument('data') args = parser.parse_args() render(args.template, args.data) ================================================ FILE: nginx_proxy/run.sh ================================================ #!/bin/bash set -e options="/data/options.json" ssl=$(jq -r '[.vhosts[] | .certname // empty] | if length > 0 then "true" else "false" end' $options) if [ "$ssl" == "true" ]; then if [ ! -e /data/dhparam.pem ]; then openssl dhparam -dsaparam -out /data/dhparam.pem 4096 fi fi auths=$(jq -r '.vhosts[] | if .auth then .vhost + " " + .auth else empty end' $options) echo "$auths" | while read -r vhost auth; do echo "$auth" >"/data/auth_$vhost" done python3 /mustache.py /templates/vhost.mustache /data/options.json > /etc/nginx/conf.d/vhosts.conf # forward request and error logs to docker log collector ln -sf /dev/stdout /var/log/nginx/access.log ln -sf /dev/stderr /var/log/nginx/error.log nginx ================================================ FILE: nginx_proxy/vhost.mustache ================================================ {{#vhosts}} server { server_name {{vhost}}; listen 80 {{#default_server}}default_server{{/default_server}}; listen [::]:80 {{#default_server}}default_server{{/default_server}}; location ~ /.well-known { allow all; auth_basic off; root /ssl/wk/; } {{#certname}} location / { return 301 https://$host$request_uri; } } server { server_name {{vhost}}; listen 443 ssl http2 {{#default_server}}default_server{{/default_server}}; listen [::]:443 ssl http2 {{#default_server}}default_server{{/default_server}}; ssl_session_timeout 1d; #ssl_session_cache shared:SSL:50m; ssl_session_tickets off; ssl_prefer_server_ciphers on; # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) add_header Strict-Transport-Security max-age=15768000; # OCSP Stapling --- # fetch OCSP records from URL in ssl_certificate and cache them ssl_stapling on; ssl_stapling_verify on; {{^ssl_modern}} # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /data/dhparam.pem; # intermediate configuration. tweak to your needs. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS'; {{/ssl_modern}} {{#ssl_modern}} # modern configuration. tweak to your needs. ssl_protocols TLSv1.2; ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; {{/ssl_modern}} ## verify chain of trust of OCSP response using Root CA and Intermediate certs ssl_trusted_certificate /ssl/letsencrypt/live/{{certname}}/chain.pem; ssl_certificate /ssl/letsencrypt/live/{{certname}}/fullchain.pem; ssl_certificate_key /ssl/letsencrypt/live/{{certname}}/privkey.pem; location ~ /.well-known { allow all; root /ssl/wk/; } {{/certname}} {{#auth}} auth_basic "password protected"; auth_basic_user_file /data/auth_{{vhost}}; {{/auth}} {{#max_body_size}} client_max_body_size {{max_body_size}}; {{/max_body_size}} location / { proxy_pass {{#remote_ssl}}https{{/remote_ssl}}{{^remote_ssl}}http{{/remote_ssl}}://{{#remote}}{{remote}}{{/remote}}{{^remote}}172.17.0.1{{/remote}}:{{port}}; {{#x-ha-access}}proxy_set_header x-ha-access "{{x-ha-access}}";{{/x-ha-access}} } } {{/vhosts}} ================================================ FILE: owserver/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ENV LANG C.UTF-8 RUN set -ex \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ owserver \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache \ && update-rc.d owserver disable # Copy data for add-on COPY owfs.conf /etc/owfs.conf COPY run.sh / RUN chmod a+x /run.sh EXPOSE 4304 CMD [ "/run.sh" ] ================================================ FILE: owserver/README.md ================================================ # one wire server [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-owserver.svg)](https://microbadger.com/images/bestlibre/armhf-owserver "Get your own version badge on microbadger.com") Addon to expose one wire sensors over a tcp server ([owserver](http://owfs.org/index.php?page=owserver)), using `/dev/i2c-1` as input device. Can be use with [pyownet](http://pyownet.readthedocs.io/en/latest/index.html) to interact with sensors in python. I'm using it to read sensor values over an I2C to 1wire converter (cf [this page for inspiration](http://raspberrypi.tomasgreno.cz/thermal-sensor-i2c.html)) ================================================ FILE: owserver/build.json ================================================ { "build_from": { "armhf" : "bestlibre/armhf-debian-base:stretch", "armv7" : "bestlibre/armhf-debian-base:stretch", "aarch64": "bestlibre/aarch64-debian-base:stretch", "amd64" : "debian:stretch", "i386" : "i386/debian:stretch" } } ================================================ FILE: owserver/config.json ================================================ { "name": "1-wire Server", "version": "0.1.1", "slug": "owserver", "description": "One wire server", "url": "https://github.com/bestlibre/hassio-addons/tree/master/owserver", "startup": "system", "boot": "auto", "image": "bestlibre/{arch}-owserver", "options": {}, "schema": {}, "devices": ["/dev/i2c-1:/dev/i2c-1:rwm"], "ports": {"4304/tcp": null}, "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"] } ================================================ FILE: owserver/owfs.conf ================================================ ######################## SOURCES ######################## # # With this setup, any client (but owserver) uses owserver on the # local machine... ! server: server = localhost:4304 # # ...and owserver uses the real hardware, by default fake devices # This part must be changed on real installation server: device = /dev/i2c-1 ####################### OWSERVER ######################## server: port = *:4304 ================================================ FILE: owserver/run.sh ================================================ #!/bin/bash set -e owserver -c /etc/owfs.conf --foreground ================================================ FILE: passbolt/Dockerfile ================================================ FROM %%BASE_IMAGE%% ENV PASSBOLT_VERSION %%UPSTREAM_VERSION%% ENV PASSBOLT_URL https://github.com/passbolt/passbolt_api/archive/v${PASSBOLT_VERSION}.tar.gz ARG BASE_PHP_DEPS="php5-curl \ php5-common \ php5-gd \ php5-intl \ php5-json \ php5-mcrypt \ php5-mysql \ php5-xsl \ php5-fpm \ php5-phar \ php5-posix \ php5-xml \ php5-openssl \ php5-zlib \ php5-ctype \ php5-pdo \ php5-pdo_mysql \ php5-pear" ARG PHP_GNUPG_DEPS="php5-dev \ make \ gcc \ g++ \ libc-dev \ pkgconfig \ re2c \ gpgme-dev \ autoconf \ zlib-dev \ file" RUN apk add --no-cache $BASE_PHP_DEPS \ sed \ tar \ bash \ curl \ nginx \ gpgme \ gnupg1 \ recode \ libxml2 \ openssl \ libpcre32 \ mysql-client \ ca-certificates \ jq RUN apk add --no-cache $PHP_GNUPG_DEPS \ && ln -s /usr/bin/php5 /usr/bin/php \ && ln -s /usr/bin/phpize5 /usr/bin/phpize \ #https://bugs.alpinelinux.org/issues/5378 && sed -i "s/ -n / /" $(which pecl) \ && pecl install gnupg memcache \ && echo "extension=memcache.so" > /etc/php5/conf.d/memcache.ini \ && echo "extension=gnupg.so" > /etc/php5/conf.d/gnupg.ini \ && apk del $PHP_GNUPG_DEPS \ && curl -sS https://getcomposer.org/installer | php \ && mv composer.phar /usr/local/bin/composer \ && mkdir /var/www/passbolt \ && curl -sSL $PASSBOLT_URL | tar zxf - -C /var/www/passbolt --strip-components 1 \ && chown -R nginx:nginx /var/www/passbolt \ && chmod -R +w /var/www/passbolt/app/tmp \ && chmod +w /var/www/passbolt/app/webroot/img/public COPY conf/passbolt.conf /etc/nginx/conf.d/default.conf COPY bin/docker-entrypoint.sh /docker-entrypoint.sh EXPOSE 80 443 CMD ["/docker-entrypoint.sh"] ================================================ FILE: passbolt/LICENSE ================================================ GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . ================================================ FILE: passbolt/bin/docker-entrypoint.sh ================================================ #!/bin/bash set -eo pipefail #GnuPG key creation related variables KEY_LENGTH=$(jq -r '.key_length // empty' /data/options.json) SUBKEY_LENGTH=$(jq -r '.subkey_length // empty' /data/options.json) KEY_NAME=$(jq -r '.key_name // empty' /data/options.json) KEY_EMAIL=$(jq -r '.key_email // empty' /data/options.json) KEY_EXPIRATION=$(jq -r '.key_expiration // empty' /data/options.json) #App file variables FINGERPRINT=$(jq -r '.fingerprint // empty' /data/options.json) REGISTRATION=$(jq -r '.registration // empty' /data/options.json) SSL=$(jq -r 'if .ssl? then "true" else "false" end' /data/options.json) #Core file variables SALT=$(jq -r '.salt // empty' /data/options.json) CIPHERSEED=$(jq -r '.cipherssed // empty' /data/options.json) URL=$(jq -r '.url // empty' /data/options.json) #Database variables DB_HOST=$(jq -r '.db_host // empty' /data/options.json) DB_PORT=$(jq -r '.db_port // empty' /data/options.json) DB_USER=$(jq -r '.db_user // empty' /data/options.json) DB_PASS=$(jq -r '.db_pass // empty' /data/options.json) DB_NAME=$(jq -r '.db_name // empty' /data/options.json) #Email variables EMAIL_TRANSPORT=$(jq -r '.email_transport // empty' /data/options.json) EMAIL_FROM=$(jq -r '.email_from // empty' /data/options.json) EMAIL_HOST=$(jq -r '.email_host // empty' /data/options.json) EMAIL_PORT=$(jq -r '.email_port // empty' /data/options.json) EMAIL_TIMEOUT=$(jq -r '.email_timeout // empty' /data/options.json) EMAIL_USERNAME=$(jq -r '.email_username // empty' /data/options.json) EMAIL_PASSWORD=$(jq -r '.email_password // empty' /data/options.json) EMAIL_TLS=$(jq -r '.email_tls // empty' /data/options.json) SSL_KEY=$(jq -r '.ssl_key // "/data/ssl/certificate.key"' /data/options.json) SSL_CERT=$(jq -r '.ssl_cert // "/data/ssl/certificate.crt"' /data/options.json) gpg_private_key=/data/gpg/serverkey.private.asc gpg_public_key=/data/gpg/serverkey.asc gpg=$(which gpg) core_config='/var/www/passbolt/app/Config/core.php' db_config='/var/www/passbolt/app/Config/database.php' app_config='/var/www/passbolt/app/Config/app.php' email_config='/var/www/passbolt/app/Config/email.php' ssl_key='/etc/ssl/certs/certificate.key' ssl_cert='/etc/ssl/certs/certificate.crt' gpg_gen_key() { su -m -c "$gpg --batch --gen-key < $gpg_private_key" -ls /bin/bash nginx su -m -c "$gpg --armor --export $KEY_EMAIL > $gpg_public_key" -ls /bin/bash nginx } gpg_import_key() { local key_id=$(su -m -c "gpg --with-colons $gpg_private_key | grep sec |cut -f5 -d:" -ls /bin/bash nginx) su -m -c "$gpg --batch --import $gpg_public_key" -ls /bin/bash nginx su -m -c "gpg -K $key_id" -ls /bin/bash nginx || su -m -c "$gpg --batch --import $gpg_private_key" -ls /bin/bash nginx } core_setup() { #Env vars: # SALT # CIPHERSEED # URL local default_salt='DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi' local default_seed='76859309657453542496749683645' local default_url='passbolt.local' cp $core_config{.default,} sed -i s:$default_salt:${SALT:-$default_salt}:g $core_config sed -i s:$default_seed:${CIPHERSEED:-$default_seed}:g $core_config sed -i "/example.com/ s:\/\/::" $core_config sed -i s:example.com:${URL:-$default_url}:g $core_config #if [ "$SSL" != false ]; then sed -i s:http:https:g $core_config #fi } db_setup() { #Env vars: # DB_HOST # DB_USER # DB_PASS # DB_NAME local default_host='localhost' local default_user='user' local default_pass='password' local default_db='database_name' cp $db_config{.default,} sed -i "/$default_host/a\ \t\t'port' => '${DB_PORT:-3306}'," $db_config sed -i s:$default_host:${DB_HOST:-db}:g $db_config sed -i s:$default_user:${DB_USER:-passbolt}:g $db_config sed -i s:$default_pass\',:${DB_PASS:-P4ssb0lt}\',:g $db_config sed -i s:$default_db:${DB_NAME:-passbolt}:g $db_config } app_setup() { #Env vars: # FINGERPRINT # REGISTRATION # SSL local default_home='/home/www-data/.gnupg' local default_public_key='unsecure.key' local default_private_key='unsecure_private.key' local default_fingerprint='2FC8945833C51946E937F9FED47B0811573EE67E' local gpg_home='/var/lib/nginx/.gnupg' local auto_fingerprint=$(su -m -c "$gpg --fingerprint |grep fingerprint| awk '{for(i=4;i<=NF;++i)printf \$i}'" -ls /bin/bash nginx) cp $app_config{.default,} sed -i s:$default_home:$gpg_home:g $app_config sed -i s:$default_public_key:serverkey.asc:g $app_config sed -i s:$default_private_key:serverkey.private.asc:g $app_config sed -i s:$default_fingerprint:${FINGERPRINT:-$auto_fingerprint}:g $app_config sed -i "/force/ s:true:${SSL:-true}:" $app_config sed -i "/'registration'/{n; s:false:${REGISTRATION:-false}:}" $app_config } email_setup() { #Env vars: # EMAIL_TRANSPORT # EMAIL_FROM # EMAIL_HOST # EMAIL_PORT # EMAIL_TIMEOUT # EMAIL_USERNAME # EMAIL_PASSWORD # EMAIL_TLS local default_transport='Smtp' local default_from='contact@passbolt.com' local default_host='smtp.mandrillapp.com' local default_port='587' local default_timeout='30' local default_username="''" local default_password="''" cp $email_config{.default,} sed -i s:$default_transport:${EMAIL_TRANSPORT:-Smtp}:g $email_config sed -i s:$default_from:${EMAIL_FROM:-contact@mydomain.local}:g $email_config sed -i s:$default_host:${EMAIL_HOST:-localhost}:g $email_config sed -i s:$default_port:${EMAIL_PORT:-587}:g $email_config sed -i s:$default_timeout:${EMAIL_TIMEOUT:-30}:g $email_config sed -i "0,/"$default_username"/s:"$default_username":'${EMAIL_USERNAME:-email_user}':" $email_config sed -i "0,/"$default_password"/s:"$default_password":'${EMAIL_PASSWORD:-email_password}':" $email_config sed -i "0,/tls/s:false:${EMAIL_TLS:-false}:" $email_config } gen_ssl_cert() { openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \ -subj "/C=FR/ST=Denial/L=Springfield/O=Dis/CN=www.passbolt.local" \ -keyout $SSL_KEY -out $SSL_CERT } install() { local database_host=${DB_HOST:-$(cat $db_config | grep -m1 "'host'" | sed -r "s/\s*'host' => '(.*)',/\1/")} local database_port=${DB_PORT:-$(cat $db_config | grep -m1 "'port' => '\d" | sed -r "s/\s*'port' => '(.*)',/\1/")} local database_user=${DB_USER:-$(cat $db_config | grep -m1 "'login'" | sed -r "s/\s*'login' => '(.*)',/\1/")} local database_pass=${DB_PASS:-$(cat $db_config | grep -m1 "'password'" | sed -r "s/\s*'password' => '(.*)',/\1/")} local database_name=${DB_NAME:-$(cat $db_config | grep -m1 "'database'" | sed -r "s/\s*'database' => '(.*)',/\1/")} tables=$(mysql -u ${database_user:-passbolt} -h $database_host -P $database_port -p -BN -e "SHOW TABLES FROM ${database_name:-passbolt}" -p${database_pass:-P4ssb0lt} |wc -l) if [ $tables -eq 0 ]; then su -c "/var/www/passbolt/app/Console/cake install --send-anonymous-statistics true --no-admin" -ls /bin/bash nginx else echo "Enjoy! ☮" fi } php_fpm_setup() { sed -i '/^user\s/ s:nobody:nginx:g' /etc/php5/php-fpm.conf sed -i '/^group\s/ s:nobody:nginx:g' /etc/php5/php-fpm.conf cp /etc/php5/php-fpm.conf /etc/php5/fpm.d/www.conf sed -i '/^include\s/ s:^:#:' /etc/php5/fpm.d/www.conf } email_cron_job() { local root_crontab='/etc/crontabs/root' local cron_task_dir='/etc/periodic/1min' local cron_task='/etc/periodic/1min/email_queue_processing' local process_email="/var/www/passbolt/app/Console/cake EmailQueue.sender --quiet" mkdir -p $cron_task_dir echo "* * * * * run-parts $cron_task_dir" >> $root_crontab echo "#!/bin/sh" > $cron_task chmod +x $cron_task echo "su -c \"$process_email\" -ls /bin/bash nginx" >> $cron_task crond -f -c /etc/crontabs } if [ ! -d /data/images ]; then mkdir /data/images ln -s /data/images /var/www/passbolt/app/webroot/img/public/images fi if [ ! -d /data/gpg ]; then mkdir -p /data/gpg chown nginx /data/gpg fi if [ ! -d /data/ssl ]; then mkdir -p /data/ssl chown nginx /data/ssl fi ln -s $SSL_KEY $ssl_key ln -s $SSL_CERT $ssl_cert ln -s {/data/,/var/www/passbolt/app/Config/}gpg/serverkey.asc ln -s {/data/,/var/www/passbolt/app/Config/}gpg/serverkey.private.asc if [ ! -f $gpg_private_key ] && [ ! -L $gpg_private_key ] || \ [ ! -f $gpg_public_key ] && [ ! -L $gpg_public_key ]; then gpg_gen_key else gpg_import_key fi if [ ! -f $core_config ] && [ ! -L $core_config ]; then core_setup fi if [ ! -f $db_config ] && [ ! -L $db_config ]; then db_setup fi if [ ! -f $app_config ] && [ ! -L $app_config ]; then app_setup fi if [ ! -f $email_config ] && [ ! -L $email_config ]; then email_setup fi if [ ! -f $ssl_key ] && [ ! -f $ssl_cert ]; then gen_ssl_cert fi php_fpm_setup install php-fpm5 ln -sf /dev/stdout /var/log/nginx/access.log ln -sf /dev/stderr /var/log/nginx/error.log nginx -g "pid /tmp/nginx.pid; daemon off;" & email_cron_job ================================================ FILE: passbolt/conf/passbolt.conf ================================================ server { listen 80; client_body_buffer_size 100K; client_header_buffer_size 1k; client_max_body_size 100k; # large_client_header_buffers 2 1k; client_body_timeout 10; client_header_timeout 10; keepalive_timeout 5 5; send_timeout 10; root /var/www/passbolt; # X-Frame-Options is to prevent from clickJacking attack add_header X-Frame-Options SAMEORIGIN; # disable content-type sniffing on some browsers. add_header X-Content-Type-Options nosniff; # This header enables the Cross-site scripting (XSS) filter add_header X-XSS-Protection "1; mode=block"; # This will enforce HTTP browsing into HTTPS and avoid ssl stripping attack # add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; location / { try_files $uri $uri/ /index.php?$args; index index.php; } location ~ \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SERVER_NAME $http_host; } location ~* \.(jpe?g|woff|woff2|ttf|gif|png|bmp|ico|css|js|json|pdf|zip|htm|html|docx?|xlsx?|pptx?|txt|wav|swf|svg|avi|mp\d)$ { access_log off; log_not_found off; try_files $uri /app/webroot/$uri /index.php?$args; } } server { listen 443; ssl on; ssl_certificate /etc/ssl/certs/certificate.crt; ssl_certificate_key /etc/ssl/certs/certificate.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS; ssl_session_tickets off; #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains"; add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; root /var/www/passbolt; # X-Frame-Options is to prevent from clickJacking attack add_header X-Frame-Options SAMEORIGIN; # disable content-type sniffing on some browsers. add_header X-Content-Type-Options nosniff; # This header enables the Cross-site scripting (XSS) filter add_header X-XSS-Protection "1; mode=block"; # This will enforce HTTP browsing into HTTPS and avoid ssl stripping attack #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; add_header Strict-Transport-Security "max-age=0; includeSubdomains;"; location / { try_files $uri $uri/ /index.php?$args; index index.php; } location ~ \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SERVER_NAME $http_host; } location ~* \.(jpe?g|woff|woff2|ttf|gif|png|bmp|ico|css|js|json|pdf|zip|htm|html|docx?|xlsx?|pptx?|txt|wav|swf|svg|avi|mp\d)$ { access_log off; log_not_found off; try_files $uri /app/webroot/$uri /index.php?$args; } } ================================================ FILE: passbolt/config.json ================================================ { "name": "Passbolt", "version": "1.6.4", "slug": "passbolt", "image": "bestlibre/{arch}-passbolt", "description": "Passbolt password manager", "url": "https://github.com/bestlibre/hassio-addons/tree/master/passbolt", "startup": "system", "boot": "auto", "ports": {"80/tcp": null, "443/tcp": null}, "arch": ["armhf", "amd64"], "options": {}, "schema": {"key_length": "int", "subkey_length": "int", "key_name": "str", "key_email": "email", "key_expiration": "int", "fingerprint": "str", "registration": "bool", "ssl": "bool", "salt": "str", "cipherssed": "str", "url": "str", "db_host": "str", "db_port": "port", "db_user": "str", "db_pass": "str", "db_name": "str", "email_transport": "str", "email_from": "email", "email_host": "url", "email_port": "port", "email_timeout": "int", "email_username": "str", "email_password": "str", "email_tls": "bool", "ssl_key": "str", "ssl_cert": "str"} } ================================================ FILE: python_exec/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM # Add env ENV LANG C.UTF-8 RUN apk add --no-cache \ jq \ py-pip \ python \ python-dev \ python3 \ python3-dev\ && pip install -U pip \ && pip3 install -U pip \ && pip install -U virtualenv # Copy data for add-on COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ================================================ FILE: python_exec/README.md ================================================ # Simple python executor [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-python-exec.svg)](https://microbadger.com/images/bestlibre/armhf-python-exec "Get your own version badge on microbadger.com") This addon is mainly for devlopment purpose. It will install, if needed, the given requirements with pip and then launch the python script. Since json config string cannot hold python code (with multilines and indents) the script code source must be present in a file accessible from the addon. It can be put in /share. ## Options ### clean (bool) If set to `true` the virtualenv holding the requirements is deleted on start. ### requirements (list of string) List of requirements to install with pip ### code (string) Path to the python source file. ================================================ FILE: python_exec/build.json ================================================ { "build_from": { "amd64": "homeassistant/amd64-base-python:3.7", "i386": "homeassistant/i386-base-python:3.7", "armhf": "homeassistant/armhf-base-python:3.7", "armv7": "homeassistant/armhf-base-python:3.7", "aarch64": "homeassistant/aarch64-base-python:3.7" } } ================================================ FILE: python_exec/config.json ================================================ { "name": "Python Executor", "version": "0.1.6", "slug": "python_exec", "image": "bestlibre/{arch}-python-exec", "description": "Python executor", "url": "https://github.com/bestlibre/hassio-addons/tree/master/python_exec", "startup": "application", "boot": "auto", "ports": {"8080/tcp": null}, "options": {"code": null, "requirements": []}, "schema": {"code": "str", "requirements": ["str"], "clean": "bool?"}, "map": ["share"], "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"] } ================================================ FILE: python_exec/run.sh ================================================ #!/bin/bash set -e requirements=$(cat /data/options.json | jq -r 'if .requirements then .requirements | join(" ") else "" end') code=$(cat /data/options.json | jq -r '.code') clean=$(cat /data/options.json | jq -r '.clean //empty') py2=$(cat /data/options.json | jq -r '.python2 // empty') PYTHON=$(which python3) if [ "${py2}" == "true" ]; then PYTHON=$(which python2) fi if [ -n "$requirements" ]; then if [ "$clean" == "true" ]; then rm -rf /data/venv/ fi if [ ! -f "/data/venv/bin/activate" ]; then mkdir -p /data/venv/ cd /data/venv virtualenv -p ${PYTHON} . . bin/activate else . /data/venv/bin/activate fi pip install -U ${requirements} fi python ${code} ================================================ FILE: repository.json ================================================ { "name": "BestLibre addons repository", "url": "https://github.com/bestlibre/hassio-addons", "maintainer": "BestLibre " } ================================================ FILE: snapcastclient/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM as BUILDER ARG BUILD_VERSION ARG BUILD_ARCH RUN set -ex \ && SNAPCAST_VERSION=${BUILD_VERSION%-*} \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ curl jq git build-essential libasound2-dev libvorbisidec-dev libvorbis-dev libflac-dev alsa-utils libavahi-client-dev avahi-daemon \ build-essential debhelper dh-make dh-systemd quilt fakeroot lintian \ && cd /tmp/ \ && git clone https://github.com/badaix/snapcast.git \ && cd snapcast \ && git checkout v${SNAPCAST_VERSION} \ && cd externals \ && git submodule update --init --recursive RUN cd /tmp/snapcast/client \ && make dpkg \ && mv $(ls ../snapclient*.deb) /snapclient.deb ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_VERSION ARG BUILD_ARCH ENV LANG C.UTF-8 COPY --from=BUILDER /snapclient.deb /tmp/ #Install snapcast-server RUN set -ex \ # Official Mopidy install for Debian/Ubuntu along with some extensions # (see https://docs.mopidy.com/en/latest/installation/debian/ ) && SNAPCAST_VERSION=${BUILD_VERSION%-*} \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ jq \ && dpkg -i /tmp/snapclient.deb || DEBIAN_FRONTEND=noninteractive apt-get install -f -y\ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache # Copy data for add-on COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ================================================ FILE: snapcastclient/README.md ================================================ # Snapcast client addon for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-snapcast-client.svg)](https://microbadger.com/images/bestlibre/armhf-snapcast-client "Get your own version badge on microbadger.com") ## Snapcast player for Home Assistant This addon provide a snapcast player. Can be used with the [mopidy_cast addon](https://github.com/bestlibre/hassio-addons/mopidy_cast). ## Configuration ### host (str) Snapcast server host to connect to. ================================================ FILE: snapcastclient/build.json ================================================ { "build_from": { "armhf" : "bestlibre/armhf-debian-base:stretch", "armv7" : "bestlibre/armv7-debian-base:stretch", "aarch64": "bestlibre/aarch64-debian-base:stretch", "amd64" : "debian:stretch", "i386" : "i386/debian:stretch" } } ================================================ FILE: snapcastclient/config.json ================================================ { "name": "snapcast-client", "version": "0.15.0-1", "slug": "snapcastclient", "description": "Snapcast client for multiroom audio diffusion", "startup": "application", "boot": "auto", "image": "bestlibre/{arch}-snapcast-client", "audio": true, "options": {}, "schema": {"host": "str"}, "ports": {}, "devices": ["/dev/snd:/dev/snd:rwm"], "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"] } ================================================ FILE: snapcastclient/run.sh ================================================ #!/bin/bash set -e host=$(jq -r '.host // empty' /data/options.json) if [ -n "${host}" ]; then host="-h ${host}" fi snapclient ${host} ================================================ FILE: snapcastserver/Dockerfile ================================================ FROM %%BASE_IMAGE%% ENV LANG C.UTF-8 #Install snapcastclient RUN apk upgrade --no-cache --available \ && apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/testing \ snapcast-server # Copy data for add-on COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ================================================ FILE: snapcastserver/config.json ================================================ { "name": "snapcast-server", "version": "beta", "slug": "snapcastserver", "description": "Snapcast server for multiroom audio diffusion", "startup": "system", "boot": "auto", "image": "bestlibre/{arch}-snapcast-server", "options": {}, "schema": {}, "ports": {"1704/tcp": 1704} } ================================================ FILE: snapcastserver/run.sh ================================================ #!/bin/bash set -e snapserver ================================================ FILE: syncthing/Dockerfile ================================================ ARG BUILD_FROM FROM $BUILD_FROM ARG BUILD_VERSION ARG BUILD_ARCH # Add env ENV LANG C.UTF-8 # Setup base RUN apk add --no-cache -U --virtual .build-deps \ curl \ tar \ && SYNCTHING_VERSION=v${BUILD_VERSION%-*} \ && if [ ${BUILD_ARCH} == "armhf" -o ${BUILD_ARCH} == "armv7" ]; then syncthingarch=arm;\ elif [ ${BUILD_ARCH} == "amd64" ]; then syncthingarch=amd64;\ elif [ ${BUILD_ARCH} == "i386" ]; then syncthingarch=386;\ elif [ ${BUILD_ARCH} == "aarch64" ]; then syncthingarch=arm64;\ fi \ && syncthingurl=https://github.com/syncthing/syncthing/releases/download/${SYNCTHING_VERSION}/syncthing-linux-${syncthingarch}-${SYNCTHING_VERSION}.tar.gz \ && curl --silent --show-error --fail --location --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ "$syncthingurl" \ | tar --no-same-owner -C /usr/local/bin/ -xz --strip-components 1 syncthing-linux-${syncthingarch}-${SYNCTHING_VERSION}/syncthing \ && chmod 0755 /usr/local/bin/syncthing \ && apk del .build-deps COPY run.sh / RUN chmod a+x /run.sh CMD [ "/run.sh" ] ================================================ FILE: syncthing/README.md ================================================ # Syncthing for hass.io [![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-syncthing.svg)](https://microbadger.com/images/bestlibre/armhf-syncthing "Get your own version badge on microbadger.com") ## Description This addon provide a [syncthing](https://syncthing.net/) container for hass.io. > Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet. When creating a new folder with the webui, you must set the folder path to something that will be persistent in case of container reboot/upgrade. You can use any of the following path : - `/data/` : `subfolder/path` will be created in the addon persistent volume, - `/data/` : `subfolder/path` will be created in the share directory, which can be accessed with samba, - `/config` : to synchronize home assistant configuration, - `/backup` : to synchronize home assistant backups, - `/addons` : to synchronize hassio addons. ## Configuration There are no configuration options. ================================================ FILE: syncthing/config.json ================================================ { "name": "Syncthing", "version": "1.14.0", "slug": "syncthing", "description": "syncthing synchronization service", "url": "https://github.com/bestlibre/hassio-addons/tree/master/syncthing", "startup": "system", "boot": "auto", "image": "bestlibre/{arch}-syncthing", "options": {}, "schema": {}, "ports": {"8384/tcp": 8384, "22000/tcp": null, "21027/udp": 21027}, "map": ["share:rw", "config:rw", "backup:rw", "addons:rw"], "webui": "http://[HOST]:[PORT:8384]", "arch": ["armv7", "armhf", "amd64", "aarch64", "i386"] } ================================================ FILE: syncthing/run.sh ================================================ #!/bin/bash set -e if [ ! -f '/data/config.xml' ]; then # Run syncthing to generate initial configuration files, then edit # config.xml to remove 127.0.0.1 limit from the GUI address. syncthing -generate=/data sed -i 's|
127.0.0.1:8384
|
:8384
|' /data/config.xml fi syncthing -allow-newer-config -no-browser -home=/data/