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>
|
||||
|
||||
|
|
190
manifest.json
190
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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -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