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.

- diff --git a/manifest.json b/manifest.json index d3b06e7..c7a5ad1 100644 --- a/manifest.json +++ b/manifest.json @@ -1,92 +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": "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 diff --git a/scripts/install b/scripts/install index 41a889b..ba7bffa 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 @@ -71,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 @@ -226,6 +228,10 @@ if [[ -n $admin && -n $title ]]; then ;; esac + if [[ $bazaar_extension ]]; then + exec_composer $app $final_path "require flagrow/bazaar --ansi" + fi + # Send login credentials to admin app_message="User : $admin, password : $admin_pwd Change your password! 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=$(