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

Merge branch 'testing' into auto-update

This commit is contained in:
Éric Gaspar 2021-10-06 11:00:18 +02:00 committed by GitHub
commit ac9db935d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 97 additions and 100 deletions

View file

@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Open source collaboration platform built for developers Open source collaboration platform built for developers
**Shipped version:** 5.38.2~ynh1 **Shipped version:** 5.39.0~ynh1

View file

@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Plateforme de collaboration open source conçue pour les développeurs Plateforme de collaboration open source conçue pour les développeurs
**Version incluse :** 5.38.2~ynh1 **Version incluse :** 5.39.0~ynh1

View file

@ -19,7 +19,7 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=202cc0725652d4b8fbca52630267247bd58c8de1 upgrade=1 from_commit=4fa3ee4ad82a6154f2eb858a3da285a35afecef8
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0 port_already_use=0
@ -43,11 +43,11 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=202cc0725652d4b8fbca52630267247bd58c8de1 upgrade=1 from_commit=4fa3ee4ad82a6154f2eb858a3da285a35afecef8
;;; Options ;;; Options
Email=kemenaran@gmail.com Email=kemenaran@gmail.com
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=202cc0725652d4b8fbca52630267247bd58c8de1 ; commit=4fa3ee4ad82a6154f2eb858a3da285a35afecef8
name=Merge pull request #196 from amyblais/patch-51 name= Merge pull request #268 from YunoHost-Apps/testing

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v5.38.2/mattermost-v5.38.2-linux-arm.tar.gz SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v5.39.0/mattermost-v5.39.0-linux-arm.tar.gz
SOURCE_SUM=c0decf1b8005b145d48950f0058f015a2f14af2612a0ce73dba842053bc951f6 SOURCE_SUM=06cf528404a2c096dc69a005654ce9c2fa89301d2f4faf38fa72bd80c05ade1a
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v5.38.2/mattermost-v5.38.2-linux-arm64.tar.gz SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v5.39.0/mattermost-v5.39.0-linux-arm64.tar.gz
SOURCE_SUM=3790dd44137f53be7ffaadba26b63ca0e1333dea06580f8f91eba1eee314e3c0 SOURCE_SUM=53bfd2bc0c7c7996c101c2905f8caced4ac1be53239e654e8c47ad5a1d397d60
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -513,7 +513,8 @@
"EnableFileDeletion": false, "EnableFileDeletion": false,
"MessageRetentionDays": 365, "MessageRetentionDays": 365,
"FileRetentionDays": 365, "FileRetentionDays": 365,
"DeletionJobStartTime": "02:00" "DeletionJobStartTime": "02:00",
"BatchSize": 3000
}, },
"MessageExportSettings": { "MessageExportSettings": {
"EnableExport": false, "EnableExport": false,
@ -552,7 +553,8 @@
"AutomaticPrepackagedPlugins": true, "AutomaticPrepackagedPlugins": true,
"RequirePluginSignature": false, "RequirePluginSignature": false,
"MarketplaceUrl": "https://api.integrations.mattermost.com", "MarketplaceUrl": "https://api.integrations.mattermost.com",
"SignaturePublicKeyFiles": [] "SignaturePublicKeyFiles": [],
"ChimeraOAuthProxyUrl": ""
}, },
"DisplaySettings": { "DisplaySettings": {
"CustomUrlSchemes": [], "CustomUrlSchemes": [],
@ -584,7 +586,6 @@
"PluginIncidentManagement": "1.14.3", "PluginIncidentManagement": "1.14.3",
"PluginApps": "", "PluginApps": "",
"PluginFocalboard": "", "PluginFocalboard": "",
"CustomDataRetentionEnabled": false,
"TimedDND": false "TimedDND": false
}, },
"ImportSettings": { "ImportSettings": {

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://releases.mattermost.com/5.38.2/mattermost-enterprise-5.38.2-linux-amd64.tar.gz SOURCE_URL=https://releases.mattermost.com/5.39.0/mattermost-enterprise-5.39.0-linux-amd64.tar.gz
SOURCE_SUM=5d6769cca6aa058547965408baa6937135e08718bc5d1477033df1000e43ec8b SOURCE_SUM=ac0adea65fa8c9a0dcb0effcb4fab2c101b65ac246b205dd5514bfa9f1c22ed4
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://releases.mattermost.com/5.38.2/mattermost-team-5.38.2-linux-amd64.tar.gz SOURCE_URL=https://releases.mattermost.com/5.39.0/mattermost-team-5.39.0-linux-amd64.tar.gz
SOURCE_SUM=b6f2f6f24017eeca9e40d3bda750047171c5728f12c29564384e1aca764e0bf0 SOURCE_SUM=07175b78b0a6e14601d93ac8363e541eadcf95943338892a80640208211284b9
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -6,7 +6,7 @@
"en": "Open source collaboration platform built for developers", "en": "Open source collaboration platform built for developers",
"fr": "Plateforme de collaboration open source conçue pour les développeurs" "fr": "Plateforme de collaboration open source conçue pour les développeurs"
}, },
"version": "5.38.2~ynh1", "version": "5.39.0~ynh1",
"url": "http://www.mattermost.org/", "url": "http://www.mattermost.org/",
"upstream": { "upstream": {
"license": "GPL-3.0-only", "license": "GPL-3.0-only",

View file

@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
@ -42,7 +43,7 @@ ynh_backup --src_path="$final_path"
# BACKUP THE APP DATA # BACKUP THE APP DATA
#================================================= #=================================================
ynh_backup --src_path="/home/yunohost.app/$app" --is_big ynh_backup --src_path="$data_path" --is_big
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION

View file

@ -69,6 +69,14 @@ ynh_script_progression --message="Finding an available port..." --weight=3
port=$(ynh_find_port --port=8065) port=$(ynh_find_port --port=8065)
ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port --value=$port
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=3
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# CREATE A MYSQL DATABASE # CREATE A MYSQL DATABASE
#================================================= #=================================================
@ -76,18 +84,9 @@ ynh_script_progression --message="Creating a MySQL database..." --weight=10
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=3
# Create a system user
ynh_system_user_create --username=$app
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -104,17 +103,23 @@ elif [ "$version" = "Team" ]; then
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
fi fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# CREATE DIRECTORY FOR DATA # CREATE DIRECTORY FOR DATA
#================================================= #=================================================
ynh_script_progression --message="Creating the data directory..." --weight=1 ynh_script_progression --message="Creating the data directory..." --weight=1
# Create datadir folder data_path=/home/yunohost.app/$app
mkdir -p "/home/yunohost.app/$app" ynh_app_setting_set --app=$app --key=data_path --value=$data_path
# Define app's data directory
data_path="/home/yunohost.app/$app" mkdir -p $data_path
# Give permission to the datadir
chown -R $app: "$data_path" chmod 750 "$data_path"
chmod -R o-rwx "$data_path"
chown -R $app:www-data "$data_path"
#================================================= #=================================================
# HANDLE LOG FILES AND LOGROTATE # HANDLE LOG FILES AND LOGROTATE
@ -142,13 +147,6 @@ url=https://$domain$path_url
ynh_add_config --template="../conf/config.json" --destination="$final_path/config/config.json" ynh_add_config --template="../conf/config.json" --destination="$final_path/config/config.json"
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
chown -R $app: $final_path
chmod -R g+w $final_path
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================

View file

@ -20,6 +20,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -59,7 +60,7 @@ ynh_script_progression --message="Removing $app main directory..." --weight=6
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
# We don't delete this dir as it is marked as is-big # We don't delete this dir as it is marked as is-big
# ynh_secure_remove --file="/home/yunohost.app/$app" # ynh_secure_remove --file="$data_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION

View file

@ -32,14 +32,13 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=1 ynh_script_progression --message="Validating restoration parameters..." --weight=1
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \ test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path " || ynh_die --message="There is already a directory: $final_path "
@ -51,6 +50,14 @@ test ! -d $final_path \
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -58,20 +65,22 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
#================================================= chmod 750 "$final_path"
# RECREATE THE DEDICATED USER chmod -R o-rwx "$final_path"
#================================================= chown -R $app:www-data "$final_path"
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
#================================================= #=================================================
# RESTORE THE APP DATA # RESTORE THE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=4
ynh_restore_file --origin_path="/home/yunohost.app/$app" --not_mandatory ynh_restore_file --origin_path="$data_path" --not_mandatory
chown -R $app: "/home/yunohost.app/$app"
mkdir -p $data_path
chmod 750 "$data_path"
chmod -R o-rwx "$data_path"
chown -R $app:www-data "$data_path"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
@ -86,10 +95,6 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
# Restore permissions on app files
chown -R $app: $final_path
chmod -R g+w $final_path
logs_path="/var/log/$app" logs_path="/var/log/$app"
mkdir -p $logs_path mkdir -p $logs_path
chown -R $app: $logs_path chown -R $app: $logs_path

View file

@ -34,6 +34,7 @@ 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) version=$(ynh_app_setting_get --app=$app --key=version)
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -43,6 +44,20 @@ ynh_script_progression --message="Checking version..." --weight=1
previous_upstream_version="$(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json")" previous_upstream_version="$(ynh_app_upstream_version --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json")"
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
@ -70,6 +85,12 @@ if [ -z "$db_name" ]; then
ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
fi fi
# If final_path doesn't exist, create it
if [ -z "$data_path" ]; then
data_path="/home/yunohost.app/$app"
ynh_app_setting_set --app=$app --key=data_path --value=$data_path
fi
# Cleaning legacy permissions # Cleaning legacy permissions
if ynh_legacy_permissions_exists; then if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all
@ -77,20 +98,6 @@ if ynh_legacy_permissions_exists; then
ynh_app_setting_delete --app=$app --key=is_public ynh_app_setting_delete --app=$app --key=is_public
fi fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -100,6 +107,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -130,6 +145,10 @@ then
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
fi fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -138,14 +157,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
@ -154,26 +165,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
#=================================================
# CREATE DIRECTORY FOR DATA
#=================================================
ynh_script_progression --message="Creating the data directory..." --weight=1
# Define app's data directory
data_path="/home/yunohost.app/$app"
# Create datadir folder
mkdir -p $data_path
# Give permission to the datadir
chown -R $app: "$data_path"
#=================================================
# RESTORE FILE PERMISSIONS
#=================================================
chown -R $app: $final_path
chmod -R g+w $final_path
chown -R $app: "/var/log/$app"
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================