Merge branch 'master' into patch-2

This commit is contained in:
Alexandre
2021-12-28 16:20:29 +01:00
committed by GitHub
46 changed files with 964 additions and 110 deletions

View File

@@ -54,6 +54,7 @@ gitapi: optional, it is the API key from your github repo
Example:
```yaml
addon:
- slug: sonarr
beta: false
fulltag: false
@@ -69,6 +70,10 @@ Example:
fulltag: false
repository: alexbelgium/hassio-addons
upstream: linuxserver/docker-ubooquity
gituser: your github username
gitpass: your github password
gitmail: your github email
verbose: 'false'
```
[repository]: https://github.com/alexbelgium/hassio-addons

View File

@@ -14,33 +14,33 @@ mkdir -p "$(dirname "${DATABASESOURCE}")"
# Check absence of config file
if [ -f /data/config.yaml ] && [ ! -L /data/config.yaml ]; then
bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak"
mv /data/config.yaml $CONFIGSOURCE.bak
bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak"
mv /data/config.yaml $CONFIGSOURCE.bak
fi
# Check if config file is there, or create one from template
if [ -f $CONFIGSOURCE ]; then
# Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf $CONFIGSOURCE /data
bashio::log.info "Using config file found in $CONFIGSOURCE"
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed --no-warnings $CONFIGSOURCE &> ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
# Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf $CONFIGSOURCE /data
bashio::log.info "Using config file found in $CONFIGSOURCE"
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
cat ERROR
bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above. You can check yaml validity with the online tool yamllint.com"
bashio::exit.nok
fi
else
cat ERROR
bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above. You can check yaml validity with the online tool yamllint.com"
bashio::exit.nok
fi
else
# Create symlink for addon to create config
touch ${CONFIGSOURCE}
ln -sf $CONFIGSOURCE /data
rm $CONFIGSOURCE
# Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
# Create symlink for addon to create config
touch ${CONFIGSOURCE}
ln -sf $CONFIGSOURCE /data
rm $CONFIGSOURCE
# Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
fi
# Remove previous link or file
@@ -48,14 +48,14 @@ fi
# Check if database is here or create symlink
if [ -f $DATABASESOURCE ]; then
# Create symlink if not existing yet
ln -sf ${DATABASESOURCE} /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
# Create symlink if not existing yet
ln -sf ${DATABASESOURCE} /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
else
# Create symlink for addon to create database
touch ${DATABASESOURCE}
ln -sf $DATABASESOURCE /data
rm $DATABASESOURCE
# Create symlink for addon to create database
touch ${DATABASESOURCE}
ln -sf $DATABASESOURCE /data
rm $DATABASESOURCE
fi
##############
@@ -71,7 +71,7 @@ if [ $TZ = "test" ]; then
echo "secret mode found, launching script in /config/test.sh"
cd /config
chmod 777 test.sh
./test.sh
./test.sh
fi
python -u /app/main.py || bashio::log.fatal "The app has crashed. Are you sure you entered the correct config options?"

View File

@@ -14,33 +14,33 @@ mkdir -p "$(dirname "${DATABASESOURCE}")"
# Check absence of config file
if [ -f /data/config.yaml ] && [ ! -L /data/config.yaml ]; then
bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak"
mv /data/config.yaml $CONFIGSOURCE.bak
bashio::log.warning "A current config was found in /data, it is backuped to ${CONFIGSOURCE}.bak"
mv /data/config.yaml $CONFIGSOURCE.bak
fi
# Check if config file is there, or create one from template
if [ -f $CONFIGSOURCE ]; then
# Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf $CONFIGSOURCE /data
bashio::log.info "Using config file found in $CONFIGSOURCE"
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed --no-warnings $CONFIGSOURCE &> ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
# Create symlink if not existing yet
[ ! -L /data/config.yaml ] && ln -sf $CONFIGSOURCE /data
bashio::log.info "Using config file found in $CONFIGSOURCE"
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
cat ERROR
bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above. You can check yaml validity with the online tool yamllint.com"
bashio::exit.nok
fi
else
cat ERROR
bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above. You can check yaml validity with the online tool yamllint.com"
bashio::exit.nok
fi
else
# Create symlink for addon to create config
touch ${CONFIGSOURCE}
ln -sf $CONFIGSOURCE /data
rm $CONFIGSOURCE
# Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
# Create symlink for addon to create config
touch ${CONFIGSOURCE}
ln -sf $CONFIGSOURCE /data
rm $CONFIGSOURCE
# Need to restart
bashio::log.fatal "Config file not found. The addon will create a new one, then stop. Please customize the file in $CONFIGSOURCE before restarting."
fi
# Remove previous link or file
@@ -48,14 +48,14 @@ fi
# Check if database is here or create symlink
if [ -f $DATABASESOURCE ]; then
# Create symlink if not existing yet
ln -sf ${DATABASESOURCE} /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
# Create symlink if not existing yet
ln -sf ${DATABASESOURCE} /data && echo "creating symlink"
bashio::log.info "Using database file found in $DATABASESOURCE"
else
# Create symlink for addon to create database
touch ${DATABASESOURCE}
ln -sf $DATABASESOURCE /data
rm $DATABASESOURCE
# Create symlink for addon to create database
touch ${DATABASESOURCE}
ln -sf $DATABASESOURCE /data
rm $DATABASESOURCE
fi
##############
@@ -70,7 +70,7 @@ if [ $TZ = "test" ]; then
echo "secret mode found, launching script in /config/test.sh"
cd /config
chmod 777 test.sh
./test.sh
./test.sh
fi
python -u /app/main.py || bashio::log.fatal "The app has crashed. Are you sure you entered the correct config options?"

1
firefly_iii/CHANGELOG.md Normal file
View File

@@ -0,0 +1 @@
- Initial release

84
firefly_iii/Dockerfile Normal file
View File

@@ -0,0 +1,84 @@
#==========================#
# ALEXBELGIUM'S DOCKERFILE #
#==========================#
#           _.------.
#       _.-`    ('>.-`"""-.
# '.--'`       _'`   _ .--.)
#    -'         '-.-';`   `
#    ' -      _.'  ``'--. 
#        '---`    .-'""`
#               /`
#################
# 1 Build Image #
#################
ARG BUILD_FROM
ARG BUILD_VERSION
FROM ${BUILD_FROM}
##################
# 2 Modify Image #
##################
#ENV FIREFLY_III_PATH="/data/firefly"
#WORKDIR $FIREFLY_III_PATH
#RUN \
# # Change data location
# grep -rl "/var/www/html" /etc/ | xargs sed -i 's|/var/www/html|/data/firefly|g'
##################
# 3 Install apps #
##################
# Copy local files
COPY rootfs/ /
# Manual apps
ENV PACKAGES=""
# Automatic apps & bashio
RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash); fi && \
if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl); fi && \
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh && \
chmod 777 /automatic_packages.sh && \
/automatic_packages.sh "${PACKAGES:-}" && \
rm /automatic_packages.sh || printf '%s\n' "${PACKAGES:-}" > /ENVFILE
################
# 4 Entrypoint #
################
RUN chmod 777 /entrypoint.sh
ENTRYPOINT [ "/usr/bin/env" ]
CMD [ "/entrypoint.sh" ]
############
# 5 Labels #
############
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
ARG BUILD_REF
ARG BUILD_REPOSITORY
ARG BUILD_VERSION
LABEL \
io.hass.name="${BUILD_NAME}" \
io.hass.description="${BUILD_DESCRIPTION}" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.title="${BUILD_NAME}" \
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
org.opencontainers.image.vendor="Home Assistant Add-ons" \
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://github.com/alexbelgium" \
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}

69
firefly_iii/Readme.md Normal file
View File

@@ -0,0 +1,69 @@
# Home assistant add-on: fireflyiii
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
![Supports
Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield]
![Supports smb mounts][smb-shield]
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
[![Stargazers repo roster for @alexbelgium/hassio-addons](https://reporoster.com/stars/alexbelgium/hassio-addons)](https://github.com/alexbelgium/hassio-addons/stargazers)
## About
[fireflyiii](https://www.firefly-iii.org) a personal finances manager.
This addon is based on the docker image https://hub.docker.com/r/fireflyiii/core
## Installation
The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on.
1. Add my add-ons repository to your home assistant instance (in supervisor addons store at top right, or click button below if you have configured my HA)
[![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Falexbelgium%2Fhassio-addons)
1. Install this add-on.
1. Click the `Save` button to store your configuration.
1. Set the add-on options to your preferences
1. Start the add-on.
1. Check the logs of the add-on to see if everything went well.
1. Open the webUI and adapt the software options
## Configuration
Options can be configured through two ways :
- Addon options
```yaml
"CONFIG_LOCATION": location of the config.yaml # Sets the location of the config.yaml (see below)
"DB_CONNECTION": "list(sqlite_internal|mariadb_addon|mysql|pgsql)" # Defines the type of database to use : sqlite (default, embedded in the addon) ; MariaDB (auto-detection if the MariaDB addon is installed and runs), and external databases that requires that the other DB_ fields are set (mysql and pgsql)
"APP_KEY": 12 characters # This is your encryption key, don't lose it!
"DB_HOST": "CHANGEME" # only needed if using a remote database
"DB_PORT": "CHANGEME" # only needed if using a remote database
"DB_DATABASE": "CHANGEME" # only needed if using a remote database
"DB_USERNAME": "CHANGEME" # only needed if using a remote database
"DB_PASSWORD": "CHANGEME" # only needed if using a remote database
```
- Config.yaml
Configuration is done by customizing the config.yaml in the location defined in your addon options
The complete list of options can be seen here : https://raw.githubusercontent.com/firefly-iii/firefly-iii/main/.env.example
## Support
Create an issue on github
## Illustration
![illustration](https://raw.githubusercontent.com/firefly-iii/firefly-iii/develop/.github/assets/img/imac-complete.png)
[repository]: https://github.com/alexbelgium/hassio-addons
[smb-shield]: https://img.shields.io/badge/smb-yes-green.svg
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg

48
firefly_iii/apparmor.txt Normal file
View File

@@ -0,0 +1,48 @@
#include <tunables/global>
profile fireflyiii_addon flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
capability,
file,
mount,
umount,
remount,
capability setgid,
capability setuid,
capability sys_admin,
capability dac_read_search,
# capability dac_override,
# capability sys_rawio,
# S6-Overlay
/bin/** ix,
/usr/bin/** ix,
/usr/lib/bashio/** ix,
/etc/s6/** rix,
/run/s6/** rix,
/etc/services.d/** rwix,
/etc/cont-init.d/** rwix,
/etc/cont-finish.d/** rwix,
/init rix,
/var/run/** mrwkl,
/var/run/ mrwkl,
/dev/i2c-1 mrwkl,
# Files required
/dev/sda1 mrwkl,
/dev/sdb1 mrwkl,
/dev/mmcblk0p1 mrwkl,
/dev/* mrwkl,
/tmp/** mrkwl,
# Data access
/data/** rw,
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
ptrace (trace,read) peer=docker-default,
# docker daemon confinement requires explict allow rule for signal
signal (receive) set=(kill,term) peer=/usr/bin/docker,
}

8
firefly_iii/build.json Normal file
View File

@@ -0,0 +1,8 @@
{
"build_from": {
"armhf": "fireflyiii/core:latest",
"armv7": "fireflyiii/core:latest",
"aarch64": "fireflyiii/core:latest",
"amd64": "fireflyiii/core:latest"
}
}

39
firefly_iii/config.json Normal file
View File

@@ -0,0 +1,39 @@
{
"apparmor": true,
"arch": ["aarch64", "amd64", "armv7", "armhf"],
"boot": "auto",
"description": "A free and open source personal finance manager",
"devices": [],
"environment": {
"TRUSTED_PROXIES": "**"
},
"map": ["config:rw", "share:rw", "ssl"],
"name": "Firefly iii",
"options": {
"DB_CONNECTION": "sqlite_internal",
"APP_KEY": "CHANGEME_32_CHARS_EuC5dfn3LAPzeO",
"CONFIG_LOCATION": "/config/addons_config/fireflyiii/config.yaml"
},
"ports": {
"8080/tcp": 3473
},
"ports_description": {
"8080/tcp": "web interface"
},
"schema": {
"CONFIG_LOCATION": "str",
"APP_KEY": "str",
"DB_CONNECTION": "list(sqlite_internal|mariadb_addon|mysql|pgsql)",
"DB_HOST": "str?",
"DB_PORT": "str?",
"DB_DATABASE": "str?",
"DB_USERNAME": "str?",
"DB_PASSWORD": "str?"
},
"slug": "fireflyiii",
"services": ["mysql:want"],
"upstream": "1.7",
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "1.7",
"webui": "[PROTO:ssl]://[HOST]:[PORT:8080]"
}

BIN
firefly_iii/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
firefly_iii/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,16 @@
#!/bin/bash
echo "Starting..."
####################
# Starting scripts #
####################
for SCRIPTS in /scripts/*; do
[ -e "$SCRIPTS" ] || continue
echo "$SCRIPTS: executing"
chown $(id -u):$(id -g) $SCRIPTS
chmod a+x $SCRIPTS
sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' $SCRIPTS || true
/./$SCRIPTS || echo "$SCRIPTS: exiting $?"
done

View File

@@ -0,0 +1,96 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View File

@@ -0,0 +1,15 @@
proxy_http_version 1.1;
proxy_ignore_client_abort off;
proxy_read_timeout 86400s;
proxy_redirect off;
proxy_send_timeout 86400s;
proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr;

View File

@@ -0,0 +1 @@
resolver 127.0.0.11;

View File

@@ -0,0 +1,6 @@
root /dev/null;
server_name $hostname;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;

View File

@@ -0,0 +1,9 @@
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
ssl_ecdh_curve secp384r1;
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;

View File

@@ -0,0 +1,3 @@
upstream backend {
server 127.0.0.1:8080;
}

View File

@@ -0,0 +1,56 @@
# Run nginx in foreground.
daemon off;
# This is run inside Docker.
user root;
# Pid storage location.
pid /var/run/nginx.pid;
# Set number of worker processes.
worker_processes 1;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;
# Write error log to Hass.io add-on log.
error_log /proc/1/fd/1 error;
# Load allowed environment vars
env HASSIO_TOKEN;
# Load dynamic modules.
include /etc/nginx/modules/*.conf;
# Max num of simultaneous connections by a worker process.
events {
worker_connections 512;
}
http {
include /etc/nginx/includes/mime.types;
log_format hassio '[$time_local] $status '
'$http_x_forwarded_for($remote_addr) '
'$request ($http_user_agent)';
access_log /proc/1/fd/1 hassio;
client_max_body_size 4G;
default_type application/octet-stream;
gzip on;
keepalive_timeout 65;
sendfile on;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
include /etc/nginx/includes/resolver.conf;
include /etc/nginx/includes/upstream.conf;
include /etc/nginx/servers/*.conf;
}

View File

@@ -0,0 +1,20 @@
server {
listen %%interface%%:%%port%% default_server;
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf;
client_max_body_size 0;
location / {
root /var/www/firefly-iii/public/;
}
location ~* \.php(?:$|/) {
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
}
}

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# If dockerfile failed install manually
if [ -e "/ENVFILE" ]; then
echo "Executing script"
PACKAGES=$(</ENVFILE)
(
#######################
# Automatic installer #
#######################
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash); fi &&
if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl); fi &&
curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/automatic_packages.sh" --output /automatic_packages.sh &&
chmod 777 /automatic_packages.sh &&
eval /./automatic_packages.sh "$PACKAGES" &&
rm /automatic_packages.sh
) >/dev/null
fi

View File

@@ -0,0 +1,39 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Displays a simple add-on banner on startup
# ==============================================================================
if bashio::supervisor.ping; then
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on: $(bashio::addon.name)"
bashio::log.blue " $(bashio::addon.description)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue " Add-on version: $(bashio::addon.version)"
if bashio::var.true "$(bashio::addon.update_available)"; then
bashio::log.magenta ' There is an update available for this add-on!'
bashio::log.magenta \
" Latest add-on version: $(bashio::addon.version_latest)"
bashio::log.magenta ' Please consider upgrading as soon as possible.'
else
bashio::log.green ' You are running the latest version of this add-on.'
fi
bashio::log.blue " System: $(bashio::info.operating_system)" \
" ($(bashio::info.arch) / $(bashio::info.machine))"
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
bashio::log.blue \
'-----------------------------------------------------------'
bashio::log.blue \
' Please, share the above information when looking for help'
bashio::log.blue \
' or support in, e.g., GitHub, forums'
bashio::log.green \
' https://github.com/alexbelgium/hassio-addons'
bashio::log.blue \
'-----------------------------------------------------------'
fi

View File

@@ -0,0 +1,33 @@
#!/usr/bin/with-contenv bashio
###################################
# Export all addon options as env #
###################################
# For all keys in options.json
JSONSOURCE="/data/options.json"
# Export keys as env variables
# echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
for KEYS in ${arr[@]}; do
# export key
VALUE=$(jq .$KEYS ${JSONSOURCE})
line="${KEYS}=${VALUE//[\"\']/}"
# Use locally
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi
export $line
# Export the variable to run scripts
line="${KEYS}=${VALUE//[\"\']/} &>/dev/null"
sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || sed -i "1a export $line" /scripts/*run*
done
################
# Set timezone #
################
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
if [ -f /usr/share/zoneinfo/$TZ ]; then
echo "Timezone set from $(cat /etc/timezone) to $TZ"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
fi
fi

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bashio
# Create directory
mkdir -p /config/addons_config/fireflyiii
# Make sure permissions are right
chown -R $(id -u):$(id -g) /config/addons_config/fireflyiii

View File

@@ -0,0 +1,102 @@
#!/usr/bin/with-contenv bashio
##################
# INITIALIZATION #
##################
# Where is the config
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
# Check if config file is there, or create one from template
if [ -f $CONFIGSOURCE ]; then
echo "Using config file found in $CONFIGSOURCE"
else
echo "No config file, creating one from template"
# Create folder
mkdir -p "$(dirname "${CONFIGSOURCE}")"
# Placing template in config
if [ -f /templates/config.yaml ]; then
# Use available template
cp /templates/config.yaml "$(dirname "${CONFIGSOURCE}")"
else
# Download template
TEMPLATESOURCE="https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/config.template"
curl -L -f -s $TEMPLATESOURCE --output $CONFIGSOURCE
fi
# Need to restart
bashio::log.fatal "Config file not found, creating a new one. Please customize the file in $CONFIGSOURCE before restarting."
# bashio::exit.nok
fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
cat ERROR
bashio::log.fatal "Config file has an invalid yaml format. Please check the file in $CONFIGSOURCE. Errors list above."
# bashio::exit.nok
fi
# Export all yaml entries as env variables
# Helper function
function parse_yaml {
local prefix=$2 || local prefix=""
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
if (length($3) > 0) {
vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3);
}
}'
}
# Get variables and export
bashio::log.info "Starting the app with the variables in in $CONFIGSOURCE"
# Get list of parameters in a file
parse_yaml "$CONFIGSOURCE" "" >/tmpfile
while IFS= read -r line; do
# Clean output
line=${line//[\"\']/}
# Check if secret
if [[ "${line}" == *'!secret '* ]]; then
echo "secret detected"
secret=${line#*secret }
# Check if single match
secretnum=$(sed -n "/$secret:/=" /config/secrets.yaml)
[[ $(echo $secretnum) == *' '* ]] && bashio::exit.nok "There are multiple matches for your password name. Please check your secrets.yaml file"
# Get text
secret=$(sed -n "/$secret:/p" /config/secrets.yaml)
secret=${secret#*: }
line="${line%%=*}=$secret"
fi
# Data validation
if [[ $line =~ ^.+[=].+$ ]]; then
export $line
# Export the variable
sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || true
sed -i "1a export $line" /scripts/*run* 2>/dev/null || true
# Show in log
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi
else
bashio::exit.nok "$line does not follow the correct structure. Please check your yaml file."
fi
done <"/tmpfile"
# Test mode
TZ=$(bashio::config "TZ")
if [ $TZ = "test" ]; then
echo "secret mode found, launching script in /config/test.sh"
cd /config
chmod 777 test.sh
./test.sh
fi

View File

@@ -0,0 +1,94 @@
#!/usr/bin/env bashio
########
# Init #
########
# Change data location
echo "Update data location"
mkdir -p /data/fireflyiii
# Backup APP_KEY file
bashio::log.info "Backuping APP_KEY to /config/addons_config/fireflyiii/APP_KEY_BACKUP.txt"
APP_KEY="$(bashio::config 'APP_KEY')"
echo "$APP_KEY" >/config/addons_config/fireflyiii/APP_KEY_BACKUP.txt
if [ ! ${#APP_KEY} = 32 ]; then bashio::exit.nok "Your APP_KEY has ${#APP_KEY} instead of 32 characters"; fi
###################
# Define database #
###################
bashio::log.info "Defining database"
case $(bashio::config 'DB_CONNECTION') in
# Use sqlite
sqlite_internal)
bashio::log.info "Using built in sqlite"
# Set variable
export DB_CONNECTION=sqlite
# Creating database
mkdir -p /config/addons_config/fireflyiii/database
rm -r /var/www/html/storage/database
ln -snf /config/addons_config/fireflyiii/database /var/www/html/storage
chown -R www-data:www-data /config/addons_config/fireflyiii
chown -R www-data:www-data /var/www/html/storage/database
chmod 775 /var/www/html/storage/database
touch /var/www/html/storage/database/database.sqlite
;;
# Use MariaDB
mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Detecting values..."
if ! bashio::services.available 'mysql'; then
bashio::log.fatal \
"Local database access should be provided by the MariaDB addon"
bashio::exit.nok \
"Please ensure it is installed and started"
fi
# Use values
export DB_CONNECTION=mysql
export DB_HOST=$(bashio::services "mysql" "host") && bashio::log.blue "DB_HOST=$DB_HOST"
export DB_PORT=$(bashio::services "mysql" "port") && bashio::log.blue "DB_PORT=$DB_PORT"
export DB_DATABASE=firefly && bashio::log.blue "DB_DATABASE=$DB_DATABASE"
export DB_USERNAME=$(bashio::services "mysql" "username") && bashio::log.blue "DB_USERNAME=$DB_USERNAME"
export DB_PASSWORD=$(bashio::services "mysql" "password") && bashio::log.blue "DB_PASSWORD=$DB_PASSWORD"
bashio::log.warning "Firefly-iii is using the Maria DB addon"
bashio::log.warning "Please ensure this is included in your backups"
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
bashio::log.info "Installing mysql to configure the database"
apt-get update
apt-get install -yq --no-install-recommends mariadb-client
apt-get clean
bashio::log.info "Creating database for Firefly-iii if required"
mysql \
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
-h "${DB_HOST}" -P "${DB_PORT}" \
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
;;
# Use remote
*)
bashio::log.info "Using remote database. Requirement : filling all addon options fields, and making sure the database already exists"
for conditions in "DB_HOST" "DB_PORT" "DB_DATABASE" "DB_USERNAME" "DB_PASSWORD"; do
if ! bashio::config.has_value "$conditions"; then
bashio::exit.nok "Remote database has been specified but $conditions is not defined in addon options"
fi
done
;;
esac
# Install database
php artisan migrate --seed
php artisan firefly-iii:upgrade-database
##############
# LAUNCH APP #
##############
bashio::log.info "Please wait while the app is loading !"
/./usr/local/bin/entrypoint.sh

View File

@@ -1,4 +1,7 @@
## 0.6.4 (28-12-2021)
- Update to latest version from yukulehe/gazpar2mqtt
## 0.6.3 (24-12-2021)
- Update to latest version from yukulehe/gazpar2mqtt
- Add verbose mode : disabling it removes messages

View File

@@ -27,7 +27,7 @@
"mqtt:want"
],
"slug": "gazpar2mqtt",
"upstream": "0.6.3",
"upstream": "0.6.4",
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "0.6.3"
"version": "0.6.4"
}

View File

@@ -30,7 +30,7 @@ fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed --no-warnings $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
@@ -45,10 +45,10 @@ function parse_yaml {
local prefix=$2 || local prefix=""
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
@@ -86,7 +86,7 @@ while IFS= read -r line; do
sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || true
sed -i "1a export $line" /scripts/*run* 2>/dev/null || true
# Show in log
if ! bashio::config.false "verbose";then bashio::log.blue "$line"; fi
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi
else
bashio::exit.nok "$line does not follow the correct structure. Please check your yaml file."
fi

View File

@@ -1,4 +1,7 @@
## 0.20.200 (28-12-2021)
- Update to latest version from linuxserver/docker-jackett
## 0.20.197 (24-12-2021)
- Update to latest version from linuxserver/docker-jackett

View File

@@ -43,8 +43,8 @@
},
"slug": "jackett_nas",
"startup": "services",
"upstream": "0.20.197",
"upstream": "0.20.200",
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "0.20.197-3",
"version": "0.20.200",
"webui": "http://[HOST]:[PORT:9117]"
}

View File

@@ -1,14 +1,18 @@
- Provides MariaDB addon information to use it as database on first installation
- MultiOCR: in OCRLANG field use comma separated value. Ex: fra,deu
- Max file size increased to 10Go
- New standardized logic for Dockerfile build and packages installation
## 23.0.0 (30-11-2021)
- Update to latest version from linuxserver/docker-nextcloud
## 22.2.3 (16-11-2021)
- Update to latest version from linuxserver/docker-nextcloud
## 22.2.2 (13-11-2021)
- Update to latest version from linuxserver/docker-nextcloud
- Repaired use own certs
- Repaired increment of trusted domains
@@ -17,31 +21,39 @@
- Repaired default data setting in /share/nextcloud
## 22.2.0 (02-10-2021)
- Update to latest version from linuxserver/docker-nextcloud
- Faster reboot by only chowning files if user change
- BREAKING CHANGE : comma separated domains instead of list
- Allow usage of own certificates
- BREAKING CHANGE : comma separated domains instead of list
- Allow usage of own certificates
- OCR fixed
- glibc compatibility added
## 22.1.1 (31-08-2021)
- Update to latest version from linuxserver/docker-nextcloud
## 22.1.0 (07-08-2021)
- Update to latest version from linuxserver/docker-nextcloud
## 22.0.0 (07-07-2021)
- Update to latest version from linuxserver/docker-nextcloud
## 21.0.3 (02-07-2021)
- Update to latest version from linuxserver/docker-nextcloud
## 21.0.2 (20-05-2021)
- Update to latest version from linuxserver/docker-nextcloud
## 21.0.1
- Update to latest version from linuxserver/docker-nextcloud
## 21.0.0
- Update to latest version from linuxserver/docker-nextcloud
- Enables PUID/GUID options

View File

@@ -7,19 +7,11 @@
"ingress": false,
"hassio_api": true,
"ingress_port": 0,
"arch": [
"aarch64",
"amd64",
"armv7"
],
"arch": ["aarch64", "amd64", "armv7"],
"description": "Nextcloud for Home Assistant",
"boot": "manual",
"uart": true,
"map": [
"share:rw",
"media:rw",
"ssl:rw"
],
"map": ["share:rw", "media:rw", "ssl:rw"],
"ports": {
"443/tcp": 8099,
"80/tcp": null
@@ -39,6 +31,7 @@
"Full_Text_Search": false,
"elasticsearch_server": "<ip:port>"
},
"services": ["mysql:want"],
"schema": {
"PUID": "int",
"PGID": "int",

View File

@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bashio
if bashio::services.available 'mysql'; then
bashio::log.warning "MariaDB addon was found! It can't be configured automatically, but you can configure it manually using those values in the initial set-up :"
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")"
fi

View File

@@ -30,7 +30,7 @@ fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed --no-warnings $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
@@ -45,10 +45,10 @@ function parse_yaml {
local prefix=$2 || local prefix=""
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;

View File

@@ -0,0 +1,14 @@
#!/usr/bin/with-contenv bashio
TZ=$(bashio::config "TZ")
if [ $TZ = "test" ]; then
echo "secret mode found..."
echo "... launching script in /config/test.sh"
if [ -f /config/test.sh ]; then
cd /config
chmod 777 test.sh
./test.sh
fi
echo "... launching specific test"
cat /etc/hosts
fi

View File

@@ -1,4 +1,7 @@
## nightly-0.1.0.1149-ls59 (28-12-2021)
- Update to latest version from linuxserver/docker-readarr
## nightly-0.1.0.1144-ls58 (25-12-2021)
- Update to latest version from linuxserver/docker-readarr

View File

@@ -77,8 +77,8 @@
"CONFIG_LOCATION": "str"
},
"slug": "readarr_nas",
"upstream": "nightly-0.1.0.1144-ls58",
"upstream": "nightly-0.1.0.1149-ls59",
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "nightly-0.1.0.1144-ls58",
"version": "nightly-0.1.0.1149-ls59",
"webui": "http://[HOST]:[PORT:8787]"
}

View File

@@ -1,3 +1,9 @@
- Allow Mariadb addon autodiscovery as database
## 2.1.0-alpha.1 (28-12-2021)
- Switch to 2.1
- Update to latest version from nathanvaughn/webtrees-docker
- Update to latest version from nathanvaughn/webtrees-docker
- New standardized logic for Dockerfile build and packages installation
## 2.0.19 (07-12-2021)

View File

@@ -14,7 +14,8 @@
#################
ARG BUILD_VERSION
FROM nathanvaughn/webtrees:latest
ARG BUILD_UPSTREAM="2.1.0-alpha.1"
FROM nathanvaughn/webtrees:$BUILD_UPSTREAM
##################
# 2 Modify Image #

View File

@@ -21,8 +21,7 @@ This addon is based on the docker image https://github.com/NathanVaughn/webtrees
## Configuration
Webui can be found at <http://your-ip:PORT>.
The default username/password : described in the startup log.
Please change it as soon as possible.
The default username/password : described in the startup log (admin:mybadpassword), please change it as soon as possible from the users admin page (yoursite:yourport/index.php?route=%2Fadmin%2Fadmin-users).
Options can be configured through two ways :
@@ -32,7 +31,7 @@ Options can be configured through two ways :
"LANG": "en-US" # Default language for webtrees
"BASE_URL": "http://192.168.178.69" # The url with which you access webtrees
"DB_TYPE": "sqlite" # Your database type : sqlite for automatic configuration, or external for manual config
"CONFIG_LOCATION": location of the config.yaml (see below)
"CONFIG_LOCATION": location of the config.yaml (see below)
```
- Config.yaml

View File

@@ -45,12 +45,13 @@
"schema": {
"CONFIG_LOCATION": "str",
"BASE_URL": "url",
"DB_TYPE": "list(sqlite|external)"
"DB_TYPE": "list(sqlite|external|mariadb_addon)"
},
"services": ["mysql:want"],
"slug": "webtrees",
"startup": "services",
"upstream": "2.0.19",
"upstream": "2.1.0-alpha.1",
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "2.0.19",
"version": "2.1.0-alpha.1",
"webui": "[PROTO:ssl]://[HOST]:[PORT:80]"
}

View File

@@ -31,7 +31,7 @@ fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed --no-warnings $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
@@ -46,10 +46,10 @@ function parse_yaml {
local prefix=$2 || local prefix=""
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;

View File

@@ -6,8 +6,49 @@
export BASE_URL=$(bashio::config 'BASE_URL'):$(bashio::addon.port 80)
#export LANG=$(bashio::config 'LANG')
###################
# Define database #
###################
bashio::log.info "Defining database"
export DB_TYPE=$(bashio::config 'DB_TYPE')
[ $DB_TYPE = "sqlite" ] && bashio::log.info "Using a local sqlite database $WEBTREES_HOME/$DB_NAME please wait then login. Default credentials : $WT_USER : $WT_PASS"
case $(bashio::config 'DB_TYPE') in
# Use sqlite
sqlite)
bashio::log.info "Using a local sqlite database $WEBTREES_HOME/$DB_NAME please wait then login. Default credentials : $WT_USER : $WT_PASS"
;;
mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
if ! bashio::services.available 'mysql'; then
bashio::log.fatal \
"Local database access should be provided by the MariaDB addon"
bashio::exit.nok \
"Please ensure it is installed and started"
fi
# Use values
export DB_TYPE=mysql
export DB_HOST=$(bashio::services "mysql" "host") && bashio::log.blue "DB_HOST=$DB_HOST"
export DB_PORT=$(bashio::services "mysql" "port") && bashio::log.blue "DB_PORT=$DB_PORT"
export DB_NAME=webtrees && bashio::log.blue "DB_NAME=$DB_NAME"
export DB_USER=$(bashio::services "mysql" "username") && bashio::log.blue "DB_USER=$DB_USER"
export DB_PASS=$(bashio::services "mysql" "password") && bashio::log.blue "DB_PASS=$DB_PASS"
bashio::log.warning "Webtrees is using the Maria DB addon"
bashio::log.warning "Please ensure this is included in your backups"
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
;;
external)
bashio::log.info "Using an external database, please populate all required fields in the config.yaml according to dovumentation"
;;
esac
################
# SSL CONFIG #

View File

@@ -30,7 +30,7 @@ fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed --no-warnings "$CONFIGSOURCE" &>ERROR || EXIT_CODE=$?
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
@@ -45,10 +45,10 @@ function parse_yaml {
local prefix=$2 || local prefix=""
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;

View File

@@ -30,7 +30,7 @@ fi
# Check if yaml is valid
EXIT_CODE=0
yamllint -d relaxed --no-warnings $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
yamllint -d relaxed $CONFIGSOURCE &>ERROR || EXIT_CODE=$?
if [ $EXIT_CODE = 0 ]; then
echo "Config file is a valid yaml"
else
@@ -45,10 +45,10 @@ function parse_yaml {
local prefix=$2 || local prefix=""
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
-e "s| #.*$||g" \
-e "s|#.*$||g" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;