This commit is contained in:
Éric Gaspar 2023-09-29 16:36:47 +02:00
parent 4129b1c33b
commit 3d09a54ac3
7 changed files with 13 additions and 59 deletions

View file

@ -18,7 +18,7 @@ cpe = "cpe:2.3:a:pydio:cells"
fund = "https://pydio.com/en/pricing" fund = "https://pydio.com/en/pricing"
[integration] [integration]
yunohost = ">= 11.1.21" yunohost = ">= 11.2"
architectures = ["amd64", "armhf", "arm64"] architectures = ["amd64", "armhf", "arm64"]
multi_instance = true multi_instance = true
ldap = false ldap = false

View file

@ -34,21 +34,6 @@ ynh_backup --src_path="$data_dir" --is_big
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP FAIL2BAN CONFIGURATION
#=================================================
# ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
# ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
# ynh_backup --src_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP SYSTEMD
#================================================= #=================================================

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
@ -32,7 +32,7 @@ ynh_change_url_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -29,25 +29,20 @@ ynh_add_nginx_config
ynh_add_systemd_config ynh_add_systemd_config
yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log"
# ynh_use_logrotate
# Create a dedicated Fail2Ban config
# ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
#================================================= #=================================================
# APP INITIAL CONFIGURATION # APP INITIAL CONFIGURATION
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring Pydio..." --weight=1 ynh_script_progression --message="Configuring $app..." --weight=1
ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml" ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml"
pushd "$install_dir" || ynh_die pushd "$install_dir"
ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yml" ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yml"
popd || ynh_die popd
ynh_secure_remove --file="$install_dir/install-conf.yml" ynh_secure_remove --file="$install_dir/install-conf.yml"
ynh_delete_file_checksum --file="$install_dir/install-conf.yml" ynh_delete_file_checksum --file="$install_dir/install-conf.yml"
@ -59,7 +54,7 @@ ynh_delete_file_checksum --file="$install_dir/install-conf.yml"
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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" ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -25,10 +25,6 @@ ynh_remove_systemd_config
ynh_remove_nginx_config ynh_remove_nginx_config
# ynh_remove_logrotate
# ynh_remove_fail2ban_config
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -46,13 +46,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable "$app.service" --quiet systemctl enable "$app.service" --quiet
yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log"
# ynh_restore_file --origin_path="/etc/logrotate.d/$app"
# ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
# ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
# ynh_systemd_action --action=restart --service_name=fail2ban
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -61,7 +55,7 @@ yunohost service add "$app" --description="Pydio - A file sharing platform" --lo
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================

View file

@ -23,7 +23,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
#================================================= #=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
@ -49,30 +49,14 @@ ynh_add_nginx_config
ynh_add_systemd_config ynh_add_systemd_config
yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log"
# ynh_use_logrotate --non-append
# ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
#=================================================
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...)
#=================================================
# UPDATE A CONFIG FILE
#=================================================
#ynh_script_progression --message="Updating a configuration file..." --weight=1
#ynh_add_config --template="some_config_file" --destination="$install_dir/some_config_file"
#chmod 400 "$install_dir/some_config_file"
#chown $app:$app "$install_dir/some_config_file"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT