1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dispatch_ynh.git synced 2024-09-03 18:25:53 +02:00

Merge pull request #16 from YunoHost-Apps/testing

Testing
This commit is contained in:
eric_G 2023-09-07 21:42:20 +02:00 committed by GitHub
commit bc8c6c869b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 91 deletions

View file

@ -15,7 +15,7 @@ demo = "https://dispatch.khlieng.com/"
code = "https://github.com/khlieng/dispatch"
[integration]
yunohost = ">= 11.1.16"
yunohost = ">= 11.2"
architectures = "all"
multi_instance = false
ldap = false
@ -27,7 +27,6 @@ ram.runtime = "50M"
[install]
[install.domain]
type = "domain"
full_domain = true
[install.init_main_permission]
help.en = "If enabled, Dispatch will be accessible by people who do not have an account. This can be changed later via the webadmin."

View file

@ -29,6 +29,14 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=3
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
yunohost service add $app --description="Web-based IRC client" --log="/var/log/$app/$app.log"
#=================================================
# SPECIFIC SETUP
#=================================================
@ -41,31 +49,6 @@ ynh_add_config --template="../conf/config.default.toml" --destination="$install_
chmod 400 "$install_dir/.dispatch/config.toml"
chown $app:$app "$install_dir/.dispatch/config.toml"
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# 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="Web-based IRC client" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================

View file

@ -22,27 +22,12 @@ 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 LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
# Remove the dedicated NGINX config
ynh_remove_nginx_config

View file

@ -29,26 +29,11 @@ ynh_script_progression --message="Restoring the NGINX web server configuration..
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=5
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description="Web-based IRC client" --log="/var/log/$app/$app.log"
#=================================================
@ -58,13 +43,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Listening on port"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#=================================================

View file

@ -40,13 +40,21 @@ chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# NGINX CONFIGURATION
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
yunohost service add $app --description="Web-based IRC client" --log="/var/log/$app/$app.log"
#=================================================
# SPECIFIC UPGRADE
#=================================================
@ -59,31 +67,6 @@ ynh_add_config --template="../conf/config.default.toml" --destination="$install_
chmod 400 "$install_dir/.dispatch/config.toml"
chown $app:$app "$install_dir/.dispatch/config.toml"
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# 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
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description="Web-based IRC client" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================