From a9575165c4cf10bb79f92b7422957a914cd110d1 Mon Sep 17 00:00:00 2001 From: frju365 Date: Mon, 13 Aug 2018 16:04:10 +0200 Subject: [PATCH 1/9] [add] choice for bazaar extension --- manifest.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index d3b06e7..060422b 100644 --- a/manifest.json +++ b/manifest.json @@ -76,6 +76,15 @@ "de": "Ist es eine öffentliche Applikation ?" }, "default": true + }, + "name": "bazaar_extension", + "type": "boolean", + "ask": { + "en": "Do you want to install bazaar extension, extensions provider for Flarum?", + "fr": "Voulez-vous installer l'extension bazaar, fournisseur d'extensions pour Flarum ?", + "de": "Wollen Sie die Bazaar Erweiterung installieren ?" + }, + "default": true }, { "name": "language", @@ -89,4 +98,4 @@ } ] } -} \ No newline at end of file +} From eac1c4f1b711a53f9e3ef4d322f10fbf9bf9ec16 Mon Sep 17 00:00:00 2001 From: frju365 Date: Mon, 13 Aug 2018 16:04:42 +0200 Subject: [PATCH 2/9] Update manifest.json --- manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.json b/manifest.json index 060422b..ed0ca65 100644 --- a/manifest.json +++ b/manifest.json @@ -77,6 +77,7 @@ }, "default": true }, + { "name": "bazaar_extension", "type": "boolean", "ask": { From ce56ed95693877f30b3b528e9da99a1c436279b2 Mon Sep 17 00:00:00 2001 From: frju365 Date: Mon, 13 Aug 2018 16:05:08 +0200 Subject: [PATCH 3/9] typo + choice set to false --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index ed0ca65..500fbb2 100644 --- a/manifest.json +++ b/manifest.json @@ -85,7 +85,7 @@ "fr": "Voulez-vous installer l'extension bazaar, fournisseur d'extensions pour Flarum ?", "de": "Wollen Sie die Bazaar Erweiterung installieren ?" }, - "default": true + "default": false }, { "name": "language", From cc5fbb3bc2712e3410686ece70e00fed705d9fd3 Mon Sep 17 00:00:00 2001 From: frju365 Date: Mon, 13 Aug 2018 16:15:41 +0200 Subject: [PATCH 4/9] Update install --- scripts/install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/install b/scripts/install index 2ee61a2..f52849d 100644 --- a/scripts/install +++ b/scripts/install @@ -42,6 +42,7 @@ is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE flarum_version="v0.1.0-beta.7" ssowat_ext_ver="*@dev" +bazaar_extension=$YNH_APP_ARG_BAZAAR_EXTENSION #=================================================== # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -223,6 +224,10 @@ if [[ -n $admin && -n $title ]]; then ynh_mysql_execute_as_root "$sql_command" $db_name ;; esac + + if [[ $bazaar_extension ]]; then + install_and_activate_extension $app $final_path $db_name "flagrow/bazaar" "flagrow-bazaar" + fi # Send login credentials to admin app_message="User : $admin, password : $admin_pwd From dfdd865503b2d07c6590b45e72bb2bb6f109dda3 Mon Sep 17 00:00:00 2001 From: frju365 Date: Mon, 13 Aug 2018 16:23:15 +0200 Subject: [PATCH 5/9] try something after hollydays :P --- scripts/upgrade | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 08a997a..8cadcd5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,6 +44,7 @@ db_pwd=$(ynh_app_setting_get $app db_pwd) old_flarum_version=$(ynh_app_setting_get "$app" flarum_version) flarum_version="v0.1.0-beta.7" ssowat_ext_ver="*@dev" +bazaar_extension=$(ynh_app_setting_get "$app" bazaar_extension) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -111,11 +112,15 @@ fi # FLARUM UPGRADE #================================================= -# Upgrade Flarum -exec_composer $app $final_path "update --ansi" -pushd $final_path -exec_as $app php flarum cache:clear -popd +if [[ $old_flarum_version -ne $flarum_version ]]; then + # Upgrade Flarum + exec_composer $app $final_path "update --ansi" + pushd $final_path + exec_as $app php flarum cache:clear + popd +else + echo "Flarum doesn't need any update, let's check the extension." +fi # Update SSOwat extension install_and_activate_extension $app $final_path $db_name "tituspijean/flarum-ext-auth-ssowat:$ssowat_ext_ver" "tituspijean-auth-ssowat" @@ -124,6 +129,10 @@ ssowatdomain=$( Date: Mon, 13 Aug 2018 16:40:17 +0200 Subject: [PATCH 6/9] Add Bazaar in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 709a963..fa5b06f 100644 --- a/README.md +++ b/README.md @@ -24,16 +24,16 @@ You can also install it with `yunohost app install https://github.com/YunoHost-A - Optional parameters are : - `title` :warning: if you leave it empty, you will have to perform manual post-installation. - `language` can be English (by default), French, and German. Other languages installable after installation as any other extensions + - `bazaar_extension` to install the extension marketplace (*false* by default), to avoid using the command line to add new extensions. ### Manual post-installation 1. Retrieve database password: * It should be displayed in the log messages, on top of installation page, for web installations. * For command line installations, `sudo cat /etc/yunohost/apps/flarum/settings.yml | grep mysql` (Replace `flarum` by its actual app id if you are using multiple Flarum instances in YunoHost) - + 2. Go to your Flarum homepage to initiate manual post-installation. 3. Fill in the blanks about `MySQL` as follow, put the retrieved database password. The remaining blanks are up to you.

- From ede7975e4e03d125b8b49eae162aafb6f4993f9c Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 13 Aug 2018 16:47:13 +0200 Subject: [PATCH 7/9] Capitalization in manifest --- manifest.json | 202 +++++++++++++++++++++++++------------------------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/manifest.json b/manifest.json index 500fbb2..c7a5ad1 100644 --- a/manifest.json +++ b/manifest.json @@ -1,102 +1,102 @@ { - "name": "Flarum", - "id": "flarum", - "packaging_format": 1, - "description": { - "en": "Flarum (open-source forum software) package for YunoHost.", - "fr": "Package Flarum (système de forum libre) pour YunoHost.", - "de": "Flarum (Open Source) ist ein Programmpaket für Yunohost." - }, - "url": "http://flarum.org/", - "license": "MIT", - "version": "0.1.0-beta.7", - "maintainer": { - "name": "Titus PiJean", - "email": "tituspijean@outlook.com" - }, - "requirements": { - "yunohost": ">= 2.4.0" - }, - "multi_instance": true, - "services": [ - "nginx", - "php5-fpm", - "mysql" - ], - "arguments": { - "install": [{ - "name": "domain", - "type": "domain", - "ask": { - "en": "Choose a domain name for Flarum", - "fr": "Choisissez un nom de domaine pour Flarum", - "de": "Wählen einen Domain-Namen für Flarum" - }, - "example": "example.com" - }, - { - "name": "path", - "type": "path", - "ask": { - "en": "Choose a path for Flarum", - "fr": "Choisissez un chemin pour Flarum", - "de": "Wählen einen Pfad für Flarum" - }, - "example": "/flarum", - "default": "/flarum" - }, - { - "name": "admin", - "type": "user", - "ask": { - "en": "Choose the admin user (required for automatic post-installation)", - "fr": "Choisissez l’administrateur (nécessaire pour la post-installation automatique)", - "de": "Wählen einen Administrator (erforderlich für die automatische Nachinstallation)" - }, - "example": "johndoe", - "optional": true - }, - { - "name": "title", - "ask": { - "en": "Choose a title for your forum (required for automatic post-installation)", - "fr": "Choisissez un titre pour votre forum (nécessaire pour la post-installation automatique)", - "de": "Wählen einen Titel für eure Internetforum (erforderlich für die automatische Nachinstallation)" - }, - "example": "My forum", - "default": "", - "optional": true - }, - { - "name": "is_public", - "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?", - "de": "Ist es eine öffentliche Applikation ?" - }, - "default": true - }, - { - "name": "bazaar_extension", - "type": "boolean", - "ask": { - "en": "Do you want to install bazaar extension, extensions provider for Flarum?", - "fr": "Voulez-vous installer l'extension bazaar, fournisseur d'extensions pour Flarum ?", - "de": "Wollen Sie die Bazaar Erweiterung installieren ?" - }, - "default": false - }, - { - "name": "language", - "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application", - "de": "Wählen Sie eine Sprache" - }, - "choices": ["fr", "en", "de"], - "default": "en" - } - ] - } -} + "name": "Flarum", + "id": "flarum", + "packaging_format": 1, + "description": { + "en": "Flarum (open-source forum software) package for YunoHost.", + "fr": "Package Flarum (système de forum libre) pour YunoHost.", + "de": "Flarum (Open Source) ist ein Programmpaket für Yunohost." + }, + "url": "http://flarum.org/", + "license": "MIT", + "version": "0.1.0-beta.7", + "maintainer": { + "name": "Titus PiJean", + "email": "tituspijean@outlook.com" + }, + "requirements": { + "yunohost": ">= 2.4.0" + }, + "multi_instance": true, + "services": [ + "nginx", + "php5-fpm", + "mysql" + ], + "arguments": { + "install": [{ + "name": "domain", + "type": "domain", + "ask": { + "en": "Choose a domain name for Flarum", + "fr": "Choisissez un nom de domaine pour Flarum", + "de": "Wählen einen Domain-Namen für Flarum" + }, + "example": "example.com" + }, + { + "name": "path", + "type": "path", + "ask": { + "en": "Choose a path for Flarum", + "fr": "Choisissez un chemin pour Flarum", + "de": "Wählen einen Pfad für Flarum" + }, + "example": "/flarum", + "default": "/flarum" + }, + { + "name": "admin", + "type": "user", + "ask": { + "en": "Choose the admin user (required for automatic post-installation)", + "fr": "Choisissez l’administrateur (nécessaire pour la post-installation automatique)", + "de": "Wählen einen Administrator (erforderlich für die automatische Nachinstallation)" + }, + "example": "johndoe", + "optional": true + }, + { + "name": "title", + "ask": { + "en": "Choose a title for your forum (required for automatic post-installation)", + "fr": "Choisissez un titre pour votre forum (nécessaire pour la post-installation automatique)", + "de": "Wählen einen Titel für eure Internetforum (erforderlich für die automatische Nachinstallation)" + }, + "example": "My forum", + "default": "", + "optional": true + }, + { + "name": "is_public", + "type": "boolean", + "ask": { + "en": "Is it a public application?", + "fr": "Est-ce une application publique ?", + "de": "Ist es eine öffentliche Applikation ?" + }, + "default": true + }, + { + "name": "bazaar_extension", + "type": "boolean", + "ask": { + "en": "Do you want to install Bazaar extension, extensions provider for Flarum?", + "fr": "Voulez-vous installer l'extension Bazaar, fournisseur d'extensions pour Flarum ?", + "de": "Wollen Sie die Bazaar Erweiterung installieren ?" + }, + "default": false + }, + { + "name": "language", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application", + "de": "Wählen Sie eine Sprache" + }, + "choices": ["fr", "en", "de"], + "default": "en" + } + ] + } +} \ No newline at end of file From 19a16f18ee9b9032ba8e09545660391180d63bd9 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 13 Aug 2018 16:47:43 +0200 Subject: [PATCH 8/9] Save bazaar_extension parameter --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index f52849d..ee2be03 100644 --- a/scripts/install +++ b/scripts/install @@ -72,6 +72,7 @@ ynh_app_setting_set $app is_public $is_public ynh_app_setting_set $app language $language ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app flarum_version $flarum_version +ynh_app_setting_set $app bazaar_extension $bazaar_extension #=================================================== # CREATE DEDICATED USER @@ -224,7 +225,7 @@ if [[ -n $admin && -n $title ]]; then ynh_mysql_execute_as_root "$sql_command" $db_name ;; esac - + if [[ $bazaar_extension ]]; then install_and_activate_extension $app $final_path $db_name "flagrow/bazaar" "flagrow-bazaar" fi From 53c44b145a270904e7dbca5cc831c36a4648b815 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 16 Aug 2018 22:56:33 +0200 Subject: [PATCH 9/9] Do not activate Bazaar Bazaar requires some actions on the database that can only be triggered from the web interface. Maybe one day we may have a API route to activate extensions from the command line. --- scripts/_common.sh | 1 - scripts/install | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index cf6b544..7f49fb9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -138,4 +138,3 @@ $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" # Send the email to the recipients echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" } - diff --git a/scripts/install b/scripts/install index ee2be03..8e90e3b 100644 --- a/scripts/install +++ b/scripts/install @@ -227,7 +227,7 @@ if [[ -n $admin && -n $title ]]; then esac if [[ $bazaar_extension ]]; then - install_and_activate_extension $app $final_path $db_name "flagrow/bazaar" "flagrow-bazaar" + exec_composer $app $final_path "require flagrow/bazaar --ansi" fi # Send login credentials to admin