From 70ca14ad7cbc58e60e6d3d091971dee909d0489d Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 13 Jun 2018 20:17:07 +0200 Subject: [PATCH] :hammer: Rebranding to TasmoAdmin --- .github/settings.yml | 4 +- .github/support.yml | 2 +- .gitlab-ci.yml | 6 +- CONTRIBUTING.md | 4 +- README.md | 91 +++++++++--------- sonweb/rootfs/etc/cont-init.d/12-patches.sh | 57 ----------- sonweb/rootfs/etc/fix-attrs.d/01-sonweb | 2 - sonweb/rootfs/etc/php7/blacklist.txt | 2 - {sonweb => tasmoadmin}/.README.j2 | 13 +-- {sonweb => tasmoadmin}/Dockerfile | 24 ++--- {sonweb => tasmoadmin}/build.json | 0 {sonweb => tasmoadmin}/config.json | 4 +- {sonweb => tasmoadmin}/icon.png | Bin {sonweb => tasmoadmin}/logo.png | Bin .../rootfs/etc/cont-init.d/10-requirements.sh | 2 +- .../rootfs/etc/cont-init.d/11-nginx.sh | 4 +- .../rootfs/etc/cont-init.d/12-migrate.sh | 19 ++++ .../etc/cont-init.d/13-persistent-data.sh | 16 +-- .../rootfs/etc/fix-attrs.d/01-tasmoadmin | 2 + .../rootfs/etc/nginx/nginx-ssl.conf | 2 +- .../rootfs/etc/nginx/nginx.conf | 2 +- tasmoadmin/rootfs/etc/php7/blacklist.txt | 2 + .../rootfs/etc/php7/conf.d/99-tasmoadmin.ini | 0 .../rootfs/etc/php7/php-fpm.d/www.conf | 0 .../rootfs/etc/services.d/nginx/finish | 2 +- .../rootfs/etc/services.d/nginx/run | 2 +- .../rootfs/etc/services.d/php-fpm/finish | 2 +- .../rootfs/etc/services.d/php-fpm/run | 2 +- .../rootfs/var/www/tasmoadmin/.dockerenv | 1 + 29 files changed, 116 insertions(+), 151 deletions(-) delete mode 100644 sonweb/rootfs/etc/cont-init.d/12-patches.sh delete mode 100644 sonweb/rootfs/etc/fix-attrs.d/01-sonweb delete mode 100644 sonweb/rootfs/etc/php7/blacklist.txt rename {sonweb => tasmoadmin}/.README.j2 (87%) rename {sonweb => tasmoadmin}/Dockerfile (66%) rename {sonweb => tasmoadmin}/build.json (100%) rename {sonweb => tasmoadmin}/config.json (92%) rename {sonweb => tasmoadmin}/icon.png (100%) rename {sonweb => tasmoadmin}/logo.png (100%) rename {sonweb => tasmoadmin}/rootfs/etc/cont-init.d/10-requirements.sh (95%) rename {sonweb => tasmoadmin}/rootfs/etc/cont-init.d/11-nginx.sh (89%) create mode 100644 tasmoadmin/rootfs/etc/cont-init.d/12-migrate.sh rename {sonweb => tasmoadmin}/rootfs/etc/cont-init.d/13-persistent-data.sh (55%) create mode 100644 tasmoadmin/rootfs/etc/fix-attrs.d/01-tasmoadmin rename {sonweb => tasmoadmin}/rootfs/etc/nginx/nginx-ssl.conf (98%) rename {sonweb => tasmoadmin}/rootfs/etc/nginx/nginx.conf (97%) create mode 100644 tasmoadmin/rootfs/etc/php7/blacklist.txt rename sonweb/rootfs/etc/php7/conf.d/99-sonweb.ini => tasmoadmin/rootfs/etc/php7/conf.d/99-tasmoadmin.ini (100%) rename {sonweb => tasmoadmin}/rootfs/etc/php7/php-fpm.d/www.conf (100%) rename {sonweb => tasmoadmin}/rootfs/etc/services.d/nginx/finish (89%) rename {sonweb => tasmoadmin}/rootfs/etc/services.d/nginx/run (90%) rename {sonweb => tasmoadmin}/rootfs/etc/services.d/php-fpm/finish (89%) rename {sonweb => tasmoadmin}/rootfs/etc/services.d/php-fpm/run (88%) create mode 100644 tasmoadmin/rootfs/var/www/tasmoadmin/.dockerenv diff --git a/.github/settings.yml b/.github/settings.yml index 319b153..c09d2ce 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,8 +1,8 @@ --- repository: - description: "SonWEB - Community Hass.io Add-on for Home Assistant" + description: "TasmoAdmin - Community Hass.io Add-on for Home Assistant" homepage: https://addons.community - topics: sonoff, tasmota, sonweb, hassio-addons, hassio, hass, home-assistant, homeassistant + topics: sonoff, tasmota, tasmoadmin, hassio-addons, hassio, hass, home-assistant, homeassistant private: false has_issues: true has_projects: false diff --git a/.github/support.yml b/.github/support.yml index f2c40c4..2237e21 100644 --- a/.github/support.yml +++ b/.github/support.yml @@ -12,7 +12,7 @@ supportComment: > support channels to get help with the project. Head over to the - [Home Assistant community forum](https://community.home-assistant.io/t/community-hass-io-add-on-sonweb/54155?u=frenck) + [Home Assistant community forum](https://community.home-assistant.io/t/community-hass-io-add-on-tasmoadmin/54155?u=frenck) or join our [Discord](https://discord.gg/c5DvZ4e) chat. # Close issues marked as support requests diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index afcee70..a19931d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,9 +2,9 @@ image: docker:stable variables: - ADDON_GITHUB_REPO: hassio-addons/addon-sonweb - ADDON_SLUG: sonweb - ADDON_TARGET: sonweb + ADDON_GITHUB_REPO: hassio-addons/addon-tasmoadmin + ADDON_SLUG: tasmoadmin + ADDON_TARGET: tasmoadmin DOCKER_DRIVER: overlay2 DOCKER_HUB_ORG: hassioaddons diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f0ea540..5658cf4 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,5 +25,5 @@ Even better: You could submit a pull request with a fix / new feature! developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you. -[github]: https://github.com/hassio-addons/addon-sonweb/issues -[prs]: https://github.com/hassio-addons/addon-sonweb/pulls +[github]: https://github.com/hassio-addons/addon-tasmoadmin/issues +[prs]: https://github.com/hassio-addons/addon-tasmoadmin/pulls diff --git a/README.md b/README.md index 1eb7def..da0fb61 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Community Hass.io Add-ons: SonWEB +# Community Hass.io Add-ons: TasmoAdmin [![GitHub Release][releases-shield]][releases] ![Project Stage][project-stage-shield] @@ -16,12 +16,13 @@ Centrally manage all your Sonoff-Tasmota devices. -![SonWEB screenshot](images/screenshot.png) +![TasmoAdmin screenshot](images/screenshot.png) ## About -SonWEB is an administrative web interface to manage all your Sonoff-Tasmota -flashed devices centrally. Some of its features: +TasmoAdmin (formerly known as SonWEB) is an administrative web interface to +manage all your Sonoff-Tasmota flashed devices centrally. +Some of its features: - Scans your networks and adds your devices automatically - See the status off all your devices quick and easy @@ -35,9 +36,9 @@ The installation of this add-on is pretty straightforward and not different in comparison to installing any other Hass.io add-on. 1. [Add our Hass.io add-ons repository][repository] to your Hass.io instance. -1. Install the "SonWEB" add-on. -1. Start the "SonWEB" add-on. -1. Check the logs of the “SonWEB” add-on to see if everything went well. +1. Install the "TasmoAdmin" add-on. +1. Start the "TasmoAdmin" add-on. +1. Check the logs of the “TasmoAdmin” add-on to see if everything went well. **NOTE**: Do not add this repository to Hass.io, please use: `https://github.com/hassio-addons/repository`. @@ -102,7 +103,7 @@ you are troubleshooting. ### Option: `ssl` -Enables/Disables SSL (HTTPS) on the web interface of SonWEB +Enables/Disables SSL (HTTPS) on the web interface of TasmoAdmin Panel. Set it `true` to enable it, `false` otherwise. ### Option: `certfile` @@ -123,7 +124,7 @@ Set this option too `false` to disable IPv6 support. ## Embedding into Home Assistant -It is possible to embed the SonWEB interface directly into Home Assistant, +It is possible to embed the TasmoAdmin interface directly into Home Assistant, allowing you to access it through the Home Assistant frontend. Home Assistant provides the `panel_iframe` component, for these purposes. @@ -132,8 +133,8 @@ Example configuration: ```yaml panel_iframe: - sonweb: - title: SonWEB + tasmoadmin: + title: TasmoAdmin icon: mdi:lightbulb-on url: http://addres.to.your.hass.io:9541 ``` @@ -215,58 +216,58 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. [aarch64-anchore-shield]: https://anchore.io/service/badges/image/db1960b51d33fe80c8a6f3318f327532c3a7f1f501c767dfa3d9202196982e2f -[aarch64-anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Fsonweb-aarch64%3Alatest +[aarch64-anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Ftasmoadmin-aarch64%3Alatest [aarch64-arch-shield]: https://img.shields.io/badge/architecture-aarch64-blue.svg -[aarch64-dockerhub]: https://hub.docker.com/r/hassioaddons/sonweb-aarch64 -[aarch64-layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/sonweb-aarch64.svg -[aarch64-microbadger]: https://microbadger.com/images/hassioaddons/sonweb-aarch64 -[aarch64-pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/sonweb-aarch64.svg -[aarch64-version-shield]: https://images.microbadger.com/badges/version/hassioaddons/sonweb-aarch64.svg +[aarch64-dockerhub]: https://hub.docker.com/r/hassioaddons/tasmoadmin-aarch64 +[aarch64-layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/tasmoadmin-aarch64.svg +[aarch64-microbadger]: https://microbadger.com/images/hassioaddons/tasmoadmin-aarch64 +[aarch64-pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/tasmoadmin-aarch64.svg +[aarch64-version-shield]: https://images.microbadger.com/badges/version/hassioaddons/tasmoadmin-aarch64.svg [amd64-anchore-shield]: https://anchore.io/service/badges/image/67ef5b927a8e861eee9e576477f4f6f1e52ccc30c657e906720a8fa3a9fe5fc7 -[amd64-anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Fsonweb-amd64%3Alatest +[amd64-anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Ftasmoadmin-amd64%3Alatest [amd64-arch-shield]: https://img.shields.io/badge/architecture-amd64-blue.svg -[amd64-dockerhub]: https://hub.docker.com/r/hassioaddons/sonweb-amd64 -[amd64-layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/sonweb-amd64.svg -[amd64-microbadger]: https://microbadger.com/images/hassioaddons/sonweb-amd64 -[amd64-pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/sonweb-amd64.svg -[amd64-version-shield]: https://images.microbadger.com/badges/version/hassioaddons/sonweb-amd64.svg +[amd64-dockerhub]: https://hub.docker.com/r/hassioaddons/tasmoadmin-amd64 +[amd64-layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/tasmoadmin-amd64.svg +[amd64-microbadger]: https://microbadger.com/images/hassioaddons/tasmoadmin-amd64 +[amd64-pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/tasmoadmin-amd64.svg +[amd64-version-shield]: https://images.microbadger.com/badges/version/hassioaddons/tasmoadmin-amd64.svg [armhf-anchore-shield]: https://anchore.io/service/badges/image/f2968fbefd4a99acfd25c100c099fcc1a5ae486289ca5b3548efde4c02583cc4 -[armhf-anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Fsonweb-armhf%3Alatest +[armhf-anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Ftasmoadmin-armhf%3Alatest [armhf-arch-shield]: https://img.shields.io/badge/architecture-armhf-blue.svg -[armhf-dockerhub]: https://hub.docker.com/r/hassioaddons/sonweb-armhf -[armhf-layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/sonweb-armhf.svg -[armhf-microbadger]: https://microbadger.com/images/hassioaddons/sonweb-armhf -[armhf-pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/sonweb-armhf.svg -[armhf-version-shield]: https://images.microbadger.com/badges/version/hassioaddons/sonweb-armhf.svg +[armhf-dockerhub]: https://hub.docker.com/r/hassioaddons/tasmoadmin-armhf +[armhf-layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/tasmoadmin-armhf.svg +[armhf-microbadger]: https://microbadger.com/images/hassioaddons/tasmoadmin-armhf +[armhf-pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/tasmoadmin-armhf.svg +[armhf-version-shield]: https://images.microbadger.com/badges/version/hassioaddons/tasmoadmin-armhf.svg [bountysource-shield]: https://img.shields.io/bountysource/team/hassio-addons/activity.svg [bountysource]: https://www.bountysource.com/teams/hassio-addons/issues [buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg [buymeacoffee]: https://www.buymeacoffee.com/frenck -[commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-sonweb.svg -[commits]: https://github.com/hassio-addons/addon-sonweb/commits/master -[contributors]: https://github.com/hassio-addons/addon-sonweb/graphs/contributors +[commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-tasmoadmin.svg +[commits]: https://github.com/hassio-addons/addon-tasmoadmin/commits/master +[contributors]: https://github.com/hassio-addons/addon-tasmoadmin/graphs/contributors [discord-shield]: https://img.shields.io/discord/330944238910963714.svg [discord]: https://discord.gg/c5DvZ4e [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg -[forum]: https://community.home-assistant.io/t/community-hass-io-add-on-sonweb/54155?u=frenck +[forum]: https://community.home-assistant.io/t/community-hass-io-add-on-tasmoadmin/54155?u=frenck [frenck]: https://github.com/frenck -[gitlabci-shield]: https://gitlab.com/hassio-addons/addon-sonweb/badges/master/pipeline.svg -[gitlabci]: https://gitlab.com/hassio-addons/addon-sonweb/pipelines +[gitlabci-shield]: https://gitlab.com/hassio-addons/addon-tasmoadmin/badges/master/pipeline.svg +[gitlabci]: https://gitlab.com/hassio-addons/addon-tasmoadmin/pipelines [i386-anchore-shield]: https://anchore.io/service/badges/image/bfa0ec04d5a8519ccfaf3be75bcd92bd1d9821946e39368d2b88d7d14d16e58e -[i386-anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Fsonweb-i386%3Alatest +[i386-anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Ftasmoadmin-i386%3Alatest [i386-arch-shield]: https://img.shields.io/badge/architecture-i386-blue.svg -[i386-dockerhub]: https://hub.docker.com/r/hassioaddons/sonweb-i386 -[i386-layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/sonweb-i386.svg -[i386-microbadger]: https://microbadger.com/images/hassioaddons/sonweb-i386 -[i386-pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/sonweb-i386.svg -[i386-version-shield]: https://images.microbadger.com/badges/version/hassioaddons/sonweb-i386.svg -[issue]: https://github.com/hassio-addons/addon-sonweb/issues +[i386-dockerhub]: https://hub.docker.com/r/hassioaddons/tasmoadmin-i386 +[i386-layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/tasmoadmin-i386.svg +[i386-microbadger]: https://microbadger.com/images/hassioaddons/tasmoadmin-i386 +[i386-pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/tasmoadmin-i386.svg +[i386-version-shield]: https://images.microbadger.com/badges/version/hassioaddons/tasmoadmin-i386.svg +[issue]: https://github.com/hassio-addons/addon-tasmoadmin/issues [keepchangelog]: http://keepachangelog.com/en/1.0.0/ -[license-shield]: https://img.shields.io/github/license/hassio-addons/addon-sonweb.svg +[license-shield]: https://img.shields.io/github/license/hassio-addons/addon-tasmoadmin.svg [maintenance-shield]: https://img.shields.io/maintenance/yes/2018.svg [project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg [reddit]: https://reddit.com/r/homeassistant -[releases-shield]: https://img.shields.io/github/release/hassio-addons/addon-sonweb.svg -[releases]: https://github.com/hassio-addons/addon-sonweb/releases +[releases-shield]: https://img.shields.io/github/release/hassio-addons/addon-tasmoadmin.svg +[releases]: https://github.com/hassio-addons/addon-tasmoadmin/releases [repository]: https://github.com/hassio-addons/repository [semver]: http://semver.org/spec/v2.0.0.html diff --git a/sonweb/rootfs/etc/cont-init.d/12-patches.sh b/sonweb/rootfs/etc/cont-init.d/12-patches.sh deleted file mode 100644 index f7df462..0000000 --- a/sonweb/rootfs/etc/cont-init.d/12-patches.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/with-contenv bash -# ============================================================================== -# Community Hass.io Add-ons: SonWEB -# Applies patch to remove SelfUpdate, since that is useless shit in Docker -# ============================================================================== -# shellcheck disable=SC1091 -source /usr/lib/hassio-addons/base.sh - -patch -F2 -R --ignore-whitespace /var/www/sonweb/includes/header.php <<'PATCH' ---- header.php 2018-05-22 00:00:00.463304792 +0200 -+++ header.php 2018-05-22 00:00:00.291634513 +0200 -@@ -178,6 +178,15 @@ - - - -+ -+ -+ -+ - - - -PATCH - -# shellcheck disable=SC2181 -if [[ "$?" -ne 0 ]]; -then - hass.die 'Patching SonWEB SelfUpdate failed' -fi -hass.log.debug 'Applied SonWEB SelfUpdate fix' - -patch -F2 -R --ignore-whitespace \ - /var/www/sonweb/pages/device_update.php << 'PATCH' ---- device_update.php 2018-05-23 21:31:36.000000000 +0200 -+++ device_update.php 2018-05-23 21:30:19.000000000 +0200 -@@ -5,7 +5,7 @@ - $subdir = str_replace( "\\", "/", $subdir ); - $subdir = $subdir == "/" ? "" : $subdir; - -- $otaServer = $_SERVER['REQUEST_SCHEME'] . "://".$localIP.":".$_SERVER[ "SERVER_PORT" ]._BASEURL_.""; -+ $otaServer = "http://".$localIP.":".$_SERVER[ "SERVER_PORT" ]._BASEURL_.""; - - if ( isset( $_POST[ 'minimal_firmware_path' ] ) && !empty( $_POST[ 'minimal_firmware_path' ] ) ) { - $ota_minimal_firmware_url = $otaServer."data/firmwares/sonoff-minimal.bin"; -PATCH - -# shellcheck disable=SC2181 -if [[ "$?" -ne 0 ]]; -then - hass.die 'Patching SonWEB OTA over HTTPS failed' -fi -hass.log.debug 'Applied SonWEB OTA over HTTPS fix' diff --git a/sonweb/rootfs/etc/fix-attrs.d/01-sonweb b/sonweb/rootfs/etc/fix-attrs.d/01-sonweb deleted file mode 100644 index 8da210a..0000000 --- a/sonweb/rootfs/etc/fix-attrs.d/01-sonweb +++ /dev/null @@ -1,2 +0,0 @@ -/var/www/sonweb true nginx 0644 0755 -/data/sonweb true nginx 0644 0755 diff --git a/sonweb/rootfs/etc/php7/blacklist.txt b/sonweb/rootfs/etc/php7/blacklist.txt deleted file mode 100644 index f47d41f..0000000 --- a/sonweb/rootfs/etc/php7/blacklist.txt +++ /dev/null @@ -1,2 +0,0 @@ -/data/sonweb/* -/var/www/sonweb/data/* diff --git a/sonweb/.README.j2 b/tasmoadmin/.README.j2 similarity index 87% rename from sonweb/.README.j2 rename to tasmoadmin/.README.j2 index 55bb0f8..cef42ab 100644 --- a/sonweb/.README.j2 +++ b/tasmoadmin/.README.j2 @@ -1,4 +1,4 @@ -# Community Hass.io Add-ons: SonWEB +# Community Hass.io Add-ons: TasmoAdmin [![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield] @@ -10,8 +10,9 @@ Centrally manage all your Sonoff-Tasmota devices. ## About -SonWEB is an administrative web interface to manage all your Sonoff-Tasmota -flashed devices centrally. Some of its features: +TasmoAdmin (formerly known as SonWEB) is an administrative web interface to +manage all your Sonoff-Tasmota flashed devices centrally. +Some of its features: - Scans your networks and adds your devices automatically - See the status off all your devices quick and easy @@ -21,7 +22,7 @@ flashed devices centrally. Some of its features: [Click here for the full documentation][docs] -![SonWEB screenshot][screenshot] +![TasmoAdmin screenshot][screenshot] {% if channel == "edge" %} ## WARNING! THIS IS AN EDGE VERSION! @@ -68,9 +69,9 @@ If you are more interested in stable releases of our add-ons: [discord]: https://discord.gg/c5DvZ4e [docs]: {{ repo }}/blob/{{ version }}/README.md [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg -[forum]: https://community.home-assistant.io/t/community-hass-io-add-on-sonweb/54155?u=frenck +[forum]: https://community.home-assistant.io/t/community-hass-io-add-on-tasmoadmin/54155?u=frenck [maintenance-shield]: https://img.shields.io/maintenance/yes/2018.svg [project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg [release-shield]: https://img.shields.io/badge/version-{{ version }}-blue.svg [release]: {{ repo }}/tree/{{ version }} -[screenshot]: https://github.com/hassio-addons/addon-sonweb/raw/master/images/screenshot.png +[screenshot]: https://github.com/hassio-addons/addon-tasmoadmin/raw/master/images/screenshot.png diff --git a/sonweb/Dockerfile b/tasmoadmin/Dockerfile similarity index 66% rename from sonweb/Dockerfile rename to tasmoadmin/Dockerfile index de38219..43b35b1 100755 --- a/sonweb/Dockerfile +++ b/tasmoadmin/Dockerfile @@ -19,16 +19,16 @@ RUN \ git=2.15.0-r1 \ \ && git clone --branch master --single-branch \ - https://github.com/reloxx13/SonWEB.git /var/www/sonweb \ - && git -C /var/www/sonweb checkout 74704ba33f7b4df0d5fd75c55253356edbb65029 \ + https://github.com/reloxx13/TasmoAdmin.git /var/www/tasmoadmin \ + && git -C /var/www/tasmoadmin checkout 74704ba33f7b4df0d5fd75c55253356edbb65029 \ \ && apk del --purge .build-dependencies \ \ - && rm -f -r /var/www/sonweb/.git \ - && find /var/www/sonweb -type f -name ".htaccess" -depth -exec rm -f {} \; \ - && find /var/www/sonweb -type f -name "*.md" -depth -exec rm -f {} \; \ - && find /var/www/sonweb -type f -name ".gitignore" -depth -exec rm -f {} \; \ - && find /var/www/sonweb -type f -name ".empty" -depth -exec rm -f {} \; + && rm -f -r /var/www/tasmoadmin/.git \ + && find /var/www/tasmoadmin -type f -name ".htaccess" -depth -exec rm -f {} \; \ + && find /var/www/tasmoadmin -type f -name "*.md" -depth -exec rm -f {} \; \ + && find /var/www/tasmoadmin -type f -name ".gitignore" -depth -exec rm -f {} \; \ + && find /var/www/tasmoadmin -type f -name ".empty" -depth -exec rm -f {} \; # Copy root filesystem COPY rootfs / @@ -41,7 +41,7 @@ ARG BUILD_VERSION # Labels LABEL \ - io.hass.name="SonWEB" \ + io.hass.name="TasmoAdmin" \ io.hass.description="Centrally manage all your Sonoff-Tasmota devices" \ io.hass.arch="${BUILD_ARCH}" \ io.hass.type="addon" \ @@ -49,10 +49,10 @@ LABEL \ maintainer="Franck Nijhof " \ org.label-schema.description="Centrally manage all your Sonoff-Tasmota devices" \ org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="SonWEB" \ + org.label-schema.name="TasmoAdmin" \ org.label-schema.schema-version="1.0" \ - org.label-schema.url="https://community.home-assistant.io/t/community-hass-io-add-on-sonweb/54155?u=frenck" \ - org.label-schema.usage="https://github.com/hassio-addons/addon-sonweb/tree/master/README.md" \ + org.label-schema.url="https://community.home-assistant.io/t/community-hass-io-add-on-tasmoadmin/54155?u=frenck" \ + org.label-schema.usage="https://github.com/hassio-addons/addon-tasmoadmin/tree/master/README.md" \ org.label-schema.vcs-ref=${BUILD_REF} \ - org.label-schema.vcs-url="https://github.com/hassio-addons/addon-sonweb" \ + org.label-schema.vcs-url="https://github.com/hassio-addons/addon-tasmoadmin" \ org.label-schema.vendor="Community Hass.io Addons" diff --git a/sonweb/build.json b/tasmoadmin/build.json similarity index 100% rename from sonweb/build.json rename to tasmoadmin/build.json diff --git a/sonweb/config.json b/tasmoadmin/config.json similarity index 92% rename from sonweb/config.json rename to tasmoadmin/config.json index a3c9244..67e07a6 100755 --- a/sonweb/config.json +++ b/tasmoadmin/config.json @@ -1,9 +1,9 @@ { - "name": "SonWEB", + "name": "TasmoAdmin", "version": "dev", "slug": "sonweb", "description": "Centrally manage all your Sonoff-Tasmota devices", - "url": "https://community.home-assistant.io/t/community-hass-io-add-on-sonweb/54155?u=frenck", + "url": "https://community.home-assistant.io/t/community-hass-io-add-on-tasmoadmin/54155?u=frenck", "webui": "[PROTO:ssl]://[HOST]:[PORT:9541]", "startup": "system", "arch": [ diff --git a/sonweb/icon.png b/tasmoadmin/icon.png similarity index 100% rename from sonweb/icon.png rename to tasmoadmin/icon.png diff --git a/sonweb/logo.png b/tasmoadmin/logo.png similarity index 100% rename from sonweb/logo.png rename to tasmoadmin/logo.png diff --git a/sonweb/rootfs/etc/cont-init.d/10-requirements.sh b/tasmoadmin/rootfs/etc/cont-init.d/10-requirements.sh similarity index 95% rename from sonweb/rootfs/etc/cont-init.d/10-requirements.sh rename to tasmoadmin/rootfs/etc/cont-init.d/10-requirements.sh index c4b0b3a..89d1bab 100755 --- a/sonweb/rootfs/etc/cont-init.d/10-requirements.sh +++ b/tasmoadmin/rootfs/etc/cont-init.d/10-requirements.sh @@ -1,6 +1,6 @@ #!/usr/bin/with-contenv bash # ============================================================================== -# Community Hass.io Add-ons: SonWEB +# Community Hass.io Add-ons: TasmoAdmin # This files check if all user configuration requirements are met # ============================================================================== # shellcheck disable=SC1091 diff --git a/sonweb/rootfs/etc/cont-init.d/11-nginx.sh b/tasmoadmin/rootfs/etc/cont-init.d/11-nginx.sh similarity index 89% rename from sonweb/rootfs/etc/cont-init.d/11-nginx.sh rename to tasmoadmin/rootfs/etc/cont-init.d/11-nginx.sh index fd3b383..7164fd0 100755 --- a/sonweb/rootfs/etc/cont-init.d/11-nginx.sh +++ b/tasmoadmin/rootfs/etc/cont-init.d/11-nginx.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bash # ============================================================================== -# Community Hass.io Add-ons: SonWEB -# Configures NGINX for use with SonWEB +# Community Hass.io Add-ons: TasmoAdmin +# Configures NGINX for use with TasmoAdmin # ============================================================================== # shellcheck disable=SC1091 source /usr/lib/hassio-addons/base.sh diff --git a/tasmoadmin/rootfs/etc/cont-init.d/12-migrate.sh b/tasmoadmin/rootfs/etc/cont-init.d/12-migrate.sh new file mode 100644 index 0000000..1276990 --- /dev/null +++ b/tasmoadmin/rootfs/etc/cont-init.d/12-migrate.sh @@ -0,0 +1,19 @@ +#!/usr/bin/with-contenv bash +# ============================================================================== +# Community Hass.io Add-ons: TasmoAdmin +# Migrates data from sonweb to TasmoAdmin +# ============================================================================== +# shellcheck disable=SC1091 +source /usr/lib/hassio-addons/base.sh + +if hass.directory_exists "/data/sonweb"; then + hass.log.inf 'Migrating data from sonweb to tasmoadmin...' + + # Rename data folder + mv /data/sonweb /data/tasmoadmin + + # Ensure file permissions + chown -R nginx:nginx /data/tasmoadmin + find /data/tasmoadmin -not -perm 0644 -type f -exec chmod 0644 {} \; + find /data/tasmoadmin -not -perm 0755 -type d -exec chmod 0755 {} \; +fi diff --git a/sonweb/rootfs/etc/cont-init.d/13-persistent-data.sh b/tasmoadmin/rootfs/etc/cont-init.d/13-persistent-data.sh similarity index 55% rename from sonweb/rootfs/etc/cont-init.d/13-persistent-data.sh rename to tasmoadmin/rootfs/etc/cont-init.d/13-persistent-data.sh index c514e51..87a5b4b 100644 --- a/sonweb/rootfs/etc/cont-init.d/13-persistent-data.sh +++ b/tasmoadmin/rootfs/etc/cont-init.d/13-persistent-data.sh @@ -1,23 +1,23 @@ #!/usr/bin/with-contenv bash # ============================================================================== -# Community Hass.io Add-ons: SonWEB +# Community Hass.io Add-ons: TasmoAdmin # Ensures data is store in a persistent location # ============================================================================== # shellcheck disable=SC1091 source /usr/lib/hassio-addons/base.sh -if ! hass.directory_exists "/data/sonweb"; then +if ! hass.directory_exists "/data/tasmoadmin"; then hass.log.debug 'Data directory not initialized, doing that now...' # Setup structure - cp -R /var/www/sonweb/data /data/sonweb + cp -R /var/www/tasmoadmin/data /data/tasmoadmin # Ensure file permissions - chown -R nginx:nginx /data/sonweb - find /data/sonweb -not -perm 0644 -type f -exec chmod 0644 {} \; - find /data/sonweb -not -perm 0755 -type d -exec chmod 0755 {} \; + chown -R nginx:nginx /data/tasmoadmin + find /data/tasmoadmin -not -perm 0644 -type f -exec chmod 0644 {} \; + find /data/tasmoadmin -not -perm 0755 -type d -exec chmod 0755 {} \; fi hass.log.debug 'Symlinking data directory to persistent storage location...' -rm -f -r /var/www/sonweb/data -ln -s /data/sonweb /var/www/sonweb/data +rm -f -r /var/www/tasmoadmin/data +ln -s /data/tasmoadmin /var/www/tasmoadmin/data diff --git a/tasmoadmin/rootfs/etc/fix-attrs.d/01-tasmoadmin b/tasmoadmin/rootfs/etc/fix-attrs.d/01-tasmoadmin new file mode 100644 index 0000000..b4c1660 --- /dev/null +++ b/tasmoadmin/rootfs/etc/fix-attrs.d/01-tasmoadmin @@ -0,0 +1,2 @@ +/var/www/tasmoadmin true nginx 0644 0755 +/data/tasmoadmin true nginx 0644 0755 diff --git a/sonweb/rootfs/etc/nginx/nginx-ssl.conf b/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf similarity index 98% rename from sonweb/rootfs/etc/nginx/nginx-ssl.conf rename to tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf index 26ddabe..7e97f6c 100755 --- a/sonweb/rootfs/etc/nginx/nginx-ssl.conf +++ b/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf @@ -16,7 +16,7 @@ http { server_name hassio.local; listen 9541 default_server ssl; listen [::]:9541 default_server ssl; - root /var/www/sonweb; + root /var/www/tasmoadmin; index index.php; ssl_certificate /ssl/%%certfile%%; diff --git a/sonweb/rootfs/etc/nginx/nginx.conf b/tasmoadmin/rootfs/etc/nginx/nginx.conf similarity index 97% rename from sonweb/rootfs/etc/nginx/nginx.conf rename to tasmoadmin/rootfs/etc/nginx/nginx.conf index 3d1a7e0..ed57020 100755 --- a/sonweb/rootfs/etc/nginx/nginx.conf +++ b/tasmoadmin/rootfs/etc/nginx/nginx.conf @@ -16,7 +16,7 @@ http { server_name hassio.local; listen 9541 default_server; listen [::]:9541 default_server; - root /var/www/sonweb/; + root /var/www/tasmoadmin/; index index.php; location /data/firmwares { diff --git a/tasmoadmin/rootfs/etc/php7/blacklist.txt b/tasmoadmin/rootfs/etc/php7/blacklist.txt new file mode 100644 index 0000000..78ebbe6 --- /dev/null +++ b/tasmoadmin/rootfs/etc/php7/blacklist.txt @@ -0,0 +1,2 @@ +/data/tasmoadmin/* +/var/www/tasmoadmin/data/* diff --git a/sonweb/rootfs/etc/php7/conf.d/99-sonweb.ini b/tasmoadmin/rootfs/etc/php7/conf.d/99-tasmoadmin.ini similarity index 100% rename from sonweb/rootfs/etc/php7/conf.d/99-sonweb.ini rename to tasmoadmin/rootfs/etc/php7/conf.d/99-tasmoadmin.ini diff --git a/sonweb/rootfs/etc/php7/php-fpm.d/www.conf b/tasmoadmin/rootfs/etc/php7/php-fpm.d/www.conf similarity index 100% rename from sonweb/rootfs/etc/php7/php-fpm.d/www.conf rename to tasmoadmin/rootfs/etc/php7/php-fpm.d/www.conf diff --git a/sonweb/rootfs/etc/services.d/nginx/finish b/tasmoadmin/rootfs/etc/services.d/nginx/finish similarity index 89% rename from sonweb/rootfs/etc/services.d/nginx/finish rename to tasmoadmin/rootfs/etc/services.d/nginx/finish index b8068ed..a89abaf 100755 --- a/sonweb/rootfs/etc/services.d/nginx/finish +++ b/tasmoadmin/rootfs/etc/services.d/nginx/finish @@ -1,6 +1,6 @@ #!/usr/bin/execlineb -S0 # ============================================================================== -# Community Hass.io Add-ons: SonWEB +# Community Hass.io Add-ons: TasmoAdmin # Take down the S6 supervision tree when Nginx fails # ============================================================================== if -n { s6-test $# -ne 0 } diff --git a/sonweb/rootfs/etc/services.d/nginx/run b/tasmoadmin/rootfs/etc/services.d/nginx/run similarity index 90% rename from sonweb/rootfs/etc/services.d/nginx/run rename to tasmoadmin/rootfs/etc/services.d/nginx/run index 4e3702b..2d07c54 100755 --- a/sonweb/rootfs/etc/services.d/nginx/run +++ b/tasmoadmin/rootfs/etc/services.d/nginx/run @@ -1,6 +1,6 @@ #!/usr/bin/with-contenv bash # ============================================================================== -# Community Hass.io Add-ons: SonWEB +# Community Hass.io Add-ons: TasmoAdmin # Runs the Nginx daemon # ============================================================================== # shellcheck disable=SC1091 diff --git a/sonweb/rootfs/etc/services.d/php-fpm/finish b/tasmoadmin/rootfs/etc/services.d/php-fpm/finish similarity index 89% rename from sonweb/rootfs/etc/services.d/php-fpm/finish rename to tasmoadmin/rootfs/etc/services.d/php-fpm/finish index b84521c..d568f61 100644 --- a/sonweb/rootfs/etc/services.d/php-fpm/finish +++ b/tasmoadmin/rootfs/etc/services.d/php-fpm/finish @@ -1,6 +1,6 @@ #!/usr/bin/execlineb -S0 # ============================================================================== -# Community Hass.io Add-ons: SonWEB +# Community Hass.io Add-ons: TasmoAdmin # Take down the S6 supervision tree when PHP FPM fails # ============================================================================== if -n { s6-test $# -ne 0 } diff --git a/sonweb/rootfs/etc/services.d/php-fpm/run b/tasmoadmin/rootfs/etc/services.d/php-fpm/run similarity index 88% rename from sonweb/rootfs/etc/services.d/php-fpm/run rename to tasmoadmin/rootfs/etc/services.d/php-fpm/run index 7486cc0..8cd1668 100644 --- a/sonweb/rootfs/etc/services.d/php-fpm/run +++ b/tasmoadmin/rootfs/etc/services.d/php-fpm/run @@ -1,6 +1,6 @@ #!/usr/bin/with-contenv bash # ============================================================================== -# Community Hass.io Add-ons: SonWEB +# Community Hass.io Add-ons: TasmoAdmin # Runs the PHP-FPM daemon # ============================================================================== # shellcheck disable=SC1091 diff --git a/tasmoadmin/rootfs/var/www/tasmoadmin/.dockerenv b/tasmoadmin/rootfs/var/www/tasmoadmin/.dockerenv new file mode 100644 index 0000000..4d1e03c --- /dev/null +++ b/tasmoadmin/rootfs/var/www/tasmoadmin/.dockerenv @@ -0,0 +1 @@ +# Disables updater