mirror of
https://github.com/YunoHost-Apps/outline_ynh.git
synced 2024-09-03 19:56:12 +02:00
First try
This commit is contained in:
parent
e46c07af6c
commit
9aeda0018a
6 changed files with 42 additions and 0 deletions
1
conf/outline.cron
Normal file
1
conf/outline.cron
Normal file
|
@ -0,0 +1 @@
|
||||||
|
0 3 * * * __APP__ curl https://__DOMAIN__/api/cron.daily?token=__UTILS_SECRET__
|
|
@ -89,6 +89,12 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP THE CRON FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP LOGS
|
# BACKUP LOGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -232,6 +232,15 @@ ynh_script_progression --message="Configuring log rotation..." --weight=1
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate
|
ynh_use_logrotate
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ADD A CRON JOB
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
cron_path="/etc/cron.d/$app"
|
||||||
|
ynh_add_config --template="../conf/outline.cron" --destination="$cron_path"
|
||||||
|
chown root: "$cron_path"
|
||||||
|
chmod 644 "$cron_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -109,6 +109,16 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
|
||||||
# Remove the dedicated NGINX config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC REMOVE
|
||||||
|
#=================================================
|
||||||
|
# REMOVE VARIOUS FILES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing various files..." --weight=1
|
||||||
|
|
||||||
|
# Remove a cron file
|
||||||
|
ynh_secure_remove --file="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -188,6 +188,13 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE CRON FILE
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring cron job..." --weight=1
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -193,6 +193,15 @@ ynh_script_progression --message="Upgrading logrotate configuration..." --weight
|
||||||
# Use logrotate to manage app-specific logfile(s)
|
# Use logrotate to manage app-specific logfile(s)
|
||||||
ynh_use_logrotate --non-append
|
ynh_use_logrotate --non-append
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# UPDATE THE CRON JOB
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
cron_path="/etc/cron.d/$app"
|
||||||
|
ynh_add_config --template="../conf/outline.cron" --destination="$cron_path"
|
||||||
|
chown root: "$cron_path"
|
||||||
|
chmod 644 "$cron_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue