diff --git a/manifest.toml b/manifest.toml index da8d47c..554aff8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -21,7 +21,7 @@ code = "https://dev.funkwhale.audio/funkwhale/funkwhale" fund = "https://next.funkwhale.audio/donate/" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = "all" multi_instance = true diff --git a/scripts/backup b/scripts/backup index f78a323..5a76af9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,5 @@ #!/bin/bash -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/install b/scripts/install index 8d80454..4d72c7f 100644 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,6 @@ admin_mail=$(ynh_user_get_info --username="$admin" --key="mail") #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir/api" --source_id="api" ynh_setup_source --dest_dir="$install_dir/front" --source_id="front" @@ -56,9 +55,6 @@ ynh_app_setting_set --key=redis_db --value=$redis_db ynh_config_add --template="env.prod" --destination="$install_dir/config/.env" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config/.env" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config/.env" - #================================================= # SETUP SYSTEMD #================================================= @@ -113,9 +109,6 @@ pushd $install_dir echo "yes" | ynh_hide_warnings ynh_exec_as_app $install_dir/venv/bin/funkwhale-manage collectstatic popd -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # LOGROTATE #================================================= @@ -127,7 +120,6 @@ ynh_config_add_logrotate touch /var/log/$app/${app}-server.log touch /var/log/$app/${app}-worker.log touch /var/log/$app/${app}-beat.log -#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:$app /var/log/$app/ #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -153,7 +145,6 @@ ynh_systemctl --service="${app}-worker" --action="start" --log_path="systemd" -- #================================================= ynh_script_progression "Configuring Fail2Ban..." -# Create a dedicated Fail2Ban config ynh_config_add_fail2ban --logpath="/var/log/nginx/${domain}-access.log" --failregex=".* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" #================================================= diff --git a/scripts/remove b/scripts/remove index 4ea90a4..84c8b2a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -53,29 +53,10 @@ ynh_script_progression "Removing NGINX web server configuration..." ynh_safe_rm "/etc/nginx/conf.d/$domain.d/funkwhale_proxy.conf" ynh_config_remove_nginx -#================================================= -# REMOVE LOGS -#================================================= -ynh_script_progression "Removing logs..." - ynh_config_remove_logrotate -#================================================= -# REMOVE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression "Removing Fail2Ban configuration..." - -# Remove the dedicated Fail2Ban config ynh_config_remove_fail2ban -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE THE REDIS DATABASE -#================================================= -ynh_script_progression "Removing the Redis database..." - -# Remove a database if it exists, along with the associated user ynh_redis_remove_db $redis_db #================================================= diff --git a/scripts/restore b/scripts/restore index 90c0d28..aaffc2f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -11,8 +11,6 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= @@ -23,7 +21,6 @@ ynh_restore "$data_dir/" || true mkdir -p $data_dir/data mkdir -p $data_dir/data/{static,media,music} -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$data_dir/" chmod -R o-rwx "$data_dir/" chown -R $app:www-data "$data_dir/" @@ -39,7 +36,7 @@ ynh_restore "/etc/nginx/conf.d/$domain.d" #================================================= ynh_script_progression "Restoring the PostgreSQL database..." -ynh_psql_db_shell < "./db.sql"" +ynh_psql_db_shell < "./db.sql" #================================================= # LOGROTATE @@ -52,7 +49,6 @@ ynh_config_add_logrotate touch /var/log/$app/${app}-server.log touch /var/log/$app/${app}-worker.log touch /var/log/$app/${app}-beat.log -#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:$app /var/log/$app/ #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 3550d74..e5effb9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,16 +15,10 @@ ynh_systemctl --action="stop" --service="${app}-worker" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed -then - ynh_script_progression "Upgrading source files..." - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir/api" --source_id="api" --full_replace - ynh_setup_source --dest_dir="$install_dir/front" --source_id="front" --full_replace -fi +ynh_setup_source --dest_dir="$install_dir/api" --source_id="api" --full_replace +ynh_setup_source --dest_dir="$install_dir/front" --source_id="front" --full_replace #================================================= # NGINX CONFIGURATION @@ -99,9 +93,6 @@ pushd $install_dir popd -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # LOGROTATE #================================================= @@ -113,7 +104,6 @@ ynh_config_add_logrotate touch /var/log/$app/${app}-server.log touch /var/log/$app/${app}-worker.log touch /var/log/$app/${app}-beat.log -#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:$app /var/log/$app/ #================================================= # SETUP SYSTEMD