From db89d1a8f4ee598eef4b4ec7eff99a2585a6fcb1 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 23 Apr 2024 12:13:54 +0200 Subject: [PATCH] allow Mariadb --- birdnet-go/CHANGELOG.md | 2 ++ birdnet-go/config.json | 5 ++++- birdnet-go/rootfs/etc/cont-init.d/33-mariadb.sh | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 birdnet-go/rootfs/etc/cont-init.d/33-mariadb.sh diff --git a/birdnet-go/CHANGELOG.md b/birdnet-go/CHANGELOG.md index 51c3b4efb..3ae0d4bed 100644 --- a/birdnet-go/CHANGELOG.md +++ b/birdnet-go/CHANGELOG.md @@ -1,3 +1,5 @@ +- Feat : provide mariadb information in the startup log to allow its usage + ## 0.5.1-3 (23-04-2024) - Feat : Allow mounting of SMB and local drives to store the audio clips on an external drive diff --git a/birdnet-go/config.json b/birdnet-go/config.json index 932614f92..050aa9fc5 100644 --- a/birdnet-go/config.json +++ b/birdnet-go/config.json @@ -94,7 +94,10 @@ "localdisks": "str?", "networkdisks": "str?" }, + "services": [ + "mysql:want" + ], "slug": "birdnet-go", "url": "https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-go", - "version": "0.5.1-3" + "version": "0.5.1-4" } diff --git a/birdnet-go/rootfs/etc/cont-init.d/33-mariadb.sh b/birdnet-go/rootfs/etc/cont-init.d/33-mariadb.sh new file mode 100644 index 000000000..8a7cf43a1 --- /dev/null +++ b/birdnet-go/rootfs/etc/cont-init.d/33-mariadb.sh @@ -0,0 +1,15 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash +set -e + +# Gives mariadb information + +if bashio::services.available 'mysql'; then + bashio::log.green "---" + bashio::log.yellow "MariaDB addon is active on your system! If you want to use it instead of sqlite, here are the informations to encode :" + bashio::log.blue "Database user : $(bashio::services "mysql" "username")" bashio::log.blue "Database user : $(bashio::services "mysql" "username")" + bashio::log.blue "Database password : $(bashio::services "mysql" "password")" + bashio::log.blue "Database name : nextcloud" + bashio::log.blue "Host-name : $(bashio::services "mysql" "host"):$(bashio::services "mysql" "port")" + bashio::log.green "---" +fi