1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

run cron task after notify push setup

This commit is contained in:
Kayou 2024-08-23 11:36:41 +02:00 committed by GitHub
parent ff2fd9a967
commit 9122f1dc2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 38 deletions

View file

@ -203,6 +203,29 @@ exec_occ config:app:set dav system_addressbook_exposed --value="$system_addressb
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$install_dir/config/config.php"
#=================================================
# CONFIGURE NOTIFY_PUSH APP
#=================================================
if [ $enable_notify_push -eq 1 ]
then
exec_occ app:install notify_push
exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push
mkdir -p /var/run/$app/
chown $app: /var/run/$app/
case $YNH_ARCH in
amd64) arch="x86_64";;
arm64) arch="aarch64";;
armel|armhf) arch="armv7";;
esac
ynh_add_systemd_config --service="${app}-notify-push"
ynh_add_systemd_config --service="${app}-notify-push-watcher" --template="watcher.service"
ynh_add_config --template="watcher.path" --destination="/etc/systemd/system/${app}-notify-push-watcher.path"
fi
#=================================================
# ADD A CRON JOB
#=================================================
@ -236,29 +259,6 @@ create_external_storage "/home/yunohost.multimedia/share" "Shared multimedia"
# Allow nextcloud to write into these directories
ynh_multimedia_addaccess $app
#=================================================
# CONFIGURE NOTIFY_PUSH APP
#=================================================
if [ $enable_notify_push -eq 1 ]
then
exec_occ app:install notify_push
exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push
mkdir -p /var/run/$app/
chown $app: /var/run/$app/
case $YNH_ARCH in
amd64) arch="x86_64";;
arm64) arch="aarch64";;
armel|armhf) arch="armv7";;
esac
ynh_add_systemd_config --service="${app}-notify-push"
ynh_add_systemd_config --service="${app}-notify-push-watcher" --template="watcher.service"
ynh_add_config --template="watcher.path" --destination="/etc/systemd/system/${app}-notify-push-watcher.path"
fi
#=================================================
# GENERIC FINALIZATION
#=================================================
@ -298,8 +298,6 @@ ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*
if [ $enable_notify_push -eq 1 ]
then
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd"

View file

@ -382,17 +382,6 @@ fi
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# CRON JOB
#=================================================
cron_path="/etc/cron.d/$app"
ynh_add_config --template="nextcloud.cron" --destination="$cron_path"
chown root: "$cron_path"
chmod 644 "$cron_path"
exec_occ background:cron
#=================================================
# CONFIGURE NOTIFY_PUSH APP
#=================================================
@ -422,6 +411,18 @@ then
ynh_add_config --template="watcher.path" --destination="/etc/systemd/system/${app}-notify-push-watcher.path"
fi
#=================================================
# CRON JOB
#=================================================
cron_path="/etc/cron.d/$app"
ynh_add_config --template="nextcloud.cron" --destination="$cron_path"
chown root: "$cron_path"
chmod 644 "$cron_path"
exec_occ background:cron
#=================================================
# LOGROTATE
#=================================================
@ -441,8 +442,6 @@ ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*
if [ $enable_notify_push -eq 1 ]
then
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" --action=restart