allows cron job

This commit is contained in:
Alexandre
2022-01-14 22:19:42 +01:00
parent 5b2ffb277d
commit a919368642
6 changed files with 41 additions and 28 deletions

View File

@@ -1,10 +1,14 @@
- Allowed automatic update in hourly, daily or weekly setting from addon options
## 5.6.10 (09-01-2022)
- Update to latest version from firefly-iii/firefly-iii
## 5.6.9 (04-01-2022)
- Update to latest version from firefly-iii/firefly-iii
## 5.6.8 (29-12-2021)
- Update to latest version from firefly-iii/firefly-iii
- Initial release

View File

@@ -43,10 +43,10 @@ RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get
mkdir -p /tmpscripts /etc/cont-init.d && \
for scripts in $MODULES; do curl -L -f -s "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/zzz_templates/$scripts" -o /tmpscripts/"$scripts"; done && \
if [ -d /etc/cont-init.d ]; then /bin/cp -rf /tmpscripts/* /etc/cont-init.d/ && chmod -R 755 /etc/cont-init.d; fi && \
rm -rf /tmpscripts || printf '%s\n' "${MODULES:-}" > /MODULESFILE
rm -rf /tmpscripts || printf '%s\n' "${MODULES:-}" > /MODULESFILE
# Manual apps
ENV PACKAGES="jq"
ENV PACKAGES="cron"
# 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 && \

View File

@@ -4,7 +4,7 @@
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
![Supports
![Supports
Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield]
![Supports smb mounts][smb-shield]
@@ -19,7 +19,7 @@ This addon is based on the docker image https://hub.docker.com/r/fireflyiii/core
## Configuration
PLEASE CHANGE YOUR APP_KEY BEFORE FIRST LAUNCH! YOU WON'T BE ABLE AFTERWRADS WITHOUT RESETTING YOUR DATABASE.
PLEASE CHANGE YOUR APP_KEY BEFORE FIRST LAUNCH! YOU WON'T BE ABLE AFTERWRADS WITHOUT RESETTING YOUR DATABASE.
Options can be configured through two ways :
@@ -34,6 +34,7 @@ Options can be configured through two ways :
"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
"Updates": hourly|daily|weekly # Sets an automatic update
```
- Config.yaml

View File

@@ -1,27 +1,19 @@
{
"apparmor": true,
"arch": [
"aarch64",
"amd64",
"armv7",
"armhf"
],
"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"
],
"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"
"CONFIG_LOCATION": "/config/addons_config/fireflyiii/config.yaml",
"Updates": "daily"
},
"ports": {
"8080/tcp": 3473
@@ -37,14 +29,13 @@
"DB_PORT": "str?",
"DB_DATABASE": "str?",
"DB_USERNAME": "str?",
"DB_PASSWORD": "str?"
"DB_PASSWORD": "str?",
"Updates": "list(|hourly|daily|weekly)"
},
"slug": "fireflyiii",
"services": [
"mysql:want"
],
"services": ["mysql:want"],
"upstream": "5.6.10",
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "5.6.10",
"version": "5.6.10-2",
"webui": "[PROTO:ssl]://[HOST]:[PORT:8080]"
}

View File

@@ -13,7 +13,7 @@ if [ ! ${#APP_KEY} = 32 ]; then bashio::exit.nok "Your APP_KEY has ${#APP_KEY} i
# Backup APP_KEY file
bashio::log.info "Backuping APP_KEY to /config/addons_config/fireflyiii/APP_KEY_BACKUP.txt"
bashio::log.warning "Changing this value will require to reset your database"
bashio::log.warning "Changing this value will require to reset your database"
APP_KEY="$(bashio::config 'APP_KEY')"
# Get current app_key
@@ -23,7 +23,7 @@ CURRENT=$(sed -e '/^[<blank><tab>]*$/d' /config/addons_config/fireflyiii/APP_KEY
# Save if new
if [ "$CURRENT" != "$APP_KEY" ]; then
echo "$APP_KEY" >>/config/addons_config/fireflyiii/APP_KEY_BACKUP.txt
echo "$APP_KEY" >>/config/addons_config/fireflyiii/APP_KEY_BACKUP.txt
fi
###################
@@ -53,9 +53,9 @@ 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"
"Local database access should be provided by the MariaDB addon"
bashio::exit.nok \
"Please ensure it is installed and started"
"Please ensure it is installed and started"
fi
# Use values
@@ -76,9 +76,9 @@ mariadb_addon)
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\` ;"
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
-h "${DB_HOST}" -P "${DB_PORT}" \
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
;;
# Use remote
@@ -97,6 +97,20 @@ esac
php artisan migrate --seed
php artisan firefly-iii:upgrade-database
################
# CRON OPTIONS #
################
# Align update with options
echo ""
FREQUENCY=$(bashio::config 'Updates')
bashio::log.info "$FREQUENCY updates"
echo ""
# Sets cron // do not delete this message
cp /templates/cronupdate /etc/cron.${FREQUENCY}
chmod 775 /etc/cron.${FREQUENCY}/cronupdate.sh
##############
# LAUNCH APP #
##############

View File

@@ -0,0 +1,3 @@
#!/bin/bash
/usr/local/bin/php /var/www/html/artisan firefly:cron