From 9f96541bfd6894e6076574c6e780ecd7ce3d6cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 13 Nov 2020 19:04:02 +0100 Subject: [PATCH] Testing (#8) * Upgrade to v.1.2.6.2 --- README.md | 11 ++++------- check_process | 10 +--------- conf/app.src | 4 ++-- conf/config.php.example | 2 +- conf/nginx.conf | 4 +++- conf/php-fpm.conf | 2 +- manifest.json | 6 +++--- scripts/_common.sh | 2 ++ scripts/backup | 12 ++++-------- scripts/install | 13 ++++++------- scripts/remove | 10 ++++------ scripts/restore | 7 ++++--- scripts/upgrade | 12 ++++++------ 13 files changed, 41 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 331770e..2206fb6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # phpLDAPadmin for YunoHost -[![Integration level](https://dash.yunohost.org/integration/phpldapadmin.svg)](https://dash.yunohost.org/appci/app/phpldapadmin) +[![Integration level](https://dash.yunohost.org/integration/phpldapadmin.svg)](https://dash.yunohost.org/appci/app/phpldapadmin) ![](https://ci-apps.yunohost.org/ci/badges/phpldapadmin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/phpldapadmin.maintain.svg) [![Install phpLDAPadmin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=phpldapadmin) > *This package allow you to install phpLDAPadmin quickly and simply on a YunoHost server. @@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview phpLDAPadmin is a web app for administering Lightweight Directory Access Protocol (LDAP) servers. -**Shipped version:** 1.2.4 +**Shipped version:** 1.2.6.2 ## Screenshots @@ -27,9 +27,8 @@ phpLDAPadmin is a web app for administering Lightweight Directory Access Protoco #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/phpldapadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/phpldapadmin/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/phpldapadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/phpldapadmin/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/phpldapadmin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/phpldapadmin/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/phpldapadmin%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/phpldapadmin/) ## Links @@ -40,10 +39,8 @@ phpLDAPadmin is a web app for administering Lightweight Directory Access Protoco --- -Developers info ----------------- +## Developers info -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/phpldapadmin_ynh/tree/testing). To try the testing branch, please proceed like that. diff --git a/check_process b/check_process index b143953..f5d6ff9 100644 --- a/check_process +++ b/check_process @@ -20,16 +20,8 @@ incorrect_path=1 change_url=0 ;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto - Level 4=auto + # If the level 5 (Package linter) is forced to 1. Please add justifications here. Level 5=auto - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 ;;; Options Email=aymhce@gmail.com Notification=none diff --git a/conf/app.src b/conf/app.src index 92d4dbd..388a9a8 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/leenooks/phpLDAPadmin/archive/1.2.4.tar.gz -SOURCE_SUM=890f1b68d9197eb8edd5366a8ac6e3bf34c2d5780e80e67b89fe3017adeb8f49 +SOURCE_URL=https://github.com/leenooks/phpLDAPadmin/archive/1.2.6.2.tar.gz +SOURCE_SUM=49b14019bf611267720b4e9de33f2502b44c526809f17225a4a76ee8296b8d64 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/config.php.example b/conf/config.php.example index f94c1aa..a3432a1 100644 --- a/conf/config.php.example +++ b/conf/config.php.example @@ -283,7 +283,7 @@ $servers->newServer('ldap_pla'); /* A convenient name that will appear in the tree viewer and throughout phpLDAPadmin to identify this LDAP server to users. */ -$servers->setValue('server','name','Yunohost OpenLDAP Server'); +$servers->setValue('server','name','YunoHost OpenLDAP Server'); $servers->setValue('login','bind_id','cn=admin,dc=yunohost,dc=org'); /* Examples: diff --git a/conf/nginx.conf b/conf/nginx.conf index 96e168f..e882cc5 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,11 +8,13 @@ location __PATH__/ { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } + index index.php; + try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index ab5dca9..ab1a471 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -33,7 +33,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/manifest.json b/manifest.json index 5152fb0..9fe2498 100644 --- a/manifest.json +++ b/manifest.json @@ -1,20 +1,20 @@ { "name": "phpLDAPadmin", "id": "phpldapadmin", - "url": "http://phpldapadmin.sourceforge.net", "packaging_format": 1, "description": { "en": "Manage OpenLDAP database over the web", "fr": "Application web de gestion de la base OpenLDAP" }, - "version": "1.2.4~ynh1", + "version": "1.2.6.2~ynh1", + "url": "http://phpldapadmin.sourceforge.net", "license": "GPL-2.0-or-later", "maintainer": { "name": "aymhce", "email": "aymhce@gmail.com" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..d7614e9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,8 @@ # COMMON VARIABLES #================================================= +YNH_PHP_VERSION="7.3" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 2e05a83..a93bf68 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -14,44 +13,41 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # STANDARD BACKUP STEPS #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." --weight=2 ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." --weight=1 ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up php-fpm configuration..." --weight=1 -ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/install b/scripts/install index 9eb1cfa..c53ce69 100755 --- a/scripts/install +++ b/scripts/install @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -24,7 +23,6 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN - app=$YNH_APP_INSTANCE_NAME #================================================= @@ -57,9 +55,9 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -73,10 +71,11 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --weight=3 +ynh_script_progression --message="Configuring PHP-FPM..." --weight=3 # Create a dedicated php-fpm config ynh_add_fpm_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP @@ -84,7 +83,7 @@ ynh_add_fpm_config # GRANT ACCESS RIGHT TO ADMIN #================================================= -yunohost app addaccess $app -u $admin +ynh_permission_update --permission "main" --add $admin --remove "all_users" #================================================= # MODIFY A CONFIG FILE @@ -111,7 +110,7 @@ chown -R root: $final_path #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 7049edb..2a55822 100755 --- a/scripts/remove +++ b/scripts/remove @@ -32,21 +32,19 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --weight=2 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." --weight=1 +ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config - - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 4fc37e3..a203bad 100755 --- a/scripts/restore +++ b/scripts/restore @@ -28,6 +28,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) admin=$(ynh_app_setting_get --app=$app --key=admin) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -73,7 +74,7 @@ chown -R root: $final_path # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # SPECIFIC RESTORATION @@ -88,9 +89,9 @@ yunohost app addaccess $app -u $admin #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 -ynh_systemd_action --service_name=php7.0-fpm --action=reload +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ed57bb8..b5955b5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,9 +75,9 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -91,9 +91,9 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=5 +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=5 -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config #================================================= @@ -102,7 +102,7 @@ ynh_add_fpm_config # GRANT ACCESS RIGHT TO ADMIN #================================================= -yunohost app addaccess $app -u $admin +ynh_permission_update --permission "main" --add $admin --remove "all_users" #================================================= # MODIFY A CONFIG FILE @@ -131,7 +131,7 @@ chown -R root: $final_path #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload