1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/droppy_ynh.git synced 2024-09-03 18:26:27 +02:00
This commit is contained in:
ericgaspar 2021-10-10 09:19:39 +02:00
parent c41b6cc63f
commit 9611690346
5 changed files with 39 additions and 2 deletions

View file

@ -61,6 +61,12 @@ ynh_backup --src_path="$data_path" --is_big
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -134,12 +134,20 @@ ynh_add_systemd_config
ynh_script_progression --message="Modifying a config file..." --weight=1
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config/config.json"
chmod 600 $final_path/config/config.json
chown $app:$app $final_path/config/config.json
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod 600 $final_path/config/config.json
chown $app:$app $final_path/config/config.json
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -41,6 +41,14 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE DEPENDENCIES
#=================================================

View file

@ -107,6 +107,13 @@ ynh_script_progression --message="Starting a systemd service..." --weight=40
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Ready for requests!"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -137,6 +137,14 @@ ynh_script_progression --message="Modifying a config file..." --weight=2
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config/config.json"
chmod 600 $final_path/config/config.json
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================