From 691b1ba9d691e4ee04e4e5fa6e69f9a712f43fca Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 21 Feb 2023 22:18:59 +0100 Subject: [PATCH] Appease the v2 linter --- doc/{DISCLAIMER.md => ADMIN.md} | 23 ++++++++--------------- doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 22 +++++++--------------- doc/notifications/post_install.md | 3 +++ doc/notifications/post_install_fr.md | 3 +++ doc/notifications/pre_install.md | 2 ++ doc/notifications/pre_install_fr.md | 2 ++ manifest.toml | 4 ---- scripts/change_url | 10 +++++----- 8 files changed, 30 insertions(+), 39 deletions(-) rename doc/{DISCLAIMER.md => ADMIN.md} (56%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (64%) create mode 100644 doc/notifications/post_install.md create mode 100644 doc/notifications/post_install_fr.md create mode 100644 doc/notifications/pre_install.md create mode 100644 doc/notifications/pre_install_fr.md diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 56% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md index 4218ffa..a0846e4 100644 --- a/doc/DISCLAIMER.md +++ b/doc/ADMIN.md @@ -1,14 +1,7 @@ -### Installing - -- The installation requires at least 1GB of free memory. A swap file of this size will be created if needed. -- You can select the default language (among English `en` by default, French `fr`, and German `de`). Other languages can be added after installation like any other extension. - -### Using - -After installation, simply open your browser to Flarum's page. First loading may be a bit longer as assets are generated. +## Login This app allows your YunoHost users to log in with a [dedicated LDAP extension](https://github.com/tituspijean/flarum-ext-auth-ldap). By default, the standard logging method is hidden. -To allow non-YunoHost users to log in, the LDAP extension setting is in the admin panel. +To allow non-YunoHost users to log in, tune the LDAP extension setting in Flarum's admin panel. ### Upgrading @@ -18,14 +11,14 @@ Note that, for the moment, all third-party extensions are removed upon upgrading Flarum does not offer to install extensions from its admin panel yet, so you need to use the command line. -Replace `flarum` with your app ID in case of multiple installations. +Replace `flarum` with your app ID (__APP__) in case of multiple installations. Replace `vendor/extension` with the appropriate names. Read the extension documentation if it requires additional steps. ```bash sudo su app=flarum cd /var/www/$app -sudo -u $app php7.4 composer.phar require vendor/extension +sudo -u $app php__PHPVERSION__ composer.phar require vendor/extension ``` #### Troubleshooting @@ -33,13 +26,13 @@ sudo -u $app php7.4 composer.phar require vendor/extension ##### `Timeout` errors Some users have reported a successful installation, but get a blank page due to a `timeout` on a PHP script that prepares the forum assests (`Minify.php`, notably). -In `/etc/php/*php_version*/fpm/pool.d/*app_id*.conf`, you can increase the `max_execution_time` and `max_input_time` limits (both values are in seconds if nothing is specified). +In `/etc/php/__PHPVERSION__/fpm/pool.d/__APP__.conf`, you can increase the `max_execution_time` and `max_input_time` limits (both values are in seconds if nothing is specified). -Reload PHP-FPM with `sudo service php*php_version*-fpm reload`. +Reload PHP-FPM with `sudo service php__PHPVERSION__-fpm reload`. ##### Upload limit If you are facing an error while uploading large files into the forum, PHP may be limiting file upload. -In `/etc/php/*php_version*/fpm/pool.d/*app_id*.conf`, you can uncomment (remove `;` at the beginning of the line) and increase the values of `upload_max_filesize` and `post_max_size` (both values are in bytes). +In `/etc/php/__PHPVERSION__/fpm/pool.d/__APP__.conf`, you can uncomment (remove `;` at the beginning of the line) and increase the values of `upload_max_filesize` and `post_max_size` (both values are in bytes). -Reload PHP-FPM with `sudo service php*php_version*-fpm reload`. +Reload PHP-FPM with `sudo service php__PHP_VERSION__-fpm reload`. diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 64% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md index f6649e6..00439e1 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/ADMIN_fr.md @@ -1,11 +1,4 @@ -### Installation - -- L'installation nécessite au moins 1 Go de mémoire vive libre. Un fichier *swap* de cette taille sera créé si nécessaire. -- Vous pouvez sélectionner la langue par défaut dans les paramètres d'installation (parmi l'anglais `en`, le français `fr` et l'allemand `de`). Les autres langues sont installables comme n'importe quelle autre extension. - -### Utilisation - -Après l'installation, ouvrez simplement votre navigateur à la page de Flarum. Le premier chargement peut être un peu retardé par la génération du cache. +### Connexion Cette app permet à vos utilisateurs enregistrés dans YunoHost de se connecter avec une [extension LDAP dédiée](https://github.com/tituspijean/flarum-ext-auth-ldap). Par défaut, la méthode de connexion standard est cachée. Pour permettre à des utilisateurs non-YunoHost de se connecter, référez-vous au menu de configuration de l'extension LDAP dans le panneau d'administration de Flarum. @@ -19,14 +12,13 @@ Leurs données et paramètres restent dans la base de donnée de Flarum, seule u Flarum ne permet pas encore d'installer des extensions depuis son interface d'administration ; vous devrez donc utiliser la ligne de commande. -Remplacez `flarum` par l'ID de votre app en cas de multiple installations. Remplacez `vendor/extension` par les noms adéquats. Référez-vous à la documentation de l'extension pour vérifier qu'elle ne nécessite pas de configuration supplémentaire. ```bash sudo su -app=flarum +app=__APP__ cd /var/www/$app -sudo -u $app php7.4 composer.phar require vendor/extension +sudo -u $app php__PHPVERSION__ composer.phar require vendor/extension ``` #### Dépannage @@ -34,13 +26,13 @@ sudo -u $app php7.4 composer.phar require vendor/extension ##### Erreurs de `timeout` Quelques utilisateurs rapportent qu'ils font fassent à une page blanche due à une erreur de `timeout` dans un script PHP qui prépare le cache (`Minify.php`, notamment). -Dans `/etc/php/*php_version*/fpm/pool.d/*app_id*.conf`, vous pouvez augmenter les limites `max_execution_time` et `max_input_time` (les deux valeurs sont en secondes si vous ne précisez pas d'unité). +Dans `/etc/php/__PHPVERSION__/fpm/pool.d/__APP__.conf`, vous pouvez augmenter les limites `max_execution_time` et `max_input_time` (les deux valeurs sont en secondes si vous ne précisez pas d'unité). -Rechargez PHP-FPM avec `sudo service php*php_version*-fpm reload`. +Rechargez PHP-FPM avec `sudo service php__PHPVERSION__-fpm reload`. ##### Limite de téléversement Si vous avez une erreur lors du chargement de gros fichiers dans le forum, PHP pourrait être en train de limiter les téléversements. -Dans `/etc/php/*php_version*/fpm/pool.d/*app_id*.conf`, vous pouvez décommenter (enlevez `;` au début de la ligne) et augmenter les valeurs de `upload_max_filesize` de `post_max_size` (les deux valeurs sont en octets). +Dans `/etc/php/__PHPVERSION__/fpm/pool.d/__APP__.conf`, vous pouvez décommenter (enlevez `;` au début de la ligne) et augmenter les valeurs de `upload_max_filesize` de `post_max_size` (les deux valeurs sont en octets). -Rechargez PHP-FPM avec `sudo service php*php_version*-fpm reload`. +Rechargez PHP-FPM avec `sudo service php__PHPVERSION__-fpm reload`. diff --git a/doc/notifications/post_install.md b/doc/notifications/post_install.md new file mode 100644 index 0000000..eb241a3 --- /dev/null +++ b/doc/notifications/post_install.md @@ -0,0 +1,3 @@ +You can now open your browser to Flarum's page. + +First loading may be a bit longer, as assets are generated. diff --git a/doc/notifications/post_install_fr.md b/doc/notifications/post_install_fr.md new file mode 100644 index 0000000..2a4e0fa --- /dev/null +++ b/doc/notifications/post_install_fr.md @@ -0,0 +1,3 @@ +Vous pouvez maintenant ouvrir votre navigateur à la page de Flarum. + +Le premier chargement peut être un peu retardé par la génération du cache. diff --git a/doc/notifications/pre_install.md b/doc/notifications/pre_install.md new file mode 100644 index 0000000..7137a14 --- /dev/null +++ b/doc/notifications/pre_install.md @@ -0,0 +1,2 @@ +- The installation requires at least 1GB of free memory. A swap file of this size will be created if needed. +- You can select the default language (among English `en` by default, French `fr`, and German `de`). Other languages can be added after installation like any other extension. diff --git a/doc/notifications/pre_install_fr.md b/doc/notifications/pre_install_fr.md new file mode 100644 index 0000000..35ed94a --- /dev/null +++ b/doc/notifications/pre_install_fr.md @@ -0,0 +1,2 @@ +- L'installation nécessite au moins 1 Go de mémoire vive libre. Un fichier *swap* de cette taille sera créé si nécessaire. +- Vous pouvez sélectionner la langue par défaut dans les paramètres d'installation (parmi l'anglais `en`, le français `fr` et l'allemand `de`). Les autres langues sont installables comme n'importe quelle autre extension. diff --git a/manifest.toml b/manifest.toml index d2b570a..efb83d0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -30,10 +30,6 @@ ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... [install] - [install.swap] - ask.en = "The installation will add a 1 GB swap file if your system has less than 1 GB free RAM." - ask.fr = "L'installation ajoutera un fichier swap de 1 Go si votre système a moins de 1 Go de RAM libre." - type = "alert" [install.domain] # this is a generic question - ask strings are automatically handled by Yunohost's core diff --git a/scripts/change_url b/scripts/change_url index 0d7b553..a77dc25 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -27,7 +27,7 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP @@ -100,15 +100,15 @@ fi #================================================= if [ $new_path = "/" ]; then if [ $old_path = "/" ]; then - ynh_replace_string "://$old_domain" "://$new_domain" "$final_path/config.php" + ynh_replace_string "://$old_domain" "://$new_domain" "$install_dir/config.php" else - ynh_replace_string "://$old_domain$old_path" "://$new_domain" "$final_path/config.php" + ynh_replace_string "://$old_domain$old_path" "://$new_domain" "$install_dir/config.php" fi else if [ $old_path = "/" ]; then - ynh_replace_string "://$old_domain" "://$new_domain$new_path" "$final_path/config.php" + ynh_replace_string "://$old_domain" "://$new_domain$new_path" "$install_dir/config.php" else - ynh_replace_string "://$old_domain$old_path" "://$new_domain$new_path" "$final_path/config.php" + ynh_replace_string "://$old_domain$old_path" "://$new_domain$new_path" "$install_dir/config.php" fi fi