From 4efe84275fc212b13c5e3c19ca041efe75ae437a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 27 Aug 2022 23:01:32 +0000 Subject: [PATCH 1/5] Upgrade to v1.12.1 --- conf/app.src | 6 +++--- manifest.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/app.src b/conf/app.src index 206bfaa..5558e55 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://www.humhub.com/download/package/humhub-1.8.2.tar.gz -SOURCE_SUM=181d9c4519f4612949fd67e84f61ead618b200bc813fd179603c7b32f4a6e3b9 +SOURCE_URL=https://www.humhub.com/download/package/humhub-1.12.1.tar.gz +SOURCE_SUM=ed9200b5d81346d5e409819e1861512c3a4da87094ea51b90dea8ca63c381951 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=humhub-1.8.2.tar.gz +SOURCE_FILENAME= SOURCE_EXTRACT=true diff --git a/manifest.json b/manifest.json index 9f3eed3..bf3590f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Enterprise Social Network.", "fr": "Réseau Social d'Entreprise." }, - "version": "1.8.2~ynh3", + "version": "1.12.1~ynh1", "url": "https://www.humhub.org", "upstream": { "license": "AGPL-3.0-only", From 2ef6a9ebe1ea7266dddffa4dfe15f64c86da17ae Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 27 Aug 2022 23:01:44 +0000 Subject: [PATCH 2/5] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 58db862..f117202 100644 --- a/README.md +++ b/README.md @@ -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. -**Shipped version:** 1.8.2~ynh3 +**Shipped version:** 1.12.1~ynh1 **Demo:** https://www.humhub.com/en diff --git a/README_fr.md b/README_fr.md index 5169ee9..93f0e35 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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. -**Version incluse :** 1.8.2~ynh3 +**Version incluse :** 1.12.1~ynh1 **Démo :** https://www.humhub.com/en From 3c865af741c525f7090c187b7a80f81cb2e7d854 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 29 Aug 2022 23:36:24 +0200 Subject: [PATCH 3/5] Fix install --- scripts/_common.sh | 2 +- sources/patches/app-00-no-password-ldap.patch | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index c2d0c5c..8b8c9e3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # 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" diff --git a/sources/patches/app-00-no-password-ldap.patch b/sources/patches/app-00-no-password-ldap.patch index 645e65f..8b6b56c 100644 --- a/sources/patches/app-00-no-password-ldap.patch +++ b/sources/patches/app-00-no-password-ldap.patch @@ -2,10 +2,10 @@ diff --git a/protected/humhub/modules/ldap/models/LdapSettings.php b/protected/h index e6402e8b3..3b653d590 100644 --- a/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 [ [['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', 'hostname', 'port', 'baseDn', 'loginFilter', 'userFilter', 'idAttribute'], 'required'], ['encryption', 'in', 'range' => ['', 'ssl', 'tls']], From 1bd68044394dd8b6390d04232e2d00a44e6aab1d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 30 Aug 2022 00:36:35 +0200 Subject: [PATCH 4/5] Apply last example_ynh --- check_process | 52 +++++++++++++++++++------------------- manifest.json | 2 +- scripts/_common.sh | 7 ++++-- scripts/install | 61 ++++++++++++++++++++++----------------------- scripts/restore | 4 +-- scripts/upgrade | 62 +++++++++++++++++++++++++--------------------- 6 files changed, 97 insertions(+), 91 deletions(-) diff --git a/check_process b/check_process index eeee805..562e35f 100644 --- a/check_process +++ b/check_process @@ -1,31 +1,31 @@ ;; Test complet - ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - # 1.8.2~ynh1 - upgrade=1 from_commit=83500d6e866539d56a0aed6f288a8a8ce02a674b - # 1.8.2~ynh3 - upgrade=1 from_commit=50c74393ad4376bc18676b4be86fce74629ad60a - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=0 + ; Manifest + domain="domain.tld" + path="/path" + is_public=1 + admin="john" + ; Checks + pkg_linter=1 + setup_sub_dir=1 + setup_root=1 + setup_nourl=0 + setup_private=1 + setup_public=1 + upgrade=1 + # 1.8.2~ynh1 + upgrade=1 from_commit=83500d6e866539d56a0aed6f288a8a8ce02a674b + # 1.8.2~ynh3 + upgrade=1 from_commit=50c74393ad4376bc18676b4be86fce74629ad60a + # 1.8.2~ynh4 + upgrade=1 from_commit=7da020da5079b580cc2a418e2f6fb48f637a989a + backup_restore=1 + multi_instance=1 + port_already_use=0 + change_url=0 ;;; Options Email= Notification=none ;;; Upgrade options - ; commit=83500d6e866539d56a0aed6f288a8a8ce02a674b - name=Name and date of the commit. - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1& - - + ; commit=83500d6e866539d56a0aed6f288a8a8ce02a674b + name=Name and date of the commit. + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1& diff --git a/manifest.json b/manifest.json index bf3590f..29e984d 100644 --- a/manifest.json +++ b/manifest.json @@ -26,7 +26,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", + "php7.4-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 8b8c9e3..688e090 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,12 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.4" +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_PATH="/protected/modules/auth-basic" diff --git a/scripts/install b/scripts/install index 3af00f4..36c112d 100644 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,7 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies @@ -149,25 +149,25 @@ ynh_script_progression --message="Finalizing installation..." --weight=2 install_sso 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${YNH_PHP_VERSION} yii settings/set ldap hostname 'localhost' - php${YNH_PHP_VERSION} yii settings/set ldap port 389 - php${YNH_PHP_VERSION} yii settings/set ldap encryption '' - php${YNH_PHP_VERSION} yii settings/set ldap username '' - php${YNH_PHP_VERSION} yii settings/set ldap password '' - php${YNH_PHP_VERSION} yii settings/set ldap baseDn 'ou=users,dc=yunohost,dc=org' - php${YNH_PHP_VERSION} yii settings/set ldap loginFilter '(uid=%s)' - php${YNH_PHP_VERSION} yii settings/set ldap userFilter 'objectClass=mailAccount' - php${YNH_PHP_VERSION} yii settings/set ldap emailAttribute 'mail' - php${YNH_PHP_VERSION} yii settings/set ldap usernameAttribute 'uid' - php${YNH_PHP_VERSION} yii settings/set ldap idAttribute 'uid' - php${YNH_PHP_VERSION} yii settings/set ldap refreshUsers '1' - php${YNH_PHP_VERSION} yii settings/set ldap refreshUsers '1' + php$phpversion yii settings/set ldap enabled '1' + php$phpversion yii settings/set ldap hostname 'localhost' + php$phpversion yii settings/set ldap port 389 + php$phpversion yii settings/set ldap encryption '' + php$phpversion yii settings/set ldap username '' + php$phpversion yii settings/set ldap password '' + php$phpversion yii settings/set ldap baseDn 'ou=users,dc=yunohost,dc=org' + php$phpversion yii settings/set ldap loginFilter '(uid=%s)' + php$phpversion yii settings/set ldap userFilter 'objectClass=mailAccount' + php$phpversion yii settings/set ldap emailAttribute 'mail' + php$phpversion yii settings/set ldap usernameAttribute 'uid' + php$phpversion yii settings/set ldap idAttribute 'uid' + php$phpversion yii settings/set ldap refreshUsers '1' + php$phpversion yii settings/set ldap refreshUsers '1' - php${YNH_PHP_VERSION} yii ldap/sync - php${YNH_PHP_VERSION} yii user/make-admin ${admin} + php$phpversion yii ldap/sync + php$phpversion yii user/make-admin ${admin} 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" \ "SampleDataForm[sampleData]=0" - php${YNH_PHP_VERSION} yii settings/set user auth.anonymousRegistration '0' - php${YNH_PHP_VERSION} 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.anonymousRegistration '0' + php$phpversion yii settings/set user auth.allowGuestAccess '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 @@ -194,20 +194,17 @@ ynh_permission_update --permission="main" --remove="visitors" 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 -R o-rwx "$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 #================================================= diff --git a/scripts/restore b/scripts/restore index 60f6fd4..98a4b85 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,7 +68,7 @@ chown -R $app:www-data "$final_path" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install 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 #================================================= -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" diff --git a/scripts/upgrade b/scripts/upgrade index be9537b..d3448cb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -94,26 +94,12 @@ then # Delete old source 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 #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." --weight=1 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 ynh_add_fpm_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # 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');"\ --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 #================================================= @@ -153,30 +163,26 @@ ynh_script_progression --message="Migrating database..." --weight=1 chown -R $app $final_path/ -sudo -u $app /usr/bin/php$YNH_PHP_VERSION $final_path/protected/yii migrate/up --includeModuleMigrations=1 +sudo -u $app /usr/bin/php$phpversion $final_path/protected/yii migrate/up --includeModuleMigrations=1 #================================================= # UPDATE MODULES #================================================= ynh_script_progression --message="Updating modules..." --weight=1 -sudo -u $app /usr/bin/php$YNH_PHP_VERSION $final_path/protected/yii module/update-all - -#================================================= -# 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 -#================================================= +sudo -u $app /usr/bin/php$phpversion $final_path/protected/yii module/update-all chmod 750 "$final_path" chmod -R o-rwx "$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 #================================================= From 18eab48d51fbd34f76f830db4e4ba1dde5ff2fd6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 31 Aug 2022 20:35:56 +0200 Subject: [PATCH 5/5] Fix upgrade --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index d3448cb..95c3b59 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -163,14 +163,14 @@ ynh_script_progression --message="Migrating database..." --weight=1 chown -R $app $final_path/ -sudo -u $app /usr/bin/php$phpversion $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 #================================================= ynh_script_progression --message="Updating modules..." --weight=1 -sudo -u $app /usr/bin/php$phpversion $final_path/protected/yii module/update-all +ynh_exec_as $app /usr/bin/php$phpversion $final_path/protected/yii module/update-all --interactive=0 chmod 750 "$final_path" chmod -R o-rwx "$final_path"