mirror of
https://github.com/YunoHost-Apps/flarum_ynh.git
synced 2024-09-03 18:36:24 +02:00
Merge pull request #84 from ABLD/master
I tried something to integrate bazaar extension.
This commit is contained in:
commit
deb373cb11
4 changed files with 122 additions and 97 deletions
|
@ -24,6 +24,7 @@ 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
|
||||
|
||||
|
@ -36,4 +37,3 @@ You can also install it with `yunohost app install https://github.com/YunoHost-A
|
|||
3. Fill in the blanks about `MySQL` as follow, put the retrieved database password. The remaining blanks are up to you.
|
||||
|
||||
<p align="center"><img src="http://i.imgur.com/p7XmTDw.png" width="300" ></p>
|
||||
|
||||
|
|
|
@ -77,6 +77,16 @@
|
|||
},
|
||||
"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": {
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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=$(</etc/yunohost/current_host)
|
|||
sql_command="INSERT IGNORE INTO \`settings\` (\`key\`, \`value\`) VALUES ('tituspijean-auth-ssowat.domain', '$ssowatdomain'), ('tituspijean-auth-ssowat.onlyUse', '0');"
|
||||
ynh_mysql_execute_as_root "$sql_command" $db_name
|
||||
|
||||
if [[ $bazaar_extension ]]; then
|
||||
install_and_activate_extension $app $final_path $db_name "flagrow/bazaar" "flagrow-bazaar"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue