diff --git a/addons_updater/README.md b/addons_updater/README.md index 2538e36e0..099ac9ac3 100644 --- a/addons_updater/README.md +++ b/addons_updater/README.md @@ -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 diff --git a/enedisgateway2mqtt/rootfs/scripts/99-run.sh b/enedisgateway2mqtt/rootfs/scripts/99-run.sh index 2848ac474..5f73018b3 100644 --- a/enedisgateway2mqtt/rootfs/scripts/99-run.sh +++ b/enedisgateway2mqtt/rootfs/scripts/99-run.sh @@ -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?" diff --git a/enedisgateway2mqtt_dev/rootfs/scripts/99-run.sh b/enedisgateway2mqtt_dev/rootfs/scripts/99-run.sh index 989d9e3e5..42cdefabb 100644 --- a/enedisgateway2mqtt_dev/rootfs/scripts/99-run.sh +++ b/enedisgateway2mqtt_dev/rootfs/scripts/99-run.sh @@ -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?" diff --git a/firefly_iii/CHANGELOG.md b/firefly_iii/CHANGELOG.md new file mode 100644 index 000000000..66f7e8b76 --- /dev/null +++ b/firefly_iii/CHANGELOG.md @@ -0,0 +1 @@ +- Initial release diff --git a/firefly_iii/Dockerfile b/firefly_iii/Dockerfile new file mode 100644 index 000000000..6ba05707c --- /dev/null +++ b/firefly_iii/Dockerfile @@ -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} diff --git a/firefly_iii/Readme.md b/firefly_iii/Readme.md new file mode 100644 index 000000000..db6b08d1a --- /dev/null +++ b/firefly_iii/Readme.md @@ -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 diff --git a/firefly_iii/apparmor.txt b/firefly_iii/apparmor.txt new file mode 100644 index 000000000..64fe0c328 --- /dev/null +++ b/firefly_iii/apparmor.txt @@ -0,0 +1,48 @@ +#include + +profile fireflyiii_addon flags=(attach_disconnected,mediate_deleted) { + #include + + 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, + +} diff --git a/firefly_iii/build.json b/firefly_iii/build.json new file mode 100644 index 000000000..b46b44d2d --- /dev/null +++ b/firefly_iii/build.json @@ -0,0 +1,8 @@ +{ + "build_from": { + "armhf": "fireflyiii/core:latest", + "armv7": "fireflyiii/core:latest", + "aarch64": "fireflyiii/core:latest", + "amd64": "fireflyiii/core:latest" + } +} diff --git a/firefly_iii/config.json b/firefly_iii/config.json new file mode 100644 index 000000000..788607c96 --- /dev/null +++ b/firefly_iii/config.json @@ -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]" +} diff --git a/firefly_iii/icon.png b/firefly_iii/icon.png new file mode 100644 index 000000000..af3334c9c Binary files /dev/null and b/firefly_iii/icon.png differ diff --git a/firefly_iii/logo.png b/firefly_iii/logo.png new file mode 100644 index 000000000..af3334c9c Binary files /dev/null and b/firefly_iii/logo.png differ diff --git a/firefly_iii/rootfs/entrypoint.sh b/firefly_iii/rootfs/entrypoint.sh new file mode 100644 index 000000000..a948f3bbb --- /dev/null +++ b/firefly_iii/rootfs/entrypoint.sh @@ -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 diff --git a/firefly_iii/rootfs/etc/nginx/includes/mime.types b/firefly_iii/rootfs/etc/nginx/includes/mime.types new file mode 100644 index 000000000..7c7cdef2d --- /dev/null +++ b/firefly_iii/rootfs/etc/nginx/includes/mime.types @@ -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; +} diff --git a/firefly_iii/rootfs/etc/nginx/includes/proxy_params.conf b/firefly_iii/rootfs/etc/nginx/includes/proxy_params.conf new file mode 100644 index 000000000..1990d4959 --- /dev/null +++ b/firefly_iii/rootfs/etc/nginx/includes/proxy_params.conf @@ -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; diff --git a/firefly_iii/rootfs/etc/nginx/includes/resolver.conf b/firefly_iii/rootfs/etc/nginx/includes/resolver.conf new file mode 100644 index 000000000..6485af141 --- /dev/null +++ b/firefly_iii/rootfs/etc/nginx/includes/resolver.conf @@ -0,0 +1 @@ +resolver 127.0.0.11; diff --git a/firefly_iii/rootfs/etc/nginx/includes/server_params.conf b/firefly_iii/rootfs/etc/nginx/includes/server_params.conf new file mode 100644 index 000000000..09c06543e --- /dev/null +++ b/firefly_iii/rootfs/etc/nginx/includes/server_params.conf @@ -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; diff --git a/firefly_iii/rootfs/etc/nginx/includes/ssl_params.conf b/firefly_iii/rootfs/etc/nginx/includes/ssl_params.conf new file mode 100644 index 000000000..6f1500599 --- /dev/null +++ b/firefly_iii/rootfs/etc/nginx/includes/ssl_params.conf @@ -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; diff --git a/firefly_iii/rootfs/etc/nginx/includes/upstream.conf b/firefly_iii/rootfs/etc/nginx/includes/upstream.conf new file mode 100644 index 000000000..b292326bd --- /dev/null +++ b/firefly_iii/rootfs/etc/nginx/includes/upstream.conf @@ -0,0 +1,3 @@ +upstream backend { + server 127.0.0.1:8080; +} diff --git a/firefly_iii/rootfs/etc/nginx/nginx.conf b/firefly_iii/rootfs/etc/nginx/nginx.conf new file mode 100644 index 000000000..7e5bc6f7c --- /dev/null +++ b/firefly_iii/rootfs/etc/nginx/nginx.conf @@ -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; +} diff --git a/firefly_iii/rootfs/etc/nginx/servers/ingress.conf b/firefly_iii/rootfs/etc/nginx/servers/ingress.conf new file mode 100644 index 000000000..ae75a09fc --- /dev/null +++ b/firefly_iii/rootfs/etc/nginx/servers/ingress.conf @@ -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; + } +} + diff --git a/firefly_iii/rootfs/scripts/00-aaa_dockerfile_backup.sh b/firefly_iii/rootfs/scripts/00-aaa_dockerfile_backup.sh new file mode 100644 index 000000000..4f9ed9c51 --- /dev/null +++ b/firefly_iii/rootfs/scripts/00-aaa_dockerfile_backup.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# If dockerfile failed install manually +if [ -e "/ENVFILE" ]; then + echo "Executing script" + PACKAGES=$(/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 diff --git a/firefly_iii/rootfs/scripts/00-banner.sh b/firefly_iii/rootfs/scripts/00-banner.sh new file mode 100644 index 000000000..0ac294e9a --- /dev/null +++ b/firefly_iii/rootfs/scripts/00-banner.sh @@ -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 diff --git a/firefly_iii/rootfs/scripts/00-global_var.sh b/firefly_iii/rootfs/scripts/00-global_var.sh new file mode 100644 index 000000000..e88ad363a --- /dev/null +++ b/firefly_iii/rootfs/scripts/00-global_var.sh @@ -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 diff --git a/firefly_iii/rootfs/scripts/20-folders.sh b/firefly_iii/rootfs/scripts/20-folders.sh new file mode 100644 index 000000000..c81026609 --- /dev/null +++ b/firefly_iii/rootfs/scripts/20-folders.sh @@ -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 diff --git a/firefly_iii/rootfs/scripts/92-config_yaml.sh b/firefly_iii/rootfs/scripts/92-config_yaml.sh new file mode 100644 index 000000000..4ce48c496 --- /dev/null +++ b/firefly_iii/rootfs/scripts/92-config_yaml.sh @@ -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/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 diff --git a/firefly_iii/rootfs/scripts/99-run.sh b/firefly_iii/rootfs/scripts/99-run.sh new file mode 100644 index 000000000..bf8912ae5 --- /dev/null +++ b/firefly_iii/rootfs/scripts/99-run.sh @@ -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 diff --git a/gazpar2mqtt/CHANGELOG.md b/gazpar2mqtt/CHANGELOG.md index 19e16b1b7..f5b223cd4 100644 --- a/gazpar2mqtt/CHANGELOG.md +++ b/gazpar2mqtt/CHANGELOG.md @@ -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 diff --git a/gazpar2mqtt/config.json b/gazpar2mqtt/config.json index c9cd03f96..08bca8189 100644 --- a/gazpar2mqtt/config.json +++ b/gazpar2mqtt/config.json @@ -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" } diff --git a/gazpar2mqtt/rootfs/scripts/92-config_yaml.sh b/gazpar2mqtt/rootfs/scripts/92-config_yaml.sh index 97a89cbaa..4ce48c496 100644 --- a/gazpar2mqtt/rootfs/scripts/92-config_yaml.sh +++ b/gazpar2mqtt/rootfs/scripts/92-config_yaml.sh @@ -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 diff --git a/jackett/CHANGELOG.md b/jackett/CHANGELOG.md index cdea22158..0c094aa40 100644 --- a/jackett/CHANGELOG.md +++ b/jackett/CHANGELOG.md @@ -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 diff --git a/jackett/config.json b/jackett/config.json index 53c1f954e..ce40dcd30 100644 --- a/jackett/config.json +++ b/jackett/config.json @@ -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]" } diff --git a/nextcloud/CHANGELOG.md b/nextcloud/CHANGELOG.md index 44336c888..3a40f0f5d 100644 --- a/nextcloud/CHANGELOG.md +++ b/nextcloud/CHANGELOG.md @@ -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 diff --git a/nextcloud/config.json b/nextcloud/config.json index 723f75cd1..44024f9ec 100644 --- a/nextcloud/config.json +++ b/nextcloud/config.json @@ -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": "" }, + "services": ["mysql:want"], "schema": { "PUID": "int", "PGID": "int", diff --git a/nextcloud/rootfs/etc/cont-init.d/99-mariadb_discovery.sh b/nextcloud/rootfs/etc/cont-init.d/99-mariadb_discovery.sh new file mode 100644 index 000000000..2a66ddff5 --- /dev/null +++ b/nextcloud/rootfs/etc/cont-init.d/99-mariadb_discovery.sh @@ -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 diff --git a/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh b/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh index 0863cb6e5..4ce48c496 100644 --- a/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh +++ b/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh @@ -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; diff --git a/qbittorrent/rootfs/etc/cont-init.d/00-aaa_proxmox.sh b/qbittorrent/rootfs/etc/cont-init.d/00-aaa_proxmox.sh new file mode 100644 index 000000000..8328f32fd --- /dev/null +++ b/qbittorrent/rootfs/etc/cont-init.d/00-aaa_proxmox.sh @@ -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 diff --git a/readarr/CHANGELOG.md b/readarr/CHANGELOG.md index 31c7065ec..8d6964cc1 100644 --- a/readarr/CHANGELOG.md +++ b/readarr/CHANGELOG.md @@ -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 diff --git a/readarr/config.json b/readarr/config.json index 2cb67a5bf..99b34555f 100644 --- a/readarr/config.json +++ b/readarr/config.json @@ -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]" } diff --git a/webtrees/CHANGELOG.md b/webtrees/CHANGELOG.md index eae95dfe9..74a23349b 100644 --- a/webtrees/CHANGELOG.md +++ b/webtrees/CHANGELOG.md @@ -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) diff --git a/webtrees/Dockerfile b/webtrees/Dockerfile index d64d05606..32d6d75c8 100644 --- a/webtrees/Dockerfile +++ b/webtrees/Dockerfile @@ -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 # diff --git a/webtrees/README.md b/webtrees/README.md index 57c0937c7..94df39c5f 100644 --- a/webtrees/README.md +++ b/webtrees/README.md @@ -21,8 +21,7 @@ This addon is based on the docker image https://github.com/NathanVaughn/webtrees ## Configuration Webui can be found at . -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 diff --git a/webtrees/config.json b/webtrees/config.json index c86fdb67e..25ccf2a13 100644 --- a/webtrees/config.json +++ b/webtrees/config.json @@ -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]" } diff --git a/webtrees/rootfs/scripts/90-config_yaml.sh b/webtrees/rootfs/scripts/90-config_yaml.sh index 25ec801ba..dfbd34ff0 100644 --- a/webtrees/rootfs/scripts/90-config_yaml.sh +++ b/webtrees/rootfs/scripts/90-config_yaml.sh @@ -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; diff --git a/webtrees/rootfs/scripts/99-run.sh b/webtrees/rootfs/scripts/99-run.sh index 055959b79..38e690971 100644 --- a/webtrees/rootfs/scripts/99-run.sh +++ b/webtrees/rootfs/scripts/99-run.sh @@ -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 # diff --git a/whoogle/rootfs/scripts/90-config_yaml.sh b/whoogle/rootfs/scripts/90-config_yaml.sh index 283595d65..50ee2f1a3 100644 --- a/whoogle/rootfs/scripts/90-config_yaml.sh +++ b/whoogle/rootfs/scripts/90-config_yaml.sh @@ -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; diff --git a/zzz_templates/90-config_yaml.sh b/zzz_templates/90-config_yaml.sh index 0863cb6e5..4ce48c496 100644 --- a/zzz_templates/90-config_yaml.sh +++ b/zzz_templates/90-config_yaml.sh @@ -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;