From 5345427e47e04dfeb42b6a4eb0ec2fb512a6e5c3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 22 Apr 2021 23:52:56 +0200 Subject: [PATCH] cleaning up --- README.md | 10 ++-------- manifest.json | 18 +----------------- pull_request_template.md | 4 +--- scripts/install | 6 +++--- scripts/upgrade | 19 +++++++++---------- 5 files changed, 16 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 7013ae0..6d68381 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ How to configure this app: a plain file at `/var/www/lstu/lstu.conf` with SSH. #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/lstu%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lstu/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/lstu%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lstu/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/lstu.svg)](https://ci-apps.yunohost.org/ci/apps/lstu/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/lstu.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lstu/) ## Links @@ -57,9 +57,3 @@ sudo yunohost app install https://github.com/YunoHost-Apps/lstu_ynh/tree/testing or sudo yunohost app upgrade lstu -u https://github.com/YunoHost-Apps/lstu_ynh/tree/testing --debug ``` - -## Todo - -- [ ] Allow to choose the database (sqlite or PostgreSQL) -- [ ] Allow to choose to use Minion -- [ ] Add CI stuff diff --git a/manifest.json b/manifest.json index 6a63efa..0065533 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "abld@abld.info" }, "requirements": { - "yunohost": ">= 4.0" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -25,29 +25,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Lstu", - "fr": "Choisissez un domaine pour Lstu" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Lstu", - "fr": "Choisissez un chemin pour Lstu" - }, "example": "/lstu", "default": "/lstu" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": false }, { @@ -66,10 +54,6 @@ { "name": "password", "type": "password", - "ask": { - "en": "Choose a password", - "fr": "Choisissez un mot de passe" - } } ] } diff --git a/pull_request_template.md b/pull_request_template.md index 95a0350..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## 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/lstu_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/lstu_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/install b/scripts/install index 7549132..42a2d36 100644 --- a/scripts/install +++ b/scripts/install @@ -85,7 +85,6 @@ db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_setup_db --db_user=$db_user --db_name=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) # Password created in ynh_psql_setup_db function #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -193,9 +192,10 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." + +ynh_permission_update --permission="main" --add="visitors" -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" if [ $is_public -eq 0 ] then # If the app is private, only the shortened URLs are publics. diff --git a/scripts/upgrade b/scripts/upgrade index bc04e31..8068ad6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,15 +40,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app @@ -97,6 +88,13 @@ then ynh_exec_warn_less yunohost firewall disallow TCP $port fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -232,7 +230,8 @@ yunohost service add $app --log="/var/log/$app.log" --log="/var/www/$app/log/pro #================================================= ynh_script_progression --message="Upgrading SSOwat configuration..." -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" +ynh_permission_update --permission="main" --add="visitors" + if [ $is_public -eq 0 ] then # If the app is private, only the shortened URLs are publics.