[
  {
    "path": ".travis.yml",
    "content": "sudo: required\nservices:\n  - docker\nbefore_install:\n  - sudo apt-get install jq\n  - docker pull multiarch/qemu-user-static\nenv:\n  - ADDON=\"python_exec\"\n  - ADDON=\"mopidy mopidy_cast\"\n  - ADDON=\"influxdb\"\n  - ADDON=\"snapcastclient\"\n  - ADDON=\"snapcastserver\"\n  - ADDON=\"nginx_proxy\"\n  - ADDON=\"certbot\"\n  - ADDON=\"syncthing\"\n  - ADDON=\"caddy_proxy\"\n  - ADDON=\"grafana\"\n  - ADDON=\"calibreweb\"\n  - ADDON=\"calibreweb_comics\"\nscript:\n  - docker login -u $DOCKER_USER -p $DOCKER_PASS\n  - ./build.sh $ADDON \n"
  },
  {
    "path": "README.md",
    "content": "# hassio-addons\n[![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)\n\nRepository for hass.io addons.\n\n**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.\n\n## [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\")\n\nsee https://github.com/kentloving/hassio-addons or https://github.com/assada/hassio-addons\n\n## [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\")\nsee https://github.com/hassio-addons/repository/tree/master/nginxproxymanager\n\n## [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\")\n\nSsl certificats creation/renewal with let's encrypt : not updated anymore\n\n## [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\")\nCaddy proxy with multiple vhosts and automatic ssl : working but not updated anymore\n\n## [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\")\nsee https://github.com/hassio-addons/repository/tree/master/influxdb\n\n## [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\")\nsee https://github.com/hassio-addons/repository/tree/master/grafana\n\n## [snapcastserver](https://github.com/bestlibre/hassio-addons/tree/master/snapcastserver) and [snapcastclient](https://github.com/bestlibre/hassio-addons/tree/master/snapcastclient)\nsnapcast server and client for multi room audio : not updated anymore\n\n## [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\")\nSyncthing synchronization service : working.\n\n## [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\")\n\nOne wire server : working.\n\n## [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\")\n\nPython executor : working.\n\n\n## [Grafana for armhf](https://github.com/bestlibre/hassio-addons/tree/master/armhf-grafana-debian)\nGrafana server for armhf arch, debian based image : **deprecated**.\n\n\n"
  },
  {
    "path": "aria2/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nARG BUILD_VERSION\nARG BUILD_ARCH\n\n# Add env\nENV LANG C.UTF-8\n\n# Setup base\nRUN apk add --no-cache -U --virtual .build-deps \\\n        git \\\n        unzip \\\n        wget \\\n && apk add --no-cache -U aria2 darkhttpd jq \\\n && mkdir /webui \\\n && git clone https://github.com/ziahamza/webui-aria2.git /tmp_webui \\\n && mv /tmp_webui/docs /webui/webui-aria2 \\\n && rm -rf /tmp_webui \\\n && mkdir /webui/ariang \\\n && cd /webui/ariang \\\n && wget -O ariang.zip https://github.com/mayswind/AriaNg/releases/download/1.2.1/AriaNg-1.2.1.zip \\\n && unzip ariang.zip \\\n && rm ariang.zip \\\n && apk del .build-deps\n\nCOPY run.sh /\nCOPY index.html /webui/\nRUN chmod a+x /run.sh\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "aria2/README.md",
    "content": "# aria2 with webui for hass.io\n[![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\")\n\n## Description\n\nThis addon provide an [aria2](https://aria2.github.io/) with the [webui-aria2](https://github.com/ziahamza/webui-aria2) frontend container for hass.io.\n\n`rpc` is enabled and session are saved in `/data`\n\n## Configuration\n\n### downloads (str)\n\nPath to the directory used for download storage. Default to `/share/aria2`\n\n### secret (str)\n\nSecret for rpc connection. Default to `123456789`\n\n### options (list of dict)\n\nAdditional options passed to aria2c. Must be entered as a list of dictionaries with this format : `{\"name\": \"...\", \"value\": \"...\"}`\n"
  },
  {
    "path": "aria2/config.json",
    "content": "{\n    \"name\": \"Aria2\",\n    \"version\": \"0.6\",\n    \"slug\": \"aria2\",\n    \"description\": \"Aria2 download manager\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/aria2\",\n    \"startup\": \"system\",\n    \"arch\": [\"armhf\", \"amd64\", \"aarch64\", \"i386\"],\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-aria2\",\n    \"options\": {\"options\":[]},\n    \"schema\": {\"downloads\": \"str?\", \"secret\": \"str?\", \"options\":[{\"name\": \"str\", \"value\": \"str\"}]},\n    \"ports\": {\"6800/tcp\": null, \"8080/tcp\": null, \"8081/tcp\": null},\n    \"map\": [\"share:rw\"],\n    \"webui\": \"http://[HOST]:[PORT:8080]\"\n}\n"
  },
  {
    "path": "aria2/run.sh",
    "content": "#!/bin/bash\nset -e\nsecret=$(jq -r '.secret // \"123456789\"' /data/options.json)\ndownloads=$(jq -r '.downloads // \"/share/aria2/\"' /data/options.json)\noptions=$(jq -r 'if .options then [.options[] | \"--\"+.name+\"=\"+.value ] | join(\" \") else \"\" end' /data/options.json)\nsession_file=/data/aria.session\n\nif [ ! -f ${session_file} ]; then\n    touch ${session_file}\nfi\n\nconf_file=/data/aria2.conf\nif [ ! -f ${conf_file} ]; then\n    touch ${conf_file}\nfi\n\ndarkhttpd /webui/ --port 8080 &\n#darkhttpd /webui/ariang --port 8081 &\n\naria2c --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}\n"
  },
  {
    "path": "armhf-grafana-debian/README.md",
    "content": "**DEPRECATED ADDON : Use the [multiarch one](https://github.com/bestlibre/hassio-addons/tree/master/grafana) instead**\n\n# Grafana addon for hass.io on armhf\n\nThis 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`.\n\nI have tried to build a grafana addon based on alpine, but failed for lack of phantomjs support.\n"
  },
  {
    "path": "armhf-grafana-debian/config_deactivated.json",
    "content": "{\n    \"name\": \"Grafana_armonly\",\n    \"version\": \"v4.3.2\",\n    \"slug\": \"grafana_armonly\",\n    \"image\": \"fg2it/grafana-armhf\",\n    \"description\": \"**DEPRECATED ADDON : Use the [multiarch one](https://github.com/bestlibre/hassio-addons/tree/master/grafana) instead**\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/armhf_grafana_debian\",\n    \"startup\": \"system\",\n    \"boot\": \"auto\",\n    \"ports\": {\"3000/tcp\": 3000},\n    \"environment\": {\"GF_PATHS_DATA\":\"/data\", \"GF_PATHS_PLUGINS\":\"/data/plugins\"},\n    \"arch\": [\"armhf\"],\n    \"options\": {},\n    \"schema\": {}\n}\n"
  },
  {
    "path": "base_debian/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nARG BUILD_ARCH\n\nCOPY qemu-arm-static /usr/bin/qemu-arm-static\nCOPY qemu-aarch64-static /usr/bin/qemu-aarch64-static\n\nRUN if [ \"$BUILD_ARCH\" = \"armhf\" -o \"$BUILD_ARCH\" = \"armv7\" ]; then rm /usr/bin/qemu-aarch64-static;\\\n    elif [ \"$BUILD_ARCH\" = \"aarch64\" ]; then rm /usr/bin/qemu-arm-static;\\\n    fi\n"
  },
  {
    "path": "base_debian/build.json",
    "content": "{\n    \"build_from\": {\n\t\"armhf\" : \"arm32v7/debian:stretch\",\n    \"armv7\" : \"arm32v7/debian:stretch\",\n\t\"aarch64\": \"arm64v8/debian:stretch\"\n    }\n}\n"
  },
  {
    "path": "base_debian/config.json",
    "content": "{\n    \"name\": \"debian base image\",\n    \"version\": \"stretch\",\n    \"slug\": \"debian_base\",\n    \"boot\": \"auto\",\n    \"startup\": \"system\",\n    \"image\": \"bestlibre/{arch}-debian-base\",\n    \"description\": \"Base debian image with qemu_static. Not really an addon perse. To be used to create addons\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/base_debian\",\n    \"arch\": [\"armhf\", \"armv7\",\"aarch64\"],\n    \"options\": {},\n    \"schema\": {}\n}\n"
  },
  {
    "path": "build.sh",
    "content": "#!/bin/bash\nset -ev\narchs=\"${ARCHS}\"\nfor addon in \"$@\"; do\n    if [ -z ${TRAVIS_COMMIT_RANGE} ] || git diff --name-only ${TRAVIS_COMMIT_RANGE} | grep -v README.md | grep -q ${addon}; then\n  if [ -z \"$archs\" ]; then\n    \tarchs=$(jq -r '.arch // [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"] | [.[] | \"--\" + .] | join(\" \")' ${addon}/config.json)\n  fi\n        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}\n    else\n\techo \"No change in commit range ${TRAVIS_COMMIT_RANGE}\"\n    fi\ndone\n"
  },
  {
    "path": "caddy_proxy/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nARG BUILD_VERSION\nARG BUILD_ARCH\n# Add env\nENV LANG C.UTF-8\n\n# Setup base\n\nRUN apk add --no-cache -U --virtual .build-deps \\\n\tcurl \\\n\ttar \\\n && apk add -U --no-cache \\\n        jq \\\n\tpython3 \\\n\tpython3-dev \\\n && pip3 install -U pip \\\n && pip install pystache \\\n && CADDY_VERSION=v${BUILD_VERSION%-*} \\\n && if [ ${BUILD_ARCH} == \"armhf\" -o  ${BUILD_ARCH} == \"armv7\" ]; then caddyarch=arm7;\\\n    elif [ ${BUILD_ARCH} == \"amd64\" ]; then caddyarch=amd64;\\\n    elif [ ${BUILD_ARCH} == \"i386\" ]; then caddyarch=386;\\\n    elif [ ${BUILD_ARCH} == \"aarch64\" ]; then caddyarch=arm64;\\\n    fi \\\n && caddyurl=https://github.com/mholt/caddy/releases/download/${CADDY_VERSION}/caddy_${CADDY_VERSION}_linux_${caddyarch}.tar.gz \\\n && echo $caddyurl \\\n && curl --silent --show-error --fail --location --header \"Accept: application/tar+gzip, application/x-gzip, application/octet-stream\" -o - \\\n      \"$caddyurl\" \\\n    | tar --no-same-owner -C /usr/local/bin/ -xz caddy \\\n && chmod 0755 /usr/local/bin/caddy \\\n && apk del .build-deps\n\n# Copy data\nCOPY run.sh /\nCOPY mustache.py /\nCOPY vhost.mustache /templates/\n\nRUN chmod a+x /run.sh\nRUN chmod a+x /mustache.py\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "caddy_proxy/README.md",
    "content": "# Caddy Proxy addon for hass.io\n[![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\")\n\n## Description\n\nThis 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.\n\nThe simplier way to use it is just to set your external address in the homeassistant field.\n\n## Configuration\n### homeassistant (str)\n\nThis 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.\n\n### vhosts (list of dict)\n\nThis list describe all the virtual host to be proxified. It must be set to have a valid configuration but can be empty.\n\n#### vhost (string)\n\nFull hostname (ie myservice.domain.tld)\n\n#### port (string)\n\nInternal port (ie 8123 for homeassistant, 3000 for grafana)\n\n#### remote (str)\n\nIp or url for the proxified server. If not set default to 172.17.0.1 (docker host).\n\n#### user (str)\n\nUsername to be used with basicauth. `pwd` (see below) must also be set.\n\n#### pwd (str)\n\nPassword to be used with basicauth. `user` (see above) must also be set.\n\n#### paths (list of str)\n\nThis 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.\n\nEach string must have the following format :\n\n```\n<path> <remote>:<port>\n```\n\nwith :\n\n- **path** (str): path to be proxify (ie `/api/`).\n- **remote** (str): Ip or url for the proxified server. Use `172.17.0.1` for the docker host.\n- **port** (str): Internal port.\n\n### email (email)\n\nEmail is the email address to use with which to generate a certificate with Let's Encrypt.\n\n### staging (bool)\n\nActivate staging  environment for letsencrypt. False by default.\n\n### raw_config (list of str)\n\nEach string will be added to the caddy configuration file as a new line, after the domain proxified with the vhosts section.\n\n**BREAKING CHANGE** In previous version, this was a list of dict with an object of the form `{'line': str}`. The inderection was removed.\n"
  },
  {
    "path": "caddy_proxy/build.json",
    "content": "{\n    \"build_from\": {\n        \"amd64\": \"homeassistant/amd64-base-python:3.7\",\n        \"i386\": \"homeassistant/i386-base-python:3.7\",\n        \"armhf\": \"homeassistant/armhf-base-python:3.7\",\n        \"armv7\": \"homeassistant/armhf-base-python:3.7\",\n        \"aarch64\": \"homeassistant/aarch64-base-python:3.7\"\n    }\n}"
  },
  {
    "path": "caddy_proxy/config.json",
    "content": "{\n    \"name\": \"Caddy Proxy\",\n    \"version\": \"1.0.4\",\n    \"slug\": \"caddy_proxy\",\n    \"description\": \"Caddy Proxy for multiple VHOSTS with ssl\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/caddy_proxy\",\n    \"startup\": \"system\",\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-caddy-proxy\",\n    \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"],\n    \"options\": {\n\t\"homeassistant\": \"homeassistant.domain.tld\",\n\t\"vhosts\": [],\n\t\"raw_config\": [],\n\t\"email\": null\n    },\n    \"schema\": {\n\t\"vhosts\": [\n\t    {\"vhost\": \"str\",\n\t     \"remote\": \"str?\",\n\t     \"port\": \"str\",\n\t     \"directory\": \"str?\",\n\t     \"paths\": [ \"str\" ],\n\t     \"user\": \"str?\",\n\t     \"pwd\": \"str?\"\n\t    }\n\t],\n\t\"email\": \"email\",\n\t\"disable_http_chalenge\": \"bool?\",\n\t\"staging\": \"bool?\",\n\t\"raw_config\": [\"str\"],\n\t\"homeassistant\": \"str?\"\n    },\n    \"ports\": {\"80/tcp\": 80, \"443/tcp\": 443},\n    \"map\": [\"ssl:rw\", \"share:rw\"]\n}\n"
  },
  {
    "path": "caddy_proxy/mustache.py",
    "content": "#!/bin/python3\nimport pystache\nimport argparse\nimport json\nimport sys\n\n\ndef render(template, data):\n    if data == '-':\n        context = json.load(sys.stdin)\n    else:\n        with open(data, 'r') as f:\n            context = json.load(f)\n    for vhost in context.get('vhosts'):\n        if vhost.get('paths'):\n            l = [{'path': line} for line in vhost.get('paths')]\n            vhost['paths'] = l\n\n    if context.get('raw_config'):\n        l = [{'line': line} for line in context.get('raw_config')]\n        context['raw_config'] = l\n    renderer = pystache.Renderer(escape=lambda u: u)\n    print(renderer.render_path(template, context))\n\n\nif __name__ == '__main__':\n    parser = argparse.ArgumentParser()\n    parser.add_argument('template')\n    parser.add_argument('data')\n    args = parser.parse_args()\n    render(args.template, args.data)\n"
  },
  {
    "path": "caddy_proxy/run.sh",
    "content": "#!/bin/bash\nset -e\nemail=$(jq -r '.email' /data/options.json)\nhttps_only=$(jq -r 'if .disable_http_chalenge? then \"-disable-http-challenge\" else \"\" end' /data/options.json)\nstaging=$(jq -r 'if .staging? then \"-ca https://acme-staging-v02.api.letsencrypt.org/directory\" else \"\" end' /data/options.json)\nhomeassistant=$(jq -r '.homeassistant // empty' /data/options.json)\n\nif [ -f /tmp/caddy.conf ];\nthen\n    rm /tmp/caddy.conf\nfi\n\nif [ -n \"$homeassistant\" ];\nthen\n    echo \"{\\\"vhosts\\\":[{\\\"vhost\\\":\\\"$homeassistant\\\", \\\"port\\\":\\\"8123\\\"}]}\" | python3 /mustache.py /templates/vhost.mustache - >> /tmp/caddy.conf\nfi\n\npython3 /mustache.py /templates/vhost.mustache /data/options.json >> /tmp/caddy.conf\n\nmkdir -p /ssl/caddy\nexport CADDYPATH=/ssl/caddy\ncaddy -agree ${https_only} ${staging} -email \"$email\" -conf /tmp/caddy.conf\n"
  },
  {
    "path": "caddy_proxy/vhost.mustache",
    "content": "{{#vhosts}}\n{{vhost}} {\n{{#directory}}\n    root {{directory}}\n{{/directory}}\n{{^directory}}\n{{#paths}}\n    proxy {{path}} {\n      transparent\n      websocket\n    }\n{{/paths}}\n    proxy / {{#remote}}{{remote}}{{/remote}}{{^remote}}172.17.0.1{{/remote}}:{{port}} {\n      transparent\n      websocket\n    }\n{{/directory}}\n{{#user}}\n  {{#pwd}}\n    basicauth / {{user}} {{pwd}}\n  {{/pwd}}\n{{/user}}\n    log stdout\n    errors stdout\n}\n{{/vhosts}}\n{{#raw_config}}\n{{line}}\n{{/raw_config}}"
  },
  {
    "path": "calibreweb/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nARG BUILD_VERSION\nARG BUILD_ARCH\n# Add env\nENV LANG C.UTF-8\n\n# Setup base\n\nRUN apk add --no-cache -U --virtual .build-deps \\\n\tgit \\\n && apk add -U --no-cache \\\n        jq \\\n\tpy-pip \\\n\tpython \\\n\tpython-dev \\\n && mkdir /cw \\\n && cd /cw \\\n && git clone https://github.com/janeczku/calibre-web.git .\\\n && pip install -r requirements.txt --target vendor\n\n# Copy data\nCOPY run.sh /\n\nRUN chmod a+x /run.sh\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "calibreweb/README.md",
    "content": "# calibreweb for hass.io\n[![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\")\n\n## Description\n\nThis addon provide a [calibreweb](https://github.com/janeczku/calibre-web) container for hass.io.\n\n## Configuration\n\nThere is no configuration. Follow the [Quick start](https://github.com/janeczku/calibre-web#quick-start) from calibreweb :\n\n- set the path to calibre (ie in `/share`)\n- use default admin/admin123 user passwd.\n"
  },
  {
    "path": "calibreweb/build.json",
    "content": "{\n    \"build_from\": {\n        \"amd64\": \"homeassistant/amd64-base-python:3.7\",\n        \"i386\": \"homeassistant/i386-base-python:3.7\",\n        \"armhf\": \"homeassistant/armhf-base-python:3.7\",\n        \"armv7\": \"homeassistant/armhf-base-python:3.7\",\n        \"aarch64\": \"homeassistant/aarch64-base-python:3.7\"\n    }\n}"
  },
  {
    "path": "calibreweb/config.json",
    "content": "{\n    \"name\": \"Calibre Web\",\n    \"version\": \"0.5\",\n    \"slug\": \"calibre-web\",\n    \"description\": \"Calibre web\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/bicbucstriim\",\n    \"startup\": \"after\",\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-calibre-web\",\n    \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"],\n    \"options\": {},\n    \"schema\": {},\n    \"ports\": {\"8083/tcp\": null},\n    \"map\": [\"share:rw\"]\n}\n"
  },
  {
    "path": "calibreweb/run.sh",
    "content": "#!/bin/bash\nset -e\n\npython /cw/cps.py -p /data/cw.db\n"
  },
  {
    "path": "calibreweb_comics/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nARG BUILD_VERSION\nARG BUILD_ARCH\n# Add env\nENV LANG C.UTF-8\n\n# Setup base\n\nRUN apk add --no-cache -U --virtual .build-deps \\\n\tgit \\\n && apk add -U --no-cache \\\n        jq \\\n\tpy-pip \\\n\tpython \\\n\tpython-dev \\\n && mkdir /cw \\\n && cd /cw \\\n && git clone https://github.com/janeczku/calibre-web.git .\\\n && pip install -r requirements.txt --target vendor\n\n# Copy data\nCOPY run.sh /\n\nRUN chmod a+x /run.sh\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "calibreweb_comics/README.md",
    "content": "# calibreweb comics branch for hass.io\n\nDeprecated. The upstream branch was merged in calibre-web.\n"
  },
  {
    "path": "calibreweb_comics/build.json",
    "content": "{\n    \"build_from\": {\n        \"amd64\": \"homeassistant/amd64-base-python:3.7\",\n        \"i386\": \"homeassistant/i386-base-python:3.7\",\n        \"armhf\": \"homeassistant/armhf-base-python:3.7\",\n        \"armv7\": \"homeassistant/armhf-base-python:3.7\",\n        \"aarch64\": \"homeassistant/aarch64-base-python:3.7\"\n    }\n}"
  },
  {
    "path": "calibreweb_comics/config.json",
    "content": "{\n    \"name\": \"Calibre Web Comics\",\n    \"version\": \"0.2\",\n    \"slug\": \"calibre-web-comics\",\n    \"description\": \"Calibre web (Comics Server branch)\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/calibreweb\",\n    \"startup\": \"after\",\n    \"boot\": \"auto\",\n    \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"],\n    \"image\": \"bestlibre/{arch}-calibre-web-comics\",\n    \"options\": {},\n    \"schema\": {},\n    \"ports\": {\"8083/tcp\": null},\n    \"map\": [\"share:rw\"]\n}\n"
  },
  {
    "path": "calibreweb_comics/run.sh",
    "content": "#!/bin/bash\nset -e\n\npython /cw/cps.py -p /data/cw.db\n"
  },
  {
    "path": "certbot/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\n# Add env\nENV LANG C.UTF-8\n\n# Setup base\nRUN apk add -U --no-cache jq py-future \\\n && apk add -U --no-cache --repository http://nl.alpinelinux.org/alpine/edge/community certbot\n\n# Copy data\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "certbot/README.md",
    "content": "# Certbot (let's encrypt) addon for hass.io\n[![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\")\n\n## Certificat creation and renewal for hass.io\n\nThis 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.\n\nThe certificats are created in `/ssl/letsencrypt/live/$NAME/`for each certificat.\n\n## Configuration\n\n### email (email)\n\nEmail address used for the registration\n\n### ssl-only (bool)\n\nOption 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.\n\nSome 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 :\n\n-  modify the nginx_proxy configuration to proxify 443 to 10443,\n-  start the certbot addon,\n-  wait for the certificats to be created/renewed,\n-  stop the addon,\n-  revert the nginx conf\n\n\n### certificats (list of objects)\n#### name (str)\nCertificat name, for directory creation.\n#### domains (str)\nList of domains to create/renew certificats, comma separated\n\n### debug (bool)\n\nIf set to true, certbot logs will be printed in the docker logs.\n"
  },
  {
    "path": "certbot/build.json",
    "content": "{\n    \"build_from\": {\n        \"amd64\": \"homeassistant/amd64-base-python:3.7\",\n        \"i386\": \"homeassistant/i386-base-python:3.7\",\n        \"armhf\": \"homeassistant/armhf-base-python:3.7\",\n        \"armv7\": \"homeassistant/armhf-base-python:3.7\",\n        \"aarch64\": \"homeassistant/aarch64-base-python:3.7\"\n    }\n}"
  },
  {
    "path": "certbot/config.json",
    "content": "{\n    \"name\": \"Certbot\",\n    \"version\": \"0.1.10\",\n    \"slug\": \"certbot\",\n    \"description\": \"Certbot compagnion for Nginx Proxy\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/certbot\",\n    \"startup\": \"system\",\n    \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"],\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-certbot\",\n    \"options\": {\n        \"debug\": false,\n        \"email\": \"email@domain.tld\",\n        \"certificats\":[{\"name\": \"hass\",\n                        \"domains\": \"homeassistant.domain.tld\" }],\n\t\"ssl_only\": false\n    },\n    \"schema\": {\n        \"debug\": \"bool?\",\n        \"email\": \"email\",\n        \"certificats\": [{\"name\": \"str\",\n                         \"domains\": \"str\"}],\n\t\"ssl_only\": \"bool?\"\n    },\n    \"map\": [\"ssl:rw\"],\n    \"ports\": {\"443/tcp\": 10443}\n}\n"
  },
  {
    "path": "certbot/run.sh",
    "content": "#!/bin/bash\nset -e\n\nCERT_DIR=/ssl/letsencrypt\nWORK_DIR=/data/workdir\nCONFIG_PATH=/data/options.json\n\nEMAIL=$(jq --raw-output \".email\" $CONFIG_PATH)\nDEBUG=$(jq --raw-output \".debug // empty\" $CONFIG_PATH)\nSSL_ONLY=$(jq --raw-output \".ssl_only // empty\" $CONFIG_PATH)\n\nmkdir -p /ssl/wk\nif [ \"${SSL_ONLY}\" == \"true\" ]; then\n    PLUGIN=\"--standalone --preferred-challenges tls-sni\"\nelse\n    PLUGIN=\"--webroot -w /ssl/wk/\"\nfi\nwhile true; do\n    jq -r '.certificats[] | .name + \" \" + .domains' $CONFIG_PATH |\n\twhile read name domains; do\n            certbot certonly $PLUGIN --non-interactive --email \"$EMAIL\" --agree-tos --config-dir \"$CERT_DIR\" --work-dir \"$WORK_DIR\" --cert-name $name -d ${domains}\n            if [ \"$DEBUG\" == \"true\" ]; then\n\t           cat /var/log/letsencrypt/letsencrypt.log\n            fi\n\tdone\n    \n    sleep 1d\ndone\n\n"
  },
  {
    "path": "create_all.sh",
    "content": "#!/bin/bash\nset -e\n\nfor arch in \"armhf\" \"aarch64\" \"i386\" \"amd64\" \"armv7\"\ndo\n    ./create_hassio_addon.sh -a $arch \"$@\" &\ndone\nwait\n"
  },
  {
    "path": "create_hassio_addon.sh",
    "content": "#!/bin/bash\nset -e\n\nBUILD_CONTAINER_NAME=hassio-addons-$$\nDOCKER_PUSH=\"true\"\nDOCKER_CACHE=\"true\"\nDOCKER_WITH_LATEST=\"true\"\nBRANCH=master\nREPOSITORY=https://github.com/home-assistant/hassio-addons\n\ncleanup() {\n    echo \"[INFO] Cleanup.\"\n\n    # Stop docker container\n    echo \"[INFO] Cleaning up hassio-build container.\"\n    docker stop $BUILD_CONTAINER_NAME 2> /dev/null || true\n    docker rm --volumes $BUILD_CONTAINER_NAME 2> /dev/null || true\n\n    if [ \"$1\" == \"fail\" ]; then\n        exit 1\n    fi\n}\ntrap 'cleanup fail' SIGINT SIGTERM\n\nhelp () {\n    cat << EOF\nScript for hassio addon docker build\ncreate_hassio_addon [options]\n\nOptions:\n    -h, --help\n        Display this help and exit.\n\n    -r, --repository https://.../addons\n        Set git repository to load addon from.\n    -b, --branch branch_name\n        Set git branch to load addon from.\n    -l, --local /path/to/repository\n        Load addon from a local folder\n    -s, --slug addon_slug\n        Name of folder/slug\n\n    -a, --arch armhf|aarch64|i386|amd64\n        Arch for addon build.\n    -t, --test\n        Don't upload the build to docker hub.\n    -n, --no-cache\n        Disable build from cache\nEOF\n}\n\n# Parse arguments\nwhile [[ $# -gt 0 ]]; do\n    key=$1\n    case $key in\n        -h|--help)\n            help\n            exit 0\n            ;;\n        -r|--repository)\n            REPOSITORY=$2\n            shift\n            ;;\n        -b|--branch)\n            BRANCH=$2\n            shift\n            ;;\n        -l|--local)\n            LOCAL_REPOSITORY=$2\n            shift\n            ;;\n        -s|--slug)\n            SLUG=$2\n            shift\n            ;;\n        -a|--arch)\n            ARCH=$2\n            shift\n            ;;\n        -t|--test)\n            DOCKER_PUSH=\"false\"\n            ;;\n        -n|--no-cache)\n            DOCKER_CACHE=\"false\"\n            ;;\n        *)\n            echo \"[WARNING] $0 : Argument '$1' unknown. Ignoring.\"\n            ;;\n    esac\n    shift\ndone\n\n# Sanity checks\nif [ \"$ARCH\" != 'armhf' ] && [ \"$ARCH\" != 'aarch64' ] && [ \"$ARCH\" != 'i386' ] && [ \"$ARCH\" != 'amd64' ]; then\n    echo \"Error: $ARCH is not a supported platform for hassio-supervisor!\"\n    help\n    exit 1\nfi\nif [ -z \"$SLUG\" ]; then\n    echo \"[ERROR] please set a slug!\"\n    help\n    exit 1\nfi\n\n# Get the absolute script location\npushd \"$(dirname \"$0\")\" > /dev/null 2>&1\nSCRIPTPATH=$(pwd)\npopd > /dev/null 2>&1\n\nBASE_IMAGE=\"homeassistant\\/$ARCH-base:latest\"\nBUILD_DIR=${BUILD_DIR:=$SCRIPTPATH}\nWORKSPACE=${BUILD_DIR:=$SCRIPTPATH}/hassio-supervisor-$ARCH\nADDON_WORKSPACE=$WORKSPACE/$SLUG\n\n# setup docker\necho \"[INFO] Setup docker for addon\"\nmkdir -p \"$BUILD_DIR\"\nmkdir -p \"$WORKSPACE\"\n\nif [ -z \"$LOCAL_REPOSITORY\" ]; then\n    git clone \"$REPOSITORY\" \"$WORKSPACE\"\n    cd \"$WORKSPACE\"; git checkout \"$BRANCH\"\n\n    if [ ! -d \"$ADDON_WORKSPACE\" ]; then\n        echo \"Error: $ADDON not found inside Repo!\"\n        exit 1\n    fi\nelse\n    cp -r \"$LOCAL_REPOSITORY/$SLUG\" \"$ADDON_WORKSPACE\"\nfi\n\n# Init docker\necho \"[INFO] Setup dockerfile\"\n\nsed -i \"s/{arch}/${ARCH}/g\" \"$ADDON_WORKSPACE/config.json\"\nDOCKER_TAG=$(jq --raw-output \".version\" \"$ADDON_WORKSPACE/config.json\")\nUPSTREAM_VERSION=${DOCKER_TAG%-*}\n\n# If set custom image in file\nDOCKER_IMAGE=$(jq --raw-output \".image // empty\" \"$ADDON_WORKSPACE/config.json\")\n\n# Replace hass.io vars\nsed -i \"s/%%BASE_IMAGE%%/${BASE_IMAGE}/g\" \"$ADDON_WORKSPACE/Dockerfile\"\nsed -i \"s/#${ARCH}:FROM/FROM/g\" \"$ADDON_WORKSPACE/Dockerfile\"\nsed -i \"s/%%ARCH%%/${ARCH}/g\" \"$ADDON_WORKSPACE/Dockerfile\"\nsed -i \"s/%%UPSTREAM_VERSION%%/${UPSTREAM_VERSION}/g\" \"$ADDON_WORKSPACE/Dockerfile\"\necho \"LABEL io.hass.version=\\\"$DOCKER_TAG\\\" io.hass.arch=\\\"$ARCH\\\" io.hass.type=\\\"addon\\\"\" >> \"$ADDON_WORKSPACE/Dockerfile\"\n\n# Run build\necho \"[INFO] start docker build\"\ndocker stop $BUILD_CONTAINER_NAME 2> /dev/null || true\ndocker rm --volumes $BUILD_CONTAINER_NAME 2> /dev/null || true\ndocker run --rm \\\n    -v \"$ADDON_WORKSPACE\":/docker \\\n    -v ~/.docker:/root/.docker \\\n    -e DOCKER_PUSH=$DOCKER_PUSH \\\n    -e DOCKER_CACHE=$DOCKER_CACHE \\\n    -e DOCKER_WITH_LATEST=$DOCKER_WITH_LATEST \\\n    -e DOCKER_IMAGE=\"$DOCKER_IMAGE\" \\\n    -e DOCKER_TAG=\"$DOCKER_TAG\" \\\n    --name $BUILD_CONTAINER_NAME \\\n    --privileged \\\n    homeassistant/docker-build-env \\\n    /run-docker.sh\n\necho \"[INFO] cleanup WORKSPACE\"\ncd \"$BUILD_DIR\"\nrm -rf \"$WORKSPACE\"\n\ncleanup \"okay\"\nexit 0\n"
  },
  {
    "path": "grafana/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nUSER root\n\nENV GOSU_VERSION 1.10\n\nCOPY qemu-arm-static /usr/bin/qemu-arm-static\n\nRUN if [ \"$BUILD_ARCH\" = \"amd64\" ]; then rm /usr/bin/qemu-arm-static; fi\n\nRUN set -ex \\\n && apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n    \t\tjq wget \\\n && dpkgArch=\"$(dpkg --print-architecture | awk -F- '{ print $NF }')\" \\\n && wget -O /usr/local/bin/gosu \"https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch\" \\\n && chmod +x /usr/local/bin/gosu \\\n && apt-get purge -y  --auto-remove wget \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache\n\n\nCOPY run_addon.sh /\nRUN chmod a+x /run_addon.sh\n\n#USER grafana\n\nENTRYPOINT [ \"/run_addon.sh\" ]\n"
  },
  {
    "path": "grafana/README.md",
    "content": "# Grafana addon for hass.io on armhf/amd64\n\nThis 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`.\n\nI have tried to build a grafana addon based on alpine, but failed for lack of phantomjs support.\n\n## env_var (dict)\n\nThis 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/). \n\nFor exemple, to change the instance name:\n``` python\n{\n  \"env_var\": [\n    {\n      \"name\": \"GF_DEFAULT_INSTANCE_NAME\",\n      \"value\": \"my-instance\"\n    }\n  ]\n}\n```\n\nTo install plugins, you can use the `GF_INSTALL_PLUGINS` variable\n``` python\n{\n  \"env_var\": [\n    {\n      \"name\": \"GF_INSTALL_PLUGINS\",\n      \"value\": \"plugin1,plugin2\"\n    }\n  ]\n}\n```\n"
  },
  {
    "path": "grafana/build.json",
    "content": "{\n    \"build_from\": {\n\t\"amd64\" : \"grafana/grafana:6.0.1\",\n\t\"armhf\" : \"grafana/grafana-arm32v7-linux:6.0.1\",\n    \"armv7\" : \"grafana/grafana-arm32v7-linux:6.0.1\",\n    \"aarch64\" : \"grafana/grafana-arm64v8-linux:6.0.1\"\n    }\n}\n"
  },
  {
    "path": "grafana/config.json",
    "content": "{\n    \"name\": \"Grafana Multiarch\",\n    \"version\": \"6.0.1\",\n    \"slug\": \"grafana_multiarch\",\n    \"image\": \"bestlibre/{arch}-grafana\",\n    \"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\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/grafana\",\n    \"startup\": \"system\",    \n    \"map\": [\"ssl\"],\n    \"boot\": \"auto\",\n    \"ports\": {\"3000/tcp\": 3000},\n    \"environment\": {\"GF_PATHS_DATA\":\"/data\", \"GF_PATHS_PLUGINS\":\"/data/plugins\"},\n    \"arch\": [\"armhf\", \"amd64\", \"armv7\", \"aarch64\"],\n    \"options\": {\"env_var\": []},\n    \"schema\": {\"env_var\":[{\"name\": \"str\", \"value\": \"str\"}]},\n    \"webui\": \"http://[HOST]:[PORT:3000]\"\n}\n"
  },
  {
    "path": "grafana/run_addon.sh",
    "content": "#!/bin/bash\nset -e\n\neval $(jq --raw-output '.env_var | .[] | \"export \" + .name + \"=\\\"\" + .value + \"\\\"\"' /data/options.json)\n\nchown -R grafana:grafana /data\n\ngosu grafana /run.sh\n"
  },
  {
    "path": "influxdb/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\nARG BUILD_ARCH\n\nENV LANG C.UTF-8\n\nCOPY qemu-arm-static /usr/bin/qemu-arm-static\nCOPY qemu-aarch64-static /usr/bin/qemu-aarch64-static\n\nRUN if [ \"$BUILD_ARCH\" = \"armhf\" -o \"$BUILD_ARCH\" = \"armv7\" ]; then rm /usr/bin/qemu-aarch64-static;\\\n    elif [ \"$BUILD_ARCH\" = \"aarch64\" ]; then rm /usr/bin/qemu-arm-static;\\\n    else\\\n    rm /usr/bin/qemu-aarch64-static;\\\n    rm /usr/bin/qemu-arm-static;\\\n    fi\nRUN apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n               jq \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache\n\nCOPY influxdb.conf /etc/influxdb/influxdb.conf\n\n# Copy data for add-on\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nEXPOSE 8086\nEXPOSE 8088\nENTRYPOINT [ \"/run.sh\" ]\nCMD [\"influxd\"]"
  },
  {
    "path": "influxdb/README.md",
    "content": "# InfluxDB server for hass.io\n[![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\")\n\n## Description\n\nThis 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/).\n\nThis a wrapper around the [official influxdb image](https://hub.docker.com/_/influxdb/).\n\nThe 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).\n\nTo create the database on first run, you can use the [http api](https://docs.influxdata.com/influxdb/v1.3/guides/writing_data/) : \n```\ncurl -i -XPOST http://hassio.local:8086/query --data-urlencode \"q=CREATE DATABASE home_assistant\"\n```\nIf this doesn't work, try to replace ̀hassio.local` with your hassio IP.\n\n## Configuration\n\n### env_var (dict)\n\nThis 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). \n\nFor exemple, to enable authentication :\n``` python\n{\"env_var\": [{\"name\": \"INFLUXDB_HTTP_AUTH_ENABLED\", \"value\": \"true\"}]}\n```\n"
  },
  {
    "path": "influxdb/build.json",
    "content": "{\n    \"build_from\": {\n\t\"armhf\" : \"arm32v7/influxdb:1.7.4\",\n\t\"armv7\" : \"arm32v7/influxdb:1.7.4\",\n\t\"aarch64\": \"arm64v8/influxdb:1.7.4\",\n\t\"amd64\" : \"amd64/influxdb:1.7.4\"\n    }\n}\n"
  },
  {
    "path": "influxdb/config.json",
    "content": "{\n    \"name\": \"InfluxDb\",\n    \"version\": \"1.7.4\",\n    \"slug\": \"influxdb\",\n    \"description\": \"InfluxDb server\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/influxdb\",\n    \"startup\": \"system\",\n    \"map\": [\"ssl\"],\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-influxdb\",\n    \"options\": {\n        \"env_var\": [{\n            \"name\": \"INFLUXDB_BIND_ADDRESS\",\n            \"value\": \":8088\"\n        }]\n    },\n    \"schema\": {\"env_var\":[{\"name\": \"str\", \"value\": \"str\"}]},\n    \"ports\": {\"8086/tcp\": 8086, \"8088/tcp\": 8088},\n    \"arch\": [\"armhf\", \"amd64\", \"aarch64\", \"armv7\"]\n}\n"
  },
  {
    "path": "influxdb/influxdb.conf",
    "content": "[meta]\n  dir = \"/data/influxdb/meta\"\n\n[data]\n  dir = \"/data/influxdb/data\"\n  engine = \"tsm1\"\n  wal-dir = \"/data/influxdb/wal\"\n"
  },
  {
    "path": "influxdb/run.sh",
    "content": "#!/bin/bash\nset -e\neval $(jq --raw-output '.env_var | .[] | \"export \" + .name + \"=\\\"\" + .value + \"\\\"\"' /data/options.json)\n\n/entrypoint.sh \"$@\"\n"
  },
  {
    "path": "kanboard/Dockerfile",
    "content": "FROM %%BASE_IMAGE%%\n\nENV LANG C.UTF-8\n\nENV KANBOARD_VERSION 1.0.44\n\n# Add Tini\nENV TINI_VERSION v0.14.0\nADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-%%ARCH%% /tini\nRUN chmod +x /tini\n\nENTRYPOINT [\"/tini\", \"--\"]\n\nRUN apk add -U --no-cache --virtual .build-deps unzip wget\\\n && 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 \\\n && cd /tmp \\\n && wget https://kanboard.net/kanboard-${KANBOARD_VERSION}.zip \\\n && unzip -d /var/www/ kanboard-${KANBOARD_VERSION}.zip \\\n && rm kanboard-${KANBOARD_VERSION}.zip \\\n && apk del .build-deps \\\n && echo \"daemon off;\" >> /etc/nginx/nginx.conf \\\n && rm /etc/nginx/conf.d/* \\\n && mkdir -p /run/nginx\n\nCOPY config.php /var/www/kanboard/\nCOPY kanboard.conf /etc/nginx/conf.d/\n\n# Copy data for add-on\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nEXPOSE 80\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "kanboard/config.json",
    "content": "{\n    \"name\": \"Kanboard\",\n    \"version\": \"1.0.44\",\n    \"slug\": \"kanboard\",\n    \"description\": \"Kanboard\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/kanboard\",\n    \"startup\": \"after\",\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-kanboard\",\n    \"options\": {},\n    \"schema\": {},\n    \"ports\": {\"80/tcp\": 3380}\n}\n"
  },
  {
    "path": "kanboard/run.sh",
    "content": "#!/bin/bash\nset -e\n\nmkdir -p /data/data /data/plugins\nchown -R nobody:nobody /data/data /data/plugins\n\nphp-fpm7\nnginx\n"
  },
  {
    "path": "mopidy/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nENV LANG C.UTF-8\n\n#Install mopidy\n\nRUN set -ex \\\n    # Official Mopidy install for Debian/Ubuntu along with some extensions\n    # (see https://docs.mopidy.com/en/latest/installation/debian/ )\n && apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n\tbuild-essential \\\n        curl \\\n        gcc \\\n\tgstreamer1.0-alsa \\\n\tgstreamer1.0-fluendo-mp3 \\\n\tgstreamer1.0-libav \\\n\tlibxml2-dev \\\n\tlibxslt-dev \\\n\tlibz-dev \\\n\tjq \\\n\tpython-crypto \\\n\tpython-dev \\\n && curl -L https://apt.mopidy.com/mopidy.gpg -o /tmp/mopidy.gpg \\\n && curl -L https://apt.mopidy.com/mopidy.list -o /etc/apt/sources.list.d/mopidy.list \\\n && apt-key add /tmp/mopidy.gpg \\\n && apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        jq mopidy mopidy-spotify mopidy-local-sqlite \\\n && curl -L https://bootstrap.pypa.io/get-pip.py | python - \\\n && pip install -U six oauth2client pyasn1 \\\n && pip install \\\n\tMopidy-Moped \\\n        Mopidy-GMusic \\\n\tMopidy-Iris \\\n && apt-get purge --auto-remove -y \\\n        curl \\\n        gcc \\\n\tbuild-essential \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache\n\n\nCOPY mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf\n\n# Copy data for add-on\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nEXPOSE 6600 6680\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "mopidy/README.md",
    "content": "# Mopidy addon for hass.io\n\n[![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\")\n\n## Audio player for Home Assistant\n\nThis addon for hass.io add audio playing capability to the host.\nMopidy is built with those extensions :\n\n- Mopidy-Moped\n- Mopidy-GMusic\n- Mopidy-Local-SQLite\n- Mopidy-Spotify\n- Mopidy-Iris\n\nThe 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.\n\nMopidy listen on `6680` for http connection, and `6600` for mpd ones.\n\nThis is a debian based addon since mopidy-spotify is not compatible with alpine.\n\n## Configuration\n### local_scan (bool)\nIf it is set to true, a local scan is performed on startup.\n\n### options (list of dict)\n\nThe base configuration contains only :\n````\n[core]\ncache_dir = /data/mopidy/cache\ndata_dir = /data/mopidy/data_dir\n\n[local]\nmedia_dir = /share/mopidy/media\nlibrary = sqlite\n\n[m3u]\nplaylists_dir = /share/mopidy/playlists\n\n[http]\nhostname = 0.0.0.0\n\n[mpd]\nhostname = 0.0.0.0\n\n````\n\nTo 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.\nThey will be added on the mopidy call as -o name=value\nFor exemple, to overwrite the media configuration to use share,\n````\n{\"name\": \"local/media_dir\", \"value\": \"/share/media\"}\n````\nwill become\n````\n-o local/media_dir=/share/media\n````\n\n## Google Music support\nTo get the GMusic addon working add this to your options section:\n````\n{\n   \"name\": \"gmusic/username\",\n   \"value\": \"YourUserName\"\n},\n{\n\t\"name\": \"gmusic/password\",\n\t\"value\": \"ApplicationPassword\"\n}\n````\n\nYou can generate your application password as described [here](https://support.google.com/accounts/answer/185833?hl=en).\n\nOther options are available, check [the official doc](https://github.com/mopidy/mopidy-gmusic#configuration) for the complete list\n\n## Spotify Support\nTo 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:\n````\n{\n   \"name\": \"spotify/username\",\n   \"value\": \"YourUserName\"\n},\n{\n\t\"name\": \"spotify/password\",\n\t\"value\": \"ApplicationPassword\"\n}\n````\nThe following configuration values are available:\n````\nspotify/enabled: If the Spotify extension should be enabled or not. Defaults to true.\nspotify/username: Your Spotify Premium username. You must provide this.\nspotify/password: Your Spotify Premium password. You must provide this.\nspotify/client_id: Your Spotify application client id. You must provide this.\nspotify/client_secret: Your Spotify application secret key. You must provide this.\nspotify/bitrate: Audio bitrate in kbps. 96, 160, or 320. Defaults to 160.\nspotify/volume_normalization: Whether volume normalization is active or not. Defaults to true.\nspotify/timeout: Seconds before giving up waiting for search results, etc. Defaults to 10.\nspotify/allow_cache: Whether to allow caching. The cache is stored in a \"spotify\" directory within Mopidy's core/cache_dir. Defaults to true.\nspotify/allow_network: Whether to allow network access or not. Defaults to true.\nspotify/allow_playlists: Whether or not playlists should be exposed. Defaults to true.\nspotify/search_album_count: Maximum number of albums returned in search results. Number between 0 and 50. Defaults to 20.\nspotify/search_artist_count: Maximum number of artists returned in search results. Number between 0 and 50. Defaults to 10.\nspotify/search_track_count: Maximum number of tracks returned in search results. Number between 0 and 50. Defaults to 50.\nspotify/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.\nspotify/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.\n````\n\n## Complete example\nThis a working configuration example, with Google Music and local scan.\n\n````\n{\n  \"local_scan\": true,\n  \"options\": [\n    {\n      \"name\": \"local/media_dir\",\n      \"value\": \"/share/mopidy/media\"\n    },\n    {\n      \"name\": \"m3u/playlists_dir\",\n      \"value\": \"/share/mopidy/playlists/\"\n    },\n    {\n      \"name\": \"gmusic/username\",\n      \"value\": \"MYUSER\"\n    },\n    {\n      \"name\": \"gmusic/password\",\n      \"value\": \"MYPASSWORD\"\n    }\n  ]\n}\n````\n"
  },
  {
    "path": "mopidy/build.json",
    "content": "{\n    \"build_from\": {\n\t\"armhf\" : \"bestlibre/armhf-debian-base:stretch\",\n    \"armv7\" : \"bestlibre/armhf-debian-base:stretch\",\n\t\"aarch64\": \"bestlibre/aarch64-debian-base:stretch\",\n\t\"amd64\" : \"amd64/debian:stretch\",\n\t\"i386\" : \"i386/debian:stretch\"\n    }\n}\n"
  },
  {
    "path": "mopidy/config.json",
    "content": "{\n    \"name\": \"Mopidy\",\n    \"version\": \"0.2.7\",\n    \"slug\": \"mopidy\",\n    \"description\": \"mopidy music server\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/mopidy\",\n    \"startup\": \"application\",\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-mopidy\",\n    \"audio\": true,\n    \"options\": {\"local_scan\": true,\n\t        \"options\": []},\n    \"schema\": {\n\t\"local_scan\": \"bool?\",\n\t\"options\": [{\"name\": \"str\", \"value\": \"str\"}]\n    },\n    \"devices\": [\"/dev/snd:/dev/snd:rwm\"],\n    \"ports\": {\"6680/tcp\": 6680, \"6600/tcp\": 6600},\n    \"map\": [\"share\"],\n    \"webui\": \"http://[HOST]:[PORT:6680]\",\n    \"host_ipc\": true,\n    \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"]\n}\n"
  },
  {
    "path": "mopidy/mopidy.conf",
    "content": "[core]\ncache_dir = /data/mopidy/cache\ndata_dir = /data/mopidy/data_dir\n\n[local]\nmedia_dir = /share/mopidy/media\nlibrary = sqlite\n\n[m3u]\nplaylists_dir = /share/mopidy/playlists\n\n[http]\nhostname = 0.0.0.0\n\n[mpd]\nhostname = 0.0.0.0"
  },
  {
    "path": "mopidy/run.sh",
    "content": "#!/bin/bash\nset -e\n\nlocal_scan=$(cat /data/options.json | jq -r '.local_scan // empty')\noptions=$(cat /data/options.json | jq -r 'if .options then [.options[] | \"-o \"+.name+\"=\"+.value ] | join(\" \") else \"\" end')\nconfig=\"/var/lib/mopidy/.config/mopidy/mopidy.conf\"\n\nif  [ \"$local_scan\" == \"true\" ]; then\n    mopidy --config $config $options local scan\nfi\nmopidy --config $config $options\n"
  },
  {
    "path": "mopidy_alpine/config.json",
    "content": "{\n    \"name\": \"Mopidy\",\n    \"version\": \"0.1.2\",\n    \"slug\": \"mopidy\",\n    \"description\": \"mopidy music server\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/mopidy\",\n    \"startup\": \"application\",\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-mopidy\",\n    \"options\": {\"local_scan\": true},\n    \"schema\": {\n\t\"local_scan\": \"bool\",\n\t\"options\": [{\"name\": \"str\", \"value\": \"str\"}]\n    },\n    \"devices\": [\"/dev/snd:/dev/snd:rwm\"],\n    \"ports\": {\"6680/tcp\": 6680, \"6600/tcp\": 6600},\n    \"map\": [\"share\"],\n    \"webui\": \"http://[HOST]:[PORT:6680]\"\n}\n"
  },
  {
    "path": "mopidy_cast/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM as BUILDER\n\nARG BUILD_VERSION\nARG BUILD_ARCH\nENV SNAPCAST_VERSION 0.15.0\n\nRUN set -ex \\\n && apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        curl jq git build-essential libasound2-dev libvorbisidec-dev libvorbis-dev libflac-dev alsa-utils libavahi-client-dev avahi-daemon \\\n\tbuild-essential debhelper dh-make dh-systemd quilt fakeroot lintian \\\n && cd /tmp/ \\\n && git clone https://github.com/badaix/snapcast.git \\\n && cd snapcast \\\n && git checkout v${SNAPCAST_VERSION} \\\n && cd externals \\\n && git submodule update --init --recursive\nRUN cd /tmp/snapcast/server \\\n && make dpkg \\\n && mv $(ls ../snapserver*.deb) /snapserver.deb\n\nARG BUILD_FROM\nFROM $BUILD_FROM\n\nARG BUILD_ARCH\n\nENV LANG C.UTF-8\nCOPY --from=BUILDER /snapserver.deb /tmp/\n#Install snapcast-server\nRUN set -ex \\\n    # Official Mopidy install for Debian/Ubuntu along with some extensions\n    # (see https://docs.mopidy.com/en/latest/installation/debian/ )\n && apt-get update \\\n && dpkg -i /tmp/snapserver.deb || DEBIAN_FRONTEND=noninteractive apt-get install -f -y\\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache\n\nCOPY mopidy_cast.conf /var/lib/mopidy/.config/mopidy/mopidy_cast.conf\n\n# Copy data for add-on\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nEXPOSE 6600 6680 1704 1705\n\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "mopidy_cast/README.md",
    "content": "# Mopidy addon for hass.io\n\n[![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\")\n\n## Audio player for Home Assistant\n\nThis 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.\n\nMopidy listen on `6681` for http connection, and `6601` for mpd ones.\n"
  },
  {
    "path": "mopidy_cast/build.json",
    "content": "{\n    \"build_from\" : {\n\t\"armhf\" : \"bestlibre/armhf-mopidy\",\n\t\"armv7\" : \"bestlibre/armv7-mopidy\",\n\t\"amd64\" : \"bestlibre/amd64-mopidy\",\n\t\"aarch64\" : \"bestlibre/aarch64-mopidy\",\n\t\"i386\" : \"bestlibre/i386-mopidy\"\n    }\n}\n"
  },
  {
    "path": "mopidy_cast/config.json",
    "content": "{\n    \"name\": \"Mopidy and Snapcast\",\n    \"version\": \"0.2.7\",\n    \"slug\": \"mopidy-cast\",\n    \"description\": \"mopidy music server with snapcast server\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/mopidy_cast\",\n    \"startup\": \"application\",\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-mopidy-cast\",\n    \"options\": {\"local_scan\": true,\n\t        \"options\": []},\n    \"schema\": {\n\t\"local_scan\": \"bool?\",\n\t\"options\": [{\"name\": \"str\", \"value\": \"str\"}]\n    },\n    \"devices\": [],\n    \"ports\": {\"6680/tcp\": 6681, \"6600/tcp\": 6601, \"1704/tcp\": 1704, \"1705/tcp\": 1705},\n    \"map\": [\"share\"],\n    \"arch\": [\"amd64\", \"armhf\", \"armv7\"],\n    \"tmpfs\": \"size=10m,rw\",\n    \"webui\": \"http://[HOST]:[PORT:6681]\",\n    \"host_ipc\": true\n}\n"
  },
  {
    "path": "mopidy_cast/mopidy_cast.conf",
    "content": "[audio]\noutput = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmpfs/snapfifo\n"
  },
  {
    "path": "mopidy_cast/run.sh",
    "content": "#!/bin/bash\nset -e\n\nlocal_scan=$(cat /data/options.json | jq -r '.local_scan // empty')\noptions=$(cat /data/options.json | jq -r 'if .options then [.options[] | \"-o \"+.name+\"=\"+.value ] | join(\" \") else \"\" end')\nconfig=\"/var/lib/mopidy/.config/mopidy/mopidy.conf:/var/lib/mopidy/.config/mopidy/mopidy_cast.conf\"\n\nsnapserver -s pipe:///tmpfs/snapfifo?name=default &\n\nif  [ \"$local_scan\" == \"true\" ]; then\n    mopidy --config $config $options local scan\nfi\nmopidy --config $config $options\n"
  },
  {
    "path": "nextcloud/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\nARG BUILD_ARCH\n\nCOPY qemu-arm-static /usr/bin/qemu-arm-static\nCOPY qemu-aarch64-static /usr/bin/qemu-aarch64-static\n\nRUN if [ \"$BUILD_ARCH\" = \"armhf\" ]; then rm /usr/bin/qemu-aarch64-static;\\\n    elif [ \"$BUILD_ARCH\" = \"aarch64\" ]; then rm /usr/bin/qemu-arm-static;\\\n    else\\\n    rm /usr/bin/qemu-aarch64-static;\\\n    rm /usr/bin/qemu-arm-static;\\\n    fi\n\nRUN apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n    \t\tjq \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache\n\nRUN sed -i \"s|/var/www|/data/www|g\" /etc/apache2/sites-enabled/000-default.conf \\\n && sed -i \"s|/var/www|/data/www|g\" /etc/apache2/apache2.conf \\\n && sed -i \"s|/var/www/html|/data/www/html|g\" /entrypoint.sh \\\n && sed -i \"s|/var/www/html|/data/www/html|g\" /usr/src/nextcloud/config/autoconfig.php\n\nCOPY run_addon.sh /\nRUN chmod a+x /run_addon.sh\n\nENTRYPOINT [ \"/run_addon.sh\" ]\nCMD [\"apache2-foreground\"]\n"
  },
  {
    "path": "nextcloud/build.json",
    "content": "{\n    \"build_from\": {\n\t\"armhf\" : \"arm32v7/nextcloud:12.0.3\",\n\t\"aarch64\": \"arm64v8/nextcloud:12.0.3\",\n\t\"amd64\" : \"amd64/nextcloud:12.0.3\",\n\t\"i386\" : \"i386/nextcloud:12.0.3\"\n    }\n}\n"
  },
  {
    "path": "nextcloud/config.json",
    "content": "{\n    \"name\": \"Nextcloud\",\n    \"version\": \"12.0.3\",\n    \"slug\": \"nextcloud\",\n    \"image\": \"bestlibre/{arch}-nextcloud\",\n    \"description\": \"Nextcloud addon. Image based on upstream docker images. This is just a wrapper to pass environment variable to the container.\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/nextcloud\",\n    \"startup\": \"system\",\n    \"boot\": \"auto\",\n    \"ports\": {\"80/tcp\": null},\n    \"environment\": {},\n    \"map\": [\"share:rw\"],\n    \"options\": {\"env_var\": [{\"name\": \"NEXTCLOUD_DATA_DIR\", \"value\": \"/share/nextcloud/\"}]},\n    \"schema\": {\"env_var\":[{\"name\": \"str\", \"value\": \"str\"}]}\n}"
  },
  {
    "path": "nextcloud/run_addon.sh",
    "content": "#!/bin/bash\nset -e\n\nHTML_DIR=/data/www/html\nif [ ! -d \"${HTML_DIR}\" ]; then\n    mkdir -p \"${HTML_DIR}\" \n    chown -R www-data:root \"${HTML_DIR}\"\n    chmod -R g=u \"${HTML_DIR}\"\nfi\nSHARE_DIR=/share/nextcloud\nif [ ! -d \"${SHARE_DIR}\" ]; then\n    mkdir -p \"${SHARE_DIR}\" \n    chown -R www-data:root \"${SHARE_DIR}\"\n    chmod -R g=u \"${SHARE_DIR}\"\nfi\neval $(jq --raw-output '.env_var | .[] | \"export \" + .name + \"=\\\"\" + .value + \"\\\"\"' /data/options.json)\n\n/entrypoint.sh \"$@\"\n"
  },
  {
    "path": "nginx_proxy/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\n# Add env\nENV LANG C.UTF-8\n\n# Setup base\nRUN apk add --no-cache -U --virtual .build-deps \\\n        build-base \\\n && apk add -U --no-cache \\\n        libressl \\\n        jq \\\n        nginx \\\n        python3 \\\n\t    python3-dev \\\n && pip3 install -U pip \\\n && pip install pystache \\\n && apk del .build-deps\n\n\n# Copy data\nCOPY run.sh /\nCOPY mustache.py /\nCOPY vhost.mustache /templates/\nRUN echo \"daemon off;\" >> /etc/nginx/nginx.conf && \\\n    rm /etc/nginx/conf.d/* && \\\n    mkdir -p /run/nginx\nCOPY commons.conf /etc/nginx/conf.d/\n\nRUN chmod a+x /run.sh\nRUN chmod a+x /mustache.py\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "nginx_proxy/README.md",
    "content": "# Nginx Proxy addon for hass.io\n[![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\")\n\n## Description\n\nThis addon provide an Nginx Proxy with multiple vhost support and optional ssl. \n\n## Configuration\n### vhosts (list)\n\nThis list describe all the virtual host to be proxified.\n\n#### vhost (string)\n\nFull hostname (ie homeassistant.domain.tld)\n\n#### port (string)\n\nInternal port (ie 8123 for homeassistant)\n\n#### default_server (bool)\n\nConfigure this vhost to be the default is set to true. Must only be used once.\n\n#### remote (str)\n\nIp or url for the proxified server. If not set default to 172.17.0.1 (docker host).\n\n#### remote_ssl (bool)\n\nIf http or https should be used for the proxified server. Defaults to http.\n\n#### auth (str)\n\nEnables HTTP basic auth for a single user on a vhost. The string is dumped\ndirectly to a file and used as the auth_basic_user_file. See the documentation\nfor\n[auth_basic_user_file](http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic_user_file)\non how to format the value.\n\n#### certname (str)\nIf not set, only http is proxified. If set, the template used for the vhosts force https. \n\nThe key and certchain must be located in\n`/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).\n\n#### ssl_modern (bool)\nIf 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.\n\n## Usage example\nI 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 :\n\n### nginx proxy :\n````\n{\n  \"vhosts\": [\n    {\n      \"vhost\": \"sub1.redacted.tld\",\n      \"default_server\": true,\n      \"certname\": \"rpi\",\n      \"port\": \"8123\"\n    },\n    {\n      \"vhost\": \"sub2.redacted.tld\",\n      \"port\": \"3380\",\n      \"default_server\": false,\n      \"certname\": \"rpi\"\n    },\n    {\n      \"vhost\": \"sub3.redacted.tld\",\n      \"certname\": \"rpi\",\n      \"port\": \"3000\"\n    },\n    {\n      \"remote\": \"192.168.0.2\",\n      \"vhost\": \"sub4.redacted.tld\",\n      \"certname\": \"nas\",\n      \"port\": \"443\"\n    }\n  ]\n}\n````\n### certbot :\n````\n{\n  \"email\": \"contact@redacted.tld\",\n  \"certificats\": [\n    {\n      \"domains\": \"sub1.redacted.tld,sub2.redacted.tld,sub3.redacted.tld\",\n      \"name\": \"rpi\"\n    },\n    {\n      \"domains\": \"sub3.redacted.tld\",\n      \"name\": \"nas\"\n    }\n  ],\n  \"ssl_only\": false\n}\n````\n"
  },
  {
    "path": "nginx_proxy/build.json",
    "content": "{\n    \"build_from\": {\n        \"amd64\": \"homeassistant/amd64-base-python:3.7\",\n        \"i386\": \"homeassistant/i386-base-python:3.7\",\n        \"armhf\": \"homeassistant/armhf-base-python:3.7\",\n        \"armv7\": \"homeassistant/armhf-base-python:3.7\",\n        \"aarch64\": \"homeassistant/aarch64-base-python:3.7\"\n    }\n}"
  },
  {
    "path": "nginx_proxy/commons.conf",
    "content": "# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the\n# scheme used to connect to this server\nmap $http_x_forwarded_proto $proxy_x_forwarded_proto {\n  default $http_x_forwarded_proto;\n  ''      $scheme;\n}\n\n# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the\n# server port the client connected to\nmap $http_x_forwarded_port $proxy_x_forwarded_port {\n  default $http_x_forwarded_port;\n  ''      $server_port;\n}\n\n# If we receive Upgrade, set Connection to \"upgrade\"; otherwise, delete any\n# Connection header that may have been passed to this server\nmap $http_upgrade $proxy_connection {\n  default upgrade;\n  '' close;\n}\n\n# Set appropriate X-Forwarded-Ssl header\nmap $scheme $proxy_x_forwarded_ssl {\n  default off;\n  https on;\n}\n\ngzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;\n\naccess_log off;\n\n# HTTP 1.1 support\nproxy_http_version 1.1;\nproxy_buffering off;\nproxy_set_header Host $http_host;\nproxy_set_header Upgrade $http_upgrade;\nproxy_set_header Connection $proxy_connection;\nproxy_set_header X-Real-IP $remote_addr;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\nproxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;\nproxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;\nproxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;\n\n# Mitigate httpoxy attack (see README for details)\nproxy_set_header Proxy \"\";\n\n# support long domain names\nserver_names_hash_bucket_size 64;\n"
  },
  {
    "path": "nginx_proxy/config.json",
    "content": "{\n  \"name\": \"Nginx Proxy\",\n  \"version\": \"0.1.14\",\n  \"slug\": \"nginx_proxy\",\n  \"description\": \"Nginx Proxy for multiple VHOSTS\",\n  \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/nginx_proxy\",\n  \"startup\": \"system\",\n  \"boot\": \"auto\",\n  \"image\": \"bestlibre/{arch}-nginx-proxy\",\n  \"options\": {\n    \"vhosts\":[\n      {\"vhost\": \"homeassistant.domain.tld\",\n       \"port\": \"8123\",\n       \"default_server\": true}\n    ]\n  },\n  \"schema\": {\n    \"vhosts\": [\n      {\"vhost\": \"str\",\n       \"remote\": \"str?\",\n       \"remote_ssl\": \"bool?\",\n       \"port\": \"str\",\n       \"default_server\": \"bool?\",\n       \"certname\": \"str?\",\n       \"ssl_modern\": \"bool?\",\n       \"auth\": \"str?\",\n       \"max_body_size\": \"str?\",\n       \"x-ha-access\": \"str?\"\n      }\n    ]\n  },\n  \"ports\": {\"80/tcp\": 80, \"443/tcp\": 443},\n  \"map\": [\"ssl\"],\n  \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"]\n}\n"
  },
  {
    "path": "nginx_proxy/mustache.py",
    "content": "#!/bin/python3\nimport pystache\nimport argparse\nimport json\nimport sys\n\n\ndef render(template, data):\n    if data == '-':\n        context = json.load(sys.stdin)\n    else:\n        with open(data, 'r') as f:\n            context = json.load(f)\n    for vhost in context.get('vhosts'):\n        if vhost.get('paths'):\n            l = [{'path': line} for line in vhost.get('paths')]\n            vhost['paths'] = l\n\n    if context.get('raw_config'):\n        l = [{'line': line} for line in context.get('raw_config')]\n        context['raw_config'] = l\n    renderer = pystache.Renderer(escape=lambda u: u)\n    print(renderer.render_path(template, context))\n\n\nif __name__ == '__main__':\n    parser = argparse.ArgumentParser()\n    parser.add_argument('template')\n    parser.add_argument('data')\n    args = parser.parse_args()\n    render(args.template, args.data)\n"
  },
  {
    "path": "nginx_proxy/run.sh",
    "content": "#!/bin/bash\nset -e\noptions=\"/data/options.json\"\nssl=$(jq -r '[.vhosts[] | .certname // empty] | if length > 0 then \"true\" else \"false\" end' $options)\nif [ \"$ssl\" == \"true\" ]; then\n    if [ ! -e /data/dhparam.pem ]; then\n        openssl dhparam -dsaparam -out /data/dhparam.pem 4096\n    fi\nfi\n\nauths=$(jq -r '.vhosts[] | if .auth then .vhost + \" \" + .auth else empty end' $options)\necho \"$auths\" | while read -r vhost auth; do\n    echo \"$auth\" >\"/data/auth_$vhost\"\ndone\n\npython3 /mustache.py /templates/vhost.mustache /data/options.json > /etc/nginx/conf.d/vhosts.conf\n\n# forward request and error logs to docker log collector\nln -sf /dev/stdout /var/log/nginx/access.log\nln -sf /dev/stderr /var/log/nginx/error.log\nnginx\n"
  },
  {
    "path": "nginx_proxy/vhost.mustache",
    "content": "{{#vhosts}}\nserver {\n    server_name {{vhost}};\n    listen 80 {{#default_server}}default_server{{/default_server}};\n    listen [::]:80 {{#default_server}}default_server{{/default_server}};\n\n    location ~ /.well-known {\n        allow all;\n        auth_basic off;\n        root /ssl/wk/;\n    }\n{{#certname}}\n\n    location / {\n        return 301 https://$host$request_uri;\n    }\n}\n\nserver {\n    server_name {{vhost}};\n    listen 443 ssl http2 {{#default_server}}default_server{{/default_server}};\n    listen [::]:443 ssl http2 {{#default_server}}default_server{{/default_server}};\n\n    ssl_session_timeout 1d;\n    #ssl_session_cache shared:SSL:50m;\n    ssl_session_tickets off;\n\n    ssl_prefer_server_ciphers on;\n\n    # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)\n    add_header Strict-Transport-Security max-age=15768000;\n\n    # OCSP Stapling ---\n    # fetch OCSP records from URL in ssl_certificate and cache them\n    ssl_stapling on;\n    ssl_stapling_verify on;\n\n{{^ssl_modern}}\n    # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits\n    ssl_dhparam /data/dhparam.pem;\n\n    # intermediate configuration. tweak to your needs.\n    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\n    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';\n{{/ssl_modern}}\n{{#ssl_modern}}\n    # modern configuration. tweak to your needs.\n    ssl_protocols TLSv1.2;\n    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';\n{{/ssl_modern}}\n    ## verify chain of trust of OCSP response using Root CA and Intermediate certs\n    ssl_trusted_certificate /ssl/letsencrypt/live/{{certname}}/chain.pem;\n    ssl_certificate /ssl/letsencrypt/live/{{certname}}/fullchain.pem;\n    ssl_certificate_key /ssl/letsencrypt/live/{{certname}}/privkey.pem;\n\n\n    location ~ /.well-known {\n        allow all;\n        root /ssl/wk/;\n    }\n{{/certname}}\n\n    {{#auth}}\n    auth_basic \"password protected\";\n    auth_basic_user_file /data/auth_{{vhost}};\n    {{/auth}}\n    {{#max_body_size}}\n    client_max_body_size {{max_body_size}};\n    {{/max_body_size}}\n    location / {\n        proxy_pass {{#remote_ssl}}https{{/remote_ssl}}{{^remote_ssl}}http{{/remote_ssl}}://{{#remote}}{{remote}}{{/remote}}{{^remote}}172.17.0.1{{/remote}}:{{port}};\n        {{#x-ha-access}}proxy_set_header x-ha-access \"{{x-ha-access}}\";{{/x-ha-access}}\n    }\n}\n{{/vhosts}}\n"
  },
  {
    "path": "owserver/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nENV LANG C.UTF-8\n\nRUN set -ex \\\n && apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n                owserver \\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache \\\n && update-rc.d owserver disable\n\n\n# Copy data for add-on\nCOPY owfs.conf /etc/owfs.conf\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nEXPOSE 4304\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "owserver/README.md",
    "content": "# one wire server\n[![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\")\n\nAddon 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.\n\nI'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))\n"
  },
  {
    "path": "owserver/build.json",
    "content": "{\n    \"build_from\": {\n\t\"armhf\" : \"bestlibre/armhf-debian-base:stretch\",\n    \"armv7\" : \"bestlibre/armhf-debian-base:stretch\",\n\t\"aarch64\": \"bestlibre/aarch64-debian-base:stretch\",\n\t\"amd64\" : \"debian:stretch\",\n\t\"i386\" : \"i386/debian:stretch\"\n    }\n}\n"
  },
  {
    "path": "owserver/config.json",
    "content": "{\n    \"name\": \"1-wire Server\",\n    \"version\": \"0.1.1\",\n    \"slug\": \"owserver\",\n    \"description\": \"One wire server\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/owserver\",\n    \"startup\": \"system\",\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-owserver\",\n    \"options\": {},\n    \"schema\": {},\n    \"devices\": [\"/dev/i2c-1:/dev/i2c-1:rwm\"],\n    \"ports\": {\"4304/tcp\": null},\n    \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"]\n}\n"
  },
  {
    "path": "owserver/owfs.conf",
    "content": "######################## SOURCES ########################\n#\n# With this setup, any client (but owserver) uses owserver on the\n# local machine...\n! server: server = localhost:4304\n#\n# ...and owserver uses the real hardware, by default fake devices\n# This part must be changed on real installation\n\nserver: device = /dev/i2c-1\n\n####################### OWSERVER ########################\n\nserver: port = *:4304\n\n"
  },
  {
    "path": "owserver/run.sh",
    "content": "#!/bin/bash\nset -e\n\nowserver -c /etc/owfs.conf --foreground\n"
  },
  {
    "path": "passbolt/Dockerfile",
    "content": "FROM %%BASE_IMAGE%%\n\nENV PASSBOLT_VERSION %%UPSTREAM_VERSION%%\nENV PASSBOLT_URL https://github.com/passbolt/passbolt_api/archive/v${PASSBOLT_VERSION}.tar.gz\n\nARG BASE_PHP_DEPS=\"php5-curl \\\n      php5-common \\\n      php5-gd \\\n      php5-intl \\\n      php5-json \\\n      php5-mcrypt \\\n      php5-mysql \\\n      php5-xsl \\\n      php5-fpm \\\n      php5-phar \\\n      php5-posix \\\n      php5-xml \\\n      php5-openssl \\\n      php5-zlib \\\n      php5-ctype \\\n      php5-pdo \\\n      php5-pdo_mysql \\\n      php5-pear\"\n\nARG PHP_GNUPG_DEPS=\"php5-dev \\\n      make \\\n      gcc \\\n      g++ \\\n      libc-dev \\\n      pkgconfig \\\n      re2c \\\n      gpgme-dev \\\n      autoconf \\\n      zlib-dev \\\n      file\"\n\nRUN apk add --no-cache $BASE_PHP_DEPS \\\n      sed \\\n      tar \\\n      bash \\\n      curl \\\n      nginx \\\n      gpgme \\\n      gnupg1 \\\n      recode \\\n      libxml2 \\\n      openssl \\\n      libpcre32 \\\n      mysql-client \\\n      ca-certificates \\\n      jq\n\nRUN apk add --no-cache $PHP_GNUPG_DEPS  \\\n    && ln -s /usr/bin/php5 /usr/bin/php \\\n    && ln -s /usr/bin/phpize5 /usr/bin/phpize \\\n    #https://bugs.alpinelinux.org/issues/5378\n    && sed -i \"s/ -n / /\" $(which pecl) \\\n    && pecl install gnupg memcache \\\n    && echo \"extension=memcache.so\" > /etc/php5/conf.d/memcache.ini \\\n    && echo \"extension=gnupg.so\" > /etc/php5/conf.d/gnupg.ini \\\n    && apk del $PHP_GNUPG_DEPS \\\n    && curl -sS https://getcomposer.org/installer | php \\\n    && mv composer.phar /usr/local/bin/composer \\\n    && mkdir /var/www/passbolt \\\n    && curl -sSL $PASSBOLT_URL | tar zxf - -C /var/www/passbolt --strip-components 1 \\\n    && chown -R nginx:nginx /var/www/passbolt \\\n    && chmod -R +w /var/www/passbolt/app/tmp \\\n    && chmod +w /var/www/passbolt/app/webroot/img/public\n\nCOPY conf/passbolt.conf /etc/nginx/conf.d/default.conf\nCOPY bin/docker-entrypoint.sh /docker-entrypoint.sh\n\nEXPOSE 80 443\n\nCMD [\"/docker-entrypoint.sh\"]\n"
  },
  {
    "path": "passbolt/LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<http://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "passbolt/bin/docker-entrypoint.sh",
    "content": "#!/bin/bash\n\nset -eo pipefail\n\n#GnuPG key creation related variables\nKEY_LENGTH=$(jq -r '.key_length // empty' /data/options.json)\nSUBKEY_LENGTH=$(jq -r '.subkey_length // empty' /data/options.json)\nKEY_NAME=$(jq -r '.key_name // empty' /data/options.json)\nKEY_EMAIL=$(jq -r '.key_email // empty' /data/options.json)\nKEY_EXPIRATION=$(jq -r '.key_expiration // empty' /data/options.json)\n\n#App file variables\n\nFINGERPRINT=$(jq -r '.fingerprint // empty' /data/options.json)\nREGISTRATION=$(jq -r '.registration // empty' /data/options.json)\nSSL=$(jq -r 'if .ssl? then \"true\" else \"false\" end' /data/options.json)\n\n#Core file variables\n\nSALT=$(jq -r '.salt // empty' /data/options.json)\nCIPHERSEED=$(jq -r '.cipherssed // empty' /data/options.json)\nURL=$(jq -r '.url // empty' /data/options.json)\n\n#Database variables\n\nDB_HOST=$(jq -r '.db_host // empty' /data/options.json)\nDB_PORT=$(jq -r '.db_port // empty' /data/options.json)\nDB_USER=$(jq -r '.db_user // empty' /data/options.json)\nDB_PASS=$(jq -r '.db_pass // empty' /data/options.json)\nDB_NAME=$(jq -r '.db_name // empty' /data/options.json)\n\n#Email variables\n\nEMAIL_TRANSPORT=$(jq -r '.email_transport // empty' /data/options.json)\nEMAIL_FROM=$(jq -r '.email_from // empty' /data/options.json)\nEMAIL_HOST=$(jq -r '.email_host // empty' /data/options.json)\nEMAIL_PORT=$(jq -r '.email_port // empty' /data/options.json)\nEMAIL_TIMEOUT=$(jq -r '.email_timeout // empty' /data/options.json)\nEMAIL_USERNAME=$(jq -r '.email_username // empty' /data/options.json)\nEMAIL_PASSWORD=$(jq -r '.email_password // empty' /data/options.json)\nEMAIL_TLS=$(jq -r '.email_tls // empty' /data/options.json)\n\nSSL_KEY=$(jq -r '.ssl_key // \"/data/ssl/certificate.key\"' /data/options.json)\nSSL_CERT=$(jq -r '.ssl_cert // \"/data/ssl/certificate.crt\"' /data/options.json)\n\ngpg_private_key=/data/gpg/serverkey.private.asc\ngpg_public_key=/data/gpg/serverkey.asc\ngpg=$(which gpg)\n\ncore_config='/var/www/passbolt/app/Config/core.php'\ndb_config='/var/www/passbolt/app/Config/database.php'\napp_config='/var/www/passbolt/app/Config/app.php'\nemail_config='/var/www/passbolt/app/Config/email.php'\nssl_key='/etc/ssl/certs/certificate.key'\nssl_cert='/etc/ssl/certs/certificate.crt'\n\ngpg_gen_key() {\n  su -m -c \"$gpg --batch --gen-key <<EOF\n    Key-Type: 1\n\t\tKey-Length: ${KEY_LENGTH:-2048}\n\t\tSubkey-Type: 1\n\t\tSubkey-Length: ${SUBKEY_LENGTH:-2048}\n\t\tName-Real: ${KEY_NAME:-Passbolt default user}\n\t\tName-Email: ${KEY_EMAIL:-passbolt@yourdomain.com}\n\t\tExpire-Date: ${KEY_EXPIRATION:-0}\n\t\t%commit\nEOF\" -ls /bin/bash nginx\n\n  su -m -c \"$gpg --armor --export-secret-keys $KEY_EMAIL > $gpg_private_key\" -ls /bin/bash nginx\n  su -m -c \"$gpg --armor --export $KEY_EMAIL > $gpg_public_key\" -ls /bin/bash nginx\n}\n\ngpg_import_key() {\n\n  local key_id=$(su -m -c \"gpg --with-colons $gpg_private_key | grep sec |cut -f5 -d:\" -ls /bin/bash nginx)\n\n  su -m -c \"$gpg --batch --import $gpg_public_key\" -ls /bin/bash nginx\n  su -m -c \"gpg -K $key_id\" -ls /bin/bash nginx || su -m -c \"$gpg --batch --import $gpg_private_key\" -ls /bin/bash nginx\n}\n\ncore_setup() {\n  #Env vars:\n  # SALT\n  # CIPHERSEED\n  # URL\n\n  local default_salt='DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi'\n  local default_seed='76859309657453542496749683645'\n  local default_url='passbolt.local'\n\n  cp $core_config{.default,}\n  sed -i s:$default_salt:${SALT:-$default_salt}:g $core_config\n  sed -i s:$default_seed:${CIPHERSEED:-$default_seed}:g $core_config\n  sed -i \"/example.com/ s:\\/\\/::\" $core_config\n  sed -i s:example.com:${URL:-$default_url}:g $core_config\n  #if [ \"$SSL\" != false ]; then\n    sed -i s:http:https:g $core_config\n  #fi\n}\n\ndb_setup() {\n  #Env vars:\n  # DB_HOST\n  # DB_USER\n  # DB_PASS\n  # DB_NAME\n\n  local default_host='localhost'\n  local default_user='user'\n  local default_pass='password'\n  local default_db='database_name'\n\n  cp $db_config{.default,}\n  sed -i \"/$default_host/a\\ \\t\\t'port' => '${DB_PORT:-3306}',\" $db_config\n  sed -i s:$default_host:${DB_HOST:-db}:g $db_config\n  sed -i s:$default_user:${DB_USER:-passbolt}:g $db_config\n  sed -i s:$default_pass\\',:${DB_PASS:-P4ssb0lt}\\',:g $db_config\n  sed -i s:$default_db:${DB_NAME:-passbolt}:g $db_config\n}\n\napp_setup() {\n  #Env vars:\n  # FINGERPRINT\n  # REGISTRATION\n  # SSL\n\n  local default_home='/home/www-data/.gnupg'\n  local default_public_key='unsecure.key'\n  local default_private_key='unsecure_private.key'\n  local default_fingerprint='2FC8945833C51946E937F9FED47B0811573EE67E'\n  local gpg_home='/var/lib/nginx/.gnupg'\n  local auto_fingerprint=$(su -m -c \"$gpg --fingerprint |grep fingerprint| awk '{for(i=4;i<=NF;++i)printf \\$i}'\" -ls /bin/bash nginx)\n\n  cp $app_config{.default,}\n  sed -i s:$default_home:$gpg_home:g $app_config\n  sed -i s:$default_public_key:serverkey.asc:g $app_config\n  sed -i s:$default_private_key:serverkey.private.asc:g $app_config\n  sed -i s:$default_fingerprint:${FINGERPRINT:-$auto_fingerprint}:g $app_config\n  sed -i \"/force/ s:true:${SSL:-true}:\" $app_config\n  sed -i \"/'registration'/{n; s:false:${REGISTRATION:-false}:}\" $app_config\n}\n\nemail_setup() {\n  #Env vars:\n  # EMAIL_TRANSPORT\n  # EMAIL_FROM\n  # EMAIL_HOST\n  # EMAIL_PORT\n  # EMAIL_TIMEOUT\n  # EMAIL_USERNAME\n  # EMAIL_PASSWORD\n  # EMAIL_TLS\n\n  local default_transport='Smtp'\n  local default_from='contact@passbolt.com'\n  local default_host='smtp.mandrillapp.com'\n  local default_port='587'\n  local default_timeout='30'\n  local default_username=\"''\"\n  local default_password=\"''\"\n\n  cp $email_config{.default,}\n  sed -i s:$default_transport:${EMAIL_TRANSPORT:-Smtp}:g $email_config\n  sed -i s:$default_from:${EMAIL_FROM:-contact@mydomain.local}:g $email_config\n  sed -i s:$default_host:${EMAIL_HOST:-localhost}:g $email_config\n  sed -i s:$default_port:${EMAIL_PORT:-587}:g $email_config\n  sed -i s:$default_timeout:${EMAIL_TIMEOUT:-30}:g $email_config\n  sed -i \"0,/\"$default_username\"/s:\"$default_username\":'${EMAIL_USERNAME:-email_user}':\" $email_config\n  sed -i \"0,/\"$default_password\"/s:\"$default_password\":'${EMAIL_PASSWORD:-email_password}':\" $email_config\n  sed -i \"0,/tls/s:false:${EMAIL_TLS:-false}:\" $email_config\n\n}\n\ngen_ssl_cert() {\n  openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \\\n    -subj \"/C=FR/ST=Denial/L=Springfield/O=Dis/CN=www.passbolt.local\" \\\n    -keyout $SSL_KEY -out $SSL_CERT\n}\n\ninstall() {\n  local database_host=${DB_HOST:-$(cat $db_config | grep -m1 \"'host'\" | sed -r \"s/\\s*'host' => '(.*)',/\\1/\")}\n  local database_port=${DB_PORT:-$(cat $db_config | grep -m1 \"'port' => '\\d\" | sed -r \"s/\\s*'port' => '(.*)',/\\1/\")}\n  local database_user=${DB_USER:-$(cat $db_config | grep -m1 \"'login'\" | sed -r \"s/\\s*'login' => '(.*)',/\\1/\")}\n  local database_pass=${DB_PASS:-$(cat $db_config | grep -m1 \"'password'\" | sed -r \"s/\\s*'password' => '(.*)',/\\1/\")}\n  local database_name=${DB_NAME:-$(cat $db_config | grep -m1 \"'database'\" | sed -r \"s/\\s*'database' => '(.*)',/\\1/\")}\n  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)\n\n  if [ $tables -eq 0 ]; then\n    su -c \"/var/www/passbolt/app/Console/cake install --send-anonymous-statistics true --no-admin\" -ls /bin/bash nginx\n  else\n    echo \"Enjoy! ☮\"\n  fi\n}\n\nphp_fpm_setup() {\n  sed -i '/^user\\s/ s:nobody:nginx:g' /etc/php5/php-fpm.conf\n  sed -i '/^group\\s/ s:nobody:nginx:g' /etc/php5/php-fpm.conf\n  cp /etc/php5/php-fpm.conf /etc/php5/fpm.d/www.conf\n  sed -i '/^include\\s/ s:^:#:' /etc/php5/fpm.d/www.conf\n}\n\nemail_cron_job() {\n  local root_crontab='/etc/crontabs/root'\n  local cron_task_dir='/etc/periodic/1min'\n  local cron_task='/etc/periodic/1min/email_queue_processing'\n  local process_email=\"/var/www/passbolt/app/Console/cake EmailQueue.sender --quiet\"\n\n  mkdir -p $cron_task_dir\n\n  echo \"* * * * * run-parts $cron_task_dir\" >> $root_crontab\n  echo \"#!/bin/sh\" > $cron_task\n  chmod +x $cron_task\n  echo \"su -c \\\"$process_email\\\" -ls /bin/bash nginx\" >> $cron_task\n\n  crond -f -c /etc/crontabs\n}\n\nif [ ! -d /data/images ]; then\n    mkdir /data/images\n    ln -s /data/images /var/www/passbolt/app/webroot/img/public/images\nfi\n\nif [ ! -d /data/gpg ]; then\n    mkdir -p /data/gpg\n    chown nginx /data/gpg\nfi\n\nif [ ! -d /data/ssl ]; then\n    mkdir -p /data/ssl\n    chown nginx /data/ssl\nfi\n\nln -s $SSL_KEY $ssl_key\nln -s $SSL_CERT $ssl_cert\n\nln -s {/data/,/var/www/passbolt/app/Config/}gpg/serverkey.asc\nln -s {/data/,/var/www/passbolt/app/Config/}gpg/serverkey.private.asc\n\n\nif [ ! -f $gpg_private_key ] && [ ! -L $gpg_private_key ] || \\\n   [ ! -f $gpg_public_key ] && [ ! -L $gpg_public_key ]; then\n  gpg_gen_key\nelse\n  gpg_import_key\nfi\n\nif [ ! -f $core_config ] && [ ! -L $core_config ]; then\n  core_setup\nfi\n\nif [ ! -f $db_config ] && [ ! -L $db_config ]; then\n  db_setup\nfi\n\nif [ ! -f $app_config ] && [ ! -L $app_config ]; then\n  app_setup\nfi\n\nif [ ! -f $email_config ] && [ ! -L $email_config ]; then\n  email_setup\nfi\n\nif [ ! -f $ssl_key ] && [ ! -f $ssl_cert ]; then\n  gen_ssl_cert\nfi\n\nphp_fpm_setup\n\ninstall\n\nphp-fpm5\n\nln -sf /dev/stdout /var/log/nginx/access.log\nln -sf /dev/stderr /var/log/nginx/error.log\nnginx -g \"pid /tmp/nginx.pid; daemon off;\" &\n\nemail_cron_job\n"
  },
  {
    "path": "passbolt/conf/passbolt.conf",
    "content": "server {\n  listen 80;\n\n  client_body_buffer_size     100K;\n  client_header_buffer_size   1k;\n  client_max_body_size        100k;\n#  large_client_header_buffers 2 1k;\n\n  client_body_timeout   10;\n  client_header_timeout 10;\n  keepalive_timeout     5 5;\n  send_timeout          10;\n\n  root /var/www/passbolt;\n\n  # X-Frame-Options is to prevent from clickJacking attack\n  add_header X-Frame-Options SAMEORIGIN;\n\n  #  disable content-type sniffing on some browsers.\n  add_header X-Content-Type-Options nosniff;\n\n  # This header enables the Cross-site scripting (XSS) filter\n  add_header X-XSS-Protection \"1; mode=block\";\n\n  # This will enforce HTTP browsing into HTTPS and avoid ssl stripping attack\n  # add_header Strict-Transport-Security \"max-age=31536000; includeSubdomains;\";\n\n  location / {\n    try_files $uri $uri/ /index.php?$args;\n    index index.php;\n  }\n\n  location ~ \\.php$ {\n    fastcgi_index           index.php;\n    fastcgi_pass            127.0.0.1:9000;\n    fastcgi_split_path_info ^(.+\\.php)(.+)$;\n    include                 fastcgi_params;\n    fastcgi_param           SCRIPT_FILENAME $document_root$fastcgi_script_name;\n    fastcgi_param           SERVER_NAME $http_host;\n  }\n\n  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)$ {\n    access_log off;\n    log_not_found off;\n    try_files $uri /app/webroot/$uri /index.php?$args;\n  }\n\n}\n\nserver {\n  listen 443;\n\n  ssl on;\n  ssl_certificate     /etc/ssl/certs/certificate.crt;\n  ssl_certificate_key /etc/ssl/certs/certificate.key;\n  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\n  ssl_prefer_server_ciphers on;\n  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;\n  ssl_session_tickets off;\n  #add_header Strict-Transport-Security \"max-age=63072000; includeSubdomains; preload\";\n  #add_header Strict-Transport-Security \"max-age=63072000; includeSubdomains\";\n  add_header X-Frame-Options DENY;\n  add_header X-Content-Type-Options nosniff;\n\n  root /var/www/passbolt;\n\n  # X-Frame-Options is to prevent from clickJacking attack\n  add_header X-Frame-Options SAMEORIGIN;\n\n  #  disable content-type sniffing on some browsers.\n  add_header X-Content-Type-Options nosniff;\n\n  # This header enables the Cross-site scripting (XSS) filter\n  add_header X-XSS-Protection \"1; mode=block\";\n\n  # This will enforce HTTP browsing into HTTPS and avoid ssl stripping attack\n  #add_header Strict-Transport-Security \"max-age=31536000; includeSubdomains;\";\n  add_header Strict-Transport-Security \"max-age=0; includeSubdomains;\";\n  location / {\n    try_files $uri $uri/ /index.php?$args;\n    index index.php;\n  }\n\n  location ~ \\.php$ {\n    fastcgi_index           index.php;\n    fastcgi_pass            127.0.0.1:9000;\n    fastcgi_split_path_info ^(.+\\.php)(.+)$;\n    include                 fastcgi_params;\n    fastcgi_param           SCRIPT_FILENAME $document_root$fastcgi_script_name;\n    fastcgi_param           SERVER_NAME $http_host;\n  }\n\n  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)$ {\n    access_log off;\n    log_not_found off;\n    try_files $uri /app/webroot/$uri /index.php?$args;\n  }\n}\n"
  },
  {
    "path": "passbolt/config.json",
    "content": "{\n    \"name\": \"Passbolt\",\n    \"version\": \"1.6.4\",\n    \"slug\": \"passbolt\",\n    \"image\": \"bestlibre/{arch}-passbolt\",\n    \"description\": \"Passbolt password manager\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/passbolt\",\n    \"startup\": \"system\",\n    \"boot\": \"auto\",\n    \"ports\": {\"80/tcp\": null, \"443/tcp\": null},\n    \"arch\": [\"armhf\", \"amd64\"],\n    \"options\": {},\n    \"schema\": {\"key_length\": \"int\",\n\t       \"subkey_length\": \"int\",\n\t       \"key_name\": \"str\",\n\t       \"key_email\": \"email\",\n\t       \"key_expiration\": \"int\",\n\t       \"fingerprint\": \"str\",\n\t       \"registration\": \"bool\",\n\t       \"ssl\": \"bool\",\n\t       \"salt\": \"str\",\n\t       \"cipherssed\": \"str\",\n\t       \"url\": \"str\",\n\t       \"db_host\": \"str\",\n\t       \"db_port\": \"port\",\n\t       \"db_user\": \"str\",\n\t       \"db_pass\": \"str\",\n\t       \"db_name\": \"str\",\n\t       \"email_transport\": \"str\",\n\t       \"email_from\": \"email\",\n\t       \"email_host\": \"url\",\n\t       \"email_port\": \"port\",\n\t       \"email_timeout\": \"int\",\n\t       \"email_username\": \"str\",\n\t       \"email_password\": \"str\",\n\t       \"email_tls\": \"bool\",\n\t       \"ssl_key\": \"str\",\n\t       \"ssl_cert\": \"str\"}\n}\n"
  },
  {
    "path": "python_exec/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\n# Add env\nENV LANG C.UTF-8\n\nRUN apk add --no-cache \\\n    \tjq \\\n        py-pip \\\n\tpython \\\n\tpython-dev \\\n\tpython3 \\\n\tpython3-dev\\\n && pip install -U pip \\\n && pip3 install -U pip \\\n && pip install -U virtualenv\n\n# Copy data for add-on\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "python_exec/README.md",
    "content": "# Simple python executor\n[![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\")\n\nThis addon is mainly for devlopment purpose. It will install, if needed, the given requirements with pip and then launch the python script.\n\nSince 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.\n\n## Options\n\n### clean (bool)\nIf set to `true` the virtualenv holding the requirements is deleted on start.\n\n### requirements (list of string)\nList of requirements to install with pip\n\n### code (string)\nPath to the python source file.\n\n"
  },
  {
    "path": "python_exec/build.json",
    "content": "{\n    \"build_from\": {\n        \"amd64\": \"homeassistant/amd64-base-python:3.7\",\n        \"i386\": \"homeassistant/i386-base-python:3.7\",\n        \"armhf\": \"homeassistant/armhf-base-python:3.7\",\n        \"armv7\": \"homeassistant/armhf-base-python:3.7\",\n        \"aarch64\": \"homeassistant/aarch64-base-python:3.7\"\n    }\n}"
  },
  {
    "path": "python_exec/config.json",
    "content": "{\n    \"name\": \"Python Executor\",\n    \"version\": \"0.1.6\",\n    \"slug\": \"python_exec\",\n    \"image\": \"bestlibre/{arch}-python-exec\",\n    \"description\": \"Python executor\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/python_exec\",\n    \"startup\": \"application\",\n    \"boot\": \"auto\",\n    \"ports\": {\"8080/tcp\": null},\n    \"options\": {\"code\": null,\n\t        \"requirements\": []},\n    \"schema\": {\"code\": \"str\",\n\t       \"requirements\": [\"str\"],\n\t       \"clean\": \"bool?\"},\n    \"map\": [\"share\"],\n    \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"]\n}\n"
  },
  {
    "path": "python_exec/run.sh",
    "content": "#!/bin/bash\nset -e\n\nrequirements=$(cat /data/options.json | jq -r 'if .requirements then .requirements | join(\" \") else \"\" end')\ncode=$(cat /data/options.json | jq -r '.code')\nclean=$(cat /data/options.json | jq -r '.clean //empty')\npy2=$(cat /data/options.json | jq -r '.python2 // empty')\n\nPYTHON=$(which python3)\n\nif [ \"${py2}\" == \"true\" ];\nthen\n    PYTHON=$(which python2)\nfi\n\nif [ -n \"$requirements\" ];\nthen\n    if [ \"$clean\" == \"true\" ];\n    then\n\trm -rf /data/venv/\n    fi\n    if [ ! -f \"/data/venv/bin/activate\" ];\n    then\n       mkdir -p /data/venv/\n       cd /data/venv\n       virtualenv -p ${PYTHON} .\n       . bin/activate\n    else\n       . /data/venv/bin/activate\n    fi\n    pip install -U ${requirements}\nfi\npython ${code}\n\n"
  },
  {
    "path": "repository.json",
    "content": "{\n    \"name\": \"BestLibre addons repository\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons\",\n    \"maintainer\": \"BestLibre <githubATbestlibreDOTorg>\"\n}\n"
  },
  {
    "path": "snapcastclient/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM as BUILDER\n\nARG BUILD_VERSION\nARG BUILD_ARCH\n\nRUN set -ex \\\n && SNAPCAST_VERSION=${BUILD_VERSION%-*} \\\n && apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        curl jq git build-essential libasound2-dev libvorbisidec-dev libvorbis-dev libflac-dev alsa-utils libavahi-client-dev avahi-daemon \\\n\tbuild-essential debhelper dh-make dh-systemd quilt fakeroot lintian \\\n && cd /tmp/ \\\n && git clone https://github.com/badaix/snapcast.git \\\n && cd snapcast \\\n && git checkout v${SNAPCAST_VERSION} \\\n && cd externals \\\n && git submodule update --init --recursive\nRUN cd /tmp/snapcast/client \\\n && make dpkg \\\n && mv $(ls ../snapclient*.deb) /snapclient.deb\n\nARG BUILD_FROM\nFROM $BUILD_FROM\n\nARG BUILD_VERSION\nARG BUILD_ARCH\n\nENV LANG C.UTF-8\n\nCOPY --from=BUILDER /snapclient.deb /tmp/\n#Install snapcast-server\nRUN set -ex \\\n    # Official Mopidy install for Debian/Ubuntu along with some extensions\n    # (see https://docs.mopidy.com/en/latest/installation/debian/ )\n && SNAPCAST_VERSION=${BUILD_VERSION%-*} \\\n && apt-get update \\\n && DEBIAN_FRONTEND=noninteractive apt-get install -y \\\n        jq \\\n && dpkg -i /tmp/snapclient.deb || DEBIAN_FRONTEND=noninteractive apt-get install -f -y\\\n && apt-get clean \\\n && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache\n\n# Copy data for add-on\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "snapcastclient/README.md",
    "content": "# Snapcast client addon for hass.io\n\n[![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\")\n\n## Snapcast player for Home Assistant\n\nThis addon provide a snapcast player. Can be used with the [mopidy_cast addon](https://github.com/bestlibre/hassio-addons/mopidy_cast).\n\n## Configuration\n\n### host (str)\n\nSnapcast server host to connect to.\n"
  },
  {
    "path": "snapcastclient/build.json",
    "content": "{\n    \"build_from\": {\n\t\"armhf\" : \"bestlibre/armhf-debian-base:stretch\",\n\t\"armv7\" : \"bestlibre/armv7-debian-base:stretch\",\n\t\"aarch64\": \"bestlibre/aarch64-debian-base:stretch\",\n\t\"amd64\" : \"debian:stretch\",\n\t\"i386\" : \"i386/debian:stretch\"\n    }\n}\n"
  },
  {
    "path": "snapcastclient/config.json",
    "content": "{\n  \"name\": \"snapcast-client\",\n  \"version\": \"0.15.0-1\",\n  \"slug\": \"snapcastclient\",\n  \"description\": \"Snapcast client for multiroom audio diffusion\",\n  \"startup\": \"application\",\n  \"boot\": \"auto\",\n  \"image\": \"bestlibre/{arch}-snapcast-client\",\n  \"audio\": true,\n  \"options\": {},\n  \"schema\": {\"host\": \"str\"},\n  \"ports\": {},\n  \"devices\": [\"/dev/snd:/dev/snd:rwm\"],\n  \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"]\n}\n"
  },
  {
    "path": "snapcastclient/run.sh",
    "content": "#!/bin/bash\nset -e\nhost=$(jq -r '.host // empty' /data/options.json)\nif [ -n \"${host}\" ];\nthen\n    host=\"-h ${host}\"\nfi\nsnapclient ${host} \n"
  },
  {
    "path": "snapcastserver/Dockerfile",
    "content": "FROM %%BASE_IMAGE%%\n\nENV LANG C.UTF-8\n\n#Install snapcastclient\nRUN apk upgrade --no-cache --available \\\n && apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/testing \\\n        snapcast-server\n\n# Copy data for add-on\nCOPY run.sh /\nRUN chmod a+x /run.sh\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "snapcastserver/config.json",
    "content": "{\n  \"name\": \"snapcast-server\",\n  \"version\": \"beta\",\n  \"slug\": \"snapcastserver\",\n  \"description\": \"Snapcast server for multiroom audio diffusion\",\n  \"startup\": \"system\",\n  \"boot\": \"auto\",\n  \"image\": \"bestlibre/{arch}-snapcast-server\",\n  \"options\": {},\n  \"schema\": {},\n  \"ports\": {\"1704/tcp\": 1704}\n}\n"
  },
  {
    "path": "snapcastserver/run.sh",
    "content": "#!/bin/bash\nset -e\n\nsnapserver\n"
  },
  {
    "path": "syncthing/Dockerfile",
    "content": "ARG BUILD_FROM\nFROM $BUILD_FROM\n\nARG BUILD_VERSION\nARG BUILD_ARCH\n\n# Add env\nENV LANG C.UTF-8\n\n# Setup base\nRUN apk add --no-cache -U --virtual .build-deps \\\n        curl \\\n\ttar \\\n && SYNCTHING_VERSION=v${BUILD_VERSION%-*} \\\n && if [ ${BUILD_ARCH} == \"armhf\" -o ${BUILD_ARCH} == \"armv7\" ]; then syncthingarch=arm;\\\n    elif [ ${BUILD_ARCH} == \"amd64\" ]; then syncthingarch=amd64;\\\n    elif [ ${BUILD_ARCH} == \"i386\" ]; then syncthingarch=386;\\\n    elif [ ${BUILD_ARCH} == \"aarch64\" ]; then syncthingarch=arm64;\\\n    fi \\\n && syncthingurl=https://github.com/syncthing/syncthing/releases/download/${SYNCTHING_VERSION}/syncthing-linux-${syncthingarch}-${SYNCTHING_VERSION}.tar.gz \\\n && curl --silent --show-error --fail --location --header \"Accept: application/tar+gzip, application/x-gzip, application/octet-stream\" -o - \\\n      \"$syncthingurl\" \\\n    | tar --no-same-owner -C /usr/local/bin/ -xz --strip-components 1 syncthing-linux-${syncthingarch}-${SYNCTHING_VERSION}/syncthing \\\n && chmod 0755 /usr/local/bin/syncthing \\\n && apk del .build-deps\n \nCOPY run.sh /\n\nRUN chmod a+x /run.sh\n\nCMD [ \"/run.sh\" ]\n"
  },
  {
    "path": "syncthing/README.md",
    "content": "# Syncthing for hass.io\n[![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\")\n\n## Description\n\nThis addon provide a [syncthing](https://syncthing.net/) container for hass.io.\n\n> 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.\n\nWhen 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 :\n\n - `/data/<subfolder/path>` : `subfolder/path` will be created in the addon persistent volume,\n - `/data/<subfolder/path>` : `subfolder/path` will be created in the share directory, which can be accessed with samba,\n - `/config` : to synchronize home assistant configuration,\n - `/backup` : to synchronize home assistant backups,\n - `/addons` :  to synchronize hassio addons.\n \n## Configuration\nThere are no configuration options.\n"
  },
  {
    "path": "syncthing/config.json",
    "content": "{\n    \"name\": \"Syncthing\",\n    \"version\": \"1.14.0\",\n    \"slug\": \"syncthing\",\n    \"description\": \"syncthing synchronization service\",\n    \"url\": \"https://github.com/bestlibre/hassio-addons/tree/master/syncthing\",\n    \"startup\": \"system\",\n    \"boot\": \"auto\",\n    \"image\": \"bestlibre/{arch}-syncthing\",\n    \"options\": {},\n    \"schema\": {},\n    \"ports\": {\"8384/tcp\": 8384, \"22000/tcp\": null, \"21027/udp\": 21027},\n    \"map\": [\"share:rw\", \"config:rw\", \"backup:rw\", \"addons:rw\"],\n    \"webui\": \"http://[HOST]:[PORT:8384]\",\n    \"arch\": [\"armv7\", \"armhf\", \"amd64\", \"aarch64\", \"i386\"]\n}\n"
  },
  {
    "path": "syncthing/run.sh",
    "content": "#!/bin/bash\nset -e\n\nif [ ! -f '/data/config.xml' ]; then\n    # Run syncthing to generate initial configuration files, then edit\n    # config.xml to remove 127.0.0.1 limit from the GUI address.\n    syncthing -generate=/data\n    sed -i 's|<address>127.0.0.1:8384</address>|<address>:8384</address>|' /data/config.xml\nfi\nsyncthing -allow-newer-config -no-browser -home=/data/\n\n"
  }
]