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 1480e4d..544d001 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,50 @@ -# 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](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. + +**Version incluse :** 14.3.0~ynh1 + +**Démo:** + +## Captures d'écran + +![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 : + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche branch](https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing), -**Shipped version:** 14.3.0~ynh1 +Pour essayer la branche testing, procédez comme suit. -**Demo:** https://piwigo.org/demo - -## Screenshots - -![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: -* Official admin documentation: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: - -## Developer info - -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/piwigo_ynh/tree/testing). - -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 ``` -**More info regarding app packaging:** \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** diff --git a/README_fr.md b/README_fr.md index a1fe06b..390ffa1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,62 +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](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 :** 14.3.0~ynh1 -**Version incluse :** 14.3.0~ynh1 +**Démo:** -**Démo :** https://piwigo.org/demo +## Captures d'écran -## Captures d’écran - -![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). +![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 +```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 :** \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** 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/conf/app.src b/conf/app.src deleted file mode 100644 index a7ba486..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://piwigo.org/download/dlcounter.php?code=14.3.0 -SOURCE_SUM=ab1d329afbb092ef74534bc09f56ef75a81d26443383e6ae47fe9801808552ef -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true 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/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/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/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/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/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.json b/manifest.json deleted file mode 100644 index 9e1b9d3..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": "14.3.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 new file mode 100644 index 0000000..1cbd09a --- /dev/null +++ b/manifest.toml @@ -0,0 +1,104 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + +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 = "14.3.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" + +[integration] +yunohost = ">= 11.2" +architectures = "all" +multi_instance = true + +ldap = true + +sso = true + +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" + +[install] + [install.domain] + type = "domain" + + [install.path] + 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 = "select" + choices = ["fr_FR", "en_UK"] + default = "en_UK" + + [install.admin] + type = "user" + + [install.password] + type = "password" + +[resources] + [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.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 + + [resources.install_dir] + + [resources.data_dir] + + [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 8f61cb4..0e701fc 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,52 +4,24 @@ # COMMON VARIABLES #================================================= -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" - #================================================= # 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 #================================================= -# 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")" -} +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= diff --git a/scripts/backup b/scripts/backup index 95422cc..82ac839 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,26 +8,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 -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -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) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -39,30 +17,22 @@ 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 +# 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 58c7fa5..a121ebc 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC STARTING #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,81 +7,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -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) - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - -#================================================= -# STANDARD MODIFICATIONS #================================================= # MODIFY URL IN NGINX CONF #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 -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" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - 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 - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - -#================================================= -# GENERIC FINALISATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." - -ynh_systemd_action --service_name=nginx --action=reload +ynh_change_url_nginx_config #================================================= # END OF SCRIPT 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 diff --git a/scripts/install b/scripts/install index b07cb4a..719d0af 100644 --- a/scripts/install +++ b/scripts/install @@ -1,217 +1,79 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= -# MANAGE SCRIPT FAILURE +# INITIALIZE AND STORE SETTINGS #================================================= -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors +mail="$(ynh_user_get_info --username=$admin --key=mail)" -#================================================= -# 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 - -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 -#================================================= -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" - -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -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 -ynh_app_setting_set --app=$app --key=language --value=$language -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 -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=40 - -ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -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 +# 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 #================================================= ynh_script_progression --message="Setting up source files..." --weight=5 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +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 tmp directory and fetch app inside -tmpdir="$(ynh_smart_mktemp --min_size=300)" -ynh_setup_source --dest_dir="$tmpdir" +_create_data_dirs_if_required -# 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 +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" -# sets extended pattern matching options in the bash shell -shopt -s extglob - -# Install files and set permissions -mkdir $final_path -cp -a $tmpdir/!(upload|_data|galleries) $final_path - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod -R o-rwx "$data_dir" +chown -R "$app:www-data" "$data_dir" #================================================= -# PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATIONS #================================================= -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 --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." - -# Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." - -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir - -mkdir -p $datadir/_data -mkdir -p $datadir/upload -mkdir -p $datadir/galleries - -ln -sd $datadir/_data $final_path/_data -ln -sd $datadir/upload $final_path/upload -ln -sd $datadir/galleries $final_path/galleries - -cp -Rp $tmpdir/_data/. $final_path/_data -cp -Rp $tmpdir/upload/. $final_path/upload -cp -Rp $tmpdir/galleries/. $final_path/galleries - -ynh_secure_remove --file="$tmpdir" - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # SETUP APPLICATION WITH CURL #================================================= 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" - -# Reload NGINX -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 - 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=$adm_pwd" "admin_pass2=$adm_pwd" "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 #================================================= -ynh_script_progression --message="Configuring Piwigo..." +ynh_script_progression --message="Configuring $app..." --weight=2 # Change local config -ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/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="$final_path/local/config/database.inc.php" +ynh_add_config --template="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 -R o-rwx "$install_dir" +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 # 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) +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 @@ -220,15 +82,12 @@ 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'; 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" - #================================================= # GENERIC FINALIZATION #================================================= @@ -237,34 +96,14 @@ ynh_permission_update --permission="main" --remove="visitors" 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 -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." - -# Make app public if necessary -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" -fi - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 75ef24b..1512187 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,90 +7,17 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." - -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) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -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 - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -#================================================= -# 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 - ynh_secure_remove --file="$datadir" -fi - #================================================= # 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 PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." - -# Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -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 -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." - -# Delete a system user -ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 645e07e..f492243 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,129 +8,54 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=2 - -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 - -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -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 - -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -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" - #================================================= # 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 -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 - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - -#================================================= -# RESTORE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=7 - -touch "/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 - -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=40 - -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# 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" - -# 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" +chown -R "$app:www-data" "$data_dir" #================================================= # RESTORE THE MYSQL DATABASE #================================================= 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 -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 #================================================= -# GENERIC FINALIZATION +# 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" + +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 + #================================================= # 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 d3bfc99..107fed7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,301 +1,126 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 - -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 - -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) - -#================================================= -# CHECK VERSION -#================================================= - -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 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# 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 +# Boring backward compatibility +if [ "${language:-}" == "fr" ] ; then + language="fr_FR" +else + language="en_UK" 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 +if [ -z "${password:-}" ]; then + password="$admin_pwd" + ynh_app_setting_set --app=$app --key=password --value="$password" 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 - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - 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 -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 -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 -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 $final_path - hashed_password=$(cd $final_path ; php hash_password.php $admin_pwd) - - # Update password hash in database - 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" - - # Remove the temporary hash generation script - ynh_secure_remove --file="$final_path/hash_password.php" -fi - -# Use path instead of path_url in settings.yml... -if [ -z "$path_url" ] -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 -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=3 -# sets extended pattern matching options in the bash shell -shopt -s extglob +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 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=3 +_create_data_dirs_if_required - # Create tmp directory and fetch app inside - tmpdir="$(ynh_smart_mktemp --min_size=300)" - ynh_setup_source --dest_dir="$tmpdir" +chmod -R o-rwx "$data_dir" +chown -R "$app:www-data" "$data_dir" - # 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 - - # Install files and set permissions - cp -a $tmpdir/!(upload|_data|galleries) $final_path - - # 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 - 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 - fi - - ynh_secure_remove --file="$tmpdir" -fi - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=6 - -ynh_install_app_dependencies $pkg_dependencies +chmod -R o-rwx "$install_dir" +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 --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 - -# Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE #================================================= # UPGRADE APPLICATION WITH CURL #================================================= 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 -ynh_local_curl "/upgrade.php?language=$applanguage&now=true" "language=$applanguage" "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=$password" #================================================= # CONFIGURE PIWIGO #================================================= -ynh_script_progression --message="Configuring Piwigo..." +ynh_script_progression --message="Configuring $app..." --weight=2 # Change local config -ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/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="$final_path/local/config/database.inc.php" +ynh_add_config --template="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 -R o-rwx "$install_dir" +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';" +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 # Login with admin account -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=$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 $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 + 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 -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -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..be7aa44 --- /dev/null +++ b/tests.toml @@ -0,0 +1,30 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + +test_format = 1.0 + +[default] + + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + [default.test_upgrade_from.bc9ab6f21a7dcaab9245ef5cbfc9d6c4bd026925] + name = "Upgrade from 12.0.0" + args.domain = "domain.tld" + args.path = "/" + args.language = "en" + 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" + + [default.test_upgrade_from.1cac04c39ba70cef6571bcb9ae4afca5ccb48ca7] + name = "Upgrade from 13.1.0" + args.domain = "domain.tld" + args.path = "/" + args.language = "en" + args.admin = "package_checker"