1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00

Add Team and Enterprise (#202)

* Add Team/Entreprise install
This commit is contained in:
Éric Gaspar 2021-01-13 11:31:12 +01:00 committed by GitHub
parent 86908c0444
commit fc6a600bb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 76 additions and 7 deletions

View file

@ -28,6 +28,10 @@ Mattermost is a self-hosted, open source instant messaging and service software.
## YunoHost specific features ## YunoHost specific features
This package can install the [*Entreprise Edition*](https://docs.mattermost.com/overview/product.html#mattermost-enterprise-edition) or the [*Team Edition*](https://docs.mattermost.com/overview/product.html#mattermost-team-edition).
Mattermost Mobile and Desktop Apps are available [here](https://mattermost.com/download/)
#### Multi-user support #### Multi-user support
* Are LDAP and HTTP auth supported? **No** * Are LDAP and HTTP auth supported? **No**
@ -44,7 +48,7 @@ Mattermost is a self-hosted, open source instant messaging and service software.
## Additional information ## Additional information
* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture. * This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` if you choose to ibstall the *Entreprise Edition*).
## Links ## Links

View file

@ -1,7 +1,7 @@
# See here for more information # See here for more information
# https://github.com/YunoHost/package_check#syntax-check_process-file # https://github.com/YunoHost/package_check#syntax-check_process-file
;; Test complet ;; Test with Enterprise Edition
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld" (DOMAIN)
path="/path" (PATH) path="/path" (PATH)
@ -11,6 +11,7 @@
password="admin!42" password="admin!42"
admin_password="admin!42" admin_password="admin!42"
language="fr" language="fr"
version="Enterprise"
team_display_name="Mon équipe" team_display_name="Mon équipe"
is_public=1 (PUBLIC|public=1|private=0) is_public=1 (PUBLIC|public=1|private=0)
; Checks ; Checks
@ -26,6 +27,26 @@
multi_instance=1 multi_instance=1
port_already_use=0 port_already_use=0
change_url=0 change_url=0
;; Test with Team Edition
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
admin="john" (USER)
email="john@gmail.com"
admin_email="john@gmail.com"
password="admin!42"
admin_password="admin!42"
language="fr"
version="Team"
team_display_name="Mon équipe"
is_public=1 (PUBLIC|public=1|private=0)
; Checks
setup_sub_dir=1
setup_root=1
setup_private=1
setup_public=1
upgrade=1
upgrade=1 from_commit=202cc0725652d4b8fbca52630267247bd58c8de1
;;; Options ;;; Options
Email=kemenaran@gmail.com Email=kemenaran@gmail.com
Notification=none Notification=none

6
conf/enterprise.src Normal file
View file

@ -0,0 +1,6 @@
SOURCE_URL=https://releases.mattermost.com/5.30.1/mattermost-5.30.1-linux-amd64.tar.gz
SOURCE_SUM=14018addf86c040200515cb0141308a6d213f149f8afe425dd171347be516401
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=mattermost-5.30.1-linux-amd64.tar.gz

View file

@ -73,6 +73,20 @@
}, },
"example": "Choose a password" "example": "Choose a password"
}, },
{
"name": "version",
"type": "string",
"ask": {
"en": "Choose the version you want to install",
"fr": "Choisissez la version que vous souhaitez installer"
},
"help": {
"en": "Use Team Edition for the open source version (ARM, ARM64 and x86-64 support) or Enterprise Edition if you want to use a license (x86-64 support only)",
"fr": "Utilisez Team Edition pour la version open source (prise en charge ARM, ARM64 et x86-64) ou Enterprise Edition si vous souhaitez utiliser une licence (prise en charge x86-64 uniquement)"
},
"choices": ["Enterprise", "Team"],
"default": "Team"
},
{ {
"name": "language", "name": "language",
"type": "string", "type": "string",

View file

@ -32,6 +32,7 @@ password=$YNH_APP_ARG_PASSWORD
language=$YNH_APP_ARG_LANGUAGE language=$YNH_APP_ARG_LANGUAGE
team_display_name=$YNH_APP_ARG_TEAM_DISPLAY_NAME team_display_name=$YNH_APP_ARG_TEAM_DISPLAY_NAME
architecture=$(ynh_detect_arch) architecture=$(ynh_detect_arch)
version=$YNH_APP_ARG_VERSION
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -57,6 +58,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=password --value=$password ynh_app_setting_set --app=$app --key=password --value=$password
ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=version --value=$version
ynh_app_setting_set --app=$app --key=team_display_name --value=$team_display_name ynh_app_setting_set --app=$app --key=team_display_name --value=$team_display_name
#================================================= #=================================================
@ -94,7 +96,14 @@ ynh_script_progression --message="Setting up source files..." --weight=3
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
if [ "$version" = "Enterprise" ]; then
# Get Enterprise binary path
ynh_setup_source --dest_dir="$final_path" --source_id="enterprise"
elif [ "$version" = "Team" ]; then
# Get Team binary path
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
fi
#================================================= #=================================================
# CREATE DIRECTORY FOR DATA # CREATE DIRECTORY FOR DATA

View file

@ -43,7 +43,7 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_remove_systemd_config ynh_remove_systemd_config
#================================================= #=================================================
# REMOVE THE POSTGRESQL DATABASE # REMOVE THE MySQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Removing the MySQL database..." --weight=2 ynh_script_progression --message="Removing the MySQL database..." --weight=2

View file

@ -34,6 +34,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language) language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
architecture=$(ynh_detect_arch) architecture=$(ynh_detect_arch)
version=$(ynh_app_setting_get --app=$app --key=version)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -60,6 +61,18 @@ if ! [[ "$port" ]]; then
ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port --value=$port
fi fi
# Save the language used if not present
if ! [[ "$language" ]]; then
language="en"
ynh_app_setting_set --app=$app --key=language --value=$language
fi
# If version setting doesn't exist
if [ -z "$version" ]; then
version="Enterprise"
ynh_app_setting_set --app=$app --key=version --value=$version
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -100,8 +113,11 @@ then
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
# Download, check integrity, uncompress and patch the source from app.src if [ "$version" = "Enterprise" ]; then
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" ynh_setup_source --dest_dir="$final_path" --source_id="enterprise"
elif [ "$version" = "Team" ]; then
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
fi
# Copy the admin saved settings from tmp directory to final path # Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/config.json" "$final_path/config/config.json" cp -a "$tmpdir/config.json" "$final_path/config/config.json"
@ -168,7 +184,6 @@ chown -R $app: "$data_path"
chown -R $app: $final_path chown -R $app: $final_path
chmod -R g+w $final_path chmod -R g+w $final_path
chown -R $app: "/var/log/$app" chown -R $app: "/var/log/$app"
#================================================= #=================================================