From f1f67a6d6736043eef2071de912c7d09082ef50b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 19 Dec 2019 12:53:58 +0100 Subject: [PATCH] mariadb: Collection of small improvements (#909) * mariadb: Prettier YAML & JSON files * mariadb: Move data files into data folder * mariadb: Update add-on URL * mariadb: Tweaks to documentation and changelog --- mariadb/CHANGELOG.md | 4 ++++ mariadb/Dockerfile | 4 ++-- mariadb/README.md | 32 +++++++++++++-------------- mariadb/azure-pipelines.yml | 15 ++++++------- mariadb/config.json | 19 ++++++++-------- mariadb/{ => data}/mariadb-server.cnf | 0 mariadb/{ => data}/run.sh | 0 7 files changed, 39 insertions(+), 35 deletions(-) rename mariadb/{ => data}/mariadb-server.cnf (100%) rename mariadb/{ => data}/run.sh (100%) diff --git a/mariadb/CHANGELOG.md b/mariadb/CHANGELOG.md index 0775271..7718645 100644 --- a/mariadb/CHANGELOG.md +++ b/mariadb/CHANGELOG.md @@ -1,13 +1,17 @@ # Changelog ## 1.3 + - Update from bash to bashio ## 1.2 + - Change the way to migrate data ## 1.1 + - Fix connection issue with 10.3.13 ## 1.0 + - Update MariaDB to 10.3.13 diff --git a/mariadb/Dockerfile b/mariadb/Dockerfile index a9ea75b..4ed0e17 100644 --- a/mariadb/Dockerfile +++ b/mariadb/Dockerfile @@ -8,7 +8,7 @@ ENV LANG C.UTF-8 RUN apk add --no-cache mariadb mariadb-client # Copy data -COPY run.sh / -COPY mariadb-server.cnf /etc/my.cnf.d/ +COPY data/run.sh / +COPY data/mariadb-server.cnf /etc/my.cnf.d/ CMD [ "/run.sh" ] diff --git a/mariadb/README.md b/mariadb/README.md index f7f373e..1c7dc5d 100644 --- a/mariadb/README.md +++ b/mariadb/README.md @@ -10,18 +10,18 @@ You can use this add-on to install MariaDB, which is an open-source (GPLv2 licen ## Installation -The installation of this add-on is straightforward and easy to do. +Follow these steps to get the add-on installed on your system: 1. Navigate in your Home Assistant frontend to **Hass.io** -> **Add-on Store**. -1. Find the "MariaDB" add-on and click it. -1. Click on the "INSTALL" button. +2. Find the "MariaDB" add-on and click it. +3. Click on the "INSTALL" button. ## How to use 1. Set the `logins` -> `password` field to something strong and unique. -1. Start the add-on. -1. Check the add-on log output to see the result. -1. Add `recorder` component to your Home Assistnat configuration. +2. Start the add-on. +3. Check the add-on log output to see the result. +4. Add `recorder` component to your Home Assistant configuration. ## Add-on Configuration @@ -55,21 +55,21 @@ Example add-on configuration: ### Option: `databases` (required) -Database name, e.g., `homeassistant` +Database name, e.g., `homeassistant`. Multiple are allowed. ### Option: `logins` (required) This section defines a create user definition in MariaDB. [Create User][createuser] documentation. -### Option: `logins` -> `username` (required) +### Option: `logins.username` (required) Database user login, e.g., `hass`. [User Name][username] documentation. -### Option: `logins` -> `host` (required) +### Option: `logins.host` (required) Hostname allowed to connect to database. [Host Name][hostname] documentation. -### Option: `logins` -> `password` (required) +### Option: `logins.password` (required) Password for user login. This should be strong and unique. @@ -77,25 +77,25 @@ Password for user login. This should be strong and unique. This section grant privileges to users in MariaDB. [Grant][grant] documentation. -### Option: `rights` -> `username` (required) +### Option: `rights.username` (required) This should be the same user name defined in `logins` -> `username`. -### Option: `rights` -> `host` (required) +### Option: `rights.host` (required) This should be the same hostname defined in `logins` -> `host`. -### Option: `rights` -> `database` (required) +### Option: `rights.database` (required) This should be the same database defined in `databases`. -### Option: `rights` -> `grant` (required) +### Option: `rights.grant` (required) -This is the grant statement giving your user access to the databse. +This is the grant statement giving your user access to the database. ## Home Assistant Configuration -MariaDB will be used by the `recorder` and `history` components within Home Assistant. For more information about setting this up, see the [MariaDB][mariadb-hass] documentation for Home Assistant. +MariaDB will be used by the `recorder` and `history` components within Home Assistant. For more information about setting this up, see the [MariaDB][mariadb-hass] documentation for Home Assistant. Example Home Assistant configuration: diff --git a/mariadb/azure-pipelines.yml b/mariadb/azure-pipelines.yml index 8f808e2..f28179d 100644 --- a/mariadb/azure-pipelines.yml +++ b/mariadb/azure-pipelines.yml @@ -3,20 +3,19 @@ trigger: branches: include: - - master + - master paths: include: - - mariadb/* + - mariadb/* pr: none variables: - name: versionBuilder - value: '2.0' + value: "2.0" - group: docker - jobs: -- template: /.azure/azp-template-addon.yml - parameters: - addon: 'mariadb' - arch: '--all' + - template: /.azure/azp-template-addon.yml + parameters: + addon: "mariadb" + arch: "--all" diff --git a/mariadb/config.json b/mariadb/config.json index f4310d5..2a9dc45 100644 --- a/mariadb/config.json +++ b/mariadb/config.json @@ -3,7 +3,7 @@ "version": "1.3", "slug": "mariadb", "description": "An SQL database server", - "url": "https://home-assistant.io/addons/mariadb/", + "url": "https://github.com/home-assistant/hassio-addons/tree/master/mariadb", "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"], "startup": "system", "boot": "auto", @@ -12,20 +12,21 @@ }, "options": { "databases": ["homeassistant"], - "logins": [ - {"username": "hass", "host": "%", "password": null} - ], + "logins": [{ "username": "hass", "host": "%", "password": null }], "rights": [ - {"username": "hass", "host": "%", "database": "homeassistant", "grant": "ALL PRIVILEGES ON"} + { + "username": "hass", + "host": "%", + "database": "homeassistant", + "grant": "ALL PRIVILEGES ON" + } ] }, "schema": { "databases": ["str"], - "logins": [ - {"username": "str", "host": "str", "password": "str"} - ], + "logins": [{ "username": "str", "host": "str", "password": "str" }], "rights": [ - {"username": "str", "host": "str", "database": "str", "grant": "str"} + { "username": "str", "host": "str", "database": "str", "grant": "str" } ] }, "image": "homeassistant/{arch}-addon-mariadb", diff --git a/mariadb/mariadb-server.cnf b/mariadb/data/mariadb-server.cnf similarity index 100% rename from mariadb/mariadb-server.cnf rename to mariadb/data/mariadb-server.cnf diff --git a/mariadb/run.sh b/mariadb/data/run.sh similarity index 100% rename from mariadb/run.sh rename to mariadb/data/run.sh