1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/humhub_ynh.git synced 2024-09-03 19:26:11 +02:00

Merge pull request #39 from YunoHost-Apps/ci-auto-update-v1.12.1

Upgrade to version 1.12.1
This commit is contained in:
yalh76 2022-09-01 01:33:16 +02:00 committed by GitHub
commit b5197ba025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 105 additions and 99 deletions

View file

@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
HumHub is an open source social network platform with a wide variety of use cases as social intranet, community or collaboration platform. HumHub consists of a core application, which can be extended through additional modules and adjusted to your needs by many configuration options. HumHub is an open source social network platform with a wide variety of use cases as social intranet, community or collaboration platform. HumHub consists of a core application, which can be extended through additional modules and adjusted to your needs by many configuration options.
**Shipped version:** 1.8.2~ynh3 **Shipped version:** 1.12.1~ynh1
**Demo:** https://www.humhub.com/en **Demo:** https://www.humhub.com/en

View file

@ -18,7 +18,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
HumHub est une plate-forme de réseau social open source avec une grande variété de cas d'utilisation en tant qu'intranet social, plate-forme de communauté ou de collaboration. HumHub se compose d'une application principale, qui peut être étendue grâce à des modules supplémentaires et ajustée à vos besoins par de nombreuses options de configuration. HumHub est une plate-forme de réseau social open source avec une grande variété de cas d'utilisation en tant qu'intranet social, plate-forme de communauté ou de collaboration. HumHub se compose d'une application principale, qui peut être étendue grâce à des modules supplémentaires et ajustée à vos besoins par de nombreuses options de configuration.
**Version incluse :** 1.8.2~ynh3 **Version incluse :** 1.12.1~ynh1
**Démo :** https://www.humhub.com/en **Démo :** https://www.humhub.com/en

View file

@ -1,31 +1,31 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
path="/path" (PATH) path="/path"
admin="john" (USER) is_public=1
is_public=1 (PUBLIC|public=1|private=0) admin="john"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1
setup_root=1 setup_root=1
setup_nourl=0 setup_nourl=0
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# 1.8.2~ynh1 # 1.8.2~ynh1
upgrade=1 from_commit=83500d6e866539d56a0aed6f288a8a8ce02a674b upgrade=1 from_commit=83500d6e866539d56a0aed6f288a8a8ce02a674b
# 1.8.2~ynh3 # 1.8.2~ynh3
upgrade=1 from_commit=50c74393ad4376bc18676b4be86fce74629ad60a upgrade=1 from_commit=50c74393ad4376bc18676b4be86fce74629ad60a
backup_restore=1 # 1.8.2~ynh4
multi_instance=1 upgrade=1 from_commit=7da020da5079b580cc2a418e2f6fb48f637a989a
port_already_use=0 backup_restore=1
change_url=0 multi_instance=1
port_already_use=0
change_url=0
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=83500d6e866539d56a0aed6f288a8a8ce02a674b ; commit=83500d6e866539d56a0aed6f288a8a8ce02a674b
name=Name and date of the commit. name=Name and date of the commit.
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1&

View file

@ -1,7 +1,7 @@
SOURCE_URL=https://www.humhub.com/download/package/humhub-1.8.2.tar.gz SOURCE_URL=https://www.humhub.com/download/package/humhub-1.12.1.tar.gz
SOURCE_SUM=181d9c4519f4612949fd67e84f61ead618b200bc813fd179603c7b32f4a6e3b9 SOURCE_SUM=ed9200b5d81346d5e409819e1861512c3a4da87094ea51b90dea8ca63c381951
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=humhub-1.8.2.tar.gz SOURCE_FILENAME=
SOURCE_EXTRACT=true SOURCE_EXTRACT=true

View file

@ -6,7 +6,7 @@
"en": "Enterprise Social Network.", "en": "Enterprise Social Network.",
"fr": "Réseau Social d'Entreprise." "fr": "Réseau Social d'Entreprise."
}, },
"version": "1.8.2~ynh3", "version": "1.12.1~ynh1",
"url": "https://www.humhub.org", "url": "https://www.humhub.org",
"upstream": { "upstream": {
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
@ -26,7 +26,7 @@
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.3-fpm", "php7.4-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {

View file

@ -4,9 +4,12 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION=7.4
pkg_dependencies="php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-apcu-bc php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap" php_dependencies="php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-apcu-bc php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap"
# dependencies used by the app (must be on a single line)
pkg_dependencies="$php_dependencies"
HUMHUB_AUTH_BASIC_VERSION=0.1.0 HUMHUB_AUTH_BASIC_VERSION=0.1.0
HUMHUB_AUTH_BASIC_PATH="/protected/modules/auth-basic" HUMHUB_AUTH_BASIC_PATH="/protected/modules/auth-basic"

View file

@ -55,7 +55,7 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." ynh_script_progression --message="Installing dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -149,25 +149,25 @@ ynh_script_progression --message="Finalizing installation..." --weight=2
install_sso install_sso
pushd $final_path/protected pushd $final_path/protected
php${YNH_PHP_VERSION} yii migrate/up --includeModuleMigrations=1 --interactive=0 php$phpversion yii migrate/up --includeModuleMigrations=1 --interactive=0
php${YNH_PHP_VERSION} yii settings/set ldap enabled '1' php$phpversion yii settings/set ldap enabled '1'
php${YNH_PHP_VERSION} yii settings/set ldap hostname 'localhost' php$phpversion yii settings/set ldap hostname 'localhost'
php${YNH_PHP_VERSION} yii settings/set ldap port 389 php$phpversion yii settings/set ldap port 389
php${YNH_PHP_VERSION} yii settings/set ldap encryption '' php$phpversion yii settings/set ldap encryption ''
php${YNH_PHP_VERSION} yii settings/set ldap username '' php$phpversion yii settings/set ldap username ''
php${YNH_PHP_VERSION} yii settings/set ldap password '' php$phpversion yii settings/set ldap password ''
php${YNH_PHP_VERSION} yii settings/set ldap baseDn 'ou=users,dc=yunohost,dc=org' php$phpversion yii settings/set ldap baseDn 'ou=users,dc=yunohost,dc=org'
php${YNH_PHP_VERSION} yii settings/set ldap loginFilter '(uid=%s)' php$phpversion yii settings/set ldap loginFilter '(uid=%s)'
php${YNH_PHP_VERSION} yii settings/set ldap userFilter 'objectClass=mailAccount' php$phpversion yii settings/set ldap userFilter 'objectClass=mailAccount'
php${YNH_PHP_VERSION} yii settings/set ldap emailAttribute 'mail' php$phpversion yii settings/set ldap emailAttribute 'mail'
php${YNH_PHP_VERSION} yii settings/set ldap usernameAttribute 'uid' php$phpversion yii settings/set ldap usernameAttribute 'uid'
php${YNH_PHP_VERSION} yii settings/set ldap idAttribute 'uid' php$phpversion yii settings/set ldap idAttribute 'uid'
php${YNH_PHP_VERSION} yii settings/set ldap refreshUsers '1' php$phpversion yii settings/set ldap refreshUsers '1'
php${YNH_PHP_VERSION} yii settings/set ldap refreshUsers '1' php$phpversion yii settings/set ldap refreshUsers '1'
php${YNH_PHP_VERSION} yii ldap/sync php$phpversion yii ldap/sync
php${YNH_PHP_VERSION} yii user/make-admin ${admin} php$phpversion yii user/make-admin ${admin}
ynh_local_curl "/index.php?r=installer/index/go" ynh_local_curl "/index.php?r=installer/index/go"
@ -181,11 +181,11 @@ pushd $final_path/protected
local_curl_csrf "/index.php?r=installer/config/sample-data" \ local_curl_csrf "/index.php?r=installer/config/sample-data" \
"SampleDataForm[sampleData]=0" "SampleDataForm[sampleData]=0"
php${YNH_PHP_VERSION} yii settings/set user auth.anonymousRegistration '0' php$phpversion yii settings/set user auth.anonymousRegistration '0'
php${YNH_PHP_VERSION} yii settings/set user auth.allowGuestAccess '0' php$phpversion yii settings/set user auth.allowGuestAccess '0'
php${YNH_PHP_VERSION} yii settings/set user auth.internalUsersCanInvite '0' php$phpversion yii settings/set user auth.internalUsersCanInvite '0'
php${YNH_PHP_VERSION} yii module/enable auth-basic php$phpversion yii module/enable auth-basic
popd popd
@ -194,20 +194,17 @@ ynh_permission_update --permission="main" --remove="visitors"
ynh_store_file_checksum --file="$final_path/protected/config/common.php" ynh_store_file_checksum --file="$final_path/protected/config/common.php"
#=================================================
# SETUP CRON CONFIGURATION
#=================================================
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/${app}"
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# SETUP CRON CONFIGURATION
#=================================================
ynh_script_progression --message="Setuping crontab..." --weight=1
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/${app}"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -68,7 +68,7 @@ chown -R $app:www-data "$final_path"
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -99,7 +99,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
#================================================= #=================================================
# RESTORE VARIOUS FILES # RESTORE VARIOUS FILES
#================================================= #=================================================
ynh_script_progression --message="Restoring various files..." ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file --origin_path="/etc/cron.d/$app" ynh_restore_file --origin_path="/etc/cron.d/$app"

View file

@ -94,26 +94,12 @@ then
# Delete old source # Delete old source
ynh_secure_remove --file="$final_path.old" ynh_secure_remove --file="$final_path.old"
if [[ ! -d $final_path/$HUMHUB_AUTH_BASIC_PATH ]]; then
install_sso
pushd $final_path/protected
php${YNH_PHP_VERSION} yii module/enable auth-basic
popd
else
current_version=$(cat $final_path/$HUMHUB_AUTH_BASIC_PATH/module.json | jq -j '.version')
if [ "$current_version" != "$HUMHUB_AUTH_BASIC_VERSION" ]; then
ynh_secure_remove $final_path/$HUMHUB_AUTH_BASIC_PATH
install_sso
fi
fi
fi fi
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -124,6 +110,7 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -146,6 +133,29 @@ ynh_replace_string --match_string="defined('YII_ENV') or define('YII_ENV', 'dev'
--replace_string="// defined('YII_ENV') or define('YII_ENV', 'dev');"\ --replace_string="// defined('YII_ENV') or define('YII_ENV', 'dev');"\
--target_file="$final_path/index.php" --target_file="$final_path/index.php"
#=================================================
# SETUP APPLICATION
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Setuping application..." --weight=1
if [[ ! -d $final_path/$HUMHUB_AUTH_BASIC_PATH ]]; then
install_sso
pushd $final_path/protected
php$phpversion yii module/enable auth-basic
popd
else
current_version=$(cat $final_path/$HUMHUB_AUTH_BASIC_PATH/module.json | jq -j '.version')
if [ "$current_version" != "$HUMHUB_AUTH_BASIC_VERSION" ]; then
ynh_secure_remove $final_path/$HUMHUB_AUTH_BASIC_PATH
install_sso
fi
fi
fi
#================================================= #=================================================
# MIGRATE DATABASE # MIGRATE DATABASE
#================================================= #=================================================
@ -153,30 +163,26 @@ ynh_script_progression --message="Migrating database..." --weight=1
chown -R $app $final_path/ chown -R $app $final_path/
sudo -u $app /usr/bin/php$YNH_PHP_VERSION $final_path/protected/yii migrate/up --includeModuleMigrations=1 ynh_exec_as $app /usr/bin/php$phpversion $final_path/protected/yii migrate/up --includeModuleMigrations=1 --interactive=0
#================================================= #=================================================
# UPDATE MODULES # UPDATE MODULES
#================================================= #=================================================
ynh_script_progression --message="Updating modules..." --weight=1 ynh_script_progression --message="Updating modules..." --weight=1
sudo -u $app /usr/bin/php$YNH_PHP_VERSION $final_path/protected/yii module/update-all ynh_exec_as $app /usr/bin/php$phpversion $final_path/protected/yii module/update-all --interactive=0
#=================================================
# REINSTALL CRONTAB
#=================================================
ynh_script_progression --message="Upgrading crontab..." --weight=1
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/${app}"
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# UPGRADE CRONTAB
#=================================================
ynh_script_progression --message="Upgrading crontab..." --weight=1
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/${app}"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -2,10 +2,10 @@ diff --git a/protected/humhub/modules/ldap/models/LdapSettings.php b/protected/h
index e6402e8b3..3b653d590 100644 index e6402e8b3..3b653d590 100644
--- a/protected/humhub/modules/ldap/models/LdapSettings.php --- a/protected/humhub/modules/ldap/models/LdapSettings.php
+++ b/protected/humhub/modules/ldap/models/LdapSettings.php +++ b/protected/humhub/modules/ldap/models/LdapSettings.php
@@ -120,7 +120,7 @@ class LdapSettings extends Model @@ -125,7 +125,7 @@ class LdapSettings extends Model
return [ return [
[['enabled', 'refreshUsers', 'usernameAttribute', 'emailAttribute', 'username', 'passwordField', 'hostname', 'port', 'idAttribute'], 'string', 'max' => 255], [['enabled', 'refreshUsers', 'usernameAttribute', 'emailAttribute', 'username', 'passwordField', 'hostname', 'port', 'idAttribute'], 'string', 'max' => 255],
[['baseDn', 'loginFilter', 'userFilter'], 'string'], [['baseDn', 'loginFilter', 'userFilter', 'ignoredDNs'], 'string'],
- [['usernameAttribute', 'username', 'passwordField', 'hostname', 'port', 'baseDn', 'loginFilter', 'userFilter', 'idAttribute'], 'required'], - [['usernameAttribute', 'username', 'passwordField', 'hostname', 'port', 'baseDn', 'loginFilter', 'userFilter', 'idAttribute'], 'required'],
+ [['usernameAttribute', 'hostname', 'port', 'baseDn', 'loginFilter', 'userFilter', 'idAttribute'], 'required'], + [['usernameAttribute', 'hostname', 'port', 'baseDn', 'loginFilter', 'userFilter', 'idAttribute'], 'required'],
['encryption', 'in', 'range' => ['', 'ssl', 'tls']], ['encryption', 'in', 'range' => ['', 'ssl', 'tls']],