1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mumble-web_ynh.git synced 2024-09-03 19:46:16 +02:00
This commit is contained in:
ericgaspar 2021-06-05 15:13:58 +02:00
parent 129c3c8268
commit c7fd01dd64
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 53 additions and 4 deletions

View file

@ -50,6 +50,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -122,6 +122,28 @@ ynh_use_nodejs
ls -lah
)
# chown -R $app $final_path
# pushd $final_path
# ynh_use_nodejs
# ynh_exec_warn_less ynh_exec_as "$app" PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --save --loglevel warn
# ynh_exec_warn_less ynh_exec_as "$app" PATH="$nodejs_path:$PATH" "$nodejs_path/npm" run build
# ls -lah
# popd
#=================================================
# HANDLE LOG FILES AND LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..."
# Create log directory
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
chown -R $app /var/log/$app
# Setup logrotate
ynh_use_logrotate --specific_user=$app/$app
#=================================================
# SETUP SYSTEMD
#=================================================

View file

@ -69,12 +69,14 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
ynh_remove_nginx_config
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE OTHER FILES
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..."
ynh_secure_remove "/var/log/$app"
ynh_secure_remove --file="/var/log/$app"
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# GENERIC FINALIZATION

View file

@ -54,6 +54,17 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# HANDLE LOG FILES AND LOGROTATE
#=================================================
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
chown -R $app /var/log/$app
# Restore logrotate configuration
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================

View file

@ -125,6 +125,14 @@ ynh_add_systemd_config
# Add Mumble as a YunoHost service
yunohost service add $app --description="Mumble web interface" --log="/var/log/$app/$app.log"
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append --specific_user=$app/$app
#=================================================
# START SYSTEMD SERVICE
#=================================================