diff --git a/manifest.toml b/manifest.toml index ee8fc3e..1ec8366 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,11 +15,14 @@ website = "https://grammalecte.net" code = "http://code.grammalecte.net:8080/" [integration] -yunohost = ">= 11.1.19" +yunohost = ">= 11.2" architectures = "all" multi_instance = true + ldap = false + sso = true + disk = "50M" ram.build = "50M" ram.runtime = "50M" diff --git a/scripts/install b/scripts/install index 3b74757..8671121 100755 --- a/scripts/install +++ b/scripts/install @@ -25,14 +25,14 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - # Create a dedicated systemd config ynh_add_systemd_config +# Use logrotate to manage application logfile(s) +ynh_use_logrotate + +yunohost service add $app --description="Spelling, grammar, and typography checking server for French and Occitan" --log="/var/log/$app/$app.log" + #================================================= # GENERIC FINALIZATION #================================================= @@ -44,21 +44,6 @@ chown -R root:$app $install_dir chmod u+x $install_dir/grammalecte-server.py chmod -R g=u,g-w,o-rwx $install_dir -#================================================= -# 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 -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Spelling, grammar, and typography checking server for French and Occitan" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index d0e3cb9..3a1171c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,36 +22,15 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= - # Remove the log files ynh_secure_remove --file="/var/log/$app" diff --git a/scripts/restore b/scripts/restore index a639c12..23087b8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,15 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -26,33 +17,24 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -#================================================= -# RESTORE USER RIGHTS -#================================================= - # Restore permissions on app files chown -R root:$app $install_dir chmod u+x $install_dir/grammalecte-server.py chmod -R g=u,g-w,o-rwx $install_dir -#================================================= -# RESTORE LOGS -#================================================= - -ynh_restore_file --origin_path="/var/log/$app" - #================================================= # RESTORE SYSTEMD #================================================= ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + +ynh_restore_file --origin_path="/var/log/$app" yunohost service add $app --description="Spelling, grammar, and typography checking server for French and Occitan" --log="/var/log/$app/$app.log" @@ -63,19 +45,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #=================================================