From d49179dd06ffef3f27d53ac246300d2587625bd0 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 25 Jan 2019 19:29:39 +0100 Subject: [PATCH 01/16] Add ynh_print_info example --- scripts/install | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/install b/scripts/install index d0fff64..48249d8 100755 --- a/scripts/install +++ b/scripts/install @@ -46,6 +46,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= +ynh_print_info "Validating arguments ..." ### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" @@ -62,6 +63,7 @@ ynh_webpath_register $app $domain $path_url # STORE SETTINGS FROM MANIFEST #================================================= +ynh_print_info "Starting example app installation ..." ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path_url ynh_app_setting_set $app admin $admin @@ -79,6 +81,7 @@ ynh_app_setting_set $app language $language ### If you're not using these lines: ### - Remove the section "CLOSE A PORT" in the remove script +ynh_print_info "Configuring firewall ..." # Find a free port port=$(ynh_find_port 8095) # Open this port @@ -96,6 +99,7 @@ ynh_app_setting_set $app port $port ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script +ynh_print_info "Installing dependencies ..." ynh_install_app_dependencies deb1 deb2 #================================================= @@ -111,6 +115,7 @@ ynh_install_app_dependencies deb1 deb2 ### - Remove also the section "REMOVE THE MYSQL DATABASE" in the remove script ### - As well as the section "RESTORE THE MYSQL DATABASE" in the restore script +ynh_print_info "Ininitializing database ..." db_name=$(ynh_sanitize_dbid $app) ynh_app_setting_set $app db_name $db_name ynh_mysql_setup_db $db_name $db_name @@ -123,6 +128,7 @@ ynh_mysql_setup_db $db_name $db_name ### downloaded from an upstream source, like a git repository. ### `ynh_setup_source` use the file conf/app.src +ynh_print_info "Setting up source files ..." ynh_app_setting_set $app final_path $final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" @@ -133,6 +139,7 @@ ynh_setup_source "$final_path" ### `ynh_add_nginx_config` will use the file conf/nginx.conf +ynh_print_info "Configuring nginx ..." # Create a dedicated nginx config ynh_add_nginx_config @@ -141,6 +148,7 @@ ynh_add_nginx_config #================================================= # Create a system user +ynh_print_info "Configuring system user ..." ynh_system_user_create $app #================================================= @@ -159,6 +167,7 @@ ynh_system_user_create $app ### - And the section "PHP-FPM CONFIGURATION" in the upgrade script # Create a dedicated php-fpm config +ynh_print_info "Configuring php-fpm ..." ynh_add_fpm_config #================================================= @@ -183,6 +192,7 @@ ynh_add_fpm_config ### - And the section "SETUP SYSTEMD" in the upgrade script # Create a dedicated systemd config +ynh_print_info "Configuring systemd service ..." ynh_add_systemd_config #================================================= @@ -198,6 +208,7 @@ ynh_add_systemd_config chown -R $app: $final_path # Set the app as temporarily public for curl call +ynh_print_info "Configuring ssowat ..." ynh_app_setting_set $app skipped_uris "/" # Reload SSOwat config yunohost app ssowatconf @@ -206,6 +217,7 @@ yunohost app ssowatconf systemctl reload nginx # Installation with curl +ynh_print_info "Finalizing install ..." ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" # Remove the public access @@ -260,6 +272,7 @@ chown -R root: $final_path ### - And the section "SETUP LOGROTATE" in the upgrade script # Use logrotate to manage application logfile(s) +ynh_print_info "Configuring log rotation ..." ynh_use_logrotate #================================================= @@ -293,4 +306,5 @@ fi # RELOAD NGINX #================================================= +ynh_print_info "Reloading nginx ..." systemctl reload nginx From 21c24f8d1f9159e46bcc229bd6ec8f3024c84a0f Mon Sep 17 00:00:00 2001 From: JimboJoe Date: Fri, 25 Jan 2019 22:17:37 +0100 Subject: [PATCH 02/16] Small typo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 48249d8..de64063 100755 --- a/scripts/install +++ b/scripts/install @@ -115,7 +115,7 @@ ynh_install_app_dependencies deb1 deb2 ### - Remove also the section "REMOVE THE MYSQL DATABASE" in the remove script ### - As well as the section "RESTORE THE MYSQL DATABASE" in the restore script -ynh_print_info "Ininitializing database ..." +ynh_print_info "Initializing database ..." db_name=$(ynh_sanitize_dbid $app) ynh_app_setting_set $app db_name $db_name ynh_mysql_setup_db $db_name $db_name From 1abba7693fe7e70226fcb2ef7910f72d4cd0692e Mon Sep 17 00:00:00 2001 From: Yalh Date: Mon, 28 Jan 2019 00:21:25 +0100 Subject: [PATCH 03/16] README.md translation in French --- README.md | 2 ++ README_fr.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 README_fr.md diff --git a/README.md b/README.md index 65030f9..3d646ce 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ [![Integration level](https://dash.yunohost.org/integration/REPLACEBYYOURAPP.svg)](https://dash.yunohost.org/appci/app/REPLACEBYYOURAPP) [![Install REPLACEBYYOURAPP with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=REPLACEBYYOURAPP) +*[Lire ce readme en français.](./README_fr.md)* + > *This package allow you to install REPLACEBYYOURAPP quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..1884e37 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,84 @@ +# Usage of this package (REMOVE THIS SECTION BEFORE RELEASE) +- Copy this app before working on it. +- Edit `conf/nginx.conf` file to match application prerequisites. +- Edit `manifest.json` with application specific information. +- Edit the `install`, `upgrade`, `remove`, `backup`, and `restore` scripts. +- Add a `LICENSE` file for the package. +- Edit `README.md`. + +# App exemple pour YunoHost + +[![Integration level](https://dash.yunohost.org/integration/REPLACEBYYOURAPP.svg)](https://dash.yunohost.org/appci/app/REPLACEBYYOURAPP) +[![Install REPLACEBYYOURAPP with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=REPLACEBYYOURAPP) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer REPLACEBYYOURAPP rapidement et simplement sur un serveur Yunohost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installe ret en profiter.* + +## Vue d'ensemble +Description rapide de cette application. + +**Version incluse:** 1.0 + +## Captures d'écran + +![](Lien vers une capture d'écran pour cette application) + +## Démo + +* [Démo officielle](Lien vers un site de démonstration pour cette application) + +## Configuration + +Comment configurer cette application: via le panneau d'administration, un fichier brut en SSH ou tout autre moyen. + +## Documentation + + * Documentation officielle: Lien vers la documentation officielle de cette application + * Documentation YunoHost: Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer. + +## Caractéristiques spécifiques YunoHost + +#### Support multi-utilisateurs + +L'authentification LDAP et HTTP est-elle prise en charge? +L'application peut-elle être utilisée par plusieurs utilisateurs? + +#### Supported architectures + +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/REPLACEBYYOURAPP/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/REPLACEBYYOURAPP/) +* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/REPLACEBYYOURAPP%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/REPLACEBYYOURAPP/) + +## Limitations + +* Limitations connues. + +## Informations additionnelles + +* Autres informations à ajouter sur cette application + +**Plus d'informations sur la page de documentation:** +https://yunohost.org/packaging_apps + +## Links + + * Signaler un bug: https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/issues + * Site de l'application: Lien vers le site officiel de cette application + * Site web YunoHost: https://yunohost.org/ + +--- + +Informations pour les développeurs +---------------- + +**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug +ou +sudo yunohost app upgrade REPLACEBYYOURAPP -u https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug +``` From f351b8c9c92aa72eac235a4e4d1d1b9906f9997d Mon Sep 17 00:00:00 2001 From: Yalh Date: Mon, 28 Jan 2019 00:23:00 +0100 Subject: [PATCH 04/16] Correction --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 1884e37..a27b42c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ *[Read this readme in english.](./README.md)* > *Ce package vous permet d'installer REPLACEBYYOURAPP rapidement et simplement sur un serveur Yunohost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installe ret en profiter.* +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble Description rapide de cette application. From b50d8f6960b37156854361ad4540f264fe6cb456 Mon Sep 17 00:00:00 2001 From: Yalh Date: Mon, 28 Jan 2019 00:24:25 +0100 Subject: [PATCH 05/16] clean up README_fr.md --- README.md | 2 +- README_fr.md | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 3d646ce..4cf70e0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ - Edit `manifest.json` with application specific information. - Edit the `install`, `upgrade`, `remove`, `backup`, and `restore` scripts. - Add a `LICENSE` file for the package. -- Edit `README.md`. +- Edit `README.md` and README_fr.md. # Example app for YunoHost diff --git a/README_fr.md b/README_fr.md index a27b42c..747f706 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,11 +1,3 @@ -# Usage of this package (REMOVE THIS SECTION BEFORE RELEASE) -- Copy this app before working on it. -- Edit `conf/nginx.conf` file to match application prerequisites. -- Edit `manifest.json` with application specific information. -- Edit the `install`, `upgrade`, `remove`, `backup`, and `restore` scripts. -- Add a `LICENSE` file for the package. -- Edit `README.md`. - # App exemple pour YunoHost [![Integration level](https://dash.yunohost.org/integration/REPLACEBYYOURAPP.svg)](https://dash.yunohost.org/appci/app/REPLACEBYYOURAPP) From 4da7d3fd1d3d51dec0967281406112e1f745d374 Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 28 Jan 2019 01:51:49 +0100 Subject: [PATCH 06/16] [fix] fpm file with the new version of php --- conf/php-fpm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 58ab5e2..e7b169b 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -30,7 +30,7 @@ group = __USER__ ; specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php5-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. A value of '-1' means unlimited. ; Default Value: 128 (-1 on FreeBSD and OpenBSD) From 31676484e3dd97ed3f6a3bb9e2c909a12321559b Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 28 Jan 2019 09:27:08 +0100 Subject: [PATCH 07/16] [fix] nginx confirm with the new PHP version --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index c7536cb..f2277ea 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -18,7 +18,7 @@ location __PATH__/ { try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php5-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; From 4bb89dd162c2b306d0a4fb831797520deea857de Mon Sep 17 00:00:00 2001 From: Yalh Date: Mon, 28 Jan 2019 19:52:26 +0100 Subject: [PATCH 08/16] Log personalization for ADMIN PANEL according default systemd.service value for logs --- scripts/install | 4 ++-- scripts/restore | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index d0fff64..d469b60 100755 --- a/scripts/install +++ b/scripts/install @@ -274,9 +274,9 @@ ynh_use_logrotate ### - Remove the section "REMOVE SERVICE FROM ADMIN PANEL" in the remove script ### - As well as the section ADVERTISE SERVICE IN ADMIN PANEL" in the restore script -yunohost service add $app --log "/var/log/$app/APP.log" +yunohost service add $app --log "/var/log/$app/$app.log" # if using yunohost version 3.2 or more in the 'manifest.json', a description can be added -#yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/APP.log" +#yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/$app.log" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index d629496..fa45675 100755 --- a/scripts/restore +++ b/scripts/restore @@ -102,7 +102,7 @@ systemctl enable $app.service # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add $app --log "/var/log/$app/APP.log" +yunohost service add $app --log "/var/log/$app/$app.log" #================================================= # RESTORE THE CRON FILE From cadde232c4d5537d53850d6bcf968511f8a1bba8 Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 30 Jan 2019 00:32:05 +0100 Subject: [PATCH 09/16] conf file with new version --- conf/php-fpm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index e7b169b..00f6812 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -355,7 +355,7 @@ catch_workers_output = yes ; exectute php code. ; Note: set an empty value to allow all extensions. ; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 +;security.limit_extensions = .php .php3 .php4 .php5 .php7 ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from ; the current environment. From c6ebdd1a8d84f76f2039415fcfce8500c885fe76 Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 30 Jan 2019 00:32:16 +0100 Subject: [PATCH 10/16] manifest with new version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a807cbf..96e8293 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "multi_instance": true, "services": [ "nginx", - "php5-fpm", + "php7.0-fpm", "mysql" ], "arguments": { From 88b948f4f376aade6c0d305c6c924e0c92b2162a Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 30 Jan 2019 00:32:36 +0100 Subject: [PATCH 11/16] scripts with new version --- scripts/backup | 2 +- scripts/restore | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/backup b/scripts/backup index c92c1d0..3e47cf2 100755 --- a/scripts/backup +++ b/scripts/backup @@ -48,7 +48,7 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup "/etc/php5/fpm/pool.d/$app.conf" +ynh_backup "/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/restore b/scripts/restore index d629496..605858b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -80,7 +80,7 @@ chown -R root: $final_path # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf" +ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # SPECIFIC RESTORATION @@ -122,5 +122,5 @@ ynh_restore_file "/etc/logrotate.d/$app" # RELOAD NGINX AND PHP-FPM #================================================= -systemctl reload php5-fpm +systemctl reload php7.0-fpm systemctl reload nginx From 92a4b25310d3176e224e903a196607420d7981fc Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 30 Jan 2019 11:41:59 +0100 Subject: [PATCH 12/16] Update to the php7 default pool file --- conf/php-fpm.conf | 91 ++++++++++++++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 32 deletions(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 00f6812..aff55a1 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -1,10 +1,11 @@ ; Start a new pool named 'www'. -; the variable $pool can we used in any directive and will be replaced by the +; the variable $pool can be used in any directive and will be replaced by the ; pool name ('www' here) [__NAMETOCHANGE__] ; Per pool prefix ; It only applies on the following directives: +; - 'access.log' ; - 'slowlog' ; - 'listen' (unixsocket) ; - 'chroot' @@ -24,28 +25,35 @@ group = __USER__ ; The address on which to accept FastCGI requests. ; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; -; 'port' - to listen on a TCP socket to all addresses on a -; specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock +listen = /run/php/php7.0-fpm-__NAMETOCHANGE__.sock -; Set listen(2) backlog. A value of '-1' means unlimited. -; Default Value: 128 (-1 on FreeBSD and OpenBSD) -;listen.backlog = 128 +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 ; Set permissions for unix socket, if one is used. In Linux, read/write ; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. +; BSD-derived systems allow connections regardless of permissions. ; Default Values: user and group are set as the running user ; mode is set to 0660 listen.owner = www-data listen.group = www-data ;listen.mode = 0660 - -; List of ipv4 addresses of FastCGI clients which are allowed to connect. +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address ; must be separated by a comma. If this value is left blank, connections will be @@ -59,7 +67,13 @@ listen.group = www-data ; - The pool processes will inherit the master process priority ; unless it specified otherwise ; Default Value: no set -; priority = -19 +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes ; Choose how the process manager will control the number of child processes. ; Possible Values: @@ -96,7 +110,7 @@ pm = dynamic ; forget to tweak pm.* to fit your needs. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' ; Note: This value is mandatory. -pm.max_children = 10 +pm.max_children = 5 ; The number of child processes created on startup. ; Note: Used only when pm is set to 'dynamic' @@ -117,12 +131,12 @@ pm.max_spare_servers = 3 ; Note: Used only when pm is set to 'ondemand' ; Default Value: 10s ;pm.process_idle_timeout = 10s; - + ; The number of requests each child process should execute before respawning. ; This can be useful to work around memory leaks in 3rd party libraries. For ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; Default Value: 0 -pm.max_requests = 500 +;pm.max_requests = 500 ; The URI to view the FPM status page. If this value is not set, no URI will be ; recognized as a status page. It shows the following informations: @@ -170,7 +184,7 @@ pm.max_requests = 500 ; ; By default the status page only outputs short status. Passing 'full' in the ; query string will also return status for each pool process. -; Example: +; Example: ; http://www.foo.bar/status?full ; http://www.foo.bar/status?json&full ; http://www.foo.bar/status?html&full @@ -215,7 +229,7 @@ pm.max_requests = 500 ; last request memory: 0 ; ; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: ${prefix}/share/fpm/status.html +; It's available in: /usr/share/php/7.0/fpm/status.html ; ; Note: The value must start with a leading slash (/). The value can be ; anything, but it may not be a good idea to use the .php extension or it @@ -275,7 +289,7 @@ pm.max_requests = 500 ; - %{megabytes}M ; - %{mega}M ; %n: pool name -; %o: ouput header +; %o: output header ; it must be associated with embraces to specify the name of the header: ; - %{Content-Type}o ; - %{X-Powered-By}o @@ -283,7 +297,7 @@ pm.max_requests = 500 ; - .... ; %p: PID of the child that serviced the request ; %P: PID of the parent of the child that serviced the request -; %q: the query string +; %q: the query string ; %Q: the '?' character if query string exists ; %r: the request URI (without the query string, see %q and %Q) ; %R: remote IP address @@ -291,47 +305,51 @@ pm.max_requests = 500 ; %t: server time the request was received ; it can accept a strftime(3) format: ; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t ; %T: time the log has been written (the request has finished) ; it can accept a strftime(3) format: ; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t ; %u: remote user ; ; Default: "%R - %u %t \"%m %r\" %s" ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - + ; The log file for slow requests ; Default Value: not set ; Note: slowlog is mandatory if request_slowlog_timeout is set -slowlog = /var/log/nginx/__NAMETOCHANGE__.slow.log - +;slowlog = log/$pool.log.slow + ; The timeout for serving a single request after which a PHP backtrace will be ; dumped to the 'slowlog' file. A value of '0s' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 -request_slowlog_timeout = 5s - +;request_slowlog_timeout = 0 + ; The timeout for serving a single request after which the worker process will ; be killed. This option should be used when the 'max_execution_time' ini option ; does not stop script execution for some reason. A value of '0' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 request_terminate_timeout = 1d - + ; Set open file descriptor rlimit. ; Default Value: system defined value ;rlimit_files = 1024 - + ; Set max core size rlimit. ; Possible Values: 'unlimited' or an integer greater or equal to 0 ; Default Value: system defined value ;rlimit_core = 0 - + ; Chroot to this directory at the start. This value must be defined as an ; absolute path. When this value is not set, chroot is not used. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one ; of its subdirectories. If the pool prefix is not set, the global prefix ; will be used instead. -; Note: chrooting is a great security feature and should be used whenever +; Note: chrooting is a great security feature and should be used whenever ; possible. However, all PHP paths will be relative to the chroot ; (error_log, sessions.save_path, ...). ; Default Value: not set @@ -347,16 +365,25 @@ chdir = __FINALPATH__ ; Note: on highloaded environement, this can cause some delay in the page ; process time (several ms). ; Default Value: no -catch_workers_output = yes +;catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no ; Limits the extensions of the main script FPM will allow to parse. This can ; prevent configuration mistakes on the web server side. You should only limit ; FPM to .php extensions to prevent malicious users to use other extensions to -; exectute php code. +; execute php code. ; Note: set an empty value to allow all extensions. ; Default Value: .php ;security.limit_extensions = .php .php3 .php4 .php5 .php7 - + ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from ; the current environment. ; Default Value: clean env @@ -370,7 +397,7 @@ catch_workers_output = yes ; overwrite the values previously defined in the php.ini. The directives are the ; same as the PHP SAPI: ; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. +; be overwritten from PHP call 'ini_set'. ; php_admin_value/php_admin_flag - these directives won't be overwritten by ; PHP call 'ini_set' ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. From dcc4ae8e3c8a7d95c15a4b4999e2546c8e589403 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 30 Jan 2019 11:43:26 +0100 Subject: [PATCH 13/16] Keep /var/run for the socket --- conf/php-fpm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index aff55a1..ab5dca9 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -33,7 +33,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /run/php/php7.0-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) From 29d27f85f9044c25a38eb0bd0f65175295f9f76e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Feb 2019 17:14:54 +0100 Subject: [PATCH 14/16] Reorder MYSQL DATABASE REMOVE before DEPENDENCIES REMOVE if using other DATABASE system --- scripts/remove | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/remove b/scripts/remove index b011da3..ad8d970 100755 --- a/scripts/remove +++ b/scripts/remove @@ -41,13 +41,6 @@ fi # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE THE MYSQL DATABASE #================================================= @@ -55,6 +48,13 @@ ynh_remove_app_dependencies # Remove a database if it exists, along with the associated user ynh_mysql_remove_db $db_user $db_name +#================================================= +# REMOVE DEPENDENCIES +#================================================= + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE APP MAIN DIR #================================================= From 2589f39dcf64c23cdf12fe387e237aa9e63d8ef2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Feb 2019 17:17:26 +0100 Subject: [PATCH 15/16] RESTORE DATABASE after REINSTALL DEPENDENCIES --- scripts/restore | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/restore b/scripts/restore index d629496..b450304 100755 --- a/scripts/restore +++ b/scripts/restore @@ -54,14 +54,6 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file "$final_path" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= - -db_pwd=$(ynh_app_setting_get $app mysqlpwd) -ynh_mysql_setup_db $db_name $db_name $db_pwd -ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -91,6 +83,14 @@ ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf" # Define and install dependencies ynh_install_app_dependencies deb1 deb2 +#================================================= +# RESTORE THE MYSQL DATABASE +#================================================= + +db_pwd=$(ynh_app_setting_get $app mysqlpwd) +ynh_mysql_setup_db $db_name $db_name $db_pwd +ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql + #================================================= # RESTORE SYSTEMD #================================================= From c42723e646d070143fd3e28c3be3e9a6671b763a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Feb 2019 17:19:12 +0100 Subject: [PATCH 16/16] Remove testing and unstable links --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index fbed5b2..65030f9 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,6 @@ Can the app be used by multiple users? * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/REPLACEBYYOURAPP/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/REPLACEBYYOURAPP/) * Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/REPLACEBYYOURAPP%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/REPLACEBYYOURAPP/) -* Testing x86-64b - [![Build Status](https://ci-apps-unstable.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Community%29%20%28testing%29.svg)](https://ci-apps-unstable.yunohost.org/ci/apps/REPLACEBYYOURAPP/) -* Unstable x86-64b - [![Build Status](https://ci-apps-unstable.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Community%29%20%28unstable%29.svg)](https://ci-apps-unstable.yunohost.org/ci/apps/REPLACEBYYOURAPP/) ## Limitations