1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invoiceninja_ynh.git synced 2024-09-03 19:26:22 +02:00

Merge pull request #2 from YunoHost-Apps/cron

Add Cronjobs to send Recurring invoices and reminder emails
This commit is contained in:
Sebastian Gumprich 2020-05-14 21:48:22 +02:00 committed by GitHub
commit 07dffc9ff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 6 deletions

View file

@ -1,6 +1,6 @@
# Invoice Ninja for YunoHost
[![Integration level](https://dash.yunohost.org/integration/invoiceninja.svg)](https://dash.yunohost.org/appci/app/invoiceninja)
[![Integration level](https://dash.yunohost.org/integration/invoiceninja.svg)](https://dash.yunohost.org/appci/app/invoiceninja)
[![Install invoiceninja with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=invoiceninja)
> *This package allow you to install invoiceninja quickly and simply on a YunoHost server.
@ -52,11 +52,7 @@ Configuration happens in the application itself.
* Upstream app repository: https://github.com/invoiceninja/invoiceninja
* YunoHost website: https://yunohost.org/
## TODOs
* Completely configure the env
* Mail settings
* Cronjobs
* Create initial user?
* If possible, create initial user
* Test upgrade

3
conf/invoiceninja.cron Normal file
View file

@ -0,0 +1,3 @@
0 8 * * * __USER__ /usr/bin/php__YNH_PHP_VERSION__ __DESTDIR__/artisan ninja:send-invoices -q
0 8 * * * __USER__ /usr/bin/php__YNH_PHP_VERSION__ __DESTDIR__/artisan ninja:send-reminders -q

View file

@ -24,6 +24,8 @@ ynh_abort_if_errors
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
YNH_PHP_VERSION="7.0"
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
@ -239,6 +241,19 @@ ynh_script_progression --message="Configuring log rotation..."
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# ADD A CRON JOB
#=================================================
cron_path="/etc/cron.d/$app"
cp -a ../conf/invoiceninja.cron "$cron_path"
chown root: "$cron_path"
chmod 644 "$cron_path"
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path"
ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path"
ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path"
#=================================================
# SETUP FAIL2BAN
#=================================================