cron user

This commit is contained in:
Alexandre
2022-01-17 11:26:09 +01:00
parent 931845e0a4
commit d32cf48b4f
2 changed files with 16 additions and 16 deletions

View File

@@ -75,9 +75,9 @@ mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Detecting values..." bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Detecting values..."
if ! bashio::services.available 'mysql'; then if ! bashio::services.available 'mysql'; then
bashio::log.fatal \ 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 \ bashio::exit.nok \
"Please ensure it is installed and started" "Please ensure it is installed and started"
fi fi
# Use values # Use values
@@ -100,9 +100,9 @@ mariadb_addon)
bashio::log.info "Creating database for Firefly-iii if required" bashio::log.info "Creating database for Firefly-iii if required"
mysql \ mysql \
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \ -u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
-h "${DB_HOST}" -P "${DB_PORT}" \ -h "${DB_HOST}" -P "${DB_PORT}" \
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;" -e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
;; ;;
# Use remote # Use remote
@@ -132,6 +132,9 @@ if bashio::config.has_value 'Updates'; then
cp /templates/cronupdate /etc/cron."${FREQUENCY}"/ cp /templates/cronupdate /etc/cron."${FREQUENCY}"/
chmod 777 /etc/cron."${FREQUENCY}"/cronupdate chmod 777 /etc/cron."${FREQUENCY}"/cronupdate
# Sets cron to run with www-data user
sed -i 's|root|www-data|g' /etc/crontab
# Starts cron # Starts cron
service cron start service cron start
fi fi
@@ -143,8 +146,8 @@ fi
bashio::log.info "Please wait while the app is loading !" bashio::log.info "Please wait while the app is loading !"
if bashio::config.true 'silent'; then if bashio::config.true 'silent'; then
bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug" bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug"
/./usr/local/bin/entrypoint.sh >/dev/null /./usr/local/bin/entrypoint.sh >/dev/null
else else
/./usr/local/bin/entrypoint.sh /./usr/local/bin/entrypoint.sh
fi fi

View File

@@ -2,11 +2,8 @@
bashio::info "Running update according to defined schedule" bashio::info "Running update according to defined schedule"
if bashio::config.true 'silent'; then if bashio::config.true 'silent'; then
bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug" bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug"
/usr/local/bin/php /var/www/html/artisan firefly:cron >/dev/null /usr/local/bin/php /var/www/html/artisan firefly:cron >/dev/null
else else
/usr/local/bin/php /var/www/html/artisan firefly:cron /usr/local/bin/php /var/www/html/artisan firefly:cron
fi fi
chown -R www-data:www-data /config/addons_config/fireflyiii
chown -R www-data:www-data /var/www/html/storage