1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/flarum_ynh.git synced 2024-09-03 18:36:24 +02:00

Fix linter warnings

This commit is contained in:
tituspijean 2021-03-18 23:50:24 +01:00
parent eae3c1e7b3
commit 1e61302fbc
3 changed files with 15 additions and 59 deletions

View file

@ -7,7 +7,7 @@
"fr": "Un forum de nouvelle génération, simplement.",
"de": "Forum der nächsten Generation leicht gemacht."
},
"version": "0.1.0.14~ynh2",
"version": "0.1.0.14~ynh3",
"url": "http://flarum.org/",
"license": "MIT",
"maintainer": {
@ -15,7 +15,7 @@
"email": "tituspijean@outlook.com"
},
"requirements": {
"yunohost": ">= 3.8.1"
"yunohost": ">= 4.1"
},
"multi_instance": true,
"services": [
@ -26,7 +26,7 @@
"arguments": {
"install" : [
{
"name": "domain",
"name": "swap",
"type": "display_text",
"ask": {
"en": "The installation will add a 1 GB swap file if your system has less than 1 GB free RAM.",
@ -36,32 +36,16 @@
{
"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"
},
"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",
"fr": "Choisissez ladministrateur",
"de": "Wählen einen Administrator"
},
"example": "johndoe"
},
{
@ -78,11 +62,6 @@
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?",
"de": "Ist es eine öffentliche Applikation ?"
},
"help": {
"en": "If public, it will be open to all visitors like any forum. If private, only the YunoHost server users can access it.",
"fr": "Si public, le forum sera accessible à tous, comme pour tout forum. Si privé, seuls les utilisateurs du serveur YunoHost pourront y accéder."

View file

@ -58,7 +58,6 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=project_version --value=$project_version
ynh_app_setting_set --app=$app --key=core_version --value=$core_version
@ -136,13 +135,13 @@ ynh_script_progression --message="Installing composer dependencies..." --weight=
ynh_exec_warn_less ynh_install_composer --user=$app --phpversion="$phpversion" --workdir="$final_path"
# Set Flarum version
ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="require flarum/core:$core_version --prefer-lowest --no-update"
ynh_exec_warn_less ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="require flarum/core:$core_version --prefer-lowest --no-update"
# Require SSOwat extension
ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="require tituspijean/flarum-ext-auth-ssowat:$ssowat_version --no-update"
ynh_exec_warn_less ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="require tituspijean/flarum-ext-auth-ssowat:$ssowat_version --no-update"
# Update and download dependencies
ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="update"
ynh_exec_warn_less ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="update"
#=================================================
# FLARUM POST-INSTALL

View file

@ -22,7 +22,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
@ -44,15 +43,6 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# 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 db_name doesn't exist, create it
if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app)
@ -66,14 +56,15 @@ if [ -z "$final_path" ]; then
fi
# Cleaning legacy permissions
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
skipped_uris=$(ynh_app_setting_get --app=$app --key=skipped_uris)
unprotected_uris=$(ynh_app_setting_get --app=$app --key=unprotected_uris)
protected_uris=$(ynh_app_setting_get --app=$app --key=protected_uris)
# Remove is_public if exists
if [ ! -z "$is_public" ]; then
ynh_app_setting_delete --app=$app --key=is_public
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
# Remove skipped_uris if exists
@ -203,13 +194,13 @@ then
chown -R $app:www-data $final_path
# Install Composer and Flarum
ynh_install_composer --user=$app --phpversion=$phpversion --workdir=$final_path
ynh_exec_warn_less ynh_install_composer --user=$app --phpversion=$phpversion --workdir=$final_path
# Perform migrations and clear cache
pushd $final_path
ynh_script_progression --message="Upgrading Flarum and its extensions..." --weight=1
ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="require tituspijean/flarum-ext-auth-ssowat:$ssowat_version --no-update"
ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="require flarum/core:$core_version --prefer-dist --update-no-dev -a --update-with-all-dependencies"
ynh_exec_warn_less ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="require tituspijean/flarum-ext-auth-ssowat:$ssowat_version --no-update"
ynh_exec_warn_less ynh_composer_exec --user=$app --phpversion=$phpversion --workdir=$final_path --commands="require flarum/core:$core_version --prefer-dist --update-no-dev -a --update-with-all-dependencies"
exec_as $app php$phpversion flarum migrate
exec_as $app php$phpversion flarum cache:clear
popd
@ -276,19 +267,6 @@ ynh_script_progression --message="Securing files and directories..."
# Set permissions on app files
chown -R $app:www-data $final_path
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1
# Make app public if necessary
if [ $is_public -eq 1 ]
then
# Everyone can access the app.
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission "main" --add "visitors"
fi
#=================================================
# RELOAD NGINX
#=================================================