From 72f5a7a5aad85d683699a5b03f2803f0045324ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 5 Oct 2023 21:38:07 +0200 Subject: [PATCH 01/45] v2 --- conf/app.src | 7 -- conf/ldap_plugin.src | 5 -- conf/log_failed_logins_plugin.src | 5 -- conf/nginx.conf | 52 +++++------ manifest.toml | 82 +++++++++++++++++ scripts/_common.sh | 4 +- scripts/backup | 20 ++--- scripts/change_url | 50 ++++++----- scripts/install | 120 ++++++++++++------------- scripts/remove | 32 +++---- scripts/restore | 60 ++++++------- scripts/upgrade | 140 +++++++++++++++--------------- 12 files changed, 322 insertions(+), 255 deletions(-) delete mode 100644 conf/app.src delete mode 100644 conf/ldap_plugin.src delete mode 100644 conf/log_failed_logins_plugin.src create mode 100644 manifest.toml diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index c8e8c51..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://piwigo.org/download/dlcounter.php?code=13.8.0 -SOURCE_SUM=7f6a2a796693a4ce245fd67ebdd8bf873dc6cb1a33acd567104a10347af7fe1d -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/conf/ldap_plugin.src b/conf/ldap_plugin.src deleted file mode 100644 index 53d6c2f..0000000 --- a/conf/ldap_plugin.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://piwigo.org/ext/download.php?rid=7036 -SOURCE_SUM=3c22652f6c0653aaeebe239435796748ee57612ad44e8e5f2553277545d36e5e -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true diff --git a/conf/log_failed_logins_plugin.src b/conf/log_failed_logins_plugin.src deleted file mode 100644 index bbef4e6..0000000 --- a/conf/log_failed_logins_plugin.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=http://piwigo.org/ext/download.php?rid=5525 -SOURCE_SUM=85b9a06f2c7ca8ae9698e6151c7631f519c945f696b02da72f9ff53243d7e4ca -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=false diff --git a/conf/nginx.conf b/conf/nginx.conf index 28469eb..5dc994e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,26 +1,26 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { - - # Path to source - alias __FINALPATH__/; - - index index.php; - - # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - client_max_body_size 100M; - - default_type text/html; - location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user if_not_empty; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; - } - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; -} +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { + + # Path to source + alias __INSTALL_DIR__/; + + index index.php; + + # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file + client_max_body_size 100M; + + default_type text/html; + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user if_not_empty; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $request_filename; + } + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; +} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..ede33c2 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,82 @@ +packaging_format = 2 + +id = "piwigo" +name = "Piwigo" +description.en = "Open source photo gallery for the web" +description.fr = "Galerie de photos open source pour le web" + +version = "13.8.0~ynh1" + +maintainers = ["JimboJoe"] + +[upstream] +license = "GPL-2.0" +website = "http://piwigo.org" +demo = "https://piwigo.org/demo" +admindoc = "https://piwigo.org/guides" +code = "https://github.com/Piwigo/Piwigo" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.2" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/piwigo" + + [install.init_main_permission] + type = "group" + default = "visitors" + + [install.language] + ask.en = "Choose the application language" + ask.fr = "Choisissez la langue de l'application" + type = "string" + choices = ["de", "en", "es", "fr", "it", "pt"] + default = "en" + + [install.admin] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "user" + +[resources] + [resources.sources] + [resources.sources.ldap_plugin] + url = "https://piwigo.org/ext/download.php?rid=7036" + sha256 = "3c22652f6c0653aaeebe239435796748ee57612ad44e8e5f2553277545d36e5e" + + [resources.sources.main] + url = "https://piwigo.org/download/dlcounter.php?code=13.8.0" + sha256 = "7f6a2a796693a4ce245fd67ebdd8bf873dc6cb1a33acd567104a10347af7fe1d" + + [resources.sources.log_failed_logins_plugin] + url = "http://piwigo.org/ext/download.php?rid=5525" + sha256 = "85b9a06f2c7ca8ae9698e6151c7631f519c945f696b02da72f9ff53243d7e4ca" + in_subdir = false + + + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] + main.url = "/" + + [resources.database] + type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 8f61cb4..68614d7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,10 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="8.0" +#REMOVEME? YNH_PHP_VERSION="8.0" # dependencies used by the app -pkg_dependencies="imagemagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysqli php${YNH_PHP_VERSION}-ldap" +#REMOVEME? pkg_dependencies="imagemagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysqli php${YNH_PHP_VERSION}-ldap" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 95422cc..2f19374 100644 --- a/scripts/backup +++ b/scripts/backup @@ -15,20 +15,20 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? 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) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -39,13 +39,13 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$datadir" --is_big +ynh_backup --src_path="$data_dir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 58c7fa5..dd81362 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -13,36 +13,36 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH +#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN +#REMOVEME? old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN +#REMOVEME? new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? # Needed for helper "ynh_add_nginx_config" +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= -change_domain=0 -if [ "$old_domain" != "$new_domain" ] +#REMOVEME? change_domain=0 +#REMOVEME? if [ "$old_domain" != "$new_domain" ] then - change_domain=1 + #REMOVEME? change_domain=1 fi -change_path=0 -if [ "$old_path" != "$new_path" ] +#REMOVEME? change_path=0 +#REMOVEME? if [ "$old_path" != "$new_path" ] then - change_path=1 + #REMOVEME? change_path=1 fi #================================================= @@ -52,28 +52,30 @@ fi #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +ynh_change_url_nginx_config + +#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # Change the path in the NGINX config file if [ $change_path -eq 1 ] then # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" +#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" +#REMOVEME? domain="$old_domain" +#REMOVEME? path="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config +#REMOVEME? ynh_add_nginx_config fi # Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf +#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" +#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi #================================================= @@ -81,9 +83,9 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index b07cb4a..83bd9ca 100644 --- a/scripts/install +++ b/scripts/install @@ -14,20 +14,20 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC -language=$YNH_APP_ARG_LANGUAGE -admin=$YNH_APP_ARG_ADMIN -phpversion=$YNH_PHP_VERSION +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? path=$YNH_APP_ARG_PATH +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? language=$YNH_APP_ARG_LANGUAGE +#REMOVEME? admin=$YNH_APP_ARG_ADMIN +#REMOVEME? phpversion=$YNH_PHP_VERSION -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME fpm_footprint="low" fpm_free_footprint=0 @@ -36,23 +36,23 @@ fpm_usage="low" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." +#REMOVEME? ynh_script_progression --message="Storing installation settings..." -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=language --value=$language -ynh_app_setting_set --app=$app --key=admin --value=$admin +#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage @@ -62,34 +62,34 @@ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=40 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=40 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=3 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." +#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$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 +#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) +#REMOVEME? db_user=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=5 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Create tmp directory and fetch app inside tmpdir="$(ynh_smart_mktemp --min_size=300)" @@ -104,12 +104,12 @@ ynh_setup_source --dest_dir="$tmpdir/plugins" --source_id=log_failed_logins_plug shopt -s extglob # Install files and set permissions -mkdir $final_path -cp -a $tmpdir/!(upload|_data|galleries) $final_path +mkdir $install_dir +cp -a $tmpdir/!(upload|_data|galleries) $install_dir -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION @@ -118,7 +118,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -135,26 +135,26 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Creating a data directory..." -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir +#REMOVEME? data_dir=/home/yunohost.app/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir -mkdir -p $datadir/_data -mkdir -p $datadir/upload -mkdir -p $datadir/galleries +mkdir -p $data_dir/_data +mkdir -p $data_dir/upload +mkdir -p $data_dir/galleries -ln -sd $datadir/_data $final_path/_data -ln -sd $datadir/upload $final_path/upload -ln -sd $datadir/galleries $final_path/galleries +ln -sd $data_dir/_data $install_dir/_data +ln -sd $data_dir/upload $install_dir/upload +ln -sd $data_dir/galleries $install_dir/galleries -cp -Rp $tmpdir/_data/. $final_path/_data -cp -Rp $tmpdir/upload/. $final_path/upload -cp -Rp $tmpdir/galleries/. $final_path/galleries +cp -Rp $tmpdir/_data/. $install_dir/_data +cp -Rp $tmpdir/upload/. $install_dir/upload +cp -Rp $tmpdir/galleries/. $install_dir/galleries ynh_secure_remove --file="$tmpdir" -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # SETUP APPLICATION WITH CURL @@ -164,14 +164,14 @@ ynh_script_progression --message="Setuping application with CURL..." --weight=5 # Set the app as temporarily public for curl call ynh_script_progression --message="Configuring SSOwat..." # Making the app public for curl -ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" # Reload NGINX -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload # Generate random password for admin adm_pwd=$(ynh_string_random --length=24) -ynh_app_setting_set --app=$app --key=admin_pwd --value="$adm_pwd" +#REMOVEME? ynh_app_setting_set --app=$app --key=admin_pwd --value="$adm_pwd" if [ "$language" = "fr" ]; then applanguage="fr_FR" @@ -191,14 +191,14 @@ ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbhost=127.0 ynh_script_progression --message="Configuring Piwigo..." # Change local config -ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/local/config/config.inc.php" +ynh_add_config --template="../conf/config.inc.php" --destination="$install_dir/local/config/config.inc.php" # Setup database in local/config/database.inc.php -ynh_add_config --template="../conf/database.inc.php" --destination="$final_path/local/config/database.inc.php" +ynh_add_config --template="../conf/database.inc.php" --destination="$install_dir/local/config/database.inc.php" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # ADD LDAP PLUGIN @@ -227,7 +227,7 @@ UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'allow_new_users'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'ld_group_user_active';" # Remove the public access -ynh_permission_update --permission="main" --remove="visitors" +#REMOVEME? ynh_permission_update --permission="main" --remove="visitors" #================================================= # GENERIC FINALIZATION @@ -248,22 +248,22 @@ ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex= #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." +#REMOVEME? ynh_script_progression --message="Configuring permissions..." # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 75ef24b..6a1c448 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,33 +12,33 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # STANDARD REMOVE #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." +#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +#REMOVEME? ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DATA DIR @@ -48,7 +48,7 @@ ynh_secure_remove --file="$final_path" if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then ynh_script_progression --message="Removing app data directory..." --weight=1 - ynh_secure_remove --file="$datadir" +#REMOVEME? ynh_secure_remove --file="$data_dir" fi #================================================= @@ -70,10 +70,10 @@ ynh_remove_fpm_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +#REMOVEME? ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # REMOVE FAIL2BAN CONFIGURATION @@ -88,10 +88,10 @@ ynh_remove_fail2ban_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 645e07e..cc72899 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,67 +15,67 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading settings..." --weight=2 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -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) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -datadir=$(ynh_app_setting_get --app=$app --key=datadir) -phpversion=$YNH_PHP_VERSION +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) +#REMOVEME? phpversion=$YNH_PHP_VERSION -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) +#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=4 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= ynh_script_progression --message="Restoring the data directory..." --weight=2 -ynh_restore_file --origin_path="$datadir" --not_mandatory +ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # RESTORE FAIL2BAN CONFIGURATION @@ -94,10 +94,10 @@ ynh_systemd_action --action=restart --service_name=fail2ban #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=40 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=40 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -119,10 +119,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=2 +#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=2 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d3bfc99..5d8d243 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,25 +12,25 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -language=$(ynh_app_setting_get --app=$app --key=language) -admin=$(ynh_app_setting_get --app=$app --key=admin) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -admin_pwd=$(ynh_app_setting_get --app=$app --key=admin_pwd) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) -phpversion=$YNH_PHP_VERSION +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? language=$(ynh_app_setting_get --app=$app --key=language) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? admin_pwd=$(ynh_app_setting_get --app=$app --key=admin_pwd) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) +#REMOVEME? phpversion=$YNH_PHP_VERSION -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) +#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) +#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK VERSION @@ -41,16 +41,16 @@ 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=6 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=6 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -78,26 +78,26 @@ if [ -z "$fpm_usage" ]; then fi # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all fi -# If datadir doesn't exist, create it -if [ -z "$datadir" ]; then - datadir=/home/yunohost.app/$app - ynh_app_setting_set --app=$app --key=datadir --value=$datadir +# If data_dir doesn't exist, create it +if [ -z "$data_dir" ]; then + data_dir=/home/yunohost.app/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir fi # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name fi -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi # Compatibility with previous version; password was not set @@ -106,33 +106,33 @@ if [ -z "$admin_pwd" ] ; then admin_pwd=$(ynh_string_random --length=24) # Compute password hash with the Piwigo function - cp ../conf/hash_password.php $final_path - hashed_password=$(cd $final_path ; php hash_password.php $admin_pwd) + cp ../conf/hash_password.php $install_dir + hashed_password=$(cd $install_dir ; php hash_password.php $admin_pwd) # Update password hash in database - db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "UPDATE users SET password='$hashed_password' WHERE username='$admin';" - ynh_app_setting_set --app=$app --key=admin_pwd --value="$admin_pwd" +#REMOVEME? ynh_app_setting_set --app=$app --key=admin_pwd --value="$admin_pwd" # Remove the temporary hash generation script - ynh_secure_remove --file="$final_path/hash_password.php" +#REMOVEME? ynh_secure_remove --file="$install_dir/hash_password.php" fi -# Use path instead of path_url in settings.yml... -if [ -z "$path_url" ] +# Use path instead of path in settings.yml... +if [ -z "$path" ] then - path_url=$(ynh_app_setting_get --app=$app --key=path_url) - ynh_app_setting_set --app=$app --key=path --value=$path_url - ynh_app_setting_delete --app=$app --key=path_url +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path + ynh_app_setting_delete --app=$app --key=path fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? 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" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -155,41 +155,41 @@ then ynh_setup_source --dest_dir="$tmpdir/plugins" --source_id=log_failed_logins_plugin # Install files and set permissions - cp -a $tmpdir/!(upload|_data|galleries) $final_path + cp -a $tmpdir/!(upload|_data|galleries) $install_dir # Backward compatibility: # If the _data subdirectory wasn't already moved to /home/yunohost.app/$app, # then move it there - if [ ! -h $final_path/_data ] ; then - mv $final_path/_data $datadir - ln -sd $datadir/_data $final_path/_data + if [ ! -h $install_dir/_data ] ; then + mv $install_dir/_data $data_dir + ln -sd $data_dir/_data $install_dir/_data fi # Backward compatibility: # If the galleries subdirectory wasn't already moved to /home/yunohost.app/$app, # then move it there - if [ ! -h $final_path/galleries ] ; then - mv $final_path/galleries $datadir - ln -sd $datadir/galleries $final_path/galleries + if [ ! -h $install_dir/galleries ] ; then + mv $install_dir/galleries $data_dir + ln -sd $data_dir/galleries $install_dir/galleries fi ynh_secure_remove --file="$tmpdir" fi -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=6 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=6 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # PHP-FPM CONFIGURATION @@ -198,7 +198,7 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -216,7 +216,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6 # Reload NGINX -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload if [ "$language" = "fr" ] ; then applanguage="fr_FR" @@ -233,14 +233,14 @@ ynh_local_curl "/upgrade.php?language=$applanguage&now=true" "language=$applangu ynh_script_progression --message="Configuring Piwigo..." # Change local config -ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/local/config/config.inc.php" +ynh_add_config --template="../conf/config.inc.php" --destination="$install_dir/local/config/config.inc.php" # Setup database in local/config/database.inc.php -ynh_add_config --template="../conf/database.inc.php" --destination="$final_path/local/config/database.inc.php" +ynh_add_config --template="../conf/database.inc.php" --destination="$install_dir/local/config/database.inc.php" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # CONFIGURE LDAP PLUGIN @@ -269,8 +269,8 @@ UPDATE piwigo_ldap_login_config SET value='' WHERE param = 'ld_binddn'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'allow_new_users'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'ld_group_user_active';" # Remove configuration file for older plugin version -if [ -f $final_path/plugins/Ldap_Login/data.dat ] ; then - ynh_secure_remove --file=$final_path/plugins/Ldap_Login/data.dat +if [ -f $install_dir/plugins/Ldap_Login/data.dat ] ; then +#REMOVEME? ynh_secure_remove --file=$install_dir/plugins/Ldap_Login/data.dat fi #================================================= @@ -292,9 +292,9 @@ ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex= #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From a20b411529f3fc3d2b437d301723fb493f51acec Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 5 Oct 2023 19:38:15 +0000 Subject: [PATCH 02/45] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index e79e7f6..73c4c55 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,6 @@ In addition to Piwigo core features, the following are made available with this * Official app website: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index e1d2d70..d5f8c88 100644 --- a/README_fr.md +++ b/README_fr.md @@ -44,7 +44,6 @@ En plus des fonctionnalités de base de Piwigo, les éléments suivants sont mis * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : * Signaler un bug : ## Informations pour les développeurs From 68f1616496d467ba3e9e9f7d6bc1fb2efee04673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 5 Oct 2023 21:48:46 +0200 Subject: [PATCH 03/45] v2 --- manifest.json | 73 ----------------------------- manifest.toml | 24 +++++----- scripts/_common.sh | 5 -- scripts/backup | 20 -------- scripts/change_url | 69 ---------------------------- scripts/install | 107 ++----------------------------------------- scripts/remove | 70 ---------------------------- scripts/restore | 70 +--------------------------- scripts/upgrade | 111 ++------------------------------------------- tests.toml | 7 +++ 10 files changed, 25 insertions(+), 531 deletions(-) delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/manifest.json b/manifest.json deleted file mode 100644 index e55d6bb..0000000 --- a/manifest.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "Piwigo", - "id": "piwigo", - "packaging_format": 1, - "description": { - "en": "Open source photo gallery for the web", - "fr": "Galerie de photos open source pour le web" - }, - "version": "13.8.0~ynh1", - "url": "http://piwigo.org", - "upstream": { - "license": "GPL-2.0", - "website": "http://piwigo.org", - "demo": "https://piwigo.org/demo", - "admindoc": "https://piwigo.org/guides", - "code": "https://github.com/Piwigo/Piwigo" - }, - "license": "GPL-2.0", - "maintainer": { - "name": "JimboJoe", - "email": "jimmy@monin.net", - "url": "" - }, - "requirements": { - "yunohost": ">= 11.2" - }, - "multi_instance": true, - "services": [ - "nginx", - "php8.0-fpm", - "mysql" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/piwigo", - "default": "/piwigo" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - }, - { - "name": "language", - "type": "string", - "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" - }, - "choices": [ - "de", - "en", - "es", - "fr", - "it", - "pt" - ], - "default": "en" - }, - { - "name": "admin", - "type": "user" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index ede33c2..ee6f050 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,26 +15,22 @@ website = "http://piwigo.org" demo = "https://piwigo.org/demo" admindoc = "https://piwigo.org/guides" code = "https://github.com/Piwigo/Piwigo" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] yunohost = ">= 11.2" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +architectures = "all" multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap =false +sso =false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/piwigo" @@ -45,12 +41,11 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [install.language] ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" - type = "string" + type = "select" choices = ["de", "en", "es", "fr", "it", "pt"] default = "en" [install.admin] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "user" [resources] @@ -68,15 +63,18 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen sha256 = "85b9a06f2c7ca8ae9698e6151c7631f519c945f696b02da72f9ff53243d7e4ca" in_subdir = false - [resources.system_user] [resources.install_dir] [resources.data_dir] + subdirs = [ "_data", "upload", "galleries" ] [resources.permissions] main.url = "/" + [resources.apt] + packages = "mariadb-server, imagemagick, php8.0-gd, php8.0-imagick, php8.0-xml, php8.0-mbstring, php8.0-mysqli, php8.0-ldap" + [resources.database] type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 68614d7..ee67723 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,11 +4,6 @@ # COMMON VARIABLES #================================================= -#REMOVEME? YNH_PHP_VERSION="8.0" - -# dependencies used by the app -#REMOVEME? pkg_dependencies="imagemagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysqli php${YNH_PHP_VERSION}-ldap" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 2f19374..61a8a7b 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,26 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index dd81362..16e0f3c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,42 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN -#REMOVEME? old_path=$YNH_APP_OLD_PATH - -#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN -#REMOVEME? new_path=$YNH_APP_NEW_PATH - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? # Needed for helper "ynh_add_nginx_config" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -#REMOVEME? change_domain=0 -#REMOVEME? if [ "$old_domain" != "$new_domain" ] -then - #REMOVEME? change_domain=1 -fi - -#REMOVEME? change_path=0 -#REMOVEME? if [ "$old_path" != "$new_path" ] -then - #REMOVEME? change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -54,39 +18,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#REMOVEME? nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified -#REMOVEME? ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper -#REMOVEME? domain="$old_domain" -#REMOVEME? path="$new_path" - # Create a dedicated NGINX config -#REMOVEME? ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location -#REMOVEME? ynh_delete_file_checksum --file="$nginx_conf_path" -#REMOVEME? mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location -#REMOVEME? ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - -#================================================= -# GENERIC FINALISATION -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? #REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 83bd9ca..628d36a 100644 --- a/scripts/install +++ b/scripts/install @@ -9,88 +9,28 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -#REMOVEME? language=$YNH_APP_ARG_LANGUAGE -#REMOVEME? admin=$YNH_APP_ARG_ADMIN -#REMOVEME? phpversion=$YNH_PHP_VERSION - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - fpm_footprint="low" fpm_free_footprint=0 fpm_usage="low" -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path -ynh_app_setting_set --app=$app --key=language --value=$language -#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=40 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." - -#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? db_user=$db_name -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=5 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir - # Create tmp directory and fetch app inside tmpdir="$(ynh_smart_mktemp --min_size=300)" ynh_setup_source --dest_dir="$tmpdir" @@ -118,12 +58,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config @@ -135,13 +69,6 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Creating a data directory..." -#REMOVEME? data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir - -mkdir -p $data_dir/_data -mkdir -p $data_dir/upload -mkdir -p $data_dir/galleries - ln -sd $data_dir/_data $install_dir/_data ln -sd $data_dir/upload $install_dir/upload ln -sd $data_dir/galleries $install_dir/galleries @@ -161,17 +88,12 @@ chown -R $app:www-data "$data_dir" #================================================= ynh_script_progression --message="Setuping application with CURL..." --weight=5 -# Set the app as temporarily public for curl call -ynh_script_progression --message="Configuring SSOwat..." -# Making the app public for curl -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" - # Reload NGINX -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name=nginx --action=reload # Generate random password for admin adm_pwd=$(ynh_string_random --length=24) -#REMOVEME? ynh_app_setting_set --app=$app --key=admin_pwd --value="$adm_pwd" +ynh_app_setting_set --app=$app --key=admin_pwd --value="$adm_pwd" if [ "$language" = "fr" ]; then applanguage="fr_FR" @@ -226,9 +148,6 @@ UPDATE piwigo_ldap_login_config SET value='' WHERE param = 'ld_binddn'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'allow_new_users'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'ld_group_user_active';" -# Remove the public access -#REMOVEME? ynh_permission_update --permission="main" --remove="visitors" - #================================================= # GENERIC FINALIZATION #================================================= @@ -245,26 +164,6 @@ chown $app: "/var/log/${app}FailedLogins.log" ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex="ip=" --max_retry=6 -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 6a1c448..34e31fb 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,48 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." - -# Remove a database if it exists, along with the associated user -#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." --weight=1 -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -59,40 +17,12 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - -#================================================= -# REMOVE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8 - # Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index cc72899..1243f54 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,49 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=2 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) -#REMOVEME? phpversion=$YNH_PHP_VERSION - -#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -60,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -71,10 +27,6 @@ ynh_script_progression --message="Restoring the data directory..." --weight=2 ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" chown -R $app:www-data "$data_dir" #================================================= @@ -89,16 +41,6 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=40 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -106,23 +48,13 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=2 - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=2 +ynh_script_progression --message="Restoring the MySQL database..." --weight=2 -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5d8d243..b67ecd8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,49 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? language=$(ynh_app_setting_get --app=$app --key=language) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? admin_pwd=$(ynh_app_setting_get --app=$app --key=admin_pwd) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) -#REMOVEME? phpversion=$YNH_PHP_VERSION - -#REMOVEME? fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -#REMOVEME? fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -#REMOVEME? fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - #================================================= # CHECK VERSION #================================================= upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=6 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -77,29 +40,6 @@ if [ -z "$fpm_usage" ]; then ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all -fi - -# If data_dir doesn't exist, create it -if [ -z "$data_dir" ]; then - data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir -fi - -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -fi - -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - # Compatibility with previous version; password was not set if [ -z "$admin_pwd" ] ; then # Generate a new password @@ -109,31 +49,6 @@ if [ -z "$admin_pwd" ] ; then cp ../conf/hash_password.php $install_dir hashed_password=$(cd $install_dir ; php hash_password.php $admin_pwd) - # Update password hash in database -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) - ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "UPDATE users SET password='$hashed_password' WHERE username='$admin';" -#REMOVEME? ynh_app_setting_set --app=$app --key=admin_pwd --value="$admin_pwd" - - # Remove the temporary hash generation script -#REMOVEME? ynh_secure_remove --file="$install_dir/hash_password.php" -fi - -# Use path instead of path in settings.yml... -if [ -z "$path" ] -then -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path - ynh_app_setting_delete --app=$app --key=path -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -184,26 +99,13 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=6 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint # Create a dedicated NGINX config ynh_add_nginx_config @@ -216,7 +118,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6 # Reload NGINX -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name=nginx --action=reload if [ "$language" = "fr" ] ; then applanguage="fr_FR" @@ -270,7 +172,7 @@ UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'allow_new_users'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'ld_group_user_active';" # Remove configuration file for older plugin version if [ -f $install_dir/plugins/Ldap_Login/data.dat ] ; then -#REMOVEME? ynh_secure_remove --file=$install_dir/plugins/Ldap_Login/data.dat + ynh_secure_remove --file=$install_dir/plugins/Ldap_Login/data.dat fi #================================================= @@ -289,13 +191,6 @@ chown $app: "/var/log/${app}FailedLogins.log" ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex="ip=" --max_retry=6 -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..91daf17 --- /dev/null +++ b/tests.toml @@ -0,0 +1,7 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ \ No newline at end of file From 79043f5addcfcfe373e534f2c65cc21dc57f56b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:19:05 +0100 Subject: [PATCH 04/45] Update install --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index 628d36a..b2e046b 100644 --- a/scripts/install +++ b/scripts/install @@ -44,7 +44,6 @@ ynh_setup_source --dest_dir="$tmpdir/plugins" --source_id=log_failed_logins_plug shopt -s extglob # Install files and set permissions -mkdir $install_dir cp -a $tmpdir/!(upload|_data|galleries) $install_dir chmod 750 "$install_dir" From 19cd02a5f0a8b08a6640d03b3a8a60db0625eb61 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 2 Nov 2023 18:19:14 +0000 Subject: [PATCH 05/45] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 73c4c55..3f04099 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ In addition to Piwigo core features, the following are made available with this * Official app website: * Official admin documentation: * Upstream app code repository: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index d5f8c88..7101adf 100644 --- a/README_fr.md +++ b/README_fr.md @@ -44,6 +44,7 @@ En plus des fonctionnalités de base de Piwigo, les éléments suivants sont mis * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From dbfb9654e10a86b3ee468040eb0a9f151b07cfa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:25:27 +0100 Subject: [PATCH 06/45] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index b2e046b..ae2fe2b 100644 --- a/scripts/install +++ b/scripts/install @@ -72,9 +72,9 @@ ln -sd $data_dir/_data $install_dir/_data ln -sd $data_dir/upload $install_dir/upload ln -sd $data_dir/galleries $install_dir/galleries -cp -Rp $tmpdir/_data/. $install_dir/_data -cp -Rp $tmpdir/upload/. $install_dir/upload -cp -Rp $tmpdir/galleries/. $install_dir/galleries +cp -Rp $tmpdir/*/_data/. $install_dir/_data +cp -Rp $tmpdir/*/upload/. $install_dir/upload +cp -Rp $tmpdir/*/galleries/. $install_dir/galleries ynh_secure_remove --file="$tmpdir" From 7c41c6b6c11486c9faf3c282716f130b74143f69 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 22:33:52 +0100 Subject: [PATCH 07/45] Simplify php conf stuff --- scripts/install | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/scripts/install b/scripts/install index ae2fe2b..790cf50 100644 --- a/scripts/install +++ b/scripts/install @@ -9,23 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -fpm_footprint="low" -fpm_free_footprint=0 -fpm_usage="low" - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -ynh_script_progression --message="Storing installation settings..." - -ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint -ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint -ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -56,7 +39,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_add_fpm_config --usage=low --footprint=low # Create a dedicated NGINX config ynh_add_nginx_config From d81a1af619cc97ff6ac5a9e36e30f324b1c050df Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 22:43:13 +0100 Subject: [PATCH 08/45] Simplify the admin password mess, it looks like at no point it is explained that the password is autogenerated and should be found in the app setting, and anyway there's no reason to not ask for the admin to chose one during the app install ... --- conf/hash_password.php | 9 --------- manifest.toml | 3 +++ scripts/install | 7 ++----- scripts/upgrade | 41 +++++------------------------------------ 4 files changed, 10 insertions(+), 50 deletions(-) delete mode 100644 conf/hash_password.php diff --git a/conf/hash_password.php b/conf/hash_password.php deleted file mode 100644 index 5f47f69..0000000 --- a/conf/hash_password.php +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/manifest.toml b/manifest.toml index ee6f050..e3b3252 100644 --- a/manifest.toml +++ b/manifest.toml @@ -48,6 +48,9 @@ ram.runtime = "50M" [install.admin] type = "user" + [install.password] + type = "password" + [resources] [resources.sources] [resources.sources.ldap_plugin] diff --git a/scripts/install b/scripts/install index 790cf50..167b831 100644 --- a/scripts/install +++ b/scripts/install @@ -74,9 +74,6 @@ ynh_script_progression --message="Setuping application with CURL..." --weight=5 ynh_systemd_action --service_name=nginx --action=reload # Generate random password for admin -adm_pwd=$(ynh_string_random --length=24) -ynh_app_setting_set --app=$app --key=admin_pwd --value="$adm_pwd" - if [ "$language" = "fr" ]; then applanguage="fr_FR" else @@ -87,7 +84,7 @@ fi mail="$(ynh_user_get_info --username=$admin --key=mail)" # Installation with cURL -ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbhost=127.0.0.1" "dbuser=$db_user" "dbpasswd=$db_pwd" "dbname=$db_name" "prefix=" "admin_name=$admin" "admin_pass1=$adm_pwd" "admin_pass2=$adm_pwd" "admin_mail=$mail" +ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbhost=127.0.0.1" "dbuser=$db_user" "dbpasswd=$db_pwd" "dbname=$db_name" "prefix=" "admin_name=$admin" "admin_pass1=$password" "admin_pass2=$password" "admin_mail=$mail" #================================================= # CONFIGURE PIWIGO @@ -112,7 +109,7 @@ ynh_script_progression --message="Configuring LDAP plugin..." # Activate the LDAP plugin using the WS API # Login with admin account -ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$adm_pwd" +ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$password" # Get session token status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus") pwg_token=$(jq --raw-output .result.pwg_token <<< $status) diff --git a/scripts/upgrade b/scripts/upgrade index b67ecd8..d009963 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,40 +15,6 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." - -# If fpm_footprint doesn't exist, create it -if [ -z "$fpm_footprint" ]; then - fpm_footprint=low - ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint -fi - -# If fpm_free_footprint doesn't exist, create it -if [ -z "$fpm_free_footprint" ]; then - fpm_free_footprint=0 - ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint -fi - -# If fpm_usage doesn't exist, create it -if [ -z "$fpm_usage" ]; then - fpm_usage=low - ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -fi - -# Compatibility with previous version; password was not set -if [ -z "$admin_pwd" ] ; then - # Generate a new password - admin_pwd=$(ynh_string_random --length=24) - - # Compute password hash with the Piwigo function - cp ../conf/hash_password.php $install_dir - hashed_password=$(cd $install_dir ; php hash_password.php $admin_pwd) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -127,7 +93,8 @@ else fi # Upgrade Piwigo via cURL -ynh_local_curl "/upgrade.php?language=$applanguage&now=true" "language=$applanguage" "username=$admin" "password=$admin_pwd" +# FIXME : Why Curl ... Why can't we trigger the migration from the command line somehow ... +#ynh_local_curl "/upgrade.php?language=$applanguage&now=true" "language=$applanguage" "username=$admin" "password=$admin_pwd" #================================================= # CONFIGURE PIWIGO @@ -155,7 +122,9 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< # Activate the LDAP plugin using the WS API # Login with admin account -ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$admin_pwd" + +# FIXME: Is this stuff really needed ... isn't there a way to enable the damn LDAP login plugin from the command line or something ... +#ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$admin_pwd" # Get session token status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus") pwg_token=$(jq --raw-output .result.pwg_token <<< $status) From e664bf07c67d2a438bd42a19e09ee9cca2020a55 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 23:12:12 +0100 Subject: [PATCH 09/45] Revert "Update install" This reverts commit dbfb9654e10a86b3ee468040eb0a9f151b07cfa1. --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 167b831..e1b7960 100644 --- a/scripts/install +++ b/scripts/install @@ -55,9 +55,9 @@ ln -sd $data_dir/_data $install_dir/_data ln -sd $data_dir/upload $install_dir/upload ln -sd $data_dir/galleries $install_dir/galleries -cp -Rp $tmpdir/*/_data/. $install_dir/_data -cp -Rp $tmpdir/*/upload/. $install_dir/upload -cp -Rp $tmpdir/*/galleries/. $install_dir/galleries +cp -Rp $tmpdir/_data/. $install_dir/_data +cp -Rp $tmpdir/upload/. $install_dir/upload +cp -Rp $tmpdir/galleries/. $install_dir/galleries ynh_secure_remove --file="$tmpdir" From 72bff8e857a15c31b5413be26525cc4b7b8c38b4 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 23:34:54 +0100 Subject: [PATCH 10/45] Hmpf, archive format can't be inferred from download URL >_> --- manifest.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifest.toml b/manifest.toml index e3b3252..ab9c972 100644 --- a/manifest.toml +++ b/manifest.toml @@ -56,15 +56,18 @@ ram.runtime = "50M" [resources.sources.ldap_plugin] url = "https://piwigo.org/ext/download.php?rid=7036" sha256 = "3c22652f6c0653aaeebe239435796748ee57612ad44e8e5f2553277545d36e5e" + format = "zip" [resources.sources.main] url = "https://piwigo.org/download/dlcounter.php?code=13.8.0" sha256 = "7f6a2a796693a4ce245fd67ebdd8bf873dc6cb1a33acd567104a10347af7fe1d" + format = "zip" [resources.sources.log_failed_logins_plugin] url = "http://piwigo.org/ext/download.php?rid=5525" sha256 = "85b9a06f2c7ca8ae9698e6151c7631f519c945f696b02da72f9ff53243d7e4ca" in_subdir = false + format = "zip" [resources.system_user] From c14f61a83dd15e548a3e2163f59712bedc43c03c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 4 Dec 2023 23:59:22 +0100 Subject: [PATCH 11/45] Yet another broken php config panel --- config_panel.toml | 30 --------------- scripts/config | 95 ----------------------------------------------- 2 files changed, 125 deletions(-) delete mode 100644 config_panel.toml delete mode 100644 scripts/config diff --git a/config_panel.toml b/config_panel.toml deleted file mode 100644 index 1e7e87c..0000000 --- a/config_panel.toml +++ /dev/null @@ -1,30 +0,0 @@ -version = "1.0" - -[main] -name = "Piwigo configuration" - - [main.php_fpm_config] - name = "PHP-FPM configuration" - - [main.php_fpm_config.fpm_footprint] - ask = "Memory footprint" - type = "select" - choices.low = "Low, <= 20Mb per pool" - choices.medium = "Medium, between 20Mb and 40Mb per pool" - choices.high = "High, > 40Mb per pool" - choices.specific = "Use specific value" - default = "low" - - [main.php_fpm_config.fpm_free_footprint] - visible = "fpm_footprint == 'specific'" - ask = "Memory footprint of the service?" - type = "number" - default = "0" - help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values." - - [main.php_fpm_config.fpm_usage] - ask = "Expected usage" - type = "select" - choices = ["low", "medium", "high"] - default = "low" - help = "low: Personal usage, behind the SSO. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.
medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.
high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding." diff --git a/scripts/config b/scripts/config deleted file mode 100644 index 91c2de7..0000000 --- a/scripts/config +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source _common.sh -source /usr/share/yunohost/helpers - -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) - -#================================================= -# SPECIFIC GETTERS FOR TOML SHORT KEY -#================================================= - -get__fpm_footprint() { - # Free footprint value for php-fpm - # Check if current_fpm_footprint is an integer - if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null - then - echo "specific" - else - echo "$current_fpm_footprint" - fi -} - -get__free_footprint() { - # Free footprint value for php-fpm - # Check if current_fpm_footprint is an integer - if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null - then - # If current_fpm_footprint is an integer, that's a numeric value for the footprint - echo "$current_fpm_footprint" - else - echo "0" - fi -} - -#================================================= -# SPECIFIC SETTERS FOR TOML SHORT KEYS -#================================================= - -set__fpm_footprint() { - if [ "$fpm_footprint" != "specific" ] - then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint" - fi -} - -set__fpm_free_footprint() { - if [ "$fpm_footprint" = "specific" ] - then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint" - fi -} - -#================================================= -# GENERIC FINALIZATION -#================================================= - -ynh_app_config_validate() { - _ynh_app_config_validate - - if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then - # If fpm_footprint is set to 'specific', use $fpm_free_footprint value. - if [ "$fpm_footprint" = "specific" ] - then - fpm_footprint=$fpm_free_footprint - fi - - if [ "$fpm_footprint" == "0" ] - then - ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." - - exit 0 - fi - fi -} - -ynh_app_config_apply() { - _ynh_app_config_apply - - ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -} - -ynh_app_config_run $1 From b8bb869935ffc63f27c46a0f4c09ba23ed27d739 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 5 Dec 2023 01:34:25 +0100 Subject: [PATCH 12/45] Boring fpm options --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index e1b7960..cc75e9d 100644 --- a/scripts/install +++ b/scripts/install @@ -39,7 +39,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config diff --git a/scripts/upgrade b/scripts/upgrade index d009963..451c358 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,7 +71,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config From a7b2d5fa83b6a2aa7c53df5fc766175aff8af71c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 5 Dec 2023 02:15:25 +0100 Subject: [PATCH 13/45] Cleanup disclaimer --- doc/DISCLAIMER.md | 9 --------- doc/DISCLAIMER_fr.md | 9 --------- manifest.toml | 4 ++-- scripts/install | 3 --- 4 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 doc/DISCLAIMER.md delete mode 100644 doc/DISCLAIMER_fr.md diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index 13b8600..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,9 +0,0 @@ -## YunoHost specific features - -In addition to Piwigo core features, the following are made available with this package: - * Integrate with YunoHost users and SSO: - * private mode: limit access to YunoHost users - * public mode: - * SSO for YunoHost users - * allow other users management, and guest mode - * Allow one YunoHost user to be the administrator (set at the installation) diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md deleted file mode 100644 index 3d44fa1..0000000 --- a/doc/DISCLAIMER_fr.md +++ /dev/null @@ -1,9 +0,0 @@ -## Caractéristiques spécifiques de YunoHost - -En plus des fonctionnalités de base de Piwigo, les éléments suivants sont mis à disposition avec ce paquet : - * Intégration avec les utilisateurs de YunoHost et le SSO : - * mode privé : limiter l'accès aux utilisateurs de YunoHost. - * mode public : - * SSO pour les utilisateurs de YunoHost - * autoriser la gestion d'autres utilisateurs, et mode invité - * Permet à un utilisateur de YunoHost d'être l'administrateur (défini à l'installation). diff --git a/manifest.toml b/manifest.toml index ab9c972..0326135 100644 --- a/manifest.toml +++ b/manifest.toml @@ -20,8 +20,8 @@ code = "https://github.com/Piwigo/Piwigo" yunohost = ">= 11.2" architectures = "all" multi_instance = true -ldap =false -sso =false +ldap = true +sso = true disk = "50M" ram.build = "50M" ram.runtime = "50M" diff --git a/scripts/install b/scripts/install index cc75e9d..b3d1723 100644 --- a/scripts/install +++ b/scripts/install @@ -70,9 +70,6 @@ chown -R $app:www-data "$data_dir" #================================================= ynh_script_progression --message="Setuping application with CURL..." --weight=5 -# Reload NGINX -ynh_systemd_action --service_name=nginx --action=reload - # Generate random password for admin if [ "$language" = "fr" ]; then applanguage="fr_FR" From 67d9bf85d91fe6cc25dd87946c63b5fec711d802 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 5 Dec 2023 01:32:51 +0000 Subject: [PATCH 14/45] Auto-update README --- README.md | 12 ------------ README_fr.md | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/README.md b/README.md index 3f04099..7625e4d 100644 --- a/README.md +++ b/README.md @@ -27,18 +27,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ![Screenshot of Piwigo](./doc/screenshots/screenshot_Piwigo.jpg) -## Disclaimers / important information - -## YunoHost specific features - -In addition to Piwigo core features, the following are made available with this package: - * Integrate with YunoHost users and SSO: - * private mode: limit access to YunoHost users - * public mode: - * SSO for YunoHost users - * allow other users management, and guest mode - * Allow one YunoHost user to be the administrator (set at the installation) - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 7101adf..ffdb58b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,18 +27,6 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ![Capture d’écran de Piwigo](./doc/screenshots/screenshot_Piwigo.jpg) -## Avertissements / informations importantes - -## Caractéristiques spécifiques de YunoHost - -En plus des fonctionnalités de base de Piwigo, les éléments suivants sont mis à disposition avec ce paquet : - * Intégration avec les utilisateurs de YunoHost et le SSO : - * mode privé : limiter l'accès aux utilisateurs de YunoHost. - * mode public : - * SSO pour les utilisateurs de YunoHost - * autoriser la gestion d'autres utilisateurs, et mode invité - * Permet à un utilisateur de YunoHost d'être l'administrateur (défini à l'installation). - ## Documentations et ressources * Site officiel de l’app : From e3e38e8cfb703dab7eb34c2903c23c45b274c82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 5 Dec 2023 09:33:36 +0100 Subject: [PATCH 15/45] cleaning --- doc/DESCRIPTION.md | 2 +- doc/DESCRIPTION_fr.md | 2 +- manifest.toml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 35de39e..1ae5a0a 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1 @@ -[Piwigo](http://piwigo.org) is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. +Piwigo is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index b315c8e..f5e08e1 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1 @@ -[Piwigo](http://piwigo.org) est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. +Piwigo est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. diff --git a/manifest.toml b/manifest.toml index 0326135..4b60679 100644 --- a/manifest.toml +++ b/manifest.toml @@ -20,8 +20,11 @@ code = "https://github.com/Piwigo/Piwigo" yunohost = ">= 11.2" architectures = "all" multi_instance = true + ldap = true + sso = true + disk = "50M" ram.build = "50M" ram.runtime = "50M" From e36ed542381d6cd06de741a1a683453e550325a5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 5 Dec 2023 08:33:42 +0000 Subject: [PATCH 16/45] 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 7625e4d..9dc44b3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -[Piwigo](http://piwigo.org) is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. +Piwigo is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. **Shipped version:** 13.8.0~ynh1 diff --git a/README_fr.md b/README_fr.md index ffdb58b..de17dd4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,7 +16,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -[Piwigo](http://piwigo.org) est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. +Piwigo est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. **Version incluse :** 13.8.0~ynh1 From 6314d5b87844ddd866c969f4aabf415c311409ff Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 27 Dec 2023 09:48:10 +0000 Subject: [PATCH 17/45] 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 4b73bf1..9dc44b3 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Piwigo is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. -**Shipped version:** 14.0.0~ynh1 +**Shipped version:** 13.8.0~ynh1 **Demo:** https://piwigo.org/demo diff --git a/README_fr.md b/README_fr.md index 6cdaa79..de17dd4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Piwigo est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. -**Version incluse :** 14.0.0~ynh1 +**Version incluse :** 13.8.0~ynh1 **Démo :** https://piwigo.org/demo From 876cbed4fa7b5a6f6b3bed7fb09ff8f6784bbeac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 27 Dec 2023 11:52:03 +0100 Subject: [PATCH 18/45] Update tests.toml --- tests.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index 91daf17..24c7df3 100644 --- a/tests.toml +++ b/tests.toml @@ -4,4 +4,7 @@ test_format = 1.0 # ------------ # Tests to run - # ------------ \ No newline at end of file + # ------------ + + test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.name = "Upgrade from 13.1.0" + \ No newline at end of file From c071139a87e7120005c73476039c3e4ac62b5ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:48:16 +0100 Subject: [PATCH 19/45] cleaning --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index b3d1723..bc59eb9 100644 --- a/scripts/install +++ b/scripts/install @@ -89,10 +89,10 @@ ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbhost=127.0 ynh_script_progression --message="Configuring Piwigo..." # Change local config -ynh_add_config --template="../conf/config.inc.php" --destination="$install_dir/local/config/config.inc.php" +ynh_add_config --template="config.inc.php" --destination="$install_dir/local/config/config.inc.php" # Setup database in local/config/database.inc.php -ynh_add_config --template="../conf/database.inc.php" --destination="$install_dir/local/config/database.inc.php" +ynh_add_config --template="database.inc.php" --destination="$install_dir/local/config/database.inc.php" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 451c358..572a26f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -102,10 +102,10 @@ fi ynh_script_progression --message="Configuring Piwigo..." # Change local config -ynh_add_config --template="../conf/config.inc.php" --destination="$install_dir/local/config/config.inc.php" +ynh_add_config --template="config.inc.php" --destination="$install_dir/local/config/config.inc.php" # Setup database in local/config/database.inc.php -ynh_add_config --template="../conf/database.inc.php" --destination="$install_dir/local/config/database.inc.php" +ynh_add_config --template="database.inc.php" --destination="$install_dir/local/config/database.inc.php" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" From 5e959596263e79fad25926fa3273a2ed9a18654d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:50:11 +0100 Subject: [PATCH 20/45] Update install --- scripts/install | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index bc59eb9..2f242f3 100644 --- a/scripts/install +++ b/scripts/install @@ -36,12 +36,10 @@ chown -R $app:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -# Create a dedicated PHP-FPM config ynh_add_fpm_config -# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -86,7 +84,7 @@ ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbhost=127.0 #================================================= # CONFIGURE PIWIGO #================================================= -ynh_script_progression --message="Configuring Piwigo..." +ynh_script_progression --message="Configuring $app..." --weight=2 # Change local config ynh_add_config --template="config.inc.php" --destination="$install_dir/local/config/config.inc.php" @@ -101,7 +99,7 @@ chown -R $app:www-data "$install_dir" #================================================= # ADD LDAP PLUGIN #================================================= -ynh_script_progression --message="Configuring LDAP plugin..." +ynh_script_progression --message="Configuring LDAP plugin..." --weight=2 # Activate the LDAP plugin using the WS API From fd06af237f701a09d67d048f505f5c3d770f994b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:51:24 +0100 Subject: [PATCH 21/45] cleaning --- scripts/restore | 31 +++++++++++++------------------ scripts/upgrade | 4 +--- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/scripts/restore b/scripts/restore index 1243f54..26017de 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,9 +30,20 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory chown -R $app:www-data "$data_dir" #================================================= -# RESTORE FAIL2BAN CONFIGURATION +# RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=7 +ynh_script_progression --message="Restoring the MySQL database..." --weight=2 + +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql + +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" touch "/var/log/${app}FailedLogins.log" chown $app: "/var/log/${app}FailedLogins.log" @@ -41,22 +52,6 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=10 - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=2 - -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 572a26f..33faca2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,12 +68,10 @@ chown -R $app:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 -# Create a dedicated PHP-FPM config ynh_add_fpm_config -# Create a dedicated NGINX config ynh_add_nginx_config #================================================= From c48bf894d14526a44bab2e5587f32a8407e5f2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:52:03 +0100 Subject: [PATCH 22/45] Update upgrade --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 33faca2..5c235a2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,7 +97,7 @@ fi #================================================= # CONFIGURE PIWIGO #================================================= -ynh_script_progression --message="Configuring Piwigo..." +ynh_script_progression --message="Configuring $app..." --weight=2 # Change local config ynh_add_config --template="config.inc.php" --destination="$install_dir/local/config/config.inc.php" @@ -112,7 +112,7 @@ chown -R $app:www-data "$install_dir" #================================================= # CONFIGURE LDAP PLUGIN #================================================= -ynh_script_progression --message="Configuring LDAP plugin..." +ynh_script_progression --message="Configuring LDAP plugin..." --weight=2 # Disable LDAP plugin to avoid warning messages during API call ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "DELETE FROM plugins WHERE id='Ldap_Login';" From 90cb3d74a04f89d8aa3a88aeddb7509d2a41ac77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:53:18 +0100 Subject: [PATCH 23/45] cleaning --- scripts/remove | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/remove b/scripts/remove index 34e31fb..b91f0fa 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,15 +12,12 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2 +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# Remove the dedicated NGINX config ynh_remove_nginx_config -# Remove the dedicated PHP-FPM config ynh_remove_fpm_config -# Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config #================================================= From 21209da7224dbaf31e95b6a639742873205d09cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:02:37 +0100 Subject: [PATCH 24/45] cleaning --- check_process | 27 --------------------------- scripts/install | 2 +- 2 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 check_process diff --git a/check_process b/check_process deleted file mode 100644 index 68cf7a8..0000000 --- a/check_process +++ /dev/null @@ -1,27 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/path" - is_public=1 - language="fr" - admin="john" - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - # 12.0.0~ynh1 - upgrade=1 from_commit=bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925 - # 12.1.0~ynh1 - upgrade=1 from_commit=cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91 - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options diff --git a/scripts/install b/scripts/install index 2f242f3..06bc042 100644 --- a/scripts/install +++ b/scripts/install @@ -47,7 +47,7 @@ ynh_add_nginx_config #================================================= # CREATE DATA DIRECTORY #================================================= -ynh_script_progression --message="Creating a data directory..." +ynh_script_progression --message="Creating a data directory..." --weight=1 ln -sd $data_dir/_data $install_dir/_data ln -sd $data_dir/upload $install_dir/upload From 7aad2fe4f4c915777f7289030704061cea5f585e Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:03:32 +0100 Subject: [PATCH 25/45] 14.0.0 (#112) * add mail * cleaning * Update manifest.toml * Auto-update README * cleaning * Update tests.toml * Update tests.toml * Auto-update README * Update config.inc.php * Update manifest.toml --------- Co-authored-by: yunohost-bot --- README.md | 2 +- README_fr.md | 2 +- manifest.toml | 6 +++--- tests.toml | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9dc44b3..4b73bf1 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Piwigo is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. -**Shipped version:** 13.8.0~ynh1 +**Shipped version:** 14.0.0~ynh1 **Demo:** https://piwigo.org/demo diff --git a/README_fr.md b/README_fr.md index de17dd4..6cdaa79 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Piwigo est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. -**Version incluse :** 13.8.0~ynh1 +**Version incluse :** 14.0.0~ynh1 **Démo :** https://piwigo.org/demo diff --git a/manifest.toml b/manifest.toml index 4b60679..ad2908c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Piwigo" description.en = "Open source photo gallery for the web" description.fr = "Galerie de photos open source pour le web" -version = "13.8.0~ynh1" +version = "14.0.0~ynh1" maintainers = ["JimboJoe"] @@ -62,8 +62,8 @@ ram.runtime = "50M" format = "zip" [resources.sources.main] - url = "https://piwigo.org/download/dlcounter.php?code=13.8.0" - sha256 = "7f6a2a796693a4ce245fd67ebdd8bf873dc6cb1a33acd567104a10347af7fe1d" + url = "https://piwigo.org/download/dlcounter.php?code=14.0.0" + sha256 = "42ad8f998177c2c9528fc9b547c2ee5637abe2dc398dcd5c2e4880fa66a8cf2f" format = "zip" [resources.sources.log_failed_logins_plugin] diff --git a/tests.toml b/tests.toml index 24c7df3..ef2f52a 100644 --- a/tests.toml +++ b/tests.toml @@ -2,9 +2,9 @@ test_format = 1.0 [default] - # ------------ - # Tests to run - # ------------ + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.name = "Upgrade from 13.1.0" \ No newline at end of file From d0e3f0a921ac748c0edf93fa2334618d358ba2d9 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 28 Dec 2023 19:58:01 +0100 Subject: [PATCH 26/45] Config file (#116) * add mail * cleaning * Update manifest.toml * Auto-update README * cleaning * Update tests.toml * Update tests.toml * Auto-update README * Update config.inc.php --------- Co-authored-by: yunohost-bot --- conf/config.inc.php | 992 +++++++++++++++++++++++++++++++++++++++++++- manifest.toml | 1 + 2 files changed, 989 insertions(+), 4 deletions(-) diff --git a/conf/config.inc.php b/conf/config.inc.php index ceee03a..d4dedda 100644 --- a/conf/config.inc.php +++ b/conf/config.inc.php @@ -1,13 +1,997 @@ 'PWG website', +// 'http://piwigo.org/forum' => 'PWG forum', +// ); +// +// Advanced use: +// You can also used special options. Instead to pass a string like parameter value +// you can pass a array with different optional parameter values +// $conf['links'] = array( +// 'http://piwigo.org' => array('label' => 'PWG website', 'new_window' => false, 'eval_visible' => 'return true;'), +// 'http://piwigo.org/forum' => array('label' => 'For ADMIN', 'new_window' => true, 'eval_visible' => 'return is_admin();'), +// 'http://piwigo.org/ext' => array('label' => 'For Guest', 'new_window' => true, 'eval_visible' => 'return is_a_guest();'), +// 'http://piwigo.org/downloads' => +// array('label' => 'PopUp', 'new_window' => true, +// 'nw_name' => 'PopUp', 'nw_features' => 'width=800,height=450,location=no,status=no,toolbar=no,scrollbars=no,menubar=no'), +// ); +// Parameters: +// 'label': +// Label to display for the link, must be defined +// 'new_window': +// If true open link on tab/window +// [Default value is true if it's not defined] +// 'nw_name': +// Name use when new_window is true +// [Default value is '' if it's not defined] +// 'nw_features': +// features use when new_window is true +// [Default value is '' if it's not defined] +// 'eval_visible': +// It's php code witch must return if the link is visible or not +// [Default value is true if it's not defined] +// +// Equivalence: +// $conf['links'] = array( +// 'http://piwigo.org' => 'PWG website', +// ); +// $conf['links'] = array( +// 'http://piwigo.org' => array('label' => 'PWG website', 'new_window' => false, 'visible' => 'return true;'), +// ); +// +// If the array is empty, the "Links" box won't be displayed on the main +// page. +$conf['links'] = array(); + +// random_index_redirect: list of 'internal' links to use when no section is defined on index.php. +// An example is the best than a long explanation : +// +// for each link is associated a php condition +// '' condition is equivalent to 'return true;' +// $conf['random_index_redirect'] = array( +// PHPWG_ROOT_PATH.'index.php?/best_rated' => 'return true;', +// PHPWG_ROOT_PATH.'index.php?/recent_pics' => 'return is_a_guest();', +// PHPWG_ROOT_PATH.'random.php' => '', +// PHPWG_ROOT_PATH.'index.php?/categories' => '', +// ); +$conf['random_index_redirect'] = array(); + +// List of notes to display on all header page +// example $conf['header_notes'] = array('Test', 'Hello'); +$conf['header_notes'] = array(); + +// show_thumbnail_caption : on thumbnails page, show thumbnail captions ? +$conf['show_thumbnail_caption'] = true; + +// allow_random_representative : do you wish Piwigo to search among +// categories elements a new representative at each reload ? +// +// If false, an element is randomly or manually chosen to represent its +// category and remains the representative as long as an admin does not +// change it. +// +// Warning : setting this parameter to true is CPU consuming. Each time you +// change the value of this parameter from false to true, an administrator +// must update categories informations in screen [Admin > General > +// Maintenance]. +$conf['allow_random_representative'] = false; + +// representative_cache_on_level: if a thumbnail is chosen as representative +// but has higher privacy level than current user, Piwigo randomly selects +// another thumbnail. Should be store this thumbnail in cache to avoid +// another consuming SQL query on next page refresh? +$conf['representative_cache_on_level'] = true; + +// representative_cache_on_subcats: if a category (= album) only contains +// sub-categories, Piwigo randomly selects a thumbnail among sub-categories +// representative. Should we store this thumbnail in cache to avoid another +// "slightly" consuming SQL query on next page refresh? +$conf['representative_cache_on_subcats'] = true; + +// allow_html_descriptions : authorize administrators to use HTML in +// category and element description. +$conf['allow_html_descriptions'] = true; + +// image level permissions available in the admin interface +$conf['available_permission_levels'] = array(0,1,2,4,8); + +// check_upgrade_feed: check if there are database upgrade required. Set to +// true, a message will strongly encourage you to upgrade your database if +// needed. +// +// This configuration parameter is set to true in BSF branch and to false +// elsewhere. +$conf['check_upgrade_feed'] = false; + +// rate_items: available rates for a picture +$conf['rate_items'] = array(0,1,2,3,4,5); + +// Define default method to use ('http' or 'html' in order to do redirect) +$conf['default_redirect_method'] = 'http'; + +// Define using double password type in admin's users management panel +$conf['double_password_type_in_admin'] = false; + +// Define if logins must be case sensitive or not of user's registration. ie : +// If set true, the login "user" will equal "User" or "USER" or "user", +// etc. ... And it will be impossible to use such login variation to create a +// new user account. +$conf['insensitive_case_logon'] = false; + +// how should we check for unicity when adding a photo. Can be 'md5sum' or +// 'filename' +$conf['uniqueness_mode'] = 'md5sum'; + +// Library used for image resizing. Value could be 'auto', 'imagick', +// 'ext_imagick' or 'gd'. If value is 'auto', library will be chosen in this +// order. If chosen library is not available, another one will be picked up. +$conf['graphics_library'] = 'auto'; + +// If library used is external installation of ImageMagick ('ext_imagick'), +// you can define imagemagick directory. +$conf['ext_imagick_dir'] = ''; + +// how many user comments to display by default on comments.php. Use 'all' +// to display all user comments without pagination. Default available values +// are array(5,10,20,50,'all') but you can set any other numeric value. +$conf['comments_page_nb_comments'] = 10; // how often should we check for new versions of Piwigo on piwigo.org? In // seconds. The check is made only if there are visits on Piwigo. // 0 to disable. $conf['update_notify_check_period'] = 0; + +// how often should be remind of new versions available? For example a first +// notification was sent on May 5th 2017 for 2.9.1, after how many seconds +// we send it again? 0 to disable. +$conf['update_notify_reminder_period'] = 7*24*60*60; + +// should the album description be displayed on all pages (value=true) or +// only the first page (value=false) +$conf['album_description_on_all_pages'] = false; + +// Number of years displayed in the history compare mode (for the years chart) +$conf['stat_compare_year_displayed'] = 5; + +// Limit for linked albums search +$conf['linked_album_search_limit'] = 100; + +// how often should we check for missing photos in the filesystem. Only in the +// administration. Consider the fs_quick_check is always performed on +// dashboard and maintenance pages. This setting is only for any other +// administration page. +// 0 to disable. +$conf['fs_quick_check_period'] = 24*60*60; + +// +-----------------------------------------------------------------------+ +// | email | +// +-----------------------------------------------------------------------+ + +// send_bcc_mail_webmaster: send bcc mail to webmaster. Set true for debug +// or test. +$conf['send_bcc_mail_webmaster'] = false; + +// define the name of sender mail: if value is empty, gallery title is used +$conf['mail_sender_name'] = '__APP__'; + +// define the email of sender mail: if value is empty, webmaster email is used +$conf['mail_sender_email'] = '__APP__@__DOMAIN__'; + +// set true to allow text/html emails +$conf['mail_allow_html'] = true; + +// smtp configuration (work if fsockopen function is allowed for smtp port) +// smtp_host: smtp server host +// if null, regular mail function is used +// format: hoststring[:port] +// exemple: smtp.pwg.net:21 +// smtp_user/smtp_password: user & password for smtp authentication +$conf['smtp_host'] = 'localhost:25'; +$conf['smtp_user'] = '__APP__'; +$conf['smtp_password'] = '__MAIL_PWD__'; + +// 'ssl' or 'tls' +$conf['smtp_secure'] = null; + +// +-----------------------------------------------------------------------+ +// | metadata | +// +-----------------------------------------------------------------------+ + +// show_iptc: Show IPTC metadata on picture.php if asked by user +$conf['show_iptc'] = false; + +// show_iptc_mapping : is used for showing IPTC metadata on picture.php +// page. For each key of the array, you need to have the same key in the +// $lang array. For example, if my first key is 'iptc_keywords' (associated +// to '2#025') then you need to have $lang['iptc_keywords'] set in +// language/$user['language']/common.lang.php. If you don't have the lang +// var set, the key will be simply displayed +// +// To know how to associated iptc_field with their meaning, use +// tools/metadata.php +$conf['show_iptc_mapping'] = array( + 'iptc_keywords' => '2#025', + 'iptc_caption_writer' => '2#122', + 'iptc_byline_title' => '2#085', + 'iptc_caption' => '2#120' + ); + +// use_iptc: Use IPTC data during database synchronization with files +// metadata +$conf['use_iptc'] = false; + +// use_iptc_mapping : in which IPTC fields will Piwigo find image +// information ? This setting is used during metadata synchronisation. It +// associates a piwigo_images column name to a IPTC key +$conf['use_iptc_mapping'] = array( + 'keywords' => '2#025', + 'date_creation' => '2#055', + 'author' => '2#122', + 'name' => '2#005', + 'comment' => '2#120' + ); + +// show_exif: Show EXIF metadata on picture.php (table or line presentation +// available) +$conf['show_exif'] = true; + +// show_exif_fields : in EXIF fields, you can choose to display fields in +// sub-arrays, for example ['COMPUTED']['ApertureFNumber']. for this, add +// 'COMPUTED;ApertureFNumber' in $conf['show_exif_fields'] +// +// The key displayed in picture.php will be $lang['exif_field_Make'] for +// example and if it exists. For compound fields, only take into account the +// last part : for key 'COMPUTED;ApertureFNumber', you need +// $lang['exif_field_ApertureFNumber'] +// +// for PHP version newer than 4.1.2 : +// $conf['show_exif_fields'] = array('CameraMake','CameraModel','DateTime'); +// +$conf['show_exif_fields'] = array( + 'Make', + 'Model', + 'DateTimeOriginal', + 'COMPUTED;ApertureFNumber' + ); + +// use_exif: Use EXIF data during database synchronization with files +// metadata +$conf['use_exif'] = true; + +// use_exif_mapping: same behaviour as use_iptc_mapping +$conf['use_exif_mapping'] = array( + 'date_creation' => 'DateTimeOriginal' + ); + +// allow_html_in_metadata: in case the origin of the photo is unsecure (user +// upload), we remove HTML tags to avoid XSS (malicious execution of +// javascript) +$conf['allow_html_in_metadata'] = false; + +// decide which characters can be used as keyword separators (works in EXIF +// and IPTC). Coma "," cannot be removed from this list. +$conf['metadata_keyword_separator_regex'] = '/[.,;]/'; + +// +-----------------------------------------------------------------------+ +// | sessions | +// +-----------------------------------------------------------------------+ + +// session_use_cookies: specifies to use cookie to store +// the session id on client side +$conf['session_use_cookies'] = true; + +// session_use_only_cookies: specifies to only use cookie to store +// the session id on client side +$conf['session_use_only_cookies'] = true; + +// session_use_trans_sid: do not use transparent session id support +$conf['session_use_trans_sid'] = false; + +// session_name: specifies the name of the session which is used as cookie name +$conf['session_name'] = 'pwg_id'; + +// session_save_handler: comment the line below +// to use file handler for sessions. +$conf['session_save_handler'] = 'db'; + +// authorize_remembering : permits user to stay logged for a long time. It +// creates a cookie on client side. +$conf['authorize_remembering'] = true; + +// remember_me_name: specifies the name of the cookie used to stay logged +$conf['remember_me_name'] = 'pwg_remember'; + +// remember_me_length : time of validity for "remember me" cookies, in +// seconds. +$conf['remember_me_length'] = 5184000; + +// session_length : time of validity for normal session, in seconds. +$conf['session_length'] = 3600; + +// session_use_ip_address: avoid session hijacking by using a part of the IP +// address +$conf['session_use_ip_address'] = true; + +// Probability, on each page generated, to launch session garbage +// collector. Integer value between 1 and 100, in %. 0 to disable and let +// the system default behavior (on Debian-like, it's "never delete +// session"). +$conf['session_gc_probability'] = 1; + +// +-----------------------------------------------------------------------+ +// | debug/performance | +// +-----------------------------------------------------------------------+ + +// number of photos beyond which individual photos are added in the +// lounge, a temporary zone where photos wait before being "launched". +// 50k photos by default. +$conf['lounge_activate_threshold'] = 1; + +// Lounge is automatically emptied (photos are being pushed to their +// albums) when the oldest one reaches this duration. Lounge can be emptied +// before, either manually or at the end of the upload. In seconds. +// 5 minutes by default. +$conf['lounge_max_duration'] = 5*60; + +// show_queries : for debug purpose, show queries and execution times +$conf['show_queries'] = false; + +// show_gt : display generation time at the bottom of each page +$conf['show_gt'] = false; + +// debug_l10n : display a warning message each time an unset language key is +// accessed +$conf['debug_l10n'] = false; + +// activate template debugging - a new window will appear +$conf['debug_template'] = false; + +// save copies of sent mails into local data dir +$conf['debug_mail'] = false; + +// die_on_sql_error: if an SQL query fails, should everything stop? +$conf['die_on_sql_error'] = false; + +// if true, some language strings are replaced during template compilation +// (instead of template output). this results in better performance. however +// any change in the language file will not be propagated until you purge +// the compiled templates from the admin / maintenance menu +$conf['compiled_template_cache_language'] = false; + +// This tells Smarty whether to check for recompiling or not. Recompiling +// does not need to happen unless a template is changed. false results in +// better performance. +$conf['template_compile_check'] = true; + +// This forces Smarty to (re)compile templates on every invocation. This is +// handy for development and debugging. It should never be used in a +// production environment. +$conf['template_force_compile'] = false; + +// activate merging of javascript / css files +$conf['template_combine_files'] = true; + +// this permit to show the php errors reporting (see INI 'error_reporting' +// for possible values) +// gives an empty value '' to deactivate +$conf['show_php_errors'] = E_ALL; + +// This sets the display_errors php option to true, so php errors and warning +// messages are shown in the browser. If this is false, the error messages are +// available in the php log of the server if show_php_errors has any set. +// If the below is turned off in local config and errors are still shown on +// frontend, check for display_errors setting server's php config +$conf['show_php_errors_on_frontend'] = true; + + +// +-----------------------------------------------------------------------+ +// | authentication | +// +-----------------------------------------------------------------------+ + +// apache_authentication : use Apache authentication as reference instead of +// users table ? +$conf['apache_authentication'] = false; + +// users_table: which table is the reference for users? Can be a different +// table than Piwigo table +// +// If you decide to use another table than the default one, you need to +// prepare your database by deleting some datas : +// +// delete from piwigo_user_access; +// delete from piwigo_user_cache; +// delete from piwigo_user_feed; +// delete from piwigo_user_group; +// delete from piwigo_user_infos; +// delete from piwigo_sessions; +// delete from piwigo_rate; +// update piwigo_images set rating_score = null, added_by = ; +// delete from piwigo_caddie; +// delete from piwigo_favorites; +// +// All informations contained in these tables and column are related to +// piwigo_users table. +$conf['users_table'] = null; + +// If you decide to use external authentication +// change conf below by $conf['external_authentification'] = true; +$conf['external_authentification'] = true; + +// Other tables can be changed, if you define associated constants +// Example: +// define('USER_INFOS_TABLE', 'pwg_main'.'user_infos'); + +// user_fields : mapping between generic field names and table specific +// field names. For example, in PWG, the mail address is names +// "mail_address" and in punbb, it's called "email". +//$conf['user_fields'] = array( +// 'id' => 'id', +// 'username' => 'username', +// 'password' => 'password', +// 'email' => 'mail_address' +// ); + +// password_hash: function hash the clear user password to store it in the +// database. The function takes only one parameter: the clear password. +//$conf['password_hash'] = 'pwg_password_hash'; + +// password_verify: function that checks the password against its hash. The +// function takes 2 mandatory parameter : clear password, hashed password + +// an optional parameter user_id. The user_id is used to update the password +// with the new hash introduced in Piwigo 2.5. See function +// pwg_password_verify in include/functions_user.inc.php +//$conf['password_verify'] = 'pwg_password_verify'; + +// guest_id : id of the anonymous user +//$conf['guest_id'] = 2; + +// default_user_id : id of user used for default value +//$conf['default_user_id'] = $conf['guest_id']; + +// Registering process and guest/generic members get language from the browser +// if language isn't available PHPWG_DEFAULT_LANGUAGE is used as previously +$conf['browser_language'] = true; + +// webmaster_id : webmaster'id. +$conf['webmaster_id'] = 1; + +// does the guest have access ? +// (not a security feature, set your categories "private" too) +// If false it'll be redirected from index.php to identification.php +$conf['guest_access'] = true; + +// +-----------------------------------------------------------------------+ +// | history | +// +-----------------------------------------------------------------------+ + +// nb_logs_page : how many logs to display on a page +$conf['nb_logs_page'] = 300; + +// Every X new line in history, perform an automatic purge. The more often, +// the fewer lines to delete. 0 to disable. +$conf['history_autopurge_every'] = 1021; + +// How many lines to keep in history on autopurge? 0 to disable. +$conf['history_autopurge_keep_lines'] = 1000000; + +// On history autopurge, how many lines should to deleted at once, maximum? +$conf['history_autopurge_blocksize'] = 50000; + +// +-----------------------------------------------------------------------+ +// | urls | +// +-----------------------------------------------------------------------+ + +// gallery_url : you can set a specific URL for the home page of your +// gallery. This is for very specific use and you don't need to change this +// setting when move your gallery to a new directory or a new domain name. +$conf['gallery_url'] = null; + +// question_mark_in_urls : the generated urls contain a ? sign. This can be +// changed to false only if the server translates PATH_INFO variable +// (depends on the server AcceptPathInfo directive configuration) +$conf['question_mark_in_urls'] = true; + +// php_extension_in_urls : if true, the urls generated for picture and +// category will not contain the .php extension. This will work only if +// .htaccess defines Options +MultiViews parameter or url rewriting rules +// are active. +$conf['php_extension_in_urls'] = true; + +// category_url_style : one of 'id' (default) or 'id-name'. 'id-name' +// means that an simplified ascii representation of the category name will +// appear in the url +$conf['category_url_style'] = 'id'; + +// picture_url_style : one of 'id' (default), 'id-file' or 'file'. 'id-file' +// or 'file' mean that the file name (without extension will appear in the +// url). Note that one additional sql query will occur if 'file' is chosen. +// Note that you might experience navigation issues if you choose 'file' +// and your file names are not unique +$conf['picture_url_style'] = 'id'; + +// tag_url_style : one of 'id-tag' (default), 'id' or 'tag'. +// Note that if you choose 'tag' and the url (ascii) representation of your +// tags is not unique, all tags with the same url representation will be shown +$conf['tag_url_style'] = 'id-tag'; + +// +-----------------------------------------------------------------------+ +// | tags | +// +-----------------------------------------------------------------------+ + +// full_tag_cloud_items_number: number of tags to show in the full tag +// cloud. Only the most represented tags will be shown +$conf['full_tag_cloud_items_number'] = 200; + +// menubar_tag_cloud_items_number: number of tags to show in the tag +// cloud in the menubar. Only the most represented tags will be shown +$conf['menubar_tag_cloud_items_number'] = 20; + +// menubar_tag_cloud_content: 'always_all', 'current_only' or 'all_or_current' +// For the tag cloud in the menubar. +// 'always_all': tag cloud always displays all tags available to the user +// 'current_only': tag cloud always displays the tags from the current pictures +// 'all_or_current': when pictures are displayed, tag cloud shows their tags, but +// when none are displayed, all the tags available to the user are shown. +$conf['menubar_tag_cloud_content'] = 'all_or_current'; + +// content_tag_cloud_items_number: number of related tags to show in the tag +// cloud on the content page, when the current section is not a set of +// tags. Only the most represented tags will be shown +$conf['content_tag_cloud_items_number'] = 12; + +// tags_levels: number of levels to use for display. Each level is bind to a +// CSS class tagLevelX. +$conf['tags_levels'] = 5; + +// tags_default_display_mode: group tags by letter or display a tag cloud by +// default? 'letters' or 'cloud'. +$conf['tags_default_display_mode'] = 'cloud'; + +// tag_letters_column_number: how many columns to display tags by letter +$conf['tag_letters_column_number'] = 4; + +// +-----------------------------------------------------------------------+ +// | Related albums | +// +-----------------------------------------------------------------------+ + +// beyond this limit, do not try to find related albums. If there are too +// many items, the SQL query will be slow and the results irrelevant, +// because showing too many related albums. +$conf['related_albums_maximum_items_to_compute'] = 1000; + +// once found the related albums, how many to show in the menubar? We take +// the heaviest (with more relations). +$conf['related_albums_display_limit'] = 20; + +// +-----------------------------------------------------------------------+ +// | Notification by mail | +// +-----------------------------------------------------------------------+ + +// Default Value for nbm user +$conf['nbm_default_value_user_enabled'] = false; + +// Search list user to send quickly (List all without to check news) +// More quickly but less fun to use +$conf['nbm_list_all_enabled_users_to_send'] = false; + +// Max time used on one pass in order to send mails. +// Timeout delay ratio. +$conf['nbm_max_treatment_timeout_percent'] = 0.8; + +// If timeout cannot be combined with nbm_max_treatment_timeout_percent, +// nbm_treatment_timeout_default is used by default +$conf['nbm_treatment_timeout_default'] = 20; + +// Parameters used in get_recent_post_dates for the 2 kind of notification +$conf['recent_post_dates'] = array( + 'RSS' => array('max_dates' => 5, 'max_elements' => 6, 'max_cats' => 6), + 'NBM' => array('max_dates' => 7, 'max_elements' => 3, 'max_cats' => 9) + ); + +// the author shown in the RSS feed element +$conf['rss_feed_author'] = 'Piwigo notifier'; + +// how long does the authentication key stays valid, in seconds. 3 days by +// default. 0 to disable. +$conf['auth_key_duration'] = 3*24*60*60; + +// +-----------------------------------------------------------------------+ +// | Set admin layout | +// +-----------------------------------------------------------------------+ + +$conf['admin_theme'] = 'clear'; + +// should we load the active plugins ? true=Yes, false=No +$conf['enable_plugins']=true; + +// Web services are allowed (true) or completely forbidden (false) +$conf['allow_web_services'] = true; + +// Maximum number of images to be returned foreach call to the web service +$conf['ws_max_images_per_page'] = 500; + +// Maximum number of users to be returned foreach call to the web service +$conf['ws_max_users_per_page'] = 1000; + +// Display a link to subscribe to Piwigo Announcements Newsletter +$conf['show_newsletter_subscription'] = true; + +// Fetch and show latest news from piwigo.org +$conf['show_piwigo_latest_news'] = true; + +// Check for available updates on Piwigo or extensions, performed each time +// the dashboard is displayed +$conf['dashboard_check_for_updates'] = true; + +// Number Weeks displayed on activity chart on the dashboard +$conf['dashboard_activity_nb_weeks'] = 4; + +// On the Admin>Users>Activity page, should we display the connection/disconnections? +// 'all' = do not filter, display all +// 'admins_only' = only display connections of admin users +// 'none' = don't even display connections of admin users +$conf['activity_display_connections'] = 'admins_only'; + +// On album mover page, number of seconds before auto openning album when +// dragging an album. In milliseconds. 3 seconds by default. +$conf['album_move_delay_before_auto_opening'] = 3*1000; + +// This variable is used to show or hide the template tab in the side menu +$conf['show_template_in_side_menu'] = false; + +// Add last calculated cache size to Dashboard Storage chart if true. +// To recalculate use Tools -> Maintenance, Refresh. +// To disable, set to false. +$conf['add_cache_to_storage_chart'] = true; + +// +-----------------------------------------------------------------------+ +// | Filter | +// +-----------------------------------------------------------------------+ +// $conf['filter_pages'] contains configuration for each pages +// o If values are not defined for a specific page, default value are used +// o Array is composed by the basename of each page without extension +// o List of value names: +// - used: filter function are used +// (if false nothing is done [start, cancel, stop, ...] +// - cancel: cancel current started filter +// - add_notes: add notes about current started filter on the header +// o Empty configuration in order to disable completely filter functions +// No filter, No icon,... +// $conf['filter_pages'] = array(); +$conf['filter_pages'] = array + ( + // Default page + 'default' => array( + 'used' => true, 'cancel' => false, 'add_notes' => false), + // Real pages + 'index' => array('add_notes' => true), + 'tags' => array('add_notes' => true), + 'search' => array('add_notes' => true), + 'comments' => array('add_notes' => true), + 'admin' => array('used' => false), + 'feed' => array('used' => false), + 'notification' => array('used' => false), + 'nbm' => array('used' => false), + 'popuphelp' => array('used' => false), + 'profile' => array('used' => false), + 'ws' => array('used' => false), + 'identification' => array('cancel' => true), + 'install' => array('cancel' => true), + 'password' => array('cancel' => true), + 'register' => array('cancel' => true), + ); + +// +-----------------------------------------------------------------------+ +// | Slideshow | +// +-----------------------------------------------------------------------+ +// slideshow_period : waiting time in seconds before loading a new page +// during automated slideshow +// slideshow_period_min, slideshow_period_max are bounds of slideshow_period +// slideshow_period_step is the step of navigation between min and max +$conf['slideshow_period_min'] = 1; +$conf['slideshow_period_max'] = 10; +$conf['slideshow_period_step'] = 1; +$conf['slideshow_period'] = 4; + +// slideshow_repeat : slideshow loops on pictures +$conf['slideshow_repeat'] = true; + +// $conf['light_slideshow'] indicates to use slideshow.tpl in state of +// picture.tpl for slideshow +// Take care to have slideshow.tpl in all available templates +// Or set it false. +// Check if Picture's plugins are compliant with it +// Every plugin from 1.7 would be design to manage light_slideshow case. +$conf['light_slideshow'] = true; + +// the local data directory is used to store data such as compiled templates, +// plugin variables, combined css/javascript or resized images. Beware of +// mandatory trailing slash. +$conf['data_location'] = '__DATA_DIR__/_data/'; + +// where should the API/UploadForm add photos? This path must be relative to +// the Piwigo installation directory (but can be outside, as long as it's +// reachable from your webserver). +$conf['upload_dir'] = '__DATA_DIR__/upload'; + +// where should the user be guided when there is no photo in his gallery yet? +$conf['no_photo_yet_url'] = 'admin.php?page=photos_add'; + +// directory with themes inside +$conf['themes_dir'] = PHPWG_ROOT_PATH.'themes'; + +// enable the synchronization method for adding photos +$conf['enable_synchronization'] = true; + +// enable the update of Piwigo core from administration pages +$conf['enable_core_update'] = true; + +// enable install/update of plugins/themes/languages from administration pages +$conf['enable_extensions_install'] = true; + +// Permitted characters for files/directories during synchronization. +// Do not add the ' U+0027 single quote apostrophe character, it WILL make some +// SQL queries fail. URI reserved characters (see +// https://tools.ietf.org/html/rfc3986#section-2.2 ) MAY make things fail, this +// is known for example for the & character leading to a query parameter +// separator if the resulting URI path is not urlencoded. Adding accented +// characters or characters of Unicode letter or digit classes in the basic +// plane *usually* are fine iff the file system's names *and* the config file +// content are both UTF-8 encoded, as is the MySQL database table, and the file +// system does not use decomposed Unicode characters for accented characters. +// +// Possible expressions could be: +// * Just add the space character: +// $conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_. ]+$/'; +// * Add space character and German umlauts and sharp s (sz) (note this is +// UTF-8 encoded, if you see "odd" sequences then the encoding in your viewer +// or editor is wrong, and maybe your file system is as well), and +// parentheses and brackets; also note the trailing 'u' regex option to have +// PHP interpret the expression as UTF-8 string instead of ASCII: +// $conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_. äÄöÖüÜßẞ()\[\]]+$/u'; +// * Allow all Unicode letter and numeric and whitespace characters (largely +// encoding independent but still might have quirks with file system's file +// name encoding) and parentheses and brackets; again with the 'u' regex +// option to let PHP match Unicode characters and properties: +// $conf['sync_chars_regex'] = '/^[-_.\p{L}\p{N}\p{Z}()\[\]]+$/u'; +// You may try your expression at https://regex101.com/ choosing the +// PCRE2 (PHP >=7.3) flavor. +// See also: +// https://www.regular-expressions.info/unicode.html +// https://www.regular-expressions.info/php.html#preg +// https://www.php.net/manual/en/pcre.pattern.php +// +// The default expression is restrictive but safe and sane ASCII only +// alphanumeric and hyphen-minus and underscore and dot. +$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.]+$/'; + +// folders name excluded during synchronization +$conf['sync_exclude_folders'] = array(); + +// PEM url (default is http://piwigo.org/ext) +$conf['alternative_pem_url'] = ''; + +// categories ID on PEM +$conf['pem_plugins_category'] = 12; +$conf['pem_themes_category'] = 10; +$conf['pem_languages_category'] = 8; + +// based on the EXIF "orientation" tag, should we rotate photos added in the +// upload form or through pwg.images.addSimple web API method? +$conf['upload_form_automatic_rotation'] = true; + +// 0-'auto', 1-'derivative' 2-'script' +$conf['derivative_url_style']=0; + +$conf['chmod_value']= substr_compare(PHP_SAPI, 'apa', 0, 3)==0 ? 0777 : 0755; + +// 'small', 'medium' or 'large' +$conf['derivative_default_size'] = 'medium'; + +// below which size (in pixels, ie width*height) do we remove metadata +// EXIF/IPTC... from derivative? +$conf['derivatives_strip_metadata_threshold'] = 256000; + +//Maximum Ajax requests at once, for thumbnails on-the-fly generation +$conf['max_requests']=3; + +// one of '', 'images', 'all' +//TODO: Put this in admin and also manage .htaccess in #sites and upload folders +$conf['original_url_protection'] = ''; + + +// Default behaviour when a new album is created: should the new album inherit the group/user +// permissions from its parent? Note that config is only used for Ftp synchro, +// and if that option is not explicitly transmit when the album is created. +$conf['inheritance_by_default'] = false; + +// 'png' or 'jpg': your uploaded TIF photos will have a representative in +// JPEG or PNG file format +$conf['tiff_representative_ext'] = 'png'; + +// in the upload form, let users upload only picture_exts or all file_exts? +// for some file types, Piwigo will try to generate a pwg_representative +// (TIFF, videos, PDF) +$conf['upload_form_all_types'] = false; + +// Size of chunks, in kilobytes. Fast connections will have better +// performances with high values, such as 5000. +$conf['upload_form_chunk_size'] = 500; + +// Maximum size for a file in the upload form, in megabytes. +$conf['upload_form_max_file_size'] = 1000; + +// If we try to generate a pwg_representative for a video we use ffmpeg. If +// "ffmpeg" is not visible by the web user, you can define the full path of +// the directory where "ffmpeg" executable is. +$conf['ffmpeg_dir'] = ''; + +// batch manager: how many images should Piwigo display by default on the +// global mode. Must be among values {20,50,100} +$conf['batch_manager_images_per_page_global'] = 20; + +// batch manager: how many images should Piwigo display by default on the +// unit mode. Must be among values {5, 10, 50} +$conf['batch_manager_images_per_page_unit'] = 5; + +// how many missing md5sum should Piwigo compute at once. +$conf['checksum_compute_blocksize'] = 50; + +// quicksearch engine: include all photos from sub-albums of any matching +// album. For example, if search is "bear", then we display photos from +// "bear/grizzly". When value changed, delete database cache files in +// _data/cache directory +$conf['quick_search_include_sub_albums'] = false; + +// +-----------------------------------------------------------------------+ +// | log | +// +-----------------------------------------------------------------------+ +// Logs directory, relative to $conf['data_location'] +$conf['log_dir'] = '/logs'; + +// Log level (OFF, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG) +// development = DEBUG, production = ERROR +$conf['log_level'] = 'DEBUG'; + +// Keep logs file during X days +$conf['log_archive_days'] = 30; + +// +-----------------------------------------------------------------------+ +// | Proxy Settings | +// +-----------------------------------------------------------------------+ + +// If piwigo needs a http-proxy to connect to the internet, set this to true +$conf['use_proxy'] = false; + +// Connection string of the proxy +$conf['proxy_server'] = 'proxy.domain.org:port'; + +// If the http-proxy requires authentication, set username and password here +// e.g. username:password +$conf['proxy_auth'] = ''; ?> + diff --git a/manifest.toml b/manifest.toml index ad2908c..220c7aa 100644 --- a/manifest.toml +++ b/manifest.toml @@ -73,6 +73,7 @@ ram.runtime = "50M" format = "zip" [resources.system_user] + allow_email = true [resources.install_dir] From fed7187b88307e490a802ff77e2bbeb106c6809c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 29 Dec 2023 12:22:22 +0100 Subject: [PATCH 27/45] Update manifest.toml --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 220c7aa..782ae02 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Piwigo" description.en = "Open source photo gallery for the web" description.fr = "Galerie de photos open source pour le web" -version = "14.0.0~ynh1" +version = "14.1.0~ynh1" maintainers = ["JimboJoe"] @@ -62,8 +62,8 @@ ram.runtime = "50M" format = "zip" [resources.sources.main] - url = "https://piwigo.org/download/dlcounter.php?code=14.0.0" - sha256 = "42ad8f998177c2c9528fc9b547c2ee5637abe2dc398dcd5c2e4880fa66a8cf2f" + url = "https://piwigo.org/download/dlcounter.php?code=14.1.0" + sha256 = "ffa3a91cd464acf46396467b2741662806407e2ffe238e7efeda075f62885083" format = "zip" [resources.sources.log_failed_logins_plugin] From e49082668dba35b4b18d156b5988517ca28caaf6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 29 Dec 2023 11:22:28 +0000 Subject: [PATCH 28/45] 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 4b73bf1..ff9d5a2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Piwigo is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. -**Shipped version:** 14.0.0~ynh1 +**Shipped version:** 14.1.0~ynh1 **Demo:** https://piwigo.org/demo diff --git a/README_fr.md b/README_fr.md index 6cdaa79..bb92bd4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Piwigo est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. -**Version incluse :** 14.0.0~ynh1 +**Version incluse :** 14.1.0~ynh1 **Démo :** https://piwigo.org/demo From cdc6f8e6c0574e7f9cc03602be8367f6ea47d9ef Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 6 Jan 2024 19:17:03 +0100 Subject: [PATCH 29/45] The manifest asks for the app language to be used with like 5 or 6 options, then proceed to savagely replace anything that is not fr or en with en... --- manifest.toml | 4 ++-- scripts/install | 13 ++----------- scripts/upgrade | 25 +++++++++---------------- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/manifest.toml b/manifest.toml index 782ae02..c17eb2a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -45,8 +45,8 @@ ram.runtime = "50M" ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" type = "select" - choices = ["de", "en", "es", "fr", "it", "pt"] - default = "en" + choices = ["fr_FR", "en_UK"] + default = "en_UK" [install.admin] type = "user" diff --git a/scripts/install b/scripts/install index 06bc042..6393436 100644 --- a/scripts/install +++ b/scripts/install @@ -68,18 +68,9 @@ chown -R $app:www-data "$data_dir" #================================================= ynh_script_progression --message="Setuping application with CURL..." --weight=5 -# Generate random password for admin -if [ "$language" = "fr" ]; then - applanguage="fr_FR" -else - applanguage="en_UK" -fi - -# Configure Piwigo via cURL -mail="$(ynh_user_get_info --username=$admin --key=mail)" - # Installation with cURL -ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbhost=127.0.0.1" "dbuser=$db_user" "dbpasswd=$db_pwd" "dbname=$db_name" "prefix=" "admin_name=$admin" "admin_pass1=$password" "admin_pass2=$password" "admin_mail=$mail" +mail="$(ynh_user_get_info --username=$admin --key=mail)" +ynh_local_curl "/install.php?language=$language" "install=true" "dbhost=127.0.0.1" "dbuser=$db_user" "dbpasswd=$db_pwd" "dbname=$db_name" "prefix=" "admin_name=$admin" "admin_pass1=$password" "admin_pass2=$password" "admin_mail=$mail" #================================================= # CONFIGURE PIWIGO diff --git a/scripts/upgrade b/scripts/upgrade index 5c235a2..6387fcd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,14 +1,16 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers +# Boring backward compatibility +if [ "${language:-}" == "fr" ] ; then + language="fr_FR" +else + language="en_UK" +fi + + #================================================= # CHECK VERSION #================================================= @@ -81,18 +83,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6 -# Reload NGINX -ynh_systemd_action --service_name=nginx --action=reload - -if [ "$language" = "fr" ] ; then - applanguage="fr_FR" -else - applanguage="en_UK" -fi - # Upgrade Piwigo via cURL # FIXME : Why Curl ... Why can't we trigger the migration from the command line somehow ... -#ynh_local_curl "/upgrade.php?language=$applanguage&now=true" "language=$applanguage" "username=$admin" "password=$admin_pwd" +#ynh_local_curl "/upgrade.php?language=$language&now=true" "language=$language" "username=$admin" "password=$admin_pwd" #================================================= # CONFIGURE PIWIGO From fb61948453498ece99a310e2a4cf52c5b15201ec Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 6 Jan 2024 19:40:17 +0100 Subject: [PATCH 30/45] Simplify the mess about seting up sources, install dir, data dir, plugin dirs ... --- manifest.toml | 1 - scripts/_common.sh | 48 ------------------------------------- scripts/install | 59 +++++++++++++--------------------------------- scripts/upgrade | 50 ++++++++++++++++----------------------- 4 files changed, 37 insertions(+), 121 deletions(-) diff --git a/manifest.toml b/manifest.toml index c17eb2a..0ac2ea9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -78,7 +78,6 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] - subdirs = [ "_data", "upload", "galleries" ] [resources.permissions] main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index ee67723..05a7907 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,50 +1,2 @@ #!/bin/bash -#================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -# Check available space before creating a temp directory. -# -# usage: ynh_smart_mktemp --min_size="Min size" -# -# | arg: -s, --min_size= - Minimal size needed for the temporary directory, in Mb -ynh_smart_mktemp () { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [s]=min_size= ) - local min_size - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - min_size="${min_size:-300}" - # Transform the minimum size from megabytes to kilobytes - min_size=$(( $min_size * 1024 )) - - # Check if there's enough free space in a directory - is_there_enough_space () { - local free_space=$(df --output=avail "$1" | sed 1d) - test $free_space -ge $min_size - } - - if is_there_enough_space /tmp; then - local tmpdir=/tmp - elif is_there_enough_space /var; then - local tmpdir=/var - elif is_there_enough_space /; then - local tmpdir=/ - elif is_there_enough_space /home; then - local tmpdir=/home - else - ynh_die "Insufficient free space to continue..." - fi - - echo "$(mktemp --directory --tmpdir="$tmpdir")" -} diff --git a/scripts/install b/scripts/install index 6393436..171929e 100644 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -14,27 +8,29 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Setting up source files..." --weight=5 -# Create tmp directory and fetch app inside -tmpdir="$(ynh_smart_mktemp --min_size=300)" -ynh_setup_source --dest_dir="$tmpdir" - -# Fetch needed plugins -mkdir -p $tmpdir/plugins/Ldap_Login -ynh_setup_source --dest_dir="$tmpdir/plugins/Ldap_Login" --source_id=ldap_plugin -ynh_setup_source --dest_dir="$tmpdir/plugins" --source_id=log_failed_logins_plugin - -# sets extended pattern matching options in the bash shell -shopt -s extglob - -# Install files and set permissions -cp -a $tmpdir/!(upload|_data|galleries) $install_dir +ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin +ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# CONFIGURE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Initializing data directory..." --weight=1 + +mv $install_dir/_data $data_dir/_data +mv $install_dir/upload $data_dir/upload +mv $install_dir/galleries $data_dir/galleries + +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" + +#================================================= +# SYSTEM CONFIGURATIONS #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 @@ -42,27 +38,6 @@ ynh_add_fpm_config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -ln -sd $data_dir/_data $install_dir/_data -ln -sd $data_dir/upload $install_dir/upload -ln -sd $data_dir/galleries $install_dir/galleries - -cp -Rp $tmpdir/_data/. $install_dir/_data -cp -Rp $tmpdir/upload/. $install_dir/upload -cp -Rp $tmpdir/galleries/. $install_dir/galleries - -ynh_secure_remove --file="$tmpdir" - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" - #================================================= # SETUP APPLICATION WITH CURL #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6387fcd..f2e320c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -10,7 +10,6 @@ else language="en_UK" fi - #================================================= # CHECK VERSION #================================================= @@ -21,42 +20,33 @@ upgrade_type=$(ynh_check_app_version_changed) # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# sets extended pattern matching options in the bash shell -shopt -s extglob +# Get rid of legacy symlinks +[ -L "$install_dir/_data" ] && ynh_secure_remove "$install_dir/_data" || true +[ -L "$install_dir/galleries" ] && ynh_secure_remove "$install_dir/galleries" || true +[ -L "$install_dir/upload" ] && ynh_secure_remove "$install_dir/upload" || true if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=3 - # Create tmp directory and fetch app inside - tmpdir="$(ynh_smart_mktemp --min_size=300)" - ynh_setup_source --dest_dir="$tmpdir" + ynh_setup_source --dest_dir="$install_dir" + ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin + ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin - # Fetch needed plugins - mkdir -p $tmpdir/plugins/Ldap_Login - ynh_setup_source --dest_dir="$tmpdir/plugins/Ldap_Login" --source_id=ldap_plugin - ynh_setup_source --dest_dir="$tmpdir/plugins" --source_id=log_failed_logins_plugin + # We don't want to keep those in the install dir, they already are in $data_dir + if [ -d "$install_dir/_data" ] && [ ! -L "$install_dir/_data" ] + then + ynh_secure_remove "$install_dir/_data" + fi + if [ -d "$install_dir/galleries" ] && [ ! -L "$install_dir/galleries" ] + then + ynh_secure_remove "$install_dir/galleries" + fi + if [ -d "$install_dir/upload" ] && [ ! -L "$install_dir/upload" ] + then + ynh_secure_remove "$install_dir/upload" + fi - # Install files and set permissions - cp -a $tmpdir/!(upload|_data|galleries) $install_dir - - # Backward compatibility: - # If the _data subdirectory wasn't already moved to /home/yunohost.app/$app, - # then move it there - if [ ! -h $install_dir/_data ] ; then - mv $install_dir/_data $data_dir - ln -sd $data_dir/_data $install_dir/_data - fi - - # Backward compatibility: - # If the galleries subdirectory wasn't already moved to /home/yunohost.app/$app, - # then move it there - if [ ! -h $install_dir/galleries ] ; then - mv $install_dir/galleries $data_dir - ln -sd $data_dir/galleries $install_dir/galleries - fi - - ynh_secure_remove --file="$tmpdir" fi chmod 750 "$data_dir" From 0a3b8c5680df0337f600e3cb39a49723da350d94 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 6 Jan 2024 19:45:31 +0100 Subject: [PATCH 31/45] Save the password during install to be able to call curl during upgrade >_> --- scripts/install | 3 +++ scripts/upgrade | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 171929e..ef6174c 100644 --- a/scripts/install +++ b/scripts/install @@ -3,6 +3,9 @@ source _common.sh source /usr/share/yunohost/helpers +# Gotta save the stupid password because we need it during upgrade because there's no way to trigger the upgrade.php script from command line ... +ynh_app_setting_set --app=$app --key=password --value="$password" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f2e320c..a97fed2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,8 +74,8 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6 # Upgrade Piwigo via cURL -# FIXME : Why Curl ... Why can't we trigger the migration from the command line somehow ... -#ynh_local_curl "/upgrade.php?language=$language&now=true" "language=$language" "username=$admin" "password=$admin_pwd" +# Why can't we trigger the migration from the command line somehow ... +ynh_local_curl "/upgrade.php?language=$language&now=true" "language=$language" "username=$admin" "password=$admin_pwd" #================================================= # CONFIGURE PIWIGO @@ -104,8 +104,8 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< # Login with admin account -# FIXME: Is this stuff really needed ... isn't there a way to enable the damn LDAP login plugin from the command line or something ... -#ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$admin_pwd" +# ... isn't there a way to enable the damn LDAP login plugin from the command line or something ... +ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$admin_pwd" # Get session token status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus") pwg_token=$(jq --raw-output .result.pwg_token <<< $status) From 78adc8034b7ab0bd4d0d9095e40f78c6f7f8408e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sat, 6 Jan 2024 21:48:11 +0100 Subject: [PATCH 32/45] Update tests.toml --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index ef2f52a..2aac459 100644 --- a/tests.toml +++ b/tests.toml @@ -7,4 +7,4 @@ test_format = 1.0 # ------------------------------- test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.name = "Upgrade from 13.1.0" - \ No newline at end of file + test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.language = "en" From ebbb5abf64ea8bc83a2817d009402d65374b9983 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sat, 6 Jan 2024 21:53:16 +0100 Subject: [PATCH 33/45] Unbound variable --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a97fed2..4c819f2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,7 +75,7 @@ ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6 # Upgrade Piwigo via cURL # Why can't we trigger the migration from the command line somehow ... -ynh_local_curl "/upgrade.php?language=$language&now=true" "language=$language" "username=$admin" "password=$admin_pwd" +ynh_local_curl "/upgrade.php?language=$language&now=true" "language=$language" "username=$admin" "password=$password" #================================================= # CONFIGURE PIWIGO From 92b9f7d235dc1fe68af73ec6acce17ad6cfaee71 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sat, 6 Jan 2024 22:59:50 +0100 Subject: [PATCH 34/45] Update tests.toml --- tests.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests.toml b/tests.toml index 2aac459..25e6b0e 100644 --- a/tests.toml +++ b/tests.toml @@ -7,4 +7,5 @@ test_format = 1.0 # ------------------------------- test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.name = "Upgrade from 13.1.0" + test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.domain = "domain.tld" test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.language = "en" From 4e13c21c9adcede3d41e221f79640993d57892c2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 7 Jan 2024 01:51:47 +0100 Subject: [PATCH 35/45] Update tests.toml --- tests.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests.toml b/tests.toml index 25e6b0e..e8a0971 100644 --- a/tests.toml +++ b/tests.toml @@ -9,3 +9,4 @@ test_format = 1.0 test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.name = "Upgrade from 13.1.0" test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.domain = "domain.tld" test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.language = "en" + test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.admin = "package_checker" From 19fcdae6729a795483acc6cb9f763bb3cc84d161 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 7 Jan 2024 04:52:35 +0100 Subject: [PATCH 36/45] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4c819f2..96db4c4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -105,7 +105,7 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< # Login with admin account # ... isn't there a way to enable the damn LDAP login plugin from the command line or something ... -ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$admin_pwd" +ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$password" # Get session token status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus") pwg_token=$(jq --raw-output .result.pwg_token <<< $status) From 3465ab159d5b49a7e751f20ae9f7d35a14659e77 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 7 Jan 2024 04:54:47 +0100 Subject: [PATCH 37/45] Update upgrade --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 96db4c4..b40049b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -10,6 +10,12 @@ else language="en_UK" fi +if [ -z "${password:-}" ]; +then + password="${admin_pwd}" + ynh_app_setting_set --app=$app --key=password --value="$password" +fi + #================================================= # CHECK VERSION #================================================= From be8253e7dc820100bfad5a48d4f2ef12d1a3ce45 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Fri, 12 Jan 2024 12:30:16 +0100 Subject: [PATCH 38/45] Update tests.toml: add tests from older version to be able to compare to current master --- tests.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests.toml b/tests.toml index e8a0971..bd576ee 100644 --- a/tests.toml +++ b/tests.toml @@ -6,6 +6,16 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- + test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925.name = "Upgrade from 12.0.0" + test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925.args.domain = "domain.tld" + test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925.args.language = "en" + test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925.args.admin = "package_checker" + + test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91.name = "Upgrade from 12.1.0" + test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91.args.domain = "domain.tld" + test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91.args.language = "en" + test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91.args.admin = "package_checker" + test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.name = "Upgrade from 13.1.0" test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.domain = "domain.tld" test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.language = "en" From 705d11ad3518d45eada2b7407126c560abac6296 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 15 Mar 2024 22:59:04 +0000 Subject: [PATCH 39/45] Auto-update README --- README.md | 17 ++++++++--------- README_fr.md | 19 +++++++++---------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index ff9d5a2..d965fca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -18,10 +18,9 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Piwigo is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. - **Shipped version:** 14.1.0~ynh1 -**Demo:** https://piwigo.org/demo +**Demo:** ## Screenshots @@ -29,11 +28,11 @@ Piwigo is a photo gallery software for the web, built by an active community of ## Documentation and resources -* Official app website: -* Official admin documentation: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Official app website: +- Official admin documentation: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info @@ -41,7 +40,7 @@ Please send your pull request to the [testing branch](https://github.com/YunoHos To try the testing branch, please proceed like that. -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing --debug or sudo yunohost app upgrade piwigo -u https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing --debug diff --git a/README_fr.md b/README_fr.md index bb92bd4..dfcb322 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,5 +1,5 @@ @@ -18,10 +18,9 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Piwigo est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. - **Version incluse :** 14.1.0~ynh1 -**Démo :** https://piwigo.org/demo +**Démo :** ## Captures d’écran @@ -29,11 +28,11 @@ Piwigo est un logiciel de galerie photo pour le web, construit par une communaut ## Documentations et ressources -* Site officiel de l’app : -* Documentation officielle de l’admin : -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Site officiel de l’app : +- Documentation officielle de l’admin : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs @@ -41,10 +40,10 @@ Merci de faire vos pull request sur la [branche testing](https://github.com/Yuno Pour essayer la branche testing, procédez comme suit. -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing --debug ou sudo yunohost app upgrade piwigo -u https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** From d04719a32f6ac369c42cbc6a352a3f80ee4e75f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 22 Mar 2024 22:13:52 +0100 Subject: [PATCH 40/45] Cleanup, apply template --- scripts/_common.sh | 15 +++++++ scripts/backup | 12 +----- scripts/change_url | 4 -- scripts/install | 36 +++++++++-------- scripts/remove | 2 - scripts/restore | 14 +++---- scripts/upgrade | 98 ++++++++++++++++++++++------------------------ 7 files changed, 87 insertions(+), 94 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 05a7907..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,2 +1,17 @@ #!/bin/bash +#================================================= +# COMMON VARIABLES +#================================================= + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= diff --git a/scripts/backup b/scripts/backup index 61a8a7b..82ac839 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -28,21 +26,13 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="$data_dir" --is_big #================================================= -# BACKUP THE NGINX CONFIGURATION +# BACKUP THE SYSTEM CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# BACKUP FAIL2BAN CONFIGURATION -#================================================= - ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" diff --git a/scripts/change_url b/scripts/change_url index 16e0f3c..a121ebc 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC STARTING #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,8 +7,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # MODIFY URL IN NGINX CONF #================================================= diff --git a/scripts/install b/scripts/install index ef6174c..3f7cf11 100644 --- a/scripts/install +++ b/scripts/install @@ -3,6 +3,12 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INITIALIZE AND STORE SETTINGS +#================================================= + +mail="$(ynh_user_get_info --username=$admin --key=mail)" + # Gotta save the stupid password because we need it during upgrade because there's no way to trigger the upgrade.php script from command line ... ynh_app_setting_set --app=$app --key=password --value="$password" @@ -15,22 +21,20 @@ ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # CONFIGURE DATA DIRECTORY #================================================= ynh_script_progression --message="Initializing data directory..." --weight=1 -mv $install_dir/_data $data_dir/_data -mv $install_dir/upload $data_dir/upload -mv $install_dir/galleries $data_dir/galleries +mv "$install_dir/_data" "$data_dir/_data" +mv "$install_dir/upload" "$data_dir/upload" +mv "$install_dir/galleries" "$data_dir/galleries" -chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" +chown -R "$app:www-data" "$data_dir" #================================================= # SYSTEM CONFIGURATIONS @@ -47,8 +51,9 @@ ynh_add_nginx_config ynh_script_progression --message="Setuping application with CURL..." --weight=5 # Installation with cURL -mail="$(ynh_user_get_info --username=$admin --key=mail)" -ynh_local_curl "/install.php?language=$language" "install=true" "dbhost=127.0.0.1" "dbuser=$db_user" "dbpasswd=$db_pwd" "dbname=$db_name" "prefix=" "admin_name=$admin" "admin_pass1=$password" "admin_pass2=$password" "admin_mail=$mail" +ynh_local_curl "/install.php?language=$language" \ + "install=true" "dbhost=127.0.0.1" "dbuser=$db_user" "dbpasswd=$db_pwd" "dbname=$db_name" \ + "prefix=" "admin_name=$admin" "admin_pass1=$password" "admin_pass2=$password" "admin_mail=$mail" #================================================= # CONFIGURE PIWIGO @@ -61,9 +66,8 @@ ynh_add_config --template="config.inc.php" --destination="$install_dir/local/con # Setup database in local/config/database.inc.php ynh_add_config --template="database.inc.php" --destination="$install_dir/local/config/database.inc.php" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # ADD LDAP PLUGIN @@ -76,7 +80,7 @@ ynh_script_progression --message="Configuring LDAP plugin..." --weight=2 ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$password" # Get session token status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus") -pwg_token=$(jq --raw-output .result.pwg_token <<< $status) +pwg_token=$(jq --raw-output .result.pwg_token <<< "$status") # Install the Ldap_Login plugin ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action=install" "plugin=Ldap_Login" "pwg_token=$pwg_token" # Activate the Ldap_Login plugin @@ -85,7 +89,7 @@ ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action= ynh_local_curl "/ws.php?format=json" "method=pwg.session.logout" # Edit Ldap_Login plugin configuration -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "UPDATE piwigo_ldap_login_config SET value='ou=users,dc=yunohost,dc=org' WHERE param = 'ld_basedn'; +ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "UPDATE piwigo_ldap_login_config SET value='ou=users,dc=yunohost,dc=org' WHERE param = 'ld_basedn'; UPDATE piwigo_ldap_login_config SET value='uid' WHERE param = 'ld_user_attr'; UPDATE piwigo_ldap_login_config SET value='' WHERE param = 'ld_binddn'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'allow_new_users'; @@ -99,11 +103,11 @@ UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'ld_group_user_activ ynh_script_progression --message="Configuring Fail2Ban..." --weight=6 # Configure and activate log_failed_logins plugin -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "INSERT INTO config (param, value) VALUES ('logFailedLoginsFilename','/var/log/${app}FailedLogins.log');" +ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" +ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO config (param, value) VALUES ('logFailedLoginsFilename','/var/log/${app}FailedLogins.log');" touch "/var/log/${app}FailedLogins.log" -chown $app: "/var/log/${app}FailedLogins.log" +chown "$app:" "/var/log/${app}FailedLogins.log" ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex="ip=" --max_retry=6 diff --git a/scripts/remove b/scripts/remove index b91f0fa..1512187 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= diff --git a/scripts/restore b/scripts/restore index 26017de..f492243 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -18,7 +16,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY @@ -27,14 +25,14 @@ ynh_script_progression --message="Restoring the data directory..." --weight=2 ynh_restore_file --origin_path="$data_dir" --not_mandatory -chown -R $app:www-data "$data_dir" +chown -R "$app:www-data" "$data_dir" #================================================= # RESTORE THE MYSQL DATABASE #================================================= ynh_script_progression --message="Restoring the MySQL database..." --weight=2 -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -46,20 +44,18 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" touch "/var/log/${app}FailedLogins.log" -chown $app: "/var/log/${app}FailedLogins.log" +chown "$app:" "/var/log/${app}FailedLogins.log" ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2 -ynh_systemd_action --service_name=php$phpversion-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 b40049b..cb924a5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -3,6 +3,11 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + # Boring backward compatibility if [ "${language:-}" == "fr" ] ; then language="fr_FR" @@ -10,58 +15,47 @@ else language="en_UK" fi -if [ -z "${password:-}" ]; -then - password="${admin_pwd}" +if [ -z "${password:-}" ]; then + password="$admin_pwd" ynh_app_setting_set --app=$app --key=password --value="$password" fi -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) +# Get rid of legacy symlinks +if [ -L "$install_dir/_data" ]; then + ynh_secure_remove "$install_dir/_data" +fi +if [ -L "$install_dir/galleries" ]; then + ynh_secure_remove "$install_dir/galleries" +fi +if [ -L "$install_dir/upload" ]; then + ynh_secure_remove "$install_dir/upload" +fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=3 -# Get rid of legacy symlinks -[ -L "$install_dir/_data" ] && ynh_secure_remove "$install_dir/_data" || true -[ -L "$install_dir/galleries" ] && ynh_secure_remove "$install_dir/galleries" || true -[ -L "$install_dir/upload" ] && ynh_secure_remove "$install_dir/upload" || true - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=3 - - ynh_setup_source --dest_dir="$install_dir" - ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin - ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin - - # We don't want to keep those in the install dir, they already are in $data_dir - if [ -d "$install_dir/_data" ] && [ ! -L "$install_dir/_data" ] - then - ynh_secure_remove "$install_dir/_data" - fi - if [ -d "$install_dir/galleries" ] && [ ! -L "$install_dir/galleries" ] - then - ynh_secure_remove "$install_dir/galleries" - fi - if [ -d "$install_dir/upload" ] && [ ! -L "$install_dir/upload" ] - then - ynh_secure_remove "$install_dir/upload" - fi +ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin +ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin +# We don't want to keep those in the install dir, they already are in $data_dir +if [ -d "$install_dir/_data" ] && [ ! -L "$install_dir/_data" ]; then + ynh_secure_remove "$install_dir/_data" +fi +if [ -d "$install_dir/galleries" ] && [ ! -L "$install_dir/galleries" ]; then + ynh_secure_remove "$install_dir/galleries" +fi +if [ -d "$install_dir/upload" ] && [ ! -L "$install_dir/upload" ]; then + ynh_secure_remove "$install_dir/upload" fi -chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" +chown -R "$app:www-data" "$data_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # PHP-FPM CONFIGURATION @@ -72,8 +66,6 @@ ynh_add_fpm_config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE #================================================= # UPGRADE APPLICATION WITH CURL #================================================= @@ -94,9 +86,8 @@ ynh_add_config --template="config.inc.php" --destination="$install_dir/local/con # Setup database in local/config/database.inc.php ynh_add_config --template="database.inc.php" --destination="$install_dir/local/config/database.inc.php" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # CONFIGURE LDAP PLUGIN @@ -104,7 +95,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Configuring LDAP plugin..." --weight=2 # Disable LDAP plugin to avoid warning messages during API call -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "DELETE FROM plugins WHERE id='Ldap_Login';" +ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "DELETE FROM plugins WHERE id='Ldap_Login';" # Activate the LDAP plugin using the WS API @@ -114,36 +105,39 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$password" # Get session token status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus") -pwg_token=$(jq --raw-output .result.pwg_token <<< $status) +pwg_token=$(jq --raw-output .result.pwg_token <<< "$status") # Activate the Ldap_Login plugin ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action=activate" "plugin=Ldap_Login" "pwg_token=$pwg_token" # Log out ynh_local_curl "/ws.php?format=json" "method=pwg.session.logout" # Edit Ldap_Login plugin configuration -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "UPDATE piwigo_ldap_login_config SET value='ou=users,dc=yunohost,dc=org' WHERE param = 'ld_basedn'; +ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "UPDATE piwigo_ldap_login_config SET value='ou=users,dc=yunohost,dc=org' WHERE param = 'ld_basedn'; UPDATE piwigo_ldap_login_config SET value='uid' WHERE param = 'ld_user_attr'; UPDATE piwigo_ldap_login_config SET value='' WHERE param = 'ld_binddn'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'allow_new_users'; UPDATE piwigo_ldap_login_config SET value='0' WHERE param = 'ld_group_user_active';" + # Remove configuration file for older plugin version -if [ -f $install_dir/plugins/Ldap_Login/data.dat ] ; then - ynh_secure_remove --file=$install_dir/plugins/Ldap_Login/data.dat +if [ -f "$install_dir/plugins/Ldap_Login/data.dat" ] ; then + ynh_secure_remove --file="$install_dir/plugins/Ldap_Login/data.dat" fi -#================================================= -# GENERIC FINALIZATION #================================================= # UPGRADE FAIL2BAN #================================================= ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=8 # Configure and activate log_failed_logins plugin -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" 2>&1 > /dev/null || ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "UPDATE plugins SET state='active' WHERE id='log_failed_logins';" -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "INSERT INTO config (param, value) VALUES ('logFailedLoginsFilename','/var/log/${app}FailedLogins.log');" 2>&1 > /dev/null || ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<< "UPDATE config SET value='/var/log/${app}FailedLogins.log' WHERE param='logFailedLoginsFilename';" +if ! ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" 2>&1 > /dev/null; then + ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "UPDATE plugins SET state='active' WHERE id='log_failed_logins';" +fi +if ! ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO config (param, value) VALUES ('logFailedLoginsFilename','/var/log/${app}FailedLogins.log');" 2>&1 > /dev/null; then + ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" <<< "UPDATE config SET value='/var/log/${app}FailedLogins.log' WHERE param='logFailedLoginsFilename';" +fi touch "/var/log/${app}FailedLogins.log" -chown $app: "/var/log/${app}FailedLogins.log" +chown "$app:" "/var/log/${app}FailedLogins.log" ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex="ip=" --max_retry=6 From af96ff8b180470a9962f4e3a50007ce092138d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 22 Mar 2024 22:26:40 +0100 Subject: [PATCH 41/45] Handle already existing data_dir --- scripts/install | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 3f7cf11..f210311 100644 --- a/scripts/install +++ b/scripts/install @@ -29,9 +29,22 @@ chown -R "$app:www-data" "$install_dir" #================================================= ynh_script_progression --message="Initializing data directory..." --weight=1 -mv "$install_dir/_data" "$data_dir/_data" -mv "$install_dir/upload" "$data_dir/upload" -mv "$install_dir/galleries" "$data_dir/galleries" +# Move data dirs to $data_dir unless they already exist +if [ -d "$install_dir/_data" ]; then + ynh_secure_remove "$install_dir/_data" +else + mv "$install_dir/_data" "$data_dir/_data" +fi +if [ -d "$install_dir/galleries" ]; then + ynh_secure_remove "$install_dir/galleries" +else + mv "$install_dir/galleries" "$data_dir/galleries" +fi +if [ -d "$install_dir/upload" ]; then + ynh_secure_remove "$install_dir/upload" +else + mv "$install_dir/upload" "$data_dir/upload" +fi chmod -R o-rwx "$data_dir" chown -R "$app:www-data" "$data_dir" From b36761202337863067f0125709056fe981921b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 22 Mar 2024 23:21:21 +0100 Subject: [PATCH 42/45] Reorder sources, add autoupdate --- manifest.toml | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8a2f22c..1cbd09a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -57,22 +57,26 @@ ram.runtime = "50M" type = "password" [resources] - [resources.sources] - [resources.sources.ldap_plugin] - url = "https://piwigo.org/ext/download.php?rid=7036" - sha256 = "3c22652f6c0653aaeebe239435796748ee57612ad44e8e5f2553277545d36e5e" - format = "zip" + [resources.sources.main] + url = "https://piwigo.org/download/dlcounter.php?code=14.3.0" + sha256 = "ab1d329afbb092ef74534bc09f56ef75a81d26443383e6ae47fe9801808552ef" + format = "zip" - [resources.sources.main] - url = "https://piwigo.org/download/dlcounter.php?code=14.3.0" - sha256 = "ab1d329afbb092ef74534bc09f56ef75a81d26443383e6ae47fe9801808552ef" - format = "zip" + autoupdate.strategy = "latest_github_release" - [resources.sources.log_failed_logins_plugin] - url = "http://piwigo.org/ext/download.php?rid=5525" - sha256 = "85b9a06f2c7ca8ae9698e6151c7631f519c945f696b02da72f9ff53243d7e4ca" - in_subdir = false - format = "zip" + [resources.sources.ldap_plugin] + url = "https://piwigo.org/ext/download.php?rid=7036" + sha256 = "3c22652f6c0653aaeebe239435796748ee57612ad44e8e5f2553277545d36e5e" + format = "zip" + + autoupdate.upstream = "https://github.com/kipjr/ldap_login" + autoupdate.strategy = "latest_github_release" + + [resources.sources.log_failed_logins_plugin] + url = "http://piwigo.org/ext/download.php?rid=5525" + sha256 = "85b9a06f2c7ca8ae9698e6151c7631f519c945f696b02da72f9ff53243d7e4ca" + in_subdir = false + format = "zip" [resources.system_user] allow_email = true @@ -85,7 +89,16 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "mariadb-server, imagemagick, php8.0-gd, php8.0-imagick, php8.0-xml, php8.0-mbstring, php8.0-mysqli, php8.0-ldap" + packages = [ + "mariadb-server", + "imagemagick", + "php8.0-gd", + "php8.0-imagick", + "php8.0-xml", + "php8.0-mbstring", + "php8.0-mysqli", + "php8.0-ldap", + ] [resources.database] type = "mysql" From fddc62251472f505d686b505f9e3c4b150b9a8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 22 Mar 2024 23:27:34 +0100 Subject: [PATCH 43/45] Fix test_upgrade_from args --- tests.toml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/tests.toml b/tests.toml index d56778a..be7aa44 100644 --- a/tests.toml +++ b/tests.toml @@ -8,17 +8,23 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925.name = "Upgrade from 12.0.0" - test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925.args.domain = "domain.tld" - test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925.args.language = "en" - test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925.args.admin = "package_checker" + [default.test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925] + name = "Upgrade from 12.0.0" + args.domain = "domain.tld" + args.path = "/" + args.language = "en" + args.admin = "package_checker" - test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91.name = "Upgrade from 12.1.0" - test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91.args.domain = "domain.tld" - test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91.args.language = "en" - test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91.args.admin = "package_checker" + [default.test_upgrade_from.cd09a41142c55f4d4c0e654574ccb3e9d1ad3f91] + name = "Upgrade from 12.1.0" + args.domain = "domain.tld" + args.path = "/" + args.language = "en" + args.admin = "package_checker" - test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.name = "Upgrade from 13.1.0" - test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.domain = "domain.tld" - test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.language = "en" - test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7.args.admin = "package_checker" + [default.test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7] + name = "Upgrade from 13.1.0" + args.domain = "domain.tld" + args.path = "/" + args.language = "en" + args.admin = "package_checker" From a1d68a915c3b53dff45db15dd132538ab201eb7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sat, 23 Mar 2024 00:00:04 +0100 Subject: [PATCH 44/45] Uniformize data_dir creation --- scripts/_common.sh | 10 ++++++++++ scripts/install | 24 ++---------------------- scripts/upgrade | 22 +--------------------- 3 files changed, 13 insertions(+), 43 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..0e701fc 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,6 +8,16 @@ # PERSONAL HELPERS #================================================= +_create_data_dirs_if_required() { + dirs=(_data galleries upload) + for dir in "${dirs[@]}"; do + if [ ! -d "$data_dir/$dir" ]; then + rsync -a "$install_dir/$dir/" "$data_dir/$dir/" + fi + ynh_secure_remove "$install_dir/$dir" + done +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index f210311..719d0af 100644 --- a/scripts/install +++ b/scripts/install @@ -21,31 +21,11 @@ ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin +_create_data_dirs_if_required + chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" -#================================================= -# CONFIGURE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Initializing data directory..." --weight=1 - -# Move data dirs to $data_dir unless they already exist -if [ -d "$install_dir/_data" ]; then - ynh_secure_remove "$install_dir/_data" -else - mv "$install_dir/_data" "$data_dir/_data" -fi -if [ -d "$install_dir/galleries" ]; then - ynh_secure_remove "$install_dir/galleries" -else - mv "$install_dir/galleries" "$data_dir/galleries" -fi -if [ -d "$install_dir/upload" ]; then - ynh_secure_remove "$install_dir/upload" -else - mv "$install_dir/upload" "$data_dir/upload" -fi - chmod -R o-rwx "$data_dir" chown -R "$app:www-data" "$data_dir" diff --git a/scripts/upgrade b/scripts/upgrade index cb924a5..107fed7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,17 +20,6 @@ if [ -z "${password:-}" ]; then ynh_app_setting_set --app=$app --key=password --value="$password" fi -# Get rid of legacy symlinks -if [ -L "$install_dir/_data" ]; then - ynh_secure_remove "$install_dir/_data" -fi -if [ -L "$install_dir/galleries" ]; then - ynh_secure_remove "$install_dir/galleries" -fi -if [ -L "$install_dir/upload" ]; then - ynh_secure_remove "$install_dir/upload" -fi - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -40,16 +29,7 @@ ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir/plugins/Ldap_Login" --source_id=ldap_plugin ynh_setup_source --dest_dir="$install_dir/plugins" --source_id=log_failed_logins_plugin -# We don't want to keep those in the install dir, they already are in $data_dir -if [ -d "$install_dir/_data" ] && [ ! -L "$install_dir/_data" ]; then - ynh_secure_remove "$install_dir/_data" -fi -if [ -d "$install_dir/galleries" ] && [ ! -L "$install_dir/galleries" ]; then - ynh_secure_remove "$install_dir/galleries" -fi -if [ -d "$install_dir/upload" ] && [ ! -L "$install_dir/upload" ]; then - ynh_secure_remove "$install_dir/upload" -fi +_create_data_dirs_if_required chmod -R o-rwx "$data_dir" chown -R "$app:www-data" "$data_dir" From 8811f6919d2761926b6ebc77f473ecc2f7bc1943 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 22 Mar 2024 23:01:06 +0000 Subject: [PATCH 45/45] Auto-update READMEs --- ALL_README.md | 8 ++++++++ README.md | 47 ++++++++++++++++++++++++----------------------- README_fr.md | 35 ++++++++++++++++++----------------- 3 files changed, 50 insertions(+), 40 deletions(-) create mode 100644 ALL_README.md diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..b412b5e --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,8 @@ +# All available README files by language + +[Read the README in English](README.md) + + +* [Lire le README en français](README_fr.md) + + diff --git a/README.md b/README.md index 3da496b..544d001 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,45 @@ -# Piwigo for YunoHost +# Piwigo pour YunoHost -[![Integration level](https://dash.yunohost.org/integration/piwigo.svg)](https://dash.yunohost.org/appci/app/piwigo) ![Working status](https://ci-apps.yunohost.org/ci/badges/piwigo.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/piwigo.maintain.svg) +[![Niveau d'intégration ](https://dash.yunohost.org/integration/piwigo.svg)](https://dash.yunohost.org/appci/app/piwigo) ![Status du fonctionnement](https://ci-apps.yunohost.org/ci/badges/piwigo.status.svg) ![Statut demaintenance](https://ci-apps.yunohost.org/ci/badges/piwigo.maintain.svg) -[![Install Piwigo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=piwigo) +[![Installer Piwigo avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=piwigo) -*[Lire ce readme en français.](./README_fr.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *This package allows you to install Piwigo quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* +> *Ce package vous permet d’installer Piwigo rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Overview +## Vue d'ensemble Piwigo is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. -**Shipped version:** 14.3.0~ynh1 +**Version incluse :** 14.3.0~ynh1 -**Demo:** +**Démo:** -## Screenshots +## Captures d'écran -![Screenshot of Piwigo](./doc/screenshots/screenshot_Piwigo.jpg) +![Capture d'écran de Piwigo](./doc/screenshots/screenshot_Piwigo.jpg) -## Documentation and resources +## Documentations et ressources -- Official app website: -- Official admin documentation: -- Upstream app code repository: -- YunoHost Store: -- Report a bug: +- Site officiel de l’app : +- Documentation officielle de l'admin +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : -## Developer info +## Informations pour les développeurs -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing). +Merci de faire vos pull request sur la [branche branch](https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing), -To try the testing branch, please proceed like that. + +Pour essayer la branche testing, procédez comme suit. ```bash sudo yunohost app install https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing --debug @@ -46,4 +47,4 @@ or sudo yunohost app upgrade piwigo -u https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing --debug ``` -**More info regarding app packaging:** +**Plus d'infos sur le packaging d'applications :** diff --git a/README_fr.md b/README_fr.md index 81767bc..390ffa1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,49 +1,50 @@ # Piwigo pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/piwigo.svg)](https://dash.yunohost.org/appci/app/piwigo) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/piwigo.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/piwigo.maintain.svg) +[![Niveau d'intégration ](https://dash.yunohost.org/integration/piwigo.svg)](https://dash.yunohost.org/appci/app/piwigo) ![Status du fonctionnement](https://ci-apps.yunohost.org/ci/badges/piwigo.status.svg) ![Statut demaintenance](https://ci-apps.yunohost.org/ci/badges/piwigo.maintain.svg) [![Installer Piwigo avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=piwigo) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* > *Ce package vous permet d’installer Piwigo rapidement et simplement sur un serveur YunoHost. Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d’ensemble +## Vue d'ensemble Piwigo est un logiciel de galerie photo pour le web, construit par une communauté active d'utilisateurs et de développeurs. Des extensions rendent Piwigo facilement personnalisable. -**Version incluse :** 14.3.0~ynh1 +**Version incluse :** 14.3.0~ynh1 -**Démo :** +**Démo:** -## Captures d’écran +## Captures d'écran -![Capture d’écran de Piwigo](./doc/screenshots/screenshot_Piwigo.jpg) +![Capture d'écran de Piwigo](./doc/screenshots/screenshot_Piwigo.jpg) ## Documentations et ressources -- Site officiel de l’app : -- Documentation officielle de l’admin : -- Dépôt de code officiel de l’app : -- YunoHost Store : -- Signaler un bug : +- Site officiel de l’app : +- Documentation officielle de l'admin +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing). +Merci de faire vos pull request sur la [branche branch](https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing), + Pour essayer la branche testing, procédez comme suit. ```bash sudo yunohost app install https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing --debug -ou +or sudo yunohost app upgrade piwigo -u https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** +**Plus d'infos sur le packaging d'applications :**