From 18a6d3397c0a458e496b57d826e5618c92da91d2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 1 Feb 2021 22:30:06 +0100 Subject: [PATCH] Fix linter warnings --- pull_request_template.md | 10 ++++++---- scripts/install | 22 ++++++---------------- scripts/upgrade | 12 ------------ 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/pull_request_template.md b/pull_request_template.md index 5379a23..c7f8274 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -16,7 +16,9 @@ - [ ] **Code review** - [ ] **Approval (LGTM)** *Code review and approval have to be from a member of @YunoHost/apps group* -- **CI succeeded** : -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/airsonic_ynh%20PR-NUM-/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/airsonic_ynh%20PR-NUM-/) -*Please replace '-NUM-' in this link by the PR number.* -When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. + +## Package_check results +--- +*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* + +[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/mantis_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/mantis_ynh%20PR-NUM-%20(USERNAME)/) diff --git a/scripts/install b/scripts/install index 0767a45..7c43309 100644 --- a/scripts/install +++ b/scripts/install @@ -212,12 +212,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/ #================================================= # SETUP APPLICATION WITH CURL #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 -# Set the app as temporarily public for curl call -ynh_app_setting_set --app=$app --key=skipped_uris --value="/" -# Reload SSOwat config -yunohost app ssowatconf +# Set the app as temporarily public for cURL call +ynh_permission_update --permission="main" --add="visitors" # Reload Nginx ynh_systemd_action --service_name=nginx --action=reload @@ -250,12 +247,6 @@ token=$(echo -n $passwordAdmin$salt | md5sum | awk '{print $1}') ynh_local_curl "/rest/createUser.view" "u=admin" "t=$token" "s=$salt" "username=$admin" "password=a" "v=$VERSION" "c=myapp" "email=$mailadmin" "adminRole=Yes" "ldapAuthenticated=Yes" "settingsRole=Yes" "streamRole=Yes" "jukeboxRole=Yes" "downloadRole=Yes" "uploadRole=Yes" "playlistRole=Yes" "coverArtRole=Yes" "commentRole=Yes" "podcastRole=Yes" "shareRole=Yes" "videoConversionRole=Yes" -# Remove the public access -if [ $is_public -eq 0 ] -then - ynh_app_setting_delete --app=$app --key=skipped_uris -fi - #================================================= # USE MULTIMEDIA #================================================= @@ -272,13 +263,12 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/ #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=2 +ynh_script_progression --message="Configuring permissions..." --weight=1 -# Make app public if necessary -if [ $is_public -eq 1 ] +# Make app public if necessary or protect it +if [ $is_public -eq 0 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + ynh_permission_update --permission="main" --remove="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2b42959..6b1fd23 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -224,18 +224,6 @@ chown -R $app: $final_path yunohost service add $app --description="Airsonic daemon" --log="$final_path/$app.log" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1 - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # START SYSTEMD SERVICE #=================================================