From 82194e82a72fd71b79736b3f080e30778867b37e Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 21 Mar 2020 01:38:11 +0100 Subject: [PATCH 01/96] Don't use parentheses --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index bcc8182..7d35478 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -292,7 +292,7 @@ then # Upgrade Nextcloud (SUCCESS = 0, UP_TO_DATE = 3) exec_occ maintenance:mode --off exec_occ upgrade \ - || ([ $? -eq 3 ] || ynh_die --message="Unable to upgrade Nextcloud") + || [ $? -eq 3 ] || ynh_die --message="Unable to upgrade Nextcloud" # Get the new current version number current_version=$(grep OC_VersionString "$final_path/version.php" | cut -d\' -f2) From 5d0436199b1675b60d99d8d39ee2f1ac52f1df5f Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 24 Mar 2020 20:56:04 +0100 Subject: [PATCH 02/96] fix caldav/carddav detection --- scripts/upgrade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index bcc8182..0f0da06 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -151,9 +151,11 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." - ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" # Delete current nginx configuration to be able to check if .well-known is already served. -ynh_remove_nginx_config $YNH_PHP_VERSION +ynh_remove_nginx_config ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$app.conf" +ynh_systemd_action --service_name=nginx --action=reload + # Check if .well-known is available for this domain if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then From 02554f94e5065a9a8c7d4e50d366a5f8f7eb4242 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 24 Mar 2020 21:13:51 +0100 Subject: [PATCH 03/96] Update _common.sh --- scripts/_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 7b84705..47253f1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -38,6 +38,9 @@ is_url_handled() { # Manage arguments with getopts ynh_handle_getopts_args "$@" + # Wait untils nginx has fully reloaded (avoid curl fail with http2) + sleep 2 + # Try to get the url with curl, and keep the http code and an eventual redirection url. local curl_output="$(curl --insecure --silent --output /dev/null \ --write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain" --resolve $domain:443:127.0.0.1)" From d1a2528c43d63760874256d57bca3670b789c39a Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 25 Mar 2020 01:22:21 +0100 Subject: [PATCH 04/96] Move sleep --- scripts/_common.sh | 3 --- scripts/upgrade | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 47253f1..7b84705 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -38,9 +38,6 @@ is_url_handled() { # Manage arguments with getopts ynh_handle_getopts_args "$@" - # Wait untils nginx has fully reloaded (avoid curl fail with http2) - sleep 2 - # Try to get the url with curl, and keep the http code and an eventual redirection url. local curl_output="$(curl --insecure --silent --output /dev/null \ --write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain" --resolve $domain:443:127.0.0.1)" diff --git a/scripts/upgrade b/scripts/upgrade index 0f0da06..9045c6f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -146,7 +146,7 @@ ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependenci #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=3 ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -156,6 +156,9 @@ ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$a ynh_systemd_action --service_name=nginx --action=reload +# Wait untils nginx has fully reloaded +sleep 1 + # Check if .well-known is available for this domain if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then From 2d1e0c0c44ba8aecee8a85e46db4bd27484c97bc Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 25 Mar 2020 13:59:01 +0100 Subject: [PATCH 05/96] wait nginx --- scripts/upgrade | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9045c6f..95ba8fc 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -146,7 +146,7 @@ ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependenci #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=3 +ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -154,10 +154,8 @@ ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.con ynh_remove_nginx_config ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$app.conf" -ynh_systemd_action --service_name=nginx --action=reload - # Wait untils nginx has fully reloaded -sleep 1 +ynh_systemd_action --service_name=nginx --action=reload --line_match="Reloaded" --log_path="systemd" # Check if .well-known is available for this domain if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" From 05977de8e1378a196c760eb259068e53026aead0 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sat, 28 Mar 2020 12:44:22 +0100 Subject: [PATCH 06/96] Add an action to disable maintenance mode --- actions.toml | 8 +++++ scripts/actions/disable_maintenance | 52 +++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 actions.toml create mode 100755 scripts/actions/disable_maintenance diff --git a/actions.toml b/actions.toml new file mode 100644 index 0000000..38c52a8 --- /dev/null +++ b/actions.toml @@ -0,0 +1,8 @@ +[disable_maintenance] +name = "Disable the maintenance mode of Nextcloud" +command = "/bin/bash scripts/actions/disable_maintenance" +# user = "root" # optional +# cwd = "/" # optional +# accepted_return_codes = [0, 1, 2, 3] # optional +accepted_return_codes = [0] +description = "Disable the maintenance mode of Nextcloud if you're stuck after an upgrade" diff --git a/scripts/actions/disable_maintenance b/scripts/actions/disable_maintenance new file mode 100755 index 0000000..0c2c8b2 --- /dev/null +++ b/scripts/actions/disable_maintenance @@ -0,0 +1,52 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source scripts/_common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} + +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +#================================================= +# CHECK IF ARGUMENTS ARE CORRECT +#================================================= + +#================================================= +# CHECK IF AN ACTION HAS TO BE DONE +#================================================= + +# Check the current status of the maintenance mode + +if [ "$(grep "maintenance" "$final_path/config/config.php" | awk '{print $3}' | cut -d',' -f1)" != "true" ] +then + ynh_die --message="Nextcloud isn't currently under maintenance." --ret_code=0 +fi + +#================================================= +# SPECIFIC ACTION +#================================================= +# DISABLE THE MAINTENANCE MODE +#================================================= + +ynh_script_progression --message="Disabling maintenance mode..." --weight=3 + +( +cd "$final_path" && exec_as "$app" \ + php$YNH_PHP_VERSION occ --no-interaction --no-ansi maintenance:mode --off +) + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Execution completed" --last From 1f41e28254e293beb1d7a800370eeb852bafbf9e Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 28 Mar 2020 14:23:26 +0100 Subject: [PATCH 07/96] Upgrade to upstream version 18.0.3 --- README.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f0153fe..f6f7994 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 18.0.2 +**Shipped version:** 18.0.3 ## Screenshots diff --git a/manifest.json b/manifest.json index 9976a6e..5f79407 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "18.0.2~ynh1", + "version": "18.0.3~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 24a1692..4da3883 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="18.0.2" +next_version="18.0.3" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="d033660923dd27106ec64bff0e3afa2f595bd1b9661b7ea7882a1a33006ecb81" +nextcloud_source_sha256="7b67e709006230f90f95727f9fa92e8c73a9e93458b22103293120f9cb50fd72" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () { From 9b7b2e766213d85104e59090cb5ad0fb5b9052bf Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 29 Mar 2020 13:49:09 +0200 Subject: [PATCH 08/96] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f0153fe..0f3fcc1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Nextcloud for YunoHost -[![Integration level](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) +[![Integration level](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) [![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) > *This package allow you to install Nextcloud quickly and simply on a YunoHost server. @@ -36,13 +36,13 @@ you can synchronize your files over your devices. In addition to Nextcloud core features, the following are made available with this package: - * Integrate with YunoHost users and SSO - i.e. logout button + * Integrate with YunoHost users and SSO - i.e logout button * Allow one user to be the administrator (set at the installation) * Allow multiple instances of this application * Optionally access the user home folder from Nextcloud files (set at the installation, the sharing is enabled by default) * Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's - not already served - i.e. by Baïkal + not already served - i.e by Baïkal #### Multi-users support From 31ae53dc0e72d735df337996da6522178c44ad25 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 29 Mar 2020 17:54:49 +0200 Subject: [PATCH 09/96] Documentation link + how to use occ command - Add a link to Nextcloud documentation - Explain how to use occ command with Yunohost config --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 0f3fcc1..a5e3778 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,14 @@ Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/h ## Additionnal informations +#### `occ` command usage + +If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/nextcloud/` folder, then use `sudo -u nextcloud php7.3 occ` instead of `occ` (as an alternative, you can use `/var/www/nextcloud/occ` to run the command from another directory). + +*NB: you may need to adapt `php7.3` to the php version that Nextcloud is using. Since Nextcloud 18 Yunohost use php7.3, before it was php7.0.* + +¹ See https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html. Use this only if you know what you're doing :) + #### Migrate from ownCloud **This is not considered as stable yet, please do it with care and only for @@ -104,6 +112,7 @@ sudo yunohost app ssowatconf * Report a bug: https://github.com/YunoHost-Apps/nextcloud_ynh/issues * Nextcloud website: https://nextcloud.com/ + * Nextcloud documentation: https://docs.nextcloud.com/ * Nextcloud repository: https://github.com/nextcloud/server * YunoHost website: https://yunohost.org/ From 30a3d9ceab1ef4a2b7d897fee53221cee09ab6ec Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Wed, 1 Apr 2020 03:40:07 +0200 Subject: [PATCH 10/96] [fix] Backward compatibility for NC 14 or older --- scripts/upgrade | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8d109b4..77fd66e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -199,8 +199,15 @@ fi # Define a function to execute commands with `occ` exec_occ() { + # Backward compatibility to upgrade from NC14 or older version + if [ $current_major_version -gt 14 ] + then + NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION + else + NEXTCLOUD_PHP_VERSION="7.0" + fi (cd "$final_path" && exec_as "$app" \ - php$YNH_PHP_VERSION occ --no-interaction --no-ansi "$@") + php$NEXTCLOUD_PHP_VERSION occ --no-interaction --no-ansi "$@") } # Define a function to add an external storage From e821c6c06b89db4619d3355f35e6101dff15731f Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Wed, 1 Apr 2020 03:54:51 +0200 Subject: [PATCH 11/96] [fix] "last" don't pass correctly --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 77fd66e..895e79c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -200,11 +200,11 @@ fi # Define a function to execute commands with `occ` exec_occ() { # Backward compatibility to upgrade from NC14 or older version - if [ $current_major_version -gt 14 ] + if [ $current_major_version -lt 15 ] then - NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION - else NEXTCLOUD_PHP_VERSION="7.0" + else + NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION fi (cd "$final_path" && exec_as "$app" \ php$NEXTCLOUD_PHP_VERSION occ --no-interaction --no-ansi "$@") From de430e91acbe45eecd3aef6590c7ce762381fb6a Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 1 Apr 2020 12:23:19 +0200 Subject: [PATCH 12/96] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 895e79c..5d832b6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -204,7 +204,7 @@ exec_occ() { then NEXTCLOUD_PHP_VERSION="7.0" else - NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION + NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION fi (cd "$final_path" && exec_as "$app" \ php$NEXTCLOUD_PHP_VERSION occ --no-interaction --no-ansi "$@") From fb648fc9cf436b98ea95859aab2942b429709961 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 1 Apr 2020 17:38:30 +0200 Subject: [PATCH 13/96] Fix nginx conf --- conf/nginx.conf | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 8f2b3fb..c4b73e1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,18 +4,24 @@ location = /.well-known/carddav { location = /.well-known/caldav { return 301 https://$server_name__PATH__/remote.php/dav; } -location = /.well-known/host-meta { - return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta; -} -location = /.well-known/host-meta.json { - return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta-json; -} -location = /.well-known/webfinger { - return 301 $scheme://$host:$server_port__PATH__/public.php?service=webfinger; -} -location = /.well-known/nodeinfo { - return 301 $scheme://$host:$server_port__PATH__/public.php?service=nodeinfo; -} + +# The following 2 rules are only needed for the user_webfinger app. +# Uncomment it if you're planning to use this app. +#location = /.well-known/host-meta { +# return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta; +#} +#location = /.well-known/host-meta.json { +# return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta-json; +#} + +# The following 2 rules are only needed for the Social app. +# Uncomment it if you're planning to use this app. +#location = /.well-known/webfinger { +# return 301 $scheme://$host:$server_port__PATH__/public.php?service=webfinger; +#} +#location = /.well-known/nodeinfo { +# return 301 $scheme://$host:$server_port__PATH__/public.php?service=nodeinfo; +#} #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location ^~ __PATH__/ { From 5bfea04d15eed4cec0bec30ff53fa3a7eac4f752 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 12 Apr 2020 00:41:21 +0200 Subject: [PATCH 14/96] Migrate to new php helpers --- conf/php-fpm.conf | 446 -------------------------- manifest.json | 2 +- scripts/_common.sh | 605 ------------------------------------ scripts/_ynh_add_fpm_config | 146 --------- scripts/config | 3 +- scripts/install | 9 +- scripts/restore | 28 +- scripts/upgrade | 7 +- 8 files changed, 23 insertions(+), 1223 deletions(-) delete mode 100644 conf/php-fpm.conf delete mode 100644 scripts/_ynh_add_fpm_config diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf deleted file mode 100644 index 33dcb5e..0000000 --- a/conf/php-fpm.conf +++ /dev/null @@ -1,446 +0,0 @@ -; Start a new pool named 'www'. -; 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' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = __USER__ -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 IPv4 address 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/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock - -; 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. -; 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 -; 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 -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; 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: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; 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 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; 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 - -; 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: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php/__PHPVERSION__/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 -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; 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 -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: output header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %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 '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %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 = 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 = 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 -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -chdir = __FINALPATH__ - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;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 -; 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 -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp -env[PATH] = $PATH -; Additional php.ini defines, specific to this pool of workers. These settings -; 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'. -; 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. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M - -; Common values to change to increase file upload limit -; php_admin_value[upload_max_filesize] = 50M -; php_admin_value[post_max_size] = 50M -; php_admin_flag[mail.add_x_header] = Off - -; Other common parameters -; php_admin_value[max_execution_time] = 600 -; php_admin_value[max_input_time] = 300 -; php_admin_value[memory_limit] = 256M -; php_admin_flag[short_open_tag] = On - -; Additional php.ini defines, specific to this pool of workers. -php_admin_value[memory_limit] = 512M -php_value[upload_max_filesize] = 10G -php_value[post_max_size] = 10G -php_value[default_charset] = UTF-8 -; OPcache is already activated by default -; php_value[opcache.enable]=1 -; The following parameters are nevertheless recommended for Nextcloud -; see here: https://docs.nextcloud.com/server/15/admin_manual/installation/server_tuning.html#enable-php-opcache -php_value[opcache.enable_cli]=1 -php_value[opcache.interned_strings_buffer]=8 -php_value[opcache.max_accelerated_files]=10000 -php_value[opcache.memory_consumption]=128 -php_value[opcache.save_comments]=1 -php_value[opcache.revalidate_freq]=1 diff --git a/manifest.json b/manifest.json index 5f79407..350b62f 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "apps@yunohost.org" }, "requirements": { - "yunohost": ">= 3.5.0" + "yunohost": ">= 3.8.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 7b84705..2b5a5c9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -344,234 +344,6 @@ ynh_smart_mktemp () { echo "$(sudo mktemp --directory --tmpdir="$tmpdir")" } -#================================================= - -# Check the amount of available RAM -# -# usage: ynh_check_ram [--required=RAM required in Mb] [--no_swap|--only_swap] [--free_ram] -# | arg: -r, --required= - Amount of RAM required in Mb. The helper will return 0 is there's enough RAM, or 1 otherwise. -# If --required isn't set, the helper will print the amount of RAM, in Mb. -# | arg: -s, --no_swap - Ignore swap -# | arg: -o, --only_swap - Ignore real RAM, consider only swap. -# | arg: -f, --free_ram - Count only free RAM, not the total amount of RAM available. -ynh_check_ram () { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [r]=required= [s]=no_swap [o]=only_swap [f]=free_ram ) - local required - local no_swap - local only_swap - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - required=${required:-} - no_swap=${no_swap:-0} - only_swap=${only_swap:-0} - - local total_ram=$(vmstat --stats --unit M | grep "total memory" | awk '{print $1}') - local total_swap=$(vmstat --stats --unit M | grep "total swap" | awk '{print $1}') - local total_ram_swap=$(( total_ram + total_swap )) - - local free_ram=$(vmstat --stats --unit M | grep "free memory" | awk '{print $1}') - local free_swap=$(vmstat --stats --unit M | grep "free swap" | awk '{print $1}') - local free_ram_swap=$(( free_ram + free_swap )) - - # Use the total amount of ram - local ram=$total_ram_swap - if [ $free_ram -eq 1 ] - then - # Use the total amount of free ram - ram=$free_ram_swap - if [ $no_swap -eq 1 ] - then - # Use only the amount of free ram - ram=$free_ram - elif [ $only_swap -eq 1 ] - then - # Use only the amount of free swap - ram=$free_swap - fi - else - if [ $no_swap -eq 1 ] - then - # Use only the amount of free ram - ram=$total_ram - elif [ $only_swap -eq 1 ] - then - # Use only the amount of free swap - ram=$total_swap - fi - fi - - if [ -n "$required" ] - then - # Return 1 if the amount of ram isn't enough. - if [ $ram -lt $required ] - then - return 1 - else - return 0 - fi - - # If no RAM is required, return the amount of available ram. - else - echo $ram - fi -} - -#================================================= - -# Define the values to configure php-fpm -# -# usage: ynh_get_scalable_phpfpm --usage=usage --footprint=footprint [--print] -# | arg: -f, --footprint - Memory footprint of the service (low/medium/high). -# low - Less than 20Mb of ram by pool. -# medium - Between 20Mb and 40Mb of ram by pool. -# high - More than 40Mb of ram by pool. -# Or specify exactly the footprint, the load of the service as Mb by pool instead of having a standard value. -# To have this value, use the following command and stress the service. -# watch -n0.5 ps -o user,cmd,%cpu,rss -u APP -# -# | arg: -u, --usage - Expected usage of the service (low/medium/high). -# low - Personal usage, behind the sso. -# medium - Low usage, few people or/and publicly accessible. -# high - High usage, frequently visited website. -# -# | arg: -p, --print - Print the result -# -# -# -# The footprint of the service will be used to defined the maximum footprint we can allow, which is half the maximum RAM. -# So it will be used to defined 'pm.max_children' -# A lower value for the footprint will allow more children for 'pm.max_children'. And so for -# 'pm.start_servers', 'pm.min_spare_servers' and 'pm.max_spare_servers' which are defined from the -# value of 'pm.max_children' -# NOTE: 'pm.max_children' can't exceed 4 times the number of processor's cores. -# -# The usage value will defined the way php will handle the children for the pool. -# A value set as 'low' will set the process manager to 'ondemand'. Children will start only if the -# service is used, otherwise no child will stay alive. This config gives the lower footprint when the -# service is idle. But will use more proc since it has to start a child as soon it's used. -# Set as 'medium', the process manager will be at dynamic. If the service is idle, a number of children -# equal to pm.min_spare_servers will stay alive. So the service can be quick to answer to any request. -# The number of children can grow if needed. The footprint can stay low if the service is idle, but -# not null. The impact on the proc is a little bit less than 'ondemand' as there's always a few -# children already available. -# Set as 'high', the process manager will be set at 'static'. There will be always as many children as -# 'pm.max_children', the footprint is important (but will be set as maximum a quarter of the maximum -# RAM) but the impact on the proc is lower. The service will be quick to answer as there's always many -# children ready to answer. -ynh_get_scalable_phpfpm () { - local legacy_args=ufp - # Declare an array to define the options of this helper. - declare -Ar args_array=( [u]=usage= [f]=footprint= [p]=print ) - local usage - local footprint - local print - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - # Set all characters as lowercase - footprint=${footprint,,} - usage=${usage,,} - print=${print:-0} - - if [ "$footprint" = "low" ] - then - footprint=20 - elif [ "$footprint" = "medium" ] - then - footprint=35 - elif [ "$footprint" = "high" ] - then - footprint=50 - fi - - # Define the way the process manager handle child processes. - if [ "$usage" = "low" ] - then - php_pm=ondemand - elif [ "$usage" = "medium" ] - then - php_pm=dynamic - elif [ "$usage" = "high" ] - then - php_pm=static - else - ynh_die --message="Does not recognize '$usage' as an usage value." - fi - - # Get the total of RAM available, except swap. - local max_ram=$(ynh_check_ram --no_swap) - - less0() { - # Do not allow value below 1 - if [ $1 -le 0 ] - then - echo 1 - else - echo $1 - fi - } - - # Define pm.max_children - # The value of pm.max_children is the total amount of ram divide by 2 and divide again by the footprint of a pool for this app. - # So if php-fpm start the maximum of children, it won't exceed half of the ram. - php_max_children=$(( $max_ram / 2 / $footprint )) - # If process manager is set as static, use half less children. - # Used as static, there's always as many children as the value of pm.max_children - if [ "$php_pm" = "static" ] - then - php_max_children=$(( $php_max_children / 2 )) - fi - php_max_children=$(less0 $php_max_children) - - # To not overload the proc, limit the number of children to 4 times the number of cores. - local core_number=$(nproc) - local max_proc=$(( $core_number * 4 )) - if [ $php_max_children -gt $max_proc ] - then - php_max_children=$max_proc - fi - - if [ "$php_pm" = "dynamic" ] - then - # Define pm.start_servers, pm.min_spare_servers and pm.max_spare_servers for a dynamic process manager - php_min_spare_servers=$(( $php_max_children / 8 )) - php_min_spare_servers=$(less0 $php_min_spare_servers) - - php_max_spare_servers=$(( $php_max_children / 2 )) - php_max_spare_servers=$(less0 $php_max_spare_servers) - - php_start_servers=$(( $php_min_spare_servers + ( $php_max_spare_servers - $php_min_spare_servers ) /2 )) - php_start_servers=$(less0 $php_start_servers) - else - php_min_spare_servers=0 - php_max_spare_servers=0 - php_start_servers=0 - fi - - if [ $print -eq 1 ] - then - ynh_debug --message="Footprint=${footprint}Mb by pool." - ynh_debug --message="Process manager=$php_pm" - ynh_debug --message="Max RAM=${max_ram}Mb" - if [ "$php_pm" != "static" ]; then - ynh_debug --message="\nMax estimated footprint=$(( $php_max_children * $footprint ))" - ynh_debug --message="Min estimated footprint=$(( $php_min_spare_servers * $footprint ))" - fi - if [ "$php_pm" = "dynamic" ]; then - ynh_debug --message="Estimated average footprint=$(( $php_max_spare_servers * $footprint ))" - elif [ "$php_pm" = "static" ]; then - ynh_debug --message="Estimated footprint=$(( $php_max_children * $footprint ))" - fi - ynh_debug --message="\nRaw php-fpm values:" - ynh_debug --message="pm.max_children = $php_max_children" - if [ "$php_pm" = "dynamic" ]; then - ynh_debug --message="pm.start_servers = $php_start_servers" - ynh_debug --message="pm.min_spare_servers = $php_min_spare_servers" - ynh_debug --message="pm.max_spare_servers = $php_max_spare_servers" - fi - fi -} - #================================================= # FUTURE OFFICIAL HELPERS #================================================= @@ -614,380 +386,3 @@ ynh_multimedia_addaccess () { groupadd -f multimedia usermod -a -G multimedia $user_name } - -# Install another version of php. -# -# usage: ynh_install_php --phpversion=phpversion [--package=packages] -# | arg: -v, --phpversion - Version of php to install. -# | arg: -p, --package - Additionnal php packages to install -ynh_install_php () { - # Declare an array to define the options of this helper. - local legacy_args=vp - declare -Ar args_array=( [v]=phpversion= [p]=package= ) - local phpversion - local package - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - package=${package:-} - - # Store phpversion into the config of this app - ynh_app_setting_set $app phpversion $phpversion - - if [ "$phpversion" == "7.0" ] - then - ynh_die "Do not use ynh_install_php to install php7.0" - fi - - # Store the ID of this app and the version of php requested for it - echo "$YNH_APP_INSTANCE_NAME:$phpversion" | tee --append "/etc/php/ynh_app_version" - - # Add an extra repository for those packages - ynh_install_extra_repo --repo="https://packages.sury.org/php/ $(lsb_release -sc) main" --key="https://packages.sury.org/php/apt.gpg" --priority=995 --name=extra_php_version - - # Install requested dependencies from this extra repository. - # Install php-fpm first, otherwise php will install apache as a dependency. - ynh_add_app_dependencies --package="php${phpversion}-fpm" - ynh_add_app_dependencies --package="php$phpversion php${phpversion}-common $package" - - # Set php7.0 back as the default version for php-cli. - update-alternatives --set php /usr/bin/php7.0 - - # Pin this extra repository after packages are installed to prevent sury of doing shit - ynh_pin_repo --package="*" --pin="origin \"packages.sury.org\"" --priority=200 --name=extra_php_version - ynh_pin_repo --package="php7.0*" --pin="origin \"packages.sury.org\"" --priority=600 --name=extra_php_version --append - - # Advertise service in admin panel - yunohost service add php${phpversion}-fpm --log "/var/log/php${phpversion}-fpm.log" -} - -# Remove the specific version of php used by the app. -# -# usage: ynh_install_php -ynh_remove_php () { - # Get the version of php used by this app - local phpversion=$(ynh_app_setting_get $app phpversion) - - if [ "$phpversion" == "7.0" ] || [ -z "$phpversion" ] - then - if [ "$phpversion" == "7.0" ] - then - ynh_print_err "Do not use ynh_remove_php to install php7.0" - fi - return 0 - fi - - # Remove the line for this app - sed --in-place "/$YNH_APP_INSTANCE_NAME:$phpversion/d" "/etc/php/ynh_app_version" - - # If no other app uses this version of php, remove it. - if ! grep --quiet "$phpversion" "/etc/php/ynh_app_version" - then - # Purge php dependences for this version. - ynh_package_autopurge "php$phpversion php${phpversion}-fpm php${phpversion}-common" - # Remove the service from the admin panel - yunohost service remove php${phpversion}-fpm - fi - - # If no other app uses alternate php versions, remove the extra repo for php - if [ ! -s "/etc/php/ynh_app_version" ] - then - ynh_secure_remove /etc/php/ynh_app_version - fi -} - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= -# Pin a repository. -# -# usage: ynh_pin_repo --package=packages --pin=pin_filter [--priority=priority_value] [--name=name] [--append] -# | arg: -p, --package - Packages concerned by the pin. Or all, *. -# | arg: -i, --pin - Filter for the pin. -# | arg: -p, --priority - Priority for the pin -# | arg: -n, --name - Name for the files for this repo, $app as default value. -# | arg: -a, --append - Do not overwrite existing files. -# -# See https://manpages.debian.org/stretch/apt/apt_preferences.5.en.html for information about pinning. -# -ynh_pin_repo () { - # Declare an array to define the options of this helper. - local legacy_args=pirna - declare -Ar args_array=( [p]=package= [i]=pin= [r]=priority= [n]=name= [a]=append ) - local package - local pin - local priority - local name - local append - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - package="${package:-*}" - priority=${priority:-50} - name="${name:-$app}" - append=${append:-0} - - if [ $append -eq 1 ] - then - append="tee -a" - else - append="tee" - fi - - mkdir -p "/etc/apt/preferences.d" - echo "Package: $package -Pin: $pin -Pin-Priority: $priority -" \ - | $append "/etc/apt/preferences.d/$name" -} - -# Add a repository. -# -# usage: ynh_add_repo --uri=uri --suite=suite --component=component [--name=name] [--append] -# | arg: -u, --uri - Uri of the repository. -# | arg: -s, --suite - Suite of the repository. -# | arg: -c, --component - Component of the repository. -# | arg: -n, --name - Name for the files for this repo, $app as default value. -# | arg: -a, --append - Do not overwrite existing files. -# -# Example for a repo like deb http://forge.yunohost.org/debian/ stretch stable -# uri suite component -# ynh_add_repo --uri=http://forge.yunohost.org/debian/ --suite=stretch --component=stable -# -ynh_add_repo () { - # Declare an array to define the options of this helper. - local legacy_args=uscna - declare -Ar args_array=( [u]=uri= [s]=suite= [c]=component= [n]=name= [a]=append ) - local uri - local suite - local component - local name - local append - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - name="${name:-$app}" - append=${append:-0} - - if [ $append -eq 1 ] - then - append="tee -a" - else - append="tee" - fi - - mkdir -p "/etc/apt/sources.list.d" - # Add the new repo in sources.list.d - echo "deb $uri $suite $component" \ - | $append "/etc/apt/sources.list.d/$name.list" -} - -# Add an extra repository correctly, pin it and get the key. -# -# usage: ynh_install_extra_repo --repo="repo" [--key=key_url] [--priority=priority_value] [--name=name] [--append] -# | arg: -r, --repo - Complete url of the extra repository. -# | arg: -k, --key - url to get the public key. -# | arg: -p, --priority - Priority for the pin -# | arg: -n, --name - Name for the files for this repo, $app as default value. -# | arg: -a, --append - Do not overwrite existing files. -ynh_install_extra_repo () { - # Declare an array to define the options of this helper. - local legacy_args=rkpna - declare -Ar args_array=( [r]=repo= [k]=key= [p]=priority= [n]=name= [a]=append ) - local repo - local key - local priority - local name - local append - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - name="${name:-$app}" - append=${append:-0} - key=${key:-0} - priority=${priority:-} - - if [ $append -eq 1 ] - then - append="--append" - wget_append="tee -a" - else - append="" - wget_append="tee" - fi - - # Split the repository into uri, suite and components. - # Remove "deb " at the beginning of the repo. - repo="${repo#deb }" - - # Get the uri - local uri="$(echo "$repo" | awk '{ print $1 }')" - - # Get the suite - local suite="$(echo "$repo" | awk '{ print $2 }')" - - # Get the components - local component="${repo##$uri $suite }" - - # Add the repository into sources.list.d - ynh_add_repo --uri="$uri" --suite="$suite" --component="$component" --name="$name" $append - - # Pin the new repo with the default priority, so it won't be used for upgrades. - # Build $pin from the uri without http and any sub path - local pin="${uri#*://}" - pin="${pin%%/*}" - # Set a priority only if asked - if [ -n "$priority" ] - then - priority="--priority=$priority" - fi - ynh_pin_repo --package="*" --pin="origin \"$pin\"" $priority --name="$name" $append - - # Get the public key for the repo - if [ -n "$key" ] - then - mkdir -p "/etc/apt/trusted.gpg.d" - wget -q "$key" -O - | gpg --dearmor | $wget_append /etc/apt/trusted.gpg.d/$name.gpg > /dev/null - fi - - # Update the list of package with the new repo - ynh_package_update -} - -# Remove an extra repository and the assiociated configuration. -# -# usage: ynh_remove_extra_repo [--name=name] -# | arg: -n, --name - Name for the files for this repo, $app as default value. -ynh_remove_extra_repo () { - # Declare an array to define the options of this helper. - local legacy_args=n - declare -Ar args_array=( [n]=name= ) - local name - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - name="${name:-$app}" - - ynh_secure_remove "/etc/apt/sources.list.d/$name.list" - ynh_secure_remove "/etc/apt/preferences.d/$name" - ynh_secure_remove "/etc/apt/trusted.gpg.d/$name.gpg" - ynh_secure_remove "/etc/apt/trusted.gpg.d/$name.asc" - - # Update the list of package to exclude the old repo - ynh_package_update -} - -# Install packages from an extra repository properly. -# -# usage: ynh_install_extra_app_dependencies --repo="repo" --package="dep1 dep2" [--key=key_url] [--name=name] -# | arg: -r, --repo - Complete url of the extra repository. -# | arg: -p, --package - The packages to install from this extra repository -# | arg: -k, --key - url to get the public key. -# | arg: -n, --name - Name for the files for this repo, $app as default value. -ynh_install_extra_app_dependencies () { - # Declare an array to define the options of this helper. - local legacy_args=rpkn - declare -Ar args_array=( [r]=repo= [p]=package= [k]=key= [n]=name= ) - local repo - local package - local key - local name - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - name="${name:-$app}" - key=${key:-0} - - # Set a key only if asked - if [ -n "$key" ] - then - key="--key=$key" - fi - # Add an extra repository for those packages - ynh_install_extra_repo --repo="$repo" $key --priority=995 --name=$name - - # Install requested dependencies from this extra repository. - ynh_add_app_dependencies --package="$package" - - # Remove this extra repository after packages are installed - ynh_remove_extra_repo --name=$app -} - -#================================================= - -# patched version of ynh_install_app_dependencies to be used with ynh_add_app_dependencies - -# Define and install dependencies with a equivs control file -# This helper can/should only be called once per app -# -# usage: ynh_install_app_dependencies dep [dep [...]] -# | arg: dep - the package name to install in dependence -# You can give a choice between some package with this syntax : "dep1|dep2" -# Example : ynh_install_app_dependencies dep1 dep2 "dep3|dep4|dep5" -# This mean in the dependence tree : dep1 & dep2 & (dep3 | dep4 | dep5) -# -# Requires YunoHost version 2.6.4 or higher. -ynh_install_app_dependencies () { - local dependencies=$@ - dependencies="$(echo "$dependencies" | sed 's/\([^\<=\>]\)\ \([^(]\)/\1, \2/g')" - dependencies=${dependencies//|/ | } - local manifest_path="../manifest.json" - if [ ! -e "$manifest_path" ]; then - manifest_path="../settings/manifest.json" # Into the restore script, the manifest is not at the same place - fi - - local version=$(grep '\"version\": ' "$manifest_path" | cut -d '"' -f 4) # Retrieve the version number in the manifest file. - if [ ${#version} -eq 0 ]; then - version="1.0" - fi - local dep_app=${app//_/-} # Replace all '_' by '-' - - # Handle specific versions - if [[ "$dependencies" =~ [\<=\>] ]] - then - # Replace version specifications by relationships syntax - # https://www.debian.org/doc/debian-policy/ch-relationships.html - # Sed clarification - # [^(\<=\>] ignore if it begins by ( or < = >. To not apply twice. - # [\<=\>] matches < = or > - # \+ matches one or more occurence of the previous characters, for >= or >>. - # [^,]\+ matches all characters except ',' - # Ex: package>=1.0 will be replaced by package (>= 1.0) - dependencies="$(echo "$dependencies" | sed 's/\([^(\<=\>]\)\([\<=\>]\+\)\([^,]\+\)/\1 (\2 \3)/g')" - fi - - cat > /tmp/${dep_app}-ynh-deps.control << EOF # Make a control file for equivs-build -Section: misc -Priority: optional -Package: ${dep_app}-ynh-deps -Version: ${version} -Depends: ${dependencies} -Architecture: all -Description: Fake package for $app (YunoHost app) dependencies - This meta-package is only responsible of installing its dependencies. -EOF - ynh_package_install_from_equivs /tmp/${dep_app}-ynh-deps.control \ - || ynh_die --message="Unable to install dependencies" # Install the fake package and its dependencies - rm /tmp/${dep_app}-ynh-deps.control - ynh_app_setting_set --app=$app --key=apt_dependencies --value="$dependencies" -} - -ynh_add_app_dependencies () { - # Declare an array to define the options of this helper. - local legacy_args=pr - declare -Ar args_array=( [p]=package= [r]=replace) - local package - local replace - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - replace=${replace:-0} - - local current_dependencies="" - if [ $replace -eq 0 ] - then - local dep_app=${app//_/-} # Replace all '_' by '-' - if ynh_package_is_installed --package="${dep_app}-ynh-deps" - then - current_dependencies="$(dpkg-query --show --showformat='${Depends}' ${dep_app}-ynh-deps) " - fi - - current_dependencies=${current_dependencies// | /|} - fi - - ynh_install_app_dependencies "${current_dependencies}${package}" -} diff --git a/scripts/_ynh_add_fpm_config b/scripts/_ynh_add_fpm_config deleted file mode 100644 index 487c044..0000000 --- a/scripts/_ynh_add_fpm_config +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash - -# Create a dedicated php-fpm config -# -# usage 1: ynh_add_fpm_config [--phpversion=7.X] [--use_template] -# | arg: -v, --phpversion - Version of php to use. -# | arg: -t, --use_template - Use this helper in template mode. -# -# ----------------------------------------------------------------------------- -# -# usage 2: ynh_add_fpm_config [--phpversion=7.X] --usage=usage --footprint=footprint -# | arg: -v, --phpversion - Version of php to use.# -# | arg: -f, --footprint - Memory footprint of the service (low/medium/high). -# low - Less than 20Mb of ram by pool. -# medium - Between 20Mb and 40Mb of ram by pool. -# high - More than 40Mb of ram by pool. -# Or specify exactly the footprint, the load of the service as Mb by pool instead of having a standard value. -# To have this value, use the following command and stress the service. -# watch -n0.5 ps -o user,cmd,%cpu,rss -u APP -# -# | arg: -u, --usage - Expected usage of the service (low/medium/high). -# low - Personal usage, behind the sso. -# medium - Low usage, few people or/and publicly accessible. -# high - High usage, frequently visited website. -# -# Requires YunoHost version 2.7.2 or higher. -ynh_add_fpm_config () { - # Declare an array to define the options of this helper. - local legacy_args=vtuf - declare -Ar args_array=( [v]=phpversion= [t]=use_template [u]=usage= [f]=footprint= ) - local phpversion - local use_template - local usage - local footprint - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - # The default behaviour is to use the template. - use_template="${use_template:-1}" - usage="${usage:-}" - footprint="${footprint:-}" - if [ -n "$usage" ] || [ -n "$footprint" ]; then - use_template=0 - fi - - # Configure PHP-FPM 7.0 by default - phpversion="${phpversion:-$YNH_PHP_VERSION}" - - local fpm_config_dir="/etc/php/$phpversion/fpm" - local fpm_service="php${phpversion}-fpm" - # Configure PHP-FPM 5 on Debian Jessie - if [ "$(ynh_get_debian_release)" == "jessie" ]; then - fpm_config_dir="/etc/php5/fpm" - fpm_service="php5-fpm" - fi - ynh_app_setting_set --app=$app --key=fpm_config_dir --value="$fpm_config_dir" - ynh_app_setting_set --app=$app --key=fpm_service --value="$fpm_service" - finalphpconf="$fpm_config_dir/pool.d/$app.conf" - ynh_backup_if_checksum_is_different --file="$finalphpconf" - - if [ $use_template -eq 1 ] - then - # Usage 1, use the template in ../conf/php-fpm.conf - sudo cp ../conf/php-fpm.conf "$finalphpconf" - ynh_replace_string --match_string="__NAMETOCHANGE__" --replace_string="$app" --target_file="$finalphpconf" - ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$finalphpconf" - ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$finalphpconf" - ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$finalphpconf" - - else - # Usage 2, generate a php-fpm config file with ynh_get_scalable_phpfpm - ynh_get_scalable_phpfpm --usage=$usage --footprint=$footprint - - # Copy the default file - sudo cp "$fpm_config_dir/pool.d/www.conf" "$finalphpconf" - - # Replace standard variables into the default file - ynh_replace_string --match_string="^\[www\]" --replace_string="[$app]" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*listen = .*" --replace_string="listen = /var/run/php/php$phpversion-fpm-$app.sock" --target_file="$finalphpconf" - ynh_replace_string --match_string="^user = .*" --replace_string="user = $app" --target_file="$finalphpconf" - ynh_replace_string --match_string="^group = .*" --replace_string="group = $app" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*chdir = .*" --replace_string="chdir = $final_path" --target_file="$finalphpconf" - - # Configure fpm children - ynh_replace_string --match_string=".*pm = .*" --replace_string="pm = $php_pm" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*pm.max_children = .*" --replace_string="pm.max_children = $php_max_children" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*pm.max_requests = .*" --replace_string="pm.max_requests = 500" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*request_terminate_timeout = .*" --replace_string="request_terminate_timeout = 1d" --target_file="$finalphpconf" - if [ "$php_pm" = "dynamic" ] - then - ynh_replace_string --match_string=".*pm.start_servers = .*" --replace_string="pm.start_servers = $php_start_servers" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*pm.min_spare_servers = .*" --replace_string="pm.min_spare_servers = $php_min_spare_servers" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*pm.max_spare_servers = .*" --replace_string="pm.max_spare_servers = $php_max_spare_servers" --target_file="$finalphpconf" - elif [ "$php_pm" = "ondemand" ] - then - ynh_replace_string --match_string=".*pm.process_idle_timeout = .*" --replace_string="pm.process_idle_timeout = 10s" --target_file="$finalphpconf" - fi - - # Comment unused parameters - if [ "$php_pm" != "dynamic" ] - then - ynh_replace_string --match_string=".*\(pm.start_servers = .*\)" --replace_string=";\1" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*\(pm.min_spare_servers = .*\)" --replace_string=";\1" --target_file="$finalphpconf" - ynh_replace_string --match_string=".*\(pm.max_spare_servers = .*\)" --replace_string=";\1" --target_file="$finalphpconf" - fi - if [ "$php_pm" != "ondemand" ] - then - ynh_replace_string --match_string=".*\(pm.process_idle_timeout = .*\)" --replace_string=";\1" --target_file="$finalphpconf" - fi - - # Concatene the extra config. - if [ -e ../conf/extra_php-fpm.conf ]; then - cat ../conf/extra_php-fpm.conf >> "$finalphpconf" - fi - fi - sudo chown root: "$finalphpconf" - ynh_store_file_checksum --file="$finalphpconf" - - if [ -e "../conf/php-fpm.ini" ] - then - echo "Packagers ! Please do not use a separate php ini file, merge your directives in the pool file instead." >&2 - finalphpini="$fpm_config_dir/conf.d/20-$app.ini" - ynh_backup_if_checksum_is_different "$finalphpini" - sudo cp ../conf/php-fpm.ini "$finalphpini" - sudo chown root: "$finalphpini" - ynh_store_file_checksum "$finalphpini" - fi - ynh_systemd_action --service_name=$fpm_service --action=reload - - # Clean other php version config files for this app. Used for migration purpose. - if [ -e "/etc/php5/fpm/pool.d/$app.conf" ] - then - ynh_secure_remove --file="/etc/php5/fpm/pool.d/$app.conf" - ynh_systemd_action --service_name=php5-fpm --action=reload - fi - for i in `seq 0 4` - do - if [ "$phpversion" != "7.$i" ] - then - if [ -e "/etc/php/7.$i/fpm/pool.d/$app.conf" ] - then - ynh_secure_remove --file="/etc/php/7.$i/fpm/pool.d/$app.conf" - ynh_systemd_action --service_name=php7.$i-fpm --action=reload - fi - fi - done -} diff --git a/scripts/config b/scripts/config index b0314f0..00601b5 100644 --- a/scripts/config +++ b/scripts/config @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -source _ynh_add_fpm_config #================================================= # RETRIEVE ARGUMENTS @@ -78,7 +77,7 @@ apply_config() { if [ "$fpm_footprint" != "0" ] then - ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint + ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION else ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." fi diff --git a/scripts/install b/scripts/install index 5c80e56..e26e7ee 100755 --- a/scripts/install +++ b/scripts/install @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -source _ynh_add_fpm_config #================================================= # MANAGE SCRIPT FAILURE @@ -54,12 +53,10 @@ ynh_app_setting_set --app=$app --key=user_home --value=$user_home #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=60 +ynh_script_progression --message="Installing dependencies..." --weight=10 ynh_install_app_dependencies $pkg_dependencies -ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependencies" - #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -115,10 +112,10 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --weight=2 +ynh_script_progression --message="Configuring php-fpm..." --weight=50 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=medium --footprint=high +ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_pkg_dependencies" #================================================= # SPECIFIC SETUP diff --git a/scripts/restore b/scripts/restore index c62be63..127e110 100755 --- a/scripts/restore +++ b/scripts/restore @@ -8,7 +8,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -source _ynh_add_fpm_config #================================================= # MANAGE SCRIPT FAILURE @@ -29,6 +28,9 @@ 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) +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 #================================================= @@ -80,23 +82,26 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" - #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=60 +ynh_script_progression --message="Reinstalling dependencies..." --weight=10 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies -ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependencies" +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Reconfiguring php-fpm..." --weight=50 + +# Restore the file first, so it can have a backup if different +ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" + +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION --package="$extra_pkg_dependencies" #================================================= # RESTORE THE CRON FILE @@ -168,11 +173,10 @@ ynh_systemd_action --action=restart --service_name=fail2ban #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX AND PHP-FPM +# RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." +ynh_script_progression --message="Reloading nginx web server..." -ynh_systemd_action --service_name=php${YNH_PHP_VERSION}-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8d109b4..69a95ae 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -source _ynh_add_fpm_config #================================================= # LOAD SETTINGS @@ -139,8 +138,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=7 ynh_install_app_dependencies $pkg_dependencies -ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependencies" - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -182,8 +179,8 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=2 -# Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_pkg_dependencies" # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then From 5ed80548de98293f5cb21d7f3b52852231d0908d Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 12 Apr 2020 12:41:57 +0200 Subject: [PATCH 15/96] extra_php_dependencies --- scripts/_common.sh | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 2b5a5c9..a868991 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ pkg_dependencies="imagemagick acl tar smbclient at" YNH_PHP_VERSION="7.3" -extra_pkg_dependencies="php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-smbclient php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary" +extra_php_dependencies="php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-smbclient php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary" #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/install b/scripts/install index e26e7ee..db96c16 100755 --- a/scripts/install +++ b/scripts/install @@ -115,7 +115,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring php-fpm..." --weight=50 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_pkg_dependencies" +ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # SPECIFIC SETUP diff --git a/scripts/restore b/scripts/restore index 127e110..8c49cad 100755 --- a/scripts/restore +++ b/scripts/restore @@ -101,7 +101,7 @@ ynh_script_progression --message="Reconfiguring php-fpm..." --weight=50 ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION --package="$extra_pkg_dependencies" +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #================================================= # RESTORE THE CRON FILE diff --git a/scripts/upgrade b/scripts/upgrade index 69a95ae..86b2c7a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -180,7 +180,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=2 # Recreate a dedicated php-fpm config -ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_pkg_dependencies" +ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then From 51dfabee8ba04108789e04198a6eca5f1782566a Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 16 Apr 2020 01:54:00 +0200 Subject: [PATCH 16/96] Update config.json --- conf/config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/config.json b/conf/config.json index 2e7aca8..7d24587 100644 --- a/conf/config.json +++ b/conf/config.json @@ -10,7 +10,8 @@ "port": "6379", "timeout": "0.0", "password": "" - } + }, + "hashing_default_password": true }, "apps": { "user_ldap": { From a60ddbf573c8c431a1c001783ecaf7f46497c759 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 17 Apr 2020 09:54:11 +0200 Subject: [PATCH 17/96] fix typo + minor improvement Co-Authored-By: JimboJoe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5e3778..6163a54 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/h If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/nextcloud/` folder, then use `sudo -u nextcloud php7.3 occ` instead of `occ` (as an alternative, you can use `/var/www/nextcloud/occ` to run the command from another directory). -*NB: you may need to adapt `php7.3` to the php version that Nextcloud is using. Since Nextcloud 18 Yunohost use php7.3, before it was php7.0.* +*NB: You may need to adapt `php7.3` to the PHP version that Nextcloud is using. Starting from Nextcloud 18, YunoHost uses php7.3, it used before php7.0.* ¹ See https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html. Use this only if you know what you're doing :) From 2d80025a049dc81cbf07589fc18a1c2132099c71 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 17 Apr 2020 09:54:31 +0200 Subject: [PATCH 18/96] minor spacing improvement Co-Authored-By: JimboJoe --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6163a54..4a7ad2d 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,8 @@ If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/n *NB: You may need to adapt `php7.3` to the PHP version that Nextcloud is using. Starting from Nextcloud 18, YunoHost uses php7.3, it used before php7.0.* -¹ See https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html. Use this only if you know what you're doing :) +¹ See https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html + Use this only if you know what you're doing :) #### Migrate from ownCloud From e2b06801ae9a254ce03a9c43885e8604d89590da Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 17 Apr 2020 09:55:49 +0200 Subject: [PATCH 19/96] adapte to multiple instance Co-Authored-By: JimboJoe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a7ad2d..bde855b 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/h #### `occ` command usage -If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/nextcloud/` folder, then use `sudo -u nextcloud php7.3 occ` instead of `occ` (as an alternative, you can use `/var/www/nextcloud/occ` to run the command from another directory). +If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/nextcloud/` folder (or `/var/www/nextcloud__n/` depending on your instance number in case of multiple concurrent installations), then use `sudo -u nextcloud php7.3 occ` instead of `occ` (as an alternative, you can use `/var/www/nextcloud/occ` to run the command from another directory). *NB: You may need to adapt `php7.3` to the PHP version that Nextcloud is using. Starting from Nextcloud 18, YunoHost uses php7.3, it used before php7.0.* From 2243f24465619bdf4acc811cbdebd4cad65c195a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 18 Apr 2020 11:27:35 +0200 Subject: [PATCH 20/96] Explain how to use OnlyOffice + minor readme reorganisation (it seems to be more a "configuration" thing) --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bde855b..7edceec 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,23 @@ you can synchronize your files over your devices. * [YunoHost demo](https://demo.yunohost.org/nextcloud/) * [Official demo](https://demo.nextcloud.com/) -## Configuration - ## Documentation * Official documentation: https://docs.nextcloud.com/server/18/user_manual/ * YunoHost documentation: https://github.com/YunoHost/doc/blob/master/app_nextcloud_fr.md +## Configuration + +#### Configure OnlyOffice integration + +Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an online rich text document editor) thought a Nextcloud app. +To install and configure it: +- Install *Community Document Server* application in your Nextcloud +- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/`. Keep others server parameters empty. Save it. +- You can also configure with file formats should be openned by OnlyOffice. +- Here you go :) You should be able to create new type of documents and open them. + + ## YunoHost specific features In addition to Nextcloud core features, the following are made available with From c402cc819b0e247b8a90a432c1fb133f575b6953 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 18 Apr 2020 11:32:07 +0200 Subject: [PATCH 21/96] OnlyOffice: add architecture support information --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7edceec..1cff9bf 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ To install and configure it: - You can also configure with file formats should be openned by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. +*NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi, …) is **not** supported* ## YunoHost specific features From ad396b04afd73f18409f5a9d9eff2e5e696deb87 Mon Sep 17 00:00:00 2001 From: lapineige Date: Fri, 24 Apr 2020 14:39:13 +0200 Subject: [PATCH 22/96] OnlyOffice doc: improve clarity --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1cff9bf..3f825dd 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,9 @@ you can synchronize your files over your devices. Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an online rich text document editor) thought a Nextcloud app. To install and configure it: -- Install *Community Document Server* application in your Nextcloud -- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/`. Keep others server parameters empty. Save it. +- Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server. +- Install OnlyOffice application. That's the client part that will connect to an OnlyOffice server. +- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (an URL might be defined by default, but is not always correct). Keep others server parameters empty. Save it. - You can also configure with file formats should be openned by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. From dda72665c3238b0f83602ef2fdce1cb33c5a8e28 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 25 Apr 2020 10:33:17 +0200 Subject: [PATCH 23/96] Upgrade to upstream version 18.0.4 --- README.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1ce4ca2..9ed1ae5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 18.0.3 +**Shipped version:** 18.0.4 ## Screenshots diff --git a/manifest.json b/manifest.json index 5f79407..c3cc160 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "18.0.3~ynh1", + "version": "18.0.4~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 4da3883..6a77d34 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="18.0.3" +next_version="18.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="7b67e709006230f90f95727f9fa92e8c73a9e93458b22103293120f9cb50fd72" +nextcloud_source_sha256="fad8e12632b352247ffc5ae181d4e414d732b9072caa0401774cfdb93a714329" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () { From f773b2879a423b0db73a83145a0c5587d190cd4a Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Tue, 28 Apr 2020 23:52:37 +0200 Subject: [PATCH 24/96] Update README.md Small typos And I removed the link to the doc as the same link is already line 29 --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3f825dd..6e37910 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,12 @@ you can synchronize your files over your devices. #### Configure OnlyOffice integration -Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an online rich text document editor) thought a Nextcloud app. +Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an online rich text document editor) through a Nextcloud app. To install and configure it: - Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server. - Install OnlyOffice application. That's the client part that will connect to an OnlyOffice server. - Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (an URL might be defined by default, but is not always correct). Keep others server parameters empty. Save it. -- You can also configure with file formats should be openned by OnlyOffice. +- You can also configure which file formats should be opened by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. *NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi, …) is **not** supported* @@ -125,7 +125,6 @@ sudo yunohost app ssowatconf * Report a bug: https://github.com/YunoHost-Apps/nextcloud_ynh/issues * Nextcloud website: https://nextcloud.com/ - * Nextcloud documentation: https://docs.nextcloud.com/ * Nextcloud repository: https://github.com/nextcloud/server * YunoHost website: https://yunohost.org/ From a442cc41ebd53ccaaec02f6d21a1a4c26a8f4aae Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 29 Apr 2020 00:08:33 +0200 Subject: [PATCH 25/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e37910..696e918 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ you can synchronize your files over your devices. ## Documentation * Official documentation: https://docs.nextcloud.com/server/18/user_manual/ - * YunoHost documentation: https://github.com/YunoHost/doc/blob/master/app_nextcloud_fr.md + * YunoHost documentation: https://github.com/YunoHost/doc/blob/master/app_nextcloud.md ## Configuration From 4c17d94ddf4ce991756948f2383ae63e6e08e2ae Mon Sep 17 00:00:00 2001 From: saimyx <44293594+Saimyx@users.noreply.github.com> Date: Wed, 29 Apr 2020 13:45:37 +0200 Subject: [PATCH 26/96] Create README_fr.md --- README_fr.md | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 README_fr.md diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..a3a0f5e --- /dev/null +++ b/README_fr.md @@ -0,0 +1,119 @@ +# Nextcloud pour YunoHost + +[![Niveau d'integration](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) +[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) + +*[Read this readme in english.](./README.md)* + + +> *Ce package vous permet d'installer Nextcloud 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 + +[Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. +Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. + +**Version incluse :** 18.0.4 + +## Captures d'écran + +![](https://raw.githubusercontent.com/nextcloud/screenshots/master/files/Files%20Overview.png) + +## Démo + +* [Démo YunoHost](https://demo.yunohost.org/nextcloud/) +* [Démo officielle](https://demo.nextcloud.com/) + +## Configuration + +## Documentation + + * Documentation officielle : https://docs.nextcloud.com/server/18/user_manual/ + * Documentation YunoHost : https://github.com/YunoHost/doc/blob/master/app_nextcloud_fr.md + +## Caractéristiques spécifiques YunoHost + +En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suivantes sont incluses dans ce package : + + * Intégration avec les utilisateurs YunoHost et le SSO - exemple, le bouton de déconnexion + * Permet à un utilisateur d'être l'administrateur (choisi à l'installation) + * Permet de multiples instances de cette application + * Accès optionnel au répertoire home depuis les fichiers Nextcloud (à activer à l'installation, le partage étant activé par défaut) + * Utilise le répertoire `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - exemple, baikal + +#### Support multi-utilisateurs + +#### Architectures supportées + +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nextcloud/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nextcloud/) + +## Limitations + +Pour intégrer le bouton de déconnexion du SSO, nous devons patcher les sources de Nextcloud. +En attendant un intégration de leur part, la vérification d'intégrité du code source est désactivée pour ne pas avoir de message d'avertissement. + +Donc notez que nous avons choisi de désactiver la applications de tierces-parties lors des mises à jour. Ça permet d'éviter une installation de Nextcloud instable - ou qui pourrait planter. +Vous devrez juste les réactiver manuellement après chaque mise à jour. + +Et enfin, le message d'erreur suivant dans les logs de Nextcloud peut être ignoré sans problème : +``` +Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/home/yunohost.multimedia/share/' not inside '/home/yunohost.multimedia/user/') +``` + +## Informations supplémentaires + +#### Migrer depuis ownCloud + +**La migration n'est pas encore considérée comme stable, merci de la faire prudemment et uniquement pour tester !** + +//fin de trad ------------------------------------------------------------------------------------- + +This package handle the migration from ownCloud to Nextcloud. For that, your +ownCloud application must be **up-to-date** in YunoHost. + +You will then have to upgrade your ownCloud application with this repository. +This can only be done from the command-line interface - e.g. through SSH. Once +you're connected, you simply have to execute the following: + +```bash +sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh owncloud --debug +``` + +The `--debug` option will let you see the full output. If you encounter any +issue, please paste it. + +Note that a cron job will be executed at some time after the end of this +command. You must wait that before doing any other application operations! +You should see that Nextcloud is installed after that. + +Note that it does not change the application label nor the URL. To rename +the label, you can execute the following - replace `Nextcloud` with whatever +you want: + +```bash +sudo yunohost app setting nextcloud label -v "Nextcloud" +sudo yunohost app ssowatconf +``` + +## Links + + * Report a bug: https://github.com/YunoHost-Apps/nextcloud_ynh/issues + * Nextcloud website: https://nextcloud.com/ + * Nextcloud repository: https://github.com/nextcloud/server + * YunoHost website: https://yunohost.org/ + +--- + +Developers infos +---------------- + +Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). + +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug +or +sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug +``` From 440fa10704533383ef8f885bd51720ea0b54926e Mon Sep 17 00:00:00 2001 From: saimyx <44293594+Saimyx@users.noreply.github.com> Date: Wed, 29 Apr 2020 14:31:08 +0200 Subject: [PATCH 27/96] Update README_fr.md --- README_fr.md | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/README_fr.md b/README_fr.md index a3a0f5e..97798ac 100644 --- a/README_fr.md +++ b/README_fr.md @@ -68,30 +68,20 @@ Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/h **La migration n'est pas encore considérée comme stable, merci de la faire prudemment et uniquement pour tester !** -//fin de trad ------------------------------------------------------------------------------------- - -This package handle the migration from ownCloud to Nextcloud. For that, your -ownCloud application must be **up-to-date** in YunoHost. - -You will then have to upgrade your ownCloud application with this repository. -This can only be done from the command-line interface - e.g. through SSH. Once -you're connected, you simply have to execute the following: +Ce package gère la migration de OwnCloud vers Nextcloud. Pour ça, l'application OwnCloud doit **être à jour** dans YunoHost. +Vous allez ensuite mettre à niveau votre OwnCloud avec ce dépôt. +Ça ne peut être fait qu'en ligne de commande - par exemple via SSH. Une fois connecté, vous n'avez plus qu'à exécuter la commande suivante : ```bash sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh owncloud --debug ``` -The `--debug` option will let you see the full output. If you encounter any -issue, please paste it. +L'option `--debug` va vous permettre de visualiser entièrement les retours de la mise à niveau. Si vous rencontrez un problème, merci de nous le transmettre. -Note that a cron job will be executed at some time after the end of this -command. You must wait that before doing any other application operations! -You should see that Nextcloud is installed after that. - -Note that it does not change the application label nor the URL. To rename -the label, you can execute the following - replace `Nextcloud` with whatever -you want: +Notez qu'une tâche cron va être exécutée une fois la fin de cette commande. Vous devez attendre qu'elle se fasse avant de faire une autre opération liée aux applications. +Nous espérons que Nextcloud sera installé après ça. +Notez que ça ne changera pas la label ni l'URL. Pour renommer le label, vous pouvez exécuter la commande suivante (en remplaçant `Nextcloud` par ce que vous voulez) : ```bash sudo yunohost app setting nextcloud label -v "Nextcloud" sudo yunohost app ssowatconf @@ -99,21 +89,19 @@ sudo yunohost app ssowatconf ## Links - * Report a bug: https://github.com/YunoHost-Apps/nextcloud_ynh/issues - * Nextcloud website: https://nextcloud.com/ - * Nextcloud repository: https://github.com/nextcloud/server - * YunoHost website: https://yunohost.org/ - + * Signaler un bug : https://github.com/YunoHost-Apps/nextcloud_ynh/issues + * Site web de Nextcloud : https://nextcloud.com/ + * Dpôt de Nextcloud : https://github.com/nextcloud/server + * Site web de YunoHost : https://yunohost.org/ + --- - -Developers infos +Informations pour les développeurs ---------------- -Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). - -To try the testing branch, please proceed like that. +Merci de faire votre « pull request » sur la [branche de test](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). +Pour tester la branche de test, faites comme ceci. ``` sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug -or +ou sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug ``` From 8a6d8fbe9df71259e35200cb97cadb8b4dfaa71b Mon Sep 17 00:00:00 2001 From: saimyx <44293594+Saimyx@users.noreply.github.com> Date: Wed, 29 Apr 2020 15:03:36 +0200 Subject: [PATCH 28/96] Update README_fr.md --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 97798ac..34620dc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Nextcloud pour YunoHost -[![Niveau d'integration](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) +[![Niveau d'integration](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) [![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) *[Read this readme in english.](./README.md)* From 0ac9fab4ed33bbcd7bfbfff391e7a90bba2b5b27 Mon Sep 17 00:00:00 2001 From: saimyx <44293594+Saimyx@users.noreply.github.com> Date: Wed, 29 Apr 2020 15:04:13 +0200 Subject: [PATCH 29/96] Update README_fr.md --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 34620dc..faf7d7a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 18.0.4 +**Version incluse :** 18.0.2 ## Captures d'écran From 651efbd63cf24f5fc2e39c62f32740d980a88233 Mon Sep 17 00:00:00 2001 From: saimyx <44293594+Saimyx@users.noreply.github.com> Date: Wed, 29 Apr 2020 15:05:50 +0200 Subject: [PATCH 30/96] Update README_fr.md --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index faf7d7a..fb7980a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -40,7 +40,7 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv * Permet à un utilisateur d'être l'administrateur (choisi à l'installation) * Permet de multiples instances de cette application * Accès optionnel au répertoire home depuis les fichiers Nextcloud (à activer à l'installation, le partage étant activé par défaut) - * Utilise le répertoire `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - exemple, baikal + * Utilise le répertoire `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà -par exemple, baikal #### Support multi-utilisateurs From c0e4da8f1837c5584a991dd936066be7811a7f25 Mon Sep 17 00:00:00 2001 From: saimyx <44293594+Saimyx@users.noreply.github.com> Date: Wed, 29 Apr 2020 15:06:32 +0200 Subject: [PATCH 31/96] lien readme-fr --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f0153fe..4c46132 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Integration level](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) [![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) +*[Lire ce readme en français.](./README_fr.md)* > *This package allow you to install Nextcloud 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.* From 829645c30ee43607c038a4e81a033792f828586f Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 29 Apr 2020 16:01:28 +0200 Subject: [PATCH 32/96] Fix typo and phrasing --- README_fr.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README_fr.md b/README_fr.md index fb7980a..4dba008 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # Nextcloud pour YunoHost -[![Niveau d'integration](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) -[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) +[![Niveau d'integration](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) +[![Installer Nextcloud avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) *[Read this readme in english.](./README.md)* @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 18.0.2 +**Version incluse :** 18.0.4 ## Captures d'écran @@ -40,7 +40,7 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv * Permet à un utilisateur d'être l'administrateur (choisi à l'installation) * Permet de multiples instances de cette application * Accès optionnel au répertoire home depuis les fichiers Nextcloud (à activer à l'installation, le partage étant activé par défaut) - * Utilise le répertoire `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà -par exemple, baikal + * Utilise l'adresse `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - par exemple, baikal #### Support multi-utilisateurs @@ -54,7 +54,7 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv Pour intégrer le bouton de déconnexion du SSO, nous devons patcher les sources de Nextcloud. En attendant un intégration de leur part, la vérification d'intégrité du code source est désactivée pour ne pas avoir de message d'avertissement. -Donc notez que nous avons choisi de désactiver la applications de tierces-parties lors des mises à jour. Ça permet d'éviter une installation de Nextcloud instable - ou qui pourrait planter. +Notez également que nous avons choisi de désactiver les applications tierces-parties lors des mises à jour. Ça permet d'éviter une installation de Nextcloud instable - ou qui pourrait planter. Vous devrez juste les réactiver manuellement après chaque mise à jour. Et enfin, le message d'erreur suivant dans les logs de Nextcloud peut être ignoré sans problème : @@ -79,9 +79,9 @@ sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh ownc L'option `--debug` va vous permettre de visualiser entièrement les retours de la mise à niveau. Si vous rencontrez un problème, merci de nous le transmettre. Notez qu'une tâche cron va être exécutée une fois la fin de cette commande. Vous devez attendre qu'elle se fasse avant de faire une autre opération liée aux applications. -Nous espérons que Nextcloud sera installé après ça. +Vous devriez constater que Nextcloud sera installé après ça. -Notez que ça ne changera pas la label ni l'URL. Pour renommer le label, vous pouvez exécuter la commande suivante (en remplaçant `Nextcloud` par ce que vous voulez) : +Notez que ça ne changera pas le label ni l'URL. Pour renommer le label, vous pouvez exécuter la commande suivante (en remplaçant `Nextcloud` par ce que vous voulez) : ```bash sudo yunohost app setting nextcloud label -v "Nextcloud" sudo yunohost app ssowatconf @@ -91,15 +91,15 @@ sudo yunohost app ssowatconf * Signaler un bug : https://github.com/YunoHost-Apps/nextcloud_ynh/issues * Site web de Nextcloud : https://nextcloud.com/ - * Dpôt de Nextcloud : https://github.com/nextcloud/server + * Dépôt de Nextcloud : https://github.com/nextcloud/server * Site web de YunoHost : https://yunohost.org/ --- Informations pour les développeurs ---------------- -Merci de faire votre « pull request » sur la [branche de test](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). -Pour tester la branche de test, faites comme ceci. +Merci de faire votre « pull request » sur la [branche testing](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). +Pour tester la branche testing, faites comme ceci. ``` sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug ou From 77fcef8ae71c17e4612a3f6b7fd9f2c8323ada79 Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 29 Apr 2020 23:03:29 +0200 Subject: [PATCH 33/96] Documentation pour OnlyOffice Pour s'aligner avec https://github.com/YunoHost-Apps/nextcloud_ynh/pull/278 --- README_fr.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README_fr.md b/README_fr.md index 4dba008..1adf19e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,12 +25,24 @@ Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. * [Démo YunoHost](https://demo.yunohost.org/nextcloud/) * [Démo officielle](https://demo.nextcloud.com/) -## Configuration - ## Documentation * Documentation officielle : https://docs.nextcloud.com/server/18/user_manual/ * Documentation YunoHost : https://github.com/YunoHost/doc/blob/master/app_nextcloud_fr.md + +## Configuration + +#### Configurer l'intégration d'OnlyOffice + +À partir de sa version 18, Nextcloud intégre une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud. +Pour l'installer et le configurer: + - Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice. + - Installez l'application *OnlyOffice*. C'est la partie cliente qui va se connecter au serveur OnlyOffice. + - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), vous devez le configurer avec l'URL suivante `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (une URL peut-être préremplie, mais elle n'est pas toujours correcte). Veuillez noter la présence de **`/index.php/`**. Laissez les autres paramètres vides. Sauvegardez. + - Vous pouvez aussi configurer quels formats de fichier s'ouvrent avec OnlyOffice. + - Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. + + *NB: OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi, …) n'est **pas** supporté* ## Caractéristiques spécifiques YunoHost From 490d27b1df66d1ee22e62925acf468c9f308ea1e Mon Sep 17 00:00:00 2001 From: lapineige Date: Wed, 29 Apr 2020 23:06:29 +0200 Subject: [PATCH 34/96] Make the URL change clearer --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 696e918..86ff788 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an o To install and configure it: - Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server. - Install OnlyOffice application. That's the client part that will connect to an OnlyOffice server. -- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (an URL might be defined by default, but is not always correct). Keep others server parameters empty. Save it. +- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (an URL might be defined by default, but is not always correct). Please note the **`/index.php/`**. Keep others server parameters empty. Save it. - You can also configure which file formats should be opened by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. From 307255b541e7c8d174da31e6f8a4399fecf5ee03 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 4 May 2020 19:16:33 +0200 Subject: [PATCH 35/96] use only YNH_APP_INSTANCE_NAME --- scripts/actions/disable_maintenance | 2 +- scripts/config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/actions/disable_maintenance b/scripts/actions/disable_maintenance index 0c2c8b2..0ea0edb 100755 --- a/scripts/actions/disable_maintenance +++ b/scripts/actions/disable_maintenance @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS #================================================= -app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} +app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) diff --git a/scripts/config b/scripts/config index b0314f0..d06b98b 100644 --- a/scripts/config +++ b/scripts/config @@ -14,7 +14,7 @@ source _ynh_add_fpm_config # RETRIEVE ARGUMENTS #================================================= -app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} +app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD VALUES From fad0adfb5eee4991795f31ed9586ef9e21b532c5 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 27 May 2020 14:10:13 +0200 Subject: [PATCH 36/96] Update nginx conf --- conf/nginx.conf | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index c4b73e1..4ddb371 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -69,15 +69,15 @@ location ^~ __PATH__/ { access_log off; } - location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)/ { + location ~ ^\__PATH__\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { deny all; } - location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { + location ~ ^\__PATH__\/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } - location ~ ^__PATH__/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+)\.php(/.*|)$ { - fastcgi_split_path_info ^(.+?\.php)(/.*|)$; + location ~ ^\__PATH__\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; include fastcgi_params; @@ -92,10 +92,9 @@ location ^~ __PATH__/ { fastcgi_pass unix:/var/run/php/php__YNH_PHP_VERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; - fastcgi_param REMOTE_USER $remote_user; } - location ~ ^__PATH__/(?:updater|oc[ms]-provider)(?:$|/) { + location ~ ^\__PATH__\/(?:updater|oc[ms]-provider)(?:$|\/) { try_files $uri/ =404; index index.php; } @@ -117,9 +116,8 @@ location ^~ __PATH__/ { } - - # Adding the cache control header for js and css files - location ~ \.(?:css|js|woff2?|svg|gif)$ { + # Adding the cache control header for js, css and map files + location ~ ^\__PATH__\/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { try_files $uri __PATH__/index.php$request_uri; more_set_headers "Cache-Control: public, max-age=15778463"; # Add headers to serve security related headers @@ -129,13 +127,14 @@ location ^~ __PATH__/ { more_set_headers "X-Robots-Tag: none"; more_set_headers "X-Download-Options: noopen"; more_set_headers "X-Permitted-Cross-Domain-Policies: none"; + more_set_headers "X-Frame-Options: SAMEORIGIN"; more_set_headers "Referrer-Policy: no-referrer"; # Optional: Don't log access to assets access_log off; } - location ~* \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { + location ~ ^\__PATH__\/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { try_files $uri __PATH__/index.php$request_uri; # Optional: Don't log access to other assets access_log off; From 63ef78d0364d7b8f06ec2daf7051a4f90b01c877 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 27 May 2020 14:13:49 +0200 Subject: [PATCH 37/96] onlyoffice works without hack --- README.md | 3 +-- README_fr.md | 3 +-- conf/nginx.conf | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3c48bca..de17cac 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,7 @@ Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an o To install and configure it: - Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server. - Install OnlyOffice application. That's the client part that will connect to an OnlyOffice server. -- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), you need to configure its URL with `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (an URL might be defined by default, but is not always correct). Please note the **`/index.php/`**. Keep others server parameters empty. Save it. -- You can also configure which file formats should be opened by OnlyOffice. +- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. *NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi, …) is **not** supported* diff --git a/README_fr.md b/README_fr.md index 1adf19e..a80bc2f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -38,8 +38,7 @@ Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. Pour l'installer et le configurer: - Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice. - Installez l'application *OnlyOffice*. C'est la partie cliente qui va se connecter au serveur OnlyOffice. - - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), vous devez le configurer avec l'URL suivante `https://yourdomain.tld/nextcloud/index.php/apps/documentserver_community/` (une URL peut-être préremplie, mais elle n'est pas toujours correcte). Veuillez noter la présence de **`/index.php/`**. Laissez les autres paramètres vides. Sauvegardez. - - Vous pouvez aussi configurer quels formats de fichier s'ouvrent avec OnlyOffice. + - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. - Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. *NB: OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi, …) n'est **pas** supporté* diff --git a/conf/nginx.conf b/conf/nginx.conf index 4ddb371..09cc770 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -115,6 +115,9 @@ location ^~ __PATH__/ { rewrite ^ __PATH__/index.php$request_uri; } + location ~* ^__PATH__/apps/documentserver_community/ { + rewrite ^ __PATH__/index.php$request_uri; + } # Adding the cache control header for js, css and map files location ~ ^\__PATH__\/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { From d3e8e5f0a76fbb15fa101117a3e018d9e403fcc1 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Mon, 8 Jun 2020 08:28:37 +0200 Subject: [PATCH 38/96] Upgrade to upstream version 18.0.5 --- README.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3c48bca..5e5162e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 18.0.4 +**Shipped version:** 18.0.5 ## Screenshots diff --git a/manifest.json b/manifest.json index c3cc160..e196b2d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "18.0.4~ynh1", + "version": "18.0.5~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 6a77d34..d4d6735 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="18.0.4" +next_version="18.0.5" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="fad8e12632b352247ffc5ae181d4e414d732b9072caa0401774cfdb93a714329" +nextcloud_source_sha256="52182fcdc289061f981100f53ccd411c35a10b81d1b88a934af9668c8055d753" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () { From 3251079286e68987e5191aa6e01c1a47c74cc78d Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 14 Jun 2020 15:23:05 +0200 Subject: [PATCH 39/96] Upgrade to upstream version 19.0.0 --- README.md | 2 +- README_fr.md | 2 +- conf/nginx.conf | 4 ++-- manifest.json | 2 +- scripts/_common.sh | 2 +- scripts/upgrade.d/upgrade.18.sh | 7 +++++++ scripts/upgrade.d/upgrade.last.sh | 6 +++--- 7 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 scripts/upgrade.d/upgrade.18.sh diff --git a/README.md b/README.md index 3c48bca..dd96415 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 18.0.4 +**Shipped version:** 19.0.0 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 1adf19e..c849567 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 18.0.4 +**Version incluse :** 19.0.0 ## Captures d'écran diff --git a/conf/nginx.conf b/conf/nginx.conf index c4b73e1..6cfb6e6 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -76,7 +76,7 @@ location ^~ __PATH__/ { deny all; } - location ~ ^__PATH__/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+)\.php(/.*|)$ { + location ~ ^__PATH__/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+|.+\/richdocumentscode\/proxy)\.php(/.*|)$ { fastcgi_split_path_info ^(.+?\.php)(/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; @@ -135,7 +135,7 @@ location ^~ __PATH__/ { access_log off; } - location ~* \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { + location ~* \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ { try_files $uri __PATH__/index.php$request_uri; # Optional: Don't log access to other assets access_log off; diff --git a/manifest.json b/manifest.json index c3cc160..1daa850 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "18.0.4~ynh1", + "version": "19.0.0~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 7b84705..5bf88c4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ pkg_dependencies="imagemagick acl tar smbclient at" YNH_PHP_VERSION="7.3" -extra_pkg_dependencies="php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-smbclient php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary" +extra_pkg_dependencies="php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-smbclient php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary php${YNH_PHP_VERSION}-bcmath" #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/upgrade.d/upgrade.18.sh b/scripts/upgrade.d/upgrade.18.sh new file mode 100644 index 0000000..e43bb76 --- /dev/null +++ b/scripts/upgrade.d/upgrade.18.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Last available nextcloud version +next_version="19.0.0" + +# Nextcloud tarball checksum sha256 +nextcloud_source_sha256="d23d429657c5e3476d7e73af1eafc70e42a81cfe2ed65b20655a005724fe0aae" diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 6a77d34..0c5e33c 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="18.0.4" +next_version="19.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="fad8e12632b352247ffc5ae181d4e414d732b9072caa0401774cfdb93a714329" +nextcloud_source_sha256="d23d429657c5e3476d7e73af1eafc70e42a81cfe2ed65b20655a005724fe0aae" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () { @@ -12,5 +12,5 @@ last_upgrade_operations () { cp -a ../sources/patches_last_version/* ../sources/patches # Execute post-upgrade operations later on - (cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log") + (cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log") } From ad4ea9d6e77c026d2036c7c393c2603135aa56b3 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 14 Jun 2020 15:23:34 +0200 Subject: [PATCH 40/96] Fix upgrade for first major versions --- scripts/upgrade | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5d832b6..8054652 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -247,17 +247,19 @@ then major_version=${last_version%%.*} current_major_version=${current_version%%.*} + # Load the value for this version + source upgrade.d/upgrade.$current_major_version.sh + # If the current version has the same major version than the next one, # then it's the last upgrade to do - if [ "$major_version" -eq "$current_major_version" ]; then + # We also cover the case where the last version is the first of the current major version series + # (e.g. 19.0.0 is the latest version) + if [[ ("$major_version" -eq "$current_major_version") || ( ("$major_version" -eq "$((current_major_version+1))") && ("$next_version" == "$last_version") ) ]]; then current_major_version=last # Execute the commands dedicated to the last upgrade last_upgrade_operations fi - # Load the value for this version - source upgrade.d/upgrade.$current_major_version.sh - ynh_print_info --message="Upgrade to nextcloud $next_version" # Create an app.src for this version of nextcloud From 8d1bb6046bbee91cd0ef3011ae675202e2519e96 Mon Sep 17 00:00:00 2001 From: Kayou Date: Fri, 19 Jun 2020 10:54:14 +0200 Subject: [PATCH 41/96] Fix backward compatibility --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e14cd53..7800a53 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -197,11 +197,11 @@ fi # Define a function to execute commands with `occ` exec_occ() { # Backward compatibility to upgrade from NC14 or older version - if [ $current_major_version -lt 15 ] + if [ $current_major_version = "last" ] || [ $current_major_version -ge 15 ] then - NEXTCLOUD_PHP_VERSION="7.0" - else NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION + else + NEXTCLOUD_PHP_VERSION="7.0" fi (cd "$final_path" && exec_as "$app" \ php$NEXTCLOUD_PHP_VERSION occ --no-interaction --no-ansi "$@") From 77386abeba1129a664b3605be5eab6fd2b245b9c Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 22 Jun 2020 10:33:40 +0200 Subject: [PATCH 42/96] fix nginx on root install --- conf/nginx.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 09cc770..d46418a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -69,14 +69,14 @@ location ^~ __PATH__/ { access_log off; } - location ~ ^\__PATH__\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { + location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)\/ { deny all; } - location ~ ^\__PATH__\/(?:\.|autotest|occ|issue|indie|db_|console) { + location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } - location ~ ^\__PATH__\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { + location ~ ^__PATH__/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; @@ -94,7 +94,7 @@ location ^~ __PATH__/ { fastcgi_request_buffering off; } - location ~ ^\__PATH__\/(?:updater|oc[ms]-provider)(?:$|\/) { + location ~ ^__PATH__/(?:updater|oc[ms]-provider)(?:$|\/) { try_files $uri/ =404; index index.php; } @@ -120,7 +120,7 @@ location ^~ __PATH__/ { } # Adding the cache control header for js, css and map files - location ~ ^\__PATH__\/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { + location ~ ^__PATH__/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { try_files $uri __PATH__/index.php$request_uri; more_set_headers "Cache-Control: public, max-age=15778463"; # Add headers to serve security related headers @@ -137,7 +137,7 @@ location ^~ __PATH__/ { access_log off; } - location ~ ^\__PATH__\/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { + location ~ ^__PATH__/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { try_files $uri __PATH__/index.php$request_uri; # Optional: Don't log access to other assets access_log off; From 5cc1c57ddd04ab6659690b0d72dc61f137bc7221 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 8 Jul 2020 10:59:54 +0200 Subject: [PATCH 43/96] fix var name --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index bcaf40b..2b9a766 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ pkg_dependencies="imagemagick acl tar smbclient at" YNH_PHP_VERSION="7.3" -extra_pkg_dependencies="php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-smbclient php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary php${YNH_PHP_VERSION}-bcmath" +extra_php_dependencies="php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-smbclient php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-apcu php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-igbinary php${YNH_PHP_VERSION}-bcmath" #================================================= # EXPERIMENTAL HELPERS From bc1fe2ff26977cca5a896baacaf8e393d46190b9 Mon Sep 17 00:00:00 2001 From: SirFerdek <17548441+SirFerdek@users.noreply.github.com> Date: Fri, 17 Jul 2020 22:18:45 +0200 Subject: [PATCH 44/96] Fix "spinning wheel" when no README.md file in folder. The rich workspace dialouge loads by default in every folder. When user deletes README.md file, Nextcloud responds with 404 http code to inform the UI scipts to not render the rich workspace. Overwriting the response with custom 404 status page creates "spinning wheel" UI bug in every folder without README.md file in it. Fixes #318 --- conf/nginx.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d46418a..dfe42e3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -57,7 +57,9 @@ location ^~ __PATH__/ { # Errors pages error_page 403 __PATH__/core/templates/403.php; - error_page 404 __PATH__/core/templates/404.php; + # Don't set custom 404 error page, as nextcloud uses 404 codes with meaningful payload. + # Setting custom 404 page clears the payload and creates UI bugs + # error_page 404 __PATH__/core/templates/404.php; location __PATH__/ { rewrite ^ __PATH__/index.php; From 1b910c20d6fbf84f145b73ff7c94d20d4448fe3f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 20 Jul 2020 17:27:27 +0200 Subject: [PATCH 45/96] Upgrade to 18.0.7 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 345c00e..7306522 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which run on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 18.0.5 +**Shipped version:** 18.0.7 ## Screenshots diff --git a/README_fr.md b/README_fr.md index a80bc2f..dced3aa 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 18.0.4 +**Version incluse :** 18.0.7 ## Captures d'écran diff --git a/manifest.json b/manifest.json index cfefefd..31bbafd 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "18.0.5~ynh1", + "version": "18.0.7~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index d4d6735..c6cf27a 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="18.0.5" +next_version="18.0.7" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="52182fcdc289061f981100f53ccd411c35a10b81d1b88a934af9668c8055d753" +nextcloud_source_sha256="4b2cc7475d925faf9ce6c655d290cbbee8c02a40aaf0628d3d41b7ccd8416a5e" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () { From bf9ab43dd26556818105c198960a90316b8bc106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Jul 2020 13:35:17 +0200 Subject: [PATCH 46/96] Update README_fr.md (#315) * Update README_fr.md * Update README_fr.md --- README_fr.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README_fr.md b/README_fr.md index a80bc2f..ce80774 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,7 +6,7 @@ *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Nextcloud rapidement et simplement sur un serveur Yunohost. +> *Ce package vous permet d'installer Nextcloud 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 @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 18.0.4 +**Version incluse :** 18.0.5 ## Captures d'écran @@ -35,13 +35,13 @@ Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. #### Configurer l'intégration d'OnlyOffice À partir de sa version 18, Nextcloud intégre une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud. -Pour l'installer et le configurer: +Pour l'installer et le configurer : - Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice. - Installez l'application *OnlyOffice*. C'est la partie cliente qui va se connecter au serveur OnlyOffice. - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. - Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. - *NB: OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi, …) n'est **pas** supporté* + *NB : OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi, …) n'est **pas** supporté* ## Caractéristiques spécifiques YunoHost @@ -57,7 +57,7 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv #### Architectures supportées -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nextcloud/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nextcloud/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nextcloud/) ## Limitations @@ -106,6 +106,7 @@ sudo yunohost app ssowatconf * Site web de YunoHost : https://yunohost.org/ --- + Informations pour les développeurs ---------------- From 5626cf402315ab9fbc348ab9f44d1e9b702d6840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 27 Jul 2020 09:07:33 +0200 Subject: [PATCH 47/96] Update README.md - *Typos* --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 345c00e..0dd94ad 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview [Nextcloud](https://nextcloud.com) gives you freedom and control over your -own data. A personal cloud which run on your own server. With Nextcloud +own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. @@ -48,19 +48,19 @@ To install and configure it: In addition to Nextcloud core features, the following are made available with this package: - * Integrate with YunoHost users and SSO - i.e logout button + * Integrate with YunoHost users and SSO - i.e. logout button * Allow one user to be the administrator (set at the installation) * Allow multiple instances of this application * Optionally access the user home folder from Nextcloud files (set at the installation, the sharing is enabled by default) * Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's - not already served - i.e by Baïkal + not already served - i.e. by Baïkal #### Multi-users support #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nextcloud/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nextcloud/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nextcloud%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nextcloud/) ## Limitations @@ -94,7 +94,7 @@ If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/n **This is not considered as stable yet, please do it with care and only for testing!** -This package handle the migration from ownCloud to Nextcloud. For that, your +This package handles the migration from ownCloud to Nextcloud. For that, your ownCloud application must be **up-to-date** in YunoHost. You will then have to upgrade your ownCloud application with this repository. From 3bbb080e94aaac81d3364634c9e851320457634b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 12 Aug 2020 20:44:55 +0200 Subject: [PATCH 48/96] upgrade to 19.0.1 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a735d2c..418b450 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 18.0.7 +**Shipped version:** 19.0.1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index ada1a91..4b76836 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 18.0.7 +**Version incluse :** 19.0.1 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 31bbafd..7320cfd 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "18.0.7~ynh1", + "version": "19.0.1~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index c6cf27a..fecdbdd 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,10 +1,10 @@ #!/bin/bash # Last available nextcloud version -next_version="18.0.7" +next_version="19.0.1" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="4b2cc7475d925faf9ce6c655d290cbbee8c02a40aaf0628d3d41b7ccd8416a5e" +nextcloud_source_sha256="4ef311e00d939915d3a9714cd3a1ad436db9157e04620e4a88c2f427e5e65b2d" # This function will only be executed upon applying the last upgrade referenced above last_upgrade_operations () { From 03f2641bb95c4037df3cfaeba2e05094c2795d58 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 12 Aug 2020 20:46:51 +0200 Subject: [PATCH 49/96] Create upgrade.18.sh --- scripts/upgrade.d/upgrade.18.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/upgrade.d/upgrade.18.sh diff --git a/scripts/upgrade.d/upgrade.18.sh b/scripts/upgrade.d/upgrade.18.sh new file mode 100644 index 0000000..e43bb76 --- /dev/null +++ b/scripts/upgrade.d/upgrade.18.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Last available nextcloud version +next_version="19.0.0" + +# Nextcloud tarball checksum sha256 +nextcloud_source_sha256="d23d429657c5e3476d7e73af1eafc70e42a81cfe2ed65b20655a005724fe0aae" From 41dee40b09dc69f71a0b200a7ecaeb1b0fb4d715 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 14 Aug 2020 12:01:51 +0200 Subject: [PATCH 50/96] Add action add_multimedia_directories --- actions.toml | 9 ++++ scripts/actions/add_multimedia_directories | 58 ++++++++++++++++++++++ scripts/upgrade | 14 ------ 3 files changed, 67 insertions(+), 14 deletions(-) create mode 100755 scripts/actions/add_multimedia_directories diff --git a/actions.toml b/actions.toml index 38c52a8..fc6cb0f 100644 --- a/actions.toml +++ b/actions.toml @@ -6,3 +6,12 @@ command = "/bin/bash scripts/actions/disable_maintenance" # accepted_return_codes = [0, 1, 2, 3] # optional accepted_return_codes = [0] description = "Disable the maintenance mode of Nextcloud if you're stuck after an upgrade" + +[add_multimedia_directories] +name = "Add multimedia directories" +command = "/bin/bash scripts/actions/add_multimedia_directories" +# user = "root" # optional +# cwd = "/" # optional +# accepted_return_codes = [0, 1, 2, 3] # optional +accepted_return_codes = [0] +description = "Add the multimedia and shared multimedia directories again" diff --git a/scripts/actions/add_multimedia_directories b/scripts/actions/add_multimedia_directories new file mode 100755 index 0000000..2f34980 --- /dev/null +++ b/scripts/actions/add_multimedia_directories @@ -0,0 +1,58 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source scripts/_common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +app=$YNH_APP_INSTANCE_NAME + +#================================================= +# CHECK IF ARGUMENTS ARE CORRECT +#================================================= + +#================================================= +# DEFINE FUNCTION +#================================================= + +# Define a function to add an external storage +# Create the external storage for the given folders and enable sharing +create_external_storage() { +local datadir="$1" +local mount_name="$2" +local mount_id=`exec_occ files_external:create --output=json \ + "$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true` +! [[ $mount_id =~ ^[0-9]+$ ]] \ + && ynh_print_warn --message="Unable to create external storage" \ + || exec_occ files_external:option "$mount_id" enable_sharing true +} + +#================================================= +# SPECIFIC ACTION +#================================================= +# YUNOHOST MULTIMEDIA INTEGRATION +#================================================= +ynh_script_progression --message="Updating multimedia directories..." --weight=6 + +# Build YunoHost multimedia directories +ynh_multimedia_build_main_dir +# Mount the user directory in Nextcloud +exec_occ app:enable files_external +create_external_storage "/home/yunohost.multimedia/\$user" "Multimedia" +create_external_storage "/home/yunohost.multimedia/share" "Shared multimedia" +# Allow nextcloud to write into these directories +ynh_multimedia_addaccess $app + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Execution completed" --last diff --git a/scripts/upgrade b/scripts/upgrade index 7800a53..b1accbe 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -401,20 +401,6 @@ exec_occ background:cron # Set system group in hooks ynh_replace_string --match_string="__GROUP__" --replace_string="$app" --target_file=../hooks/post_user_create -#================================================= -# YUNOHOST MULTIMEDIA INTEGRATION -#================================================= -ynh_script_progression --message="Updating multimedia directories..." --weight=6 - -# Build YunoHost multimedia directories -ynh_multimedia_build_main_dir -# Mount the user directory in Nextcloud -exec_occ app:enable files_external -create_external_storage "/home/yunohost.multimedia/\$user" "Multimedia" -create_external_storage "/home/yunohost.multimedia/share" "Shared multimedia" -# Allow nextcloud to write into these directories -ynh_multimedia_addaccess $app - #================================================= # GENERIC FINALIZATION #================================================= From 38b66a8530010f83a42cce22ce74066f5c693a63 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 14 Aug 2020 13:11:14 +0200 Subject: [PATCH 51/96] fix action --- scripts/actions/add_multimedia_directories | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/actions/add_multimedia_directories b/scripts/actions/add_multimedia_directories index 2f34980..4dc7881 100755 --- a/scripts/actions/add_multimedia_directories +++ b/scripts/actions/add_multimedia_directories @@ -15,6 +15,8 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + #================================================= # CHECK IF ARGUMENTS ARE CORRECT #================================================= @@ -23,6 +25,12 @@ app=$YNH_APP_INSTANCE_NAME # DEFINE FUNCTION #================================================= +# Define a function to execute commands with `occ` +exec_occ() { + (cd "$final_path" && exec_as "$app" \ + php$YNH_PHP_VERSION occ --no-interaction --no-ansi "$@") +} + # Define a function to add an external storage # Create the external storage for the given folders and enable sharing create_external_storage() { From 74f3112feaa4ca0778d2532000d04f77eca9c455 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 17 Aug 2020 17:07:34 +0200 Subject: [PATCH 52/96] fix upgrade --- scripts/install | 7 ++++++- scripts/upgrade | 27 ++++++++++++++++----------- scripts/upgrade.d/upgrade.last.sh | 9 --------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/scripts/install b/scripts/install index db96c16..6eb8471 100755 --- a/scripts/install +++ b/scripts/install @@ -273,7 +273,12 @@ exec_occ background:cron # POST-INSTALL MAINTENANCE #================================================= -(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log") +( + cd $final_path + sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices + sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns + sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n +) #================================================= # CONFIGURE THE HOOK FILE FOR USER CREATE diff --git a/scripts/upgrade b/scripts/upgrade index a6a467b..b793386 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -229,6 +229,8 @@ then source upgrade.d/upgrade.last.sh last_version=$next_version + last_major_version=${last_version%%.*} + # Set write access for the following commands chown -R $app: "$final_path" "$datadir" @@ -240,23 +242,19 @@ then do # The major version is the first part of the version number - # major_version=${next_version%%.*} - major_version=${last_version%%.*} current_major_version=${current_version%%.*} - # Load the value for this version - source upgrade.d/upgrade.$current_major_version.sh - # If the current version has the same major version than the next one, # then it's the last upgrade to do - # We also cover the case where the last version is the first of the current major version series - # (e.g. 19.0.0 is the latest version) - if [[ ("$major_version" -eq "$current_major_version") || ( ("$major_version" -eq "$((current_major_version+1))") && ("$next_version" == "$last_version") ) ]]; then - current_major_version=last - # Execute the commands dedicated to the last upgrade - last_upgrade_operations + if [ "$last_major_version" -eq "$current_major_version" ]; then + current_major_version=last + # Enable YunoHost patches on Nextcloud sources + cp -a ../sources/patches_last_version/* ../sources/patches fi + # Load the value for this version + source upgrade.d/upgrade.$current_major_version.sh + ynh_print_info --message="Upgrade to nextcloud $next_version" # Create an app.src for this version of nextcloud @@ -311,6 +309,13 @@ then exec_occ -V done + ( + cd $final_path + sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices + sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns + sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n + ) + #================================================= # CONFIGURE NEXTCLOUD #================================================= diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 312ae98..2e73d3d 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -5,12 +5,3 @@ next_version="19.0.1" # Nextcloud tarball checksum sha256 nextcloud_source_sha256="4ef311e00d939915d3a9714cd3a1ad436db9157e04620e4a88c2f427e5e65b2d" - -# This function will only be executed upon applying the last upgrade referenced above -last_upgrade_operations () { - # Patch nextcloud files only for the last version - cp -a ../sources/patches_last_version/* ../sources/patches - - # Execute post-upgrade operations later on - (cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log") -} From fa00d46c04f8d78a1af0de23a76650bbf39e4ad2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 26 Aug 2020 23:24:09 +0200 Subject: [PATCH 53/96] upgrade to v.19.0.2 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 418b450..d4edc7b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 19.0.1 +**Shipped version:** 19.0.2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 4b76836..945d76c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 19.0.1 +**Version incluse :** 19.0.2 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 7320cfd..d9f1c08 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "19.0.1~ynh1", + "version": "19.0.2~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 2e73d3d..cf10d7c 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="19.0.1" +next_version="19.0.2" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="4ef311e00d939915d3a9714cd3a1ad436db9157e04620e4a88c2f427e5e65b2d" +nextcloud_source_sha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" From 1591235c2e6e11ea28fa8bfae4b6f4c18ea633fc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 26 Aug 2020 23:57:53 +0200 Subject: [PATCH 54/96] Update upgrade.last.sh --- scripts/upgrade.d/upgrade.last.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index cf10d7c..0d733b9 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -4,4 +4,4 @@ next_version="19.0.2" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" +nextcloud_source_sha256="8152f385fdb0645114e0043aaf07b0de046fbaf205fa6d6bf530d22db86c66a5" From caf092aa0c0d98da60b78317e879baf885f77cdf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 2 Sep 2020 08:56:33 +0200 Subject: [PATCH 55/96] Update doc version URL --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d4edc7b..9a3dd85 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ you can synchronize your files over your devices. ## Documentation - * Official documentation: https://docs.nextcloud.com/server/18/user_manual/ + * Official documentation: https://docs.nextcloud.com/server/19/user_manual/ * YunoHost documentation: https://github.com/YunoHost/doc/blob/master/app_nextcloud.md ## Configuration diff --git a/README_fr.md b/README_fr.md index 945d76c..9741bb9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. ## Documentation - * Documentation officielle : https://docs.nextcloud.com/server/18/user_manual/ + * Documentation officielle : https://docs.nextcloud.com/server/19/user_manual/ * Documentation YunoHost : https://github.com/YunoHost/doc/blob/master/app_nextcloud_fr.md ## Configuration From 895f9951b2ad8c7e17ea2d67ba572d0dca41443c Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 7 Sep 2020 17:52:07 +0200 Subject: [PATCH 56/96] fix nginx conf --- conf/nginx.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index af8ce3e..0cf3732 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -78,8 +78,8 @@ location ^~ __PATH__/ { deny all; } - location ~ ^__PATH__/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(\/.*|)$ { - fastcgi_split_path_info ^(.+?\.php)(/.*|)$; + location ~ ^__PATH__/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; include fastcgi_params; @@ -139,7 +139,7 @@ location ^~ __PATH__/ { access_log off; } - location ~* \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ { + location ~ ^__PATH__/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ { try_files $uri __PATH__/index.php$request_uri; # Optional: Don't log access to other assets access_log off; From 70207544ab195121d041c63e24192082abc939c5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Sep 2020 22:28:49 +0200 Subject: [PATCH 57/96] Upgrade to 19.0.3 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9a3dd85..b4b939b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 19.0.2 +**Shipped version:** 19.0.3 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 9741bb9..404ef69 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 19.0.2 +**Version incluse :** 19.0.3 ## Captures d'écran diff --git a/manifest.json b/manifest.json index d9f1c08..75aa560 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "19.0.2~ynh1", + "version": "19.0.3~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 0d733b9..569c56e 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="19.0.2" +next_version="19.0.3" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="8152f385fdb0645114e0043aaf07b0de046fbaf205fa6d6bf530d22db86c66a5" +nextcloud_source_sha256="fc503985e8aa4ed795d882e35679e0e1b7670181768e7820307222d8b4658969" From 1ff40ff3d1b2ddc3dd9c5238a852d30c95fa98f7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Sep 2020 23:11:58 +0200 Subject: [PATCH 58/96] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index afc9dec..2d53163 100644 --- a/check_process +++ b/check_process @@ -12,7 +12,7 @@ setup_private=0 setup_public=0 upgrade=1 - upgrade=1 from_commit=9c57c2f78f3da979d587d708eb9379ffaa41bcfa + upgrade=1 from_commit=af36640ee5a5f1fab69651d638d23ebe47198152 backup_restore=1 multi_instance=1 incorrect_path=1 @@ -24,6 +24,6 @@ Email= Notification=none ;;; Upgrade options - ; commit=9c57c2f78f3da979d587d708eb9379ffaa41bcfa - name=Do not use too much process for php (#247) + ; commit=af36640ee5a5f1fab69651d638d23ebe47198152 + name=Merge pull request #320 enh-upgrade-18.0.7 manifest_arg=domain=DOMAIN&path=PATH&admin=USER&user_home=1& From 998215834e44fb0a4dc2ddd5e573c97dd10fb80e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Sep 2020 08:25:25 +0200 Subject: [PATCH 59/96] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 2d53163..0ee0bab 100644 --- a/check_process +++ b/check_process @@ -12,7 +12,7 @@ setup_private=0 setup_public=0 upgrade=1 - upgrade=1 from_commit=af36640ee5a5f1fab69651d638d23ebe47198152 + upgrade=1 from_commit=c864e086625363d91dde6ba78a652011a991a027 backup_restore=1 multi_instance=1 incorrect_path=1 @@ -24,6 +24,6 @@ Email= Notification=none ;;; Upgrade options - ; commit=af36640ee5a5f1fab69651d638d23ebe47198152 - name=Merge pull request #320 enh-upgrade-18.0.7 + ; commit=c864e086625363d91dde6ba78a652011a991a027 + name=[fix] php7.2-mcrypt doesn't exist (#253) manifest_arg=domain=DOMAIN&path=PATH&admin=USER&user_home=1& From a31385b6b64920e1df6d2176da2898f02f1f88e2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 13 Sep 2020 12:32:26 +0200 Subject: [PATCH 60/96] Update backup --- scripts/backup | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/backup b/scripts/backup index 68ae4ee..bb92dda 100755 --- a/scripts/backup +++ b/scripts/backup @@ -19,7 +19,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -28,32 +28,32 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up php-fpm configuration..." ynh_backup --src_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Backing up the MySQL database..." --weight=2 +ynh_print_info --message="Backing up the MySQL database..." ynh_mysql_dump_db --database="$db_name" > db.sql @@ -62,14 +62,12 @@ ynh_mysql_dump_db --database="$db_name" > db.sql #================================================= # BACKUP LOGROTATE #================================================= -ynh_script_progression --message="Backing up logrotate configuration..." ynh_backup "/etc/logrotate.d/$app" #================================================= # BACKUP FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Backing up fail2ban configuration..." ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" @@ -83,7 +81,7 @@ ynh_backup --src_path="/etc/cron.d/$app" #================================================= # BACKUP THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Backing up data directory..." +ynh_print_info --message="Backing up data directory..." ynh_backup --src_path="/home/yunohost.app/${app}/data" --is_big @@ -91,4 +89,4 @@ ynh_backup --src_path="/home/yunohost.app/${app}/data" --is_big # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." From 8f7fb69e839e5b948591823750ce5e81162bfeb8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 13 Sep 2020 12:41:43 +0200 Subject: [PATCH 61/96] Minor typos --- scripts/change_url | 14 +++++++------- scripts/install | 18 +++++++++--------- scripts/remove | 12 ++++++------ scripts/restore | 6 +++--- scripts/upgrade | 22 +++++++++++----------- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c9f7a9c..2aa5f36 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -50,23 +50,23 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 +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 +# 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 + # 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 + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config YNH_PHP_VERSION fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -114,7 +114,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index 6eb8471..cfe9d5b 100755 --- a/scripts/install +++ b/scripts/install @@ -87,7 +87,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Check if .well-known is available for this domain if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" @@ -98,7 +98,7 @@ then sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" fi -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config YNH_PHP_VERSION #================================================= @@ -112,7 +112,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --weight=50 +ynh_script_progression --message="Configuring PHP-FPM..." --weight=50 # Create a dedicated php-fpm config ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" @@ -131,7 +131,7 @@ mkdir -p "$datadir" #================================================= # INSTALL NEXTCLOUD #================================================= -ynh_script_progression --message="Installing nextcloud..." --weight=30 +ynh_script_progression --message="Installing Nextcloud..." --weight=30 # Define a function to execute commands with `occ` exec_occ() { @@ -153,7 +153,7 @@ exec_occ maintenance:install \ #================================================= # CONFIGURE NEXTCLOUD #================================================= -ynh_script_progression --message="Configuring nextcloud..." --weight=8 +ynh_script_progression --message="Configuring Nextcloud..." --weight=8 # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification @@ -162,7 +162,7 @@ exec_occ app:disable updatenotification exec_occ app:enable user_ldap exec_occ ldap:create-empty-config -# Load the installation config file in nextcloud +# Load the installation config file in Nextcloud nc_conf="$final_path/config_install.json" cp ../conf/config_install.json "$nc_conf" @@ -327,9 +327,9 @@ ynh_use_logrotate --logfile="$datadir/nextcloud.log" #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Configuring fail2ban..." --weight=8 +ynh_script_progression --message="Configuring Fail2ban..." --weight=8 -# Create a dedicated fail2ban config +# Create a dedicated Fail2ban config ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: ''.*$" --max_retry=5 #================================================= @@ -344,7 +344,7 @@ ynh_app_setting_set --app=$app --key=skipped_regex \ #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 9ea5c15..ebf87d2 100755 --- a/scripts/remove +++ b/scripts/remove @@ -49,17 +49,17 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." --weight=2 +ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config #================================================= @@ -73,9 +73,9 @@ ynh_remove_logrotate #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Removing fail2ban configuration..." --weight=8 +ynh_script_progression --message="Removing Fail2ban configuration..." --weight=8 -# Remove the dedicated fail2ban config +# Remove the dedicated Fail2ban config ynh_remove_fail2ban_config #================================================= diff --git a/scripts/restore b/scripts/restore index 8c49cad..daa51e9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -95,7 +95,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Reconfiguring php-fpm..." --weight=50 +ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=50 # Restore the file first, so it can have a backup if different ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" @@ -156,7 +156,7 @@ ynh_multimedia_addaccess $app #================================================= # RESTORE THE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the fail2ban configuration..." --weight=7 +ynh_script_progression --message="Restoring the Fail2ban configuration..." --weight=7 ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" @@ -175,7 +175,7 @@ ynh_systemd_action --action=restart --service_name=fail2ban #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index b793386..6c76b8f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,7 +143,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -177,7 +177,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=2 +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Recreate a dedicated php-fpm config ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" @@ -223,7 +223,7 @@ datadir="/home/yunohost.app/$app/data" if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading nextcloud..." --weight=3 + ynh_script_progression --message="Upgrading Nextcloud..." --weight=3 # Load the last available version source upgrade.d/upgrade.last.sh @@ -234,7 +234,7 @@ then # Set write access for the following commands chown -R $app: "$final_path" "$datadir" - # Print the current version number of nextcloud + # Print the current version number of Nextcloud exec_occ -V # While the current version is not the last version, do an upgrade @@ -257,7 +257,7 @@ then ynh_print_info --message="Upgrade to nextcloud $next_version" - # Create an app.src for this version of nextcloud + # Create an app.src for this version of Nextcloud cp ../conf/app.src.default ../conf/app.src ynh_replace_string --match_string="__VERSION__" --replace_string="$next_version" --target_file="../conf/app.src" ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$nextcloud_source_sha256" --target_file="../conf/app.src" @@ -274,7 +274,7 @@ then # Backup the config file in the temp dir cp -a "$final_path/config/config.php" "$tmpdir/config/config.php" - # Backup 3rd party applications from the current nextcloud + # Backup 3rd party applications from the current Nextcloud # But do not overwrite if there is any upgrade # (apps directory already exists in Nextcloud archive) ( @@ -319,7 +319,7 @@ then #================================================= # CONFIGURE NEXTCLOUD #================================================= - ynh_script_progression --message="Reconfiguring nextcloud..." --weight=9 + ynh_script_progression --message="Reconfiguring Nextcloud..." --weight=9 # Verify the checksum and backup the file if it's different ynh_backup_if_checksum_is_different --file="$final_path/config/config.php" @@ -445,9 +445,9 @@ ynh_use_logrotate --non-append #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Reconfiguring fail2ban..." --weight=7 +ynh_script_progression --message="Reconfiguring Fail2ban..." --weight=7 -# Create a dedicated fail2ban config +# Create a dedicated Fail2ban config ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: ''.*$" --max_retry=5 #================================================= @@ -464,7 +464,7 @@ ynh_app_setting_set --app=$app --key=skipped_regex \ #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -474,7 +474,7 @@ ynh_systemd_action --service_name=nginx --action=reload if [ $migration_process -eq 1 ] then - ynh_print_info --message="ownCloud has been successfully migrated to Nextcloud! \ + ynh_print_info --message="OwnCloud has been successfully migrated to Nextcloud! \ A last scheduled operation will run in a couple of minutes to finish the \ migration in YunoHost side. Do not proceed any application operation while \ you don't see Nextcloud as installed." From 425862b882391ae647fa488cf61417f4ab073020 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Oct 2020 19:32:00 +0200 Subject: [PATCH 62/96] Upgrade to 20.0.0 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 6 +++--- scripts/upgrade.d/upgrade.19.sh | 7 +++++++ scripts/upgrade.d/upgrade.last.sh | 4 ++-- 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 scripts/upgrade.d/upgrade.19.sh diff --git a/README.md b/README.md index b4b939b..40dbcbe 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 19.0.3 +**Shipped version:** 20.0.0 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 404ef69..26f200f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 19.0.3 +**Version incluse :** 20.0.0 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 75aa560..75881e2 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "name": "Nextcloud", "packaging_format": 1, "description": { - "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", - "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" + "en": "Online storage, file sharing platform and various other applications", + "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "19.0.3~ynh1", + "version": "20.0.0~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.19.sh b/scripts/upgrade.d/upgrade.19.sh new file mode 100644 index 0000000..f62a916 --- /dev/null +++ b/scripts/upgrade.d/upgrade.19.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Last available nextcloud version +next_version="20.0.0" + +# Nextcloud tarball checksum sha256 +nextcloud_source_sha256="" diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 569c56e..f62a916 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="19.0.3" +next_version="20.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="fc503985e8aa4ed795d882e35679e0e1b7670181768e7820307222d8b4658969" +nextcloud_source_sha256="" From 6e5449def94bb421d6dfc0e7daa7180e779eafca Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 10:44:39 +0200 Subject: [PATCH 63/96] Add shasum --- scripts/upgrade.d/upgrade.19.sh | 2 +- scripts/upgrade.d/upgrade.last.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade.d/upgrade.19.sh b/scripts/upgrade.d/upgrade.19.sh index f62a916..c44f02b 100644 --- a/scripts/upgrade.d/upgrade.19.sh +++ b/scripts/upgrade.d/upgrade.19.sh @@ -4,4 +4,4 @@ next_version="20.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="" +nextcloud_source_sha256="a273e0151f68567f729d9a82a7e3f124ff0f0471aa17bae6bfd83c5362d84cd8" diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index f62a916..c44f02b 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -4,4 +4,4 @@ next_version="20.0.0" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="" +nextcloud_source_sha256="a273e0151f68567f729d9a82a7e3f124ff0f0471aa17bae6bfd83c5362d84cd8" From 7e638dbaa8c67e9032077200009a2a9547735d3d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 11:12:35 +0200 Subject: [PATCH 64/96] Update install --- scripts/install | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index cfe9d5b..c106a4f 100755 --- a/scripts/install +++ b/scripts/install @@ -187,8 +187,8 @@ ynh_secure_remove --file="$nc_conf" #================================================= # Check LDAP configuration to see if everything worked well -exec_occ ldap:test-config \'\' \ - || ynh_die --message="An error occured during LDAP configuration" +# exec_occ ldap:test-config \'\' \ +# || ynh_die --message="An error occured during LDAP configuration" #================================================= # MOUNT HOME FOLDERS AS EXTERNAL STORAGE @@ -273,12 +273,9 @@ exec_occ background:cron # POST-INSTALL MAINTENANCE #================================================= -( - cd $final_path - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns - sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n -) +exec_occ db:add-missing-indices +exec_occ db:add-missing-columns +exec_occ db:convert-filecache-bigint -n #================================================= # CONFIGURE THE HOOK FILE FOR USER CREATE From 8a52c9d4016f70995bf8632314617ae6b2d66122 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 12:11:28 +0200 Subject: [PATCH 65/96] Small typos --- README.md | 41 ++++++++++++----------------------------- README_fr.md | 9 ++++----- scripts/install | 10 +++++----- scripts/remove | 4 ++-- scripts/restore | 2 +- scripts/upgrade | 25 +++++++++++-------------- 6 files changed, 35 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 40dbcbe..e7c85fb 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview -[Nextcloud](https://nextcloud.com) gives you freedom and control over your -own data. A personal cloud which runs on your own server. With Nextcloud -you can synchronize your files over your devices. +[Nextcloud](https://nextcloud.com) gives you freedom and control over your own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. **Shipped version:** 20.0.0 @@ -41,7 +39,7 @@ To install and configure it: - Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. -*NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi, …) is **not** supported* +*NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi...) is **not** supported* ## YunoHost specific features @@ -51,10 +49,8 @@ this package: * Integrate with YunoHost users and SSO - i.e. logout button * Allow one user to be the administrator (set at the installation) * Allow multiple instances of this application - * Optionally access the user home folder from Nextcloud files (set at the - installation, the sharing is enabled by default) - * Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's - not already served - i.e. by Baïkal + * Optionally access the user home folder from Nextcloud files (set at the installation, the sharing is enabled by default) + * Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal #### Multi-users support @@ -65,13 +61,9 @@ this package: ## Limitations -To integrate the logout button to the SSO, we have to patch Nextcloud sources. -In waiting an upstream integration, the source code integrity checking has been -disabled to prevent the warning message. +To integrate the logout button to the SSO, we have to patch Nextcloud sources. In waiting an upstream integration, the source code integrity checking has been disabled to prevent the warning message. -Also, note we made the choice to disable third-parties applications at the -upgrade. It allows to prevent an unstable - and sometimes broken - Nextcloud -installation. You will just have to manually activate them after the upgrade. +Also, note we made the choice to disable third-parties applications at the upgrade. It allows to prevent an unstable - and sometimes broken - Nextcloud installation. You will just have to manually activate them after the upgrade. Finally, the following error message in Nextcloud logs can be safely ignored: ``` @@ -91,15 +83,11 @@ If you need/want to use Nextcloud `occ` command¹, you need to be in `/var/www/n #### Migrate from ownCloud -**This is not considered as stable yet, please do it with care and only for -testing!** +**This is not considered as stable yet, please do it with care and only for testing!** -This package handles the migration from ownCloud to Nextcloud. For that, your -ownCloud application must be **up-to-date** in YunoHost. +This package handles the migration from ownCloud to Nextcloud. For that, your ownCloud application must be **up-to-date** in YunoHost. -You will then have to upgrade your ownCloud application with this repository. -This can only be done from the command-line interface - e.g. through SSH. Once -you're connected, you simply have to execute the following: +You will then have to upgrade your ownCloud application with this repository. This can only be done from the command-line interface - e.g. through SSH. Once you're connected, you simply have to execute the following: ```bash sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh owncloud --debug @@ -108,13 +96,9 @@ sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh ownc The `--debug` option will let you see the full output. If you encounter any issue, please paste it. -Note that a cron job will be executed at some time after the end of this -command. You must wait that before doing any other application operations! -You should see that Nextcloud is installed after that. +Note that a cron job will be executed at some time after the end of this command. You must wait that before doing any other application operations! You should see that Nextcloud is installed after that. -Note that it does not change the application label nor the URL. To rename -the label, you can execute the following - replace `Nextcloud` with whatever -you want: +Note that it does not change the application label nor the URL. To rename the label, you can execute the following - replace `Nextcloud` with whatever you want: ```bash sudo yunohost app setting nextcloud label -v "Nextcloud" @@ -130,8 +114,7 @@ sudo yunohost app ssowatconf --- -Developers infos ----------------- +## Developers infos Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). diff --git a/README_fr.md b/README_fr.md index 26f200f..3b76b23 100644 --- a/README_fr.md +++ b/README_fr.md @@ -41,7 +41,7 @@ Pour l'installer et le configurer : - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. - Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. - *NB : OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi, …) n'est **pas** supporté* + *NB : OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi...) n'est **pas** supporté* ## Caractéristiques spécifiques YunoHost @@ -79,9 +79,9 @@ Following symlinks is not allowed ('/home/yunohost.multimedia/user/Share' -> '/h **La migration n'est pas encore considérée comme stable, merci de la faire prudemment et uniquement pour tester !** -Ce package gère la migration de OwnCloud vers Nextcloud. Pour ça, l'application OwnCloud doit **être à jour** dans YunoHost. +Ce package gère la migration de ownCloud vers Nextcloud. Pour ça, l'application ownCloud doit **être à jour** dans YunoHost. -Vous allez ensuite mettre à niveau votre OwnCloud avec ce dépôt. +Vous allez ensuite mettre à niveau votre ownCloud avec ce dépôt. Ça ne peut être fait qu'en ligne de commande - par exemple via SSH. Une fois connecté, vous n'avez plus qu'à exécuter la commande suivante : ```bash sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/nextcloud_ynh owncloud --debug @@ -107,8 +107,7 @@ sudo yunohost app ssowatconf --- -Informations pour les développeurs ----------------- +## Informations pour les développeurs Merci de faire votre « pull request » sur la [branche testing](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing). Pour tester la branche testing, faites comme ceci. diff --git a/scripts/install b/scripts/install index c106a4f..bacc853 100755 --- a/scripts/install +++ b/scripts/install @@ -158,7 +158,7 @@ ynh_script_progression --message="Configuring Nextcloud..." --weight=8 # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification -# Enable ldap plugin +# Enable LDAP plugin exec_occ app:enable user_ldap exec_occ ldap:create-empty-config @@ -187,8 +187,8 @@ ynh_secure_remove --file="$nc_conf" #================================================= # Check LDAP configuration to see if everything worked well -# exec_occ ldap:test-config \'\' \ -# || ynh_die --message="An error occured during LDAP configuration" +exec_occ ldap:test-config \'\' \ + || ynh_die --message="An error occured during LDAP configuration" #================================================= # MOUNT HOME FOLDERS AS EXTERNAL STORAGE @@ -324,9 +324,9 @@ ynh_use_logrotate --logfile="$datadir/nextcloud.log" #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Configuring Fail2ban..." --weight=8 +ynh_script_progression --message="Configuring Fail2Ban..." --weight=8 -# Create a dedicated Fail2ban config +# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: ''.*$" --max_retry=5 #================================================= diff --git a/scripts/remove b/scripts/remove index ebf87d2..b84d5bf 100755 --- a/scripts/remove +++ b/scripts/remove @@ -73,9 +73,9 @@ ynh_remove_logrotate #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Removing Fail2ban configuration..." --weight=8 +ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8 -# Remove the dedicated Fail2ban config +# Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config #================================================= diff --git a/scripts/restore b/scripts/restore index daa51e9..764c229 100755 --- a/scripts/restore +++ b/scripts/restore @@ -156,7 +156,7 @@ ynh_multimedia_addaccess $app #================================================= # RESTORE THE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the Fail2ban configuration..." --weight=7 +ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=7 ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 6c76b8f..5325faf 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,11 +147,11 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" -# Delete current nginx configuration to be able to check if .well-known is already served. +# Delete current NGINX configuration to be able to check if .well-known is already served. ynh_remove_nginx_config ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$app.conf" -# Wait untils nginx has fully reloaded +# Wait untils NGINX has fully reloaded ynh_systemd_action --service_name=nginx --action=reload --line_match="Reloaded" --log_path="systemd" # Check if .well-known is available for this domain @@ -163,7 +163,7 @@ then sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" fi -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config YNH_PHP_VERSION #================================================= @@ -179,7 +179,7 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 -# Recreate a dedicated php-fpm config +# Recreate a dedicated PHP-FPM config ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) @@ -309,12 +309,9 @@ then exec_occ -V done - ( - cd $final_path - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns - sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n - ) + exec_occ db:add-missing-indices + exec_occ db:add-missing-columns + exec_occ db:convert-filecache-bigint -n #================================================= # CONFIGURE NEXTCLOUD @@ -333,7 +330,7 @@ then # Ensure that UpdateNotification app is disabled exec_occ app:disable updatenotification - # Enable plugins + # Enable LDAP plugin exec_occ app:enable user_ldap # Load the config file in nextcloud @@ -445,9 +442,9 @@ ynh_use_logrotate --non-append #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Reconfiguring Fail2ban..." --weight=7 +ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=7 -# Create a dedicated Fail2ban config +# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: ''.*$" --max_retry=5 #================================================= @@ -474,7 +471,7 @@ ynh_systemd_action --service_name=nginx --action=reload if [ $migration_process -eq 1 ] then - ynh_print_info --message="OwnCloud has been successfully migrated to Nextcloud! \ + ynh_print_info --message="ownCloud has been successfully migrated to Nextcloud! \ A last scheduled operation will run in a couple of minutes to finish the \ migration in YunoHost side. Do not proceed any application operation while \ you don't see Nextcloud as installed." From 6038e9c5ce2e4d808ef3a5cefdbbc68e75e0c046 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 14:03:01 +0200 Subject: [PATCH 66/96] small typos --- README.md | 6 +++--- README_fr.md | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e7c85fb..5482848 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,11 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Starting from Nextcloud 18, it features a direct integration of OnlyOffice (an online rich text document editor) through a Nextcloud app. To install and configure it: - Install *Community Document Server* application in your Nextcloud. That's the part that runs OnlyOffice server. -- Install OnlyOffice application. That's the client part that will connect to an OnlyOffice server. -- Then in Settings -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice. +- Install *ONLYOFFICE* application. That's the client part that will connect to an OnlyOffice server. +- Then in Settings -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), if you want to configure which file formats should be opened by OnlyOffice. - Here you go :) You should be able to create new type of documents and open them. -*NB: OnlyOffice is only available for x86 architecture - **ARM** (Raspberry Pi...) is **not** supported* +*NB: OnlyOffice is only available for x86 architecture - **ARM** architecture is **not** supported (Raspberry Pi, OLinuXino...)* ## YunoHost specific features diff --git a/README_fr.md b/README_fr.md index 3b76b23..5b9eecf 100644 --- a/README_fr.md +++ b/README_fr.md @@ -34,14 +34,14 @@ Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. #### Configurer l'intégration d'OnlyOffice -À partir de sa version 18, Nextcloud intégre une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud. -Pour l'installer et le configurer : - - Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice. - - Installez l'application *OnlyOffice*. C'est la partie cliente qui va se connecter au serveur OnlyOffice. - - Ensuite dans les Paramètres -> OnlyOffice (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. - - Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. +À partir de sa version 18, Nextcloud inclut une intégration directe de OnlyOffice (un éditeur de texte enrichi en ligne) via une application Nextcloud. +Pour l'installer et la configurer : +- Installez l'application *Community Document Server* dans votre Nextcloud. C'est la partie qui fait tourner un serveur OnlyOffice. +- Installez l'application *ONLYOFFICE*. C'est la partie cliente qui va se connecter au serveur OnlyOffice. +- Ensuite dans les Paramètres -> ONLYOFFICE (`https://yourdomain.tld/nextcloud/settings/admin/onlyoffice`), si vous voulez configurer quels formats de fichier s'ouvrent avec OnlyOffice. +- Et voilà :) Vous devriez pouvoir créer de nouveaux types de documents, et les ouvrir. - *NB : OnlyOffice n'est disponible que sous architecture x86 - **ARM** (Raspberry Pi...) n'est **pas** supporté* +*NB : OnlyOffice n'est disponible que sous architecture x86 - L'architecture **ARM** n'est **pas** supporté (Raspberry Pi, OLinuXino...)* ## Caractéristiques spécifiques YunoHost From 30759821eca72a1d636ec36c136b9018b239eb0b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Oct 2020 15:36:48 +0200 Subject: [PATCH 67/96] Fix Invalid configID --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index bacc853..abcedb4 100755 --- a/scripts/install +++ b/scripts/install @@ -187,7 +187,7 @@ ynh_secure_remove --file="$nc_conf" #================================================= # Check LDAP configuration to see if everything worked well -exec_occ ldap:test-config \'\' \ +exec_occ ldap:test-config '' \ || ynh_die --message="An error occured during LDAP configuration" #================================================= From fe62ab987a88a5c2540c248f80ec08122fbadb31 Mon Sep 17 00:00:00 2001 From: Sebastien Mennetrier Date: Wed, 7 Oct 2020 17:38:32 +0200 Subject: [PATCH 68/96] Fix issues with Element (Riotchat) app --- conf/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 0cf3732..462d900 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -121,6 +121,10 @@ location ^~ __PATH__/ { rewrite ^ __PATH__/index.php$request_uri; } + location ~* ^__PATH__/apps/riotchat/riot/ { + rewrite ^ __PATH__/index.php$request_uri; + } + # Adding the cache control header for js, css and map files location ~ ^__PATH__/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { try_files $uri __PATH__/index.php$request_uri; From 9717e59557a2c746ed29ad9d405a783dcbf2fceb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 8 Oct 2020 09:51:32 +0200 Subject: [PATCH 69/96] upgrade to v19.0.4 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/install | 9 +++------ scripts/upgrade | 9 +++------ scripts/upgrade.d/upgrade.last.sh | 4 ++-- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b4b939b..fd10c0f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 19.0.3 +**Shipped version:** 19.0.4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 404ef69..d9e3dc2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 19.0.3 +**Version incluse :** 19.0.4 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 75aa560..f2746de 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Access & share your files, calendars, contacts, mail & more from any device, on your terms", "fr": "Consultez et partagez vos fichiers, agendas, carnets d'adresses, emails et bien plus depuis les appareils de votre choix, sous vos conditions" }, - "version": "19.0.3~ynh1", + "version": "19.0.4~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/install b/scripts/install index cfe9d5b..0ad4cde 100755 --- a/scripts/install +++ b/scripts/install @@ -273,12 +273,9 @@ exec_occ background:cron # POST-INSTALL MAINTENANCE #================================================= -( - cd $final_path - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns - sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n -) +exec_occ db:add-missing-indices +exec_occ db:add-missing-columns +exec_occ db:convert-filecache-bigint -n #================================================= # CONFIGURE THE HOOK FILE FOR USER CREATE diff --git a/scripts/upgrade b/scripts/upgrade index 6c76b8f..e3ec094 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -309,12 +309,9 @@ then exec_occ -V done - ( - cd $final_path - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices - sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns - sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n - ) + exec_occ db:add-missing-indices + exec_occ db:add-missing-columns + exec_occ db:convert-filecache-bigint -n #================================================= # CONFIGURE NEXTCLOUD diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 569c56e..7a8f7df 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="19.0.3" +next_version="19.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="fc503985e8aa4ed795d882e35679e0e1b7670181768e7820307222d8b4658969" +nextcloud_source_sha256="" From de251cebfcba1f7da2bf427f168a0edb397d6524 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 8 Oct 2020 10:57:22 +0200 Subject: [PATCH 70/96] Update upgrade.last.sh --- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 7a8f7df..f05cba2 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash -# Last available nextcloud version +# Last available Nextcloud version next_version="19.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="" +nextcloud_source_sha256="465711715d64cbdf0465fcb4405f23b6f0947b85bbe12b6577c9e1602c63ae78" From 3735ac2ad2632cf6fff681b5808eb5a6824641ea Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 13 Oct 2020 14:52:32 +0200 Subject: [PATCH 71/96] fix upgrade for new major version --- scripts/upgrade | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5325faf..c9faaae 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -212,8 +212,8 @@ exec_occ() { create_external_storage() { local datadir="$1" local mount_name="$2" -local mount_id=`exec_occ files_external:create --output=json \ - "$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true` +local mount_id=$(exec_occ files_external:create --output=json \ + "$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true) ! [[ $mount_id =~ ^[0-9]+$ ]] \ && ynh_print_warn --message="Unable to create external storage" \ || exec_occ files_external:option "$mount_id" enable_sharing true @@ -244,9 +244,17 @@ then # The major version is the first part of the version number current_major_version=${current_version%%.*} + if [ ! -f upgrade.d/upgrade.$current_major_version.sh ]; then + source upgrade.d/upgrade.last.sh + else + source upgrade.d/upgrade.$current_major_version.sh + fi + # If the current version has the same major version than the next one, # then it's the last upgrade to do - if [ "$last_major_version" -eq "$current_major_version" ]; then + # We also cover the case where the last version is the first of the current major version series + # (e.g. 20.0.0 is the latest version) + if [[ ("$last_major_version" -eq "$current_major_version") || ( ("$last_major_version" -eq "$((current_major_version+1))") && ("$next_version" == "$last_version") ) ]]; then current_major_version=last # Enable YunoHost patches on Nextcloud sources cp -a ../sources/patches_last_version/* ../sources/patches From 0207a89fe6781a1db59d2df57189564053e70b74 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 26 Oct 2020 12:03:17 +0100 Subject: [PATCH 72/96] 20.0.1 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5482848..35e444d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Nextcloud](https://nextcloud.com) gives you freedom and control over your own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 20.0.0 +**Shipped version:** 20.0.1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 5b9eecf..d2c8ff3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 20.0.0 +**Version incluse :** 20.0.1 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 75881e2..ca9bab0 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.0~ynh1", + "version": "20.0.1~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index c44f02b..5ab466b 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="20.0.0" +next_version="20.0.1" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="a273e0151f68567f729d9a82a7e3f124ff0f0471aa17bae6bfd83c5362d84cd8" +nextcloud_source_sha256="96c6b50e1e676e46cec82d8f8ff1abd5eef9dfa00580081b6c640612c3ff2efc" From 0bd857d7620310be09d70f2a7e48b10a7827be48 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 3 Nov 2020 18:13:11 +0100 Subject: [PATCH 73/96] Fix last warning in linter about sudo ? --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 2b9a766..84a4b01 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -341,7 +341,7 @@ ynh_smart_mktemp () { ynh_die "Insufficient free space to continue..." fi - echo "$(sudo mktemp --directory --tmpdir="$tmpdir")" + echo "$(mktemp --directory --tmpdir="$tmpdir")" } #================================================= From 1be264d94daf6d8dba31210c799708d24f9de6dc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 18 Nov 2020 20:58:57 +0100 Subject: [PATCH 74/96] Upgrade to version 20.0.2 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5482848..6b0e808 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Nextcloud](https://nextcloud.com) gives you freedom and control over your own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 20.0.0 +**Shipped version:** 20.0.2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 5b9eecf..2d36ec8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 20.0.0 +**Version incluse :** 20.0.2 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 75881e2..f96496f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.0~ynh1", + "version": "20.0.2~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index c44f02b..682e66e 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="20.0.0" +next_version="20.0.2" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="a273e0151f68567f729d9a82a7e3f124ff0f0471aa17bae6bfd83c5362d84cd8" +nextcloud_source_sha256="be84c2ac7fba066ddc0637a4672b39628bbbd200dad8c00a0437a4765007dd21" From d5f703f47a27676b3188d1914d5d9740f56d6a0f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 08:10:43 +0100 Subject: [PATCH 75/96] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 462d900..adc69c3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -91,7 +91,7 @@ location ^~ __PATH__/ { fastcgi_param modHeadersAvailable true; # Enable pretty urls fastcgi_param front_controller_active true; - fastcgi_pass unix:/var/run/php/php__YNH_PHP_VERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; } From 7d09e4b1978e74318b468c0da08bec48d3dc3a86 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 08:16:17 +0100 Subject: [PATCH 76/96] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 462d900..4508d5a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -91,7 +91,7 @@ location ^~ __PATH__/ { fastcgi_param modHeadersAvailable true; # Enable pretty urls fastcgi_param front_controller_active true; - fastcgi_pass unix:/var/run/php/php__YNH_PHP_VERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; } From 3502b84407491cbae5654dfe52380b47c616f517 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 08:33:00 +0100 Subject: [PATCH 77/96] Small typos --- README.md | 1 + README_fr.md | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51ad16a..a1eeaef 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) *[Lire ce readme en français.](./README_fr.md)* + > *This package allow you to install Nextcloud 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 index 2d36ec8..37b5691 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,6 @@ *[Read this readme in english.](./README.md)* - > *Ce package vous permet d'installer Nextcloud 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.* @@ -98,7 +97,7 @@ sudo yunohost app setting nextcloud label -v "Nextcloud" sudo yunohost app ssowatconf ``` -## Links +## Liens * Signaler un bug : https://github.com/YunoHost-Apps/nextcloud_ynh/issues * Site web de Nextcloud : https://nextcloud.com/ From a9559aeac4f75332c3fd12a603e45540f41beb57 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 19 Nov 2020 11:39:57 +0100 Subject: [PATCH 78/96] use phpversion for nginx helper --- scripts/change_url | 5 +++-- scripts/install | 36 +++++++++++++++++++----------------- scripts/upgrade | 46 ++++++++++++++++++++++++---------------------- 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 2aa5f36..c779071 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,7 @@ 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) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED @@ -63,7 +64,7 @@ then domain="$old_domain" path_url="$new_path" # Create a dedicated NGINX config - ynh_add_nginx_config YNH_PHP_VERSION + ynh_add_nginx_config fi # Change the domain for NGINX @@ -84,7 +85,7 @@ ynh_script_progression --message="Applying Nextcloud specific modifications..." # Define a function to execute commands with `occ` exec_occ() { (cd "$final_path" && exec_as "$app" \ - php${YNH_PHP_VERSION} occ --no-interaction --no-ansi "$@") + php${phpversion} occ --no-interaction --no-ansi "$@") } if [ $change_domain -eq 1 ] diff --git a/scripts/install b/scripts/install index abcedb4..692f594 100755 --- a/scripts/install +++ b/scripts/install @@ -84,23 +84,6 @@ cp -a ../sources/patches_last_version/* ../sources/patches # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - -# Check if .well-known is available for this domain -if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" -then - ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." - - # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" -fi - -# Create a dedicated NGINX config -ynh_add_nginx_config YNH_PHP_VERSION - #================================================= # CREATE DEDICATED USER #================================================= @@ -116,6 +99,25 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=50 # Create a dedicated php-fpm config ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +# Used by ynh_add_nginx_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 + +# Check if .well-known is available for this domain +if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" +then + ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." + + # Remove lines about .well-known/carddav and caldav with sed. + sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" +fi + +# Create a dedicated NGINX config +ynh_add_nginx_config #================================================= # SPECIFIC SETUP diff --git a/scripts/upgrade b/scripts/upgrade index d3f647e..24fa8d3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -140,6 +140,29 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # STANDARD UPGRADE STEPS +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app + +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 + +# Recreate a dedicated PHP-FPM config +ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" + +# Delete existing ini configuration file (backward compatibility) +if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then + ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini +fi +# Used by ynh_add_nginx_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + #================================================= # NGINX CONFIGURATION #================================================= @@ -164,28 +187,7 @@ then fi # Create a dedicated NGINX config -ynh_add_nginx_config YNH_PHP_VERSION - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 - -# Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" - -# Delete existing ini configuration file (backward compatibility) -if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then - ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini -fi +ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE From dfe0624a71bd39c63385ee242d764a6f69c9e7df Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 21:36:22 +0100 Subject: [PATCH 79/96] fix --- scripts/backup | 3 ++- scripts/config | 2 +- scripts/install | 4 ++-- scripts/restore | 5 +++-- scripts/upgrade | 13 ++++++------- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/scripts/backup b/scripts/backup index bb92dda..7ed3c7f 100755 --- a/scripts/backup +++ b/scripts/backup @@ -26,6 +26,7 @@ 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) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -48,7 +49,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/config b/scripts/config index 1d774dd..85769fc 100644 --- a/scripts/config +++ b/scripts/config @@ -77,7 +77,7 @@ apply_config() { if [ "$fpm_footprint" != "0" ] then - ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$YNH_PHP_VERSION + ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint else ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." fi diff --git a/scripts/install b/scripts/install index 692f594..70e89f4 100755 --- a/scripts/install +++ b/scripts/install @@ -138,7 +138,7 @@ ynh_script_progression --message="Installing Nextcloud..." --weight=30 # Define a function to execute commands with `occ` exec_occ() { (cd "$final_path" && exec_as "$app" \ - php$YNH_PHP_VERSION occ --no-interaction --no-ansi "$@") + php${phpversion} occ --no-interaction --no-ansi "$@") } # Set write access for the following commands @@ -267,7 +267,7 @@ chmod 644 "$cron_path" ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path" ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path" -ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path" +ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$phpversion" --target_file="$cron_path" exec_occ background:cron diff --git a/scripts/restore b/scripts/restore index 764c229..3cc1584 100755 --- a/scripts/restore +++ b/scripts/restore @@ -27,6 +27,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) @@ -98,10 +99,10 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=50 # Restore the file first, so it can have a backup if different -ynh_restore_file --origin_path="/etc/php/$YNH_PHP_VERSION/fpm/pool.d/$app.conf" +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=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" #================================================= # RESTORE THE CRON FILE diff --git a/scripts/upgrade b/scripts/upgrade index 24fa8d3..a88a455 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ 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) user_home=$(ynh_app_setting_get --app=$app --key=user_home) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) @@ -154,14 +155,12 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) -if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then - ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini +if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then + ynh_secure_remove --file=/etc/php/$phpversion/fpm/conf.d/20-$app.ini fi -# Used by ynh_add_nginx_config -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION @@ -201,7 +200,7 @@ exec_occ() { # Backward compatibility to upgrade from NC14 or older version if [ $current_major_version = "last" ] || [ $current_major_version -ge 15 ] then - NEXTCLOUD_PHP_VERSION=$YNH_PHP_VERSION + NEXTCLOUD_PHP_VERSION=$phpversion else NEXTCLOUD_PHP_VERSION="7.0" fi @@ -404,7 +403,7 @@ chmod 644 "$cron_path" ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path" ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path" -ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path" +ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$phpversion" --target_file="$cron_path" exec_occ background:cron From 00c90826df2eb0d7812234227252656a959ba6c2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 24 Nov 2020 03:55:50 +0100 Subject: [PATCH 80/96] Moar linter warning fixes --- scripts/_common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 84a4b01..ebffb0e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -154,7 +154,7 @@ ynh_handle_app_migration () { # TODO Handle multi instance apps... # Check that there is not already an app installed for this id. - (yunohost app list --installed -f "$new_app" | grep -q id) \ + yunohost app list | grep -q 'id: $appname' \ && ynh_die "$new_app is already installed" #================================================= @@ -360,7 +360,7 @@ ynh_multimedia_build_main_dir () { local checksum="806a827ba1902d6911095602a9221181" # Download yunohost.multimedia scripts - wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz + wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz 2>&1 # Check the control sum echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \ From ba559194376963fad2884e9dfc598b529de7be27 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 30 Nov 2020 17:39:20 +0100 Subject: [PATCH 81/96] Update nginx conf for nextcloud 20 --- conf/nginx.conf | 173 +++++++++++++++++++++--------------------------- 1 file changed, 74 insertions(+), 99 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index adc69c3..d4581c2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,27 +1,20 @@ -location = /.well-known/carddav { - return 301 https://$server_name__PATH__/remote.php/dav; -} -location = /.well-known/caldav { - return 301 https://$server_name__PATH__/remote.php/dav; -} +location ^~ /.well-known { + # The following 6 rules are borrowed from `.htaccess` -# The following 2 rules are only needed for the user_webfinger app. -# Uncomment it if you're planning to use this app. -#location = /.well-known/host-meta { -# return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta; -#} -#location = /.well-known/host-meta.json { -# return 301 $scheme://$host:$server_port__PATH__/public.php?service=host-meta-json; -#} + # The following 2 rules are only needed for the user_webfinger app. + # Uncomment it if you're planning to use this app. + #rewrite ^/\.well-known/host-meta\.json __PATH__/public.php?service=host-meta-json last; + #rewrite ^/\.well-known/host-meta __PATH__/public.php?service=host-meta last; + # The following 2 rules are only needed for the Social app. + # Uncomment it if you're planning to use this app. + #rewrite ^/\.well-known/webfinger __PATH__/public.php?service=webfinger last; + #rewrite ^/\.well-known/nodeinfo __PATH__/public.php?service=nodeinfo last; -# The following 2 rules are only needed for the Social app. -# Uncomment it if you're planning to use this app. -#location = /.well-known/webfinger { -# return 301 $scheme://$host:$server_port__PATH__/public.php?service=webfinger; -#} -#location = /.well-known/nodeinfo { -# return 301 $scheme://$host:$server_port__PATH__/public.php?service=nodeinfo; -#} + location = /.well-known/carddav { return 301 __PATH__/remote.php/dav/; } + location = /.well-known/caldav { return 301 __PATH__/remote.php/dav/; } + + try_files $uri $uri/ =404; +} #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location ^~ __PATH__/ { @@ -36,33 +29,53 @@ location ^~ __PATH__/ { # Add headers to serve security related headers more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;"; - more_set_headers "X-Content-Type-Options: nosniff"; - more_set_headers "X-XSS-Protection: 1; mode=block"; - more_set_headers "X-Robots-Tag: none"; - more_set_headers "X-Download-Options: noopen"; - more_set_headers "X-Permitted-Cross-Domain-Policies: none"; more_set_headers "Referrer-Policy: no-referrer"; + more_set_headers "X-Content-Type-Options: nosniff"; + more_set_headers "X-Download-Options: noopen"; + more_set_headers "X-Frame-Options: SAMEORIGIN"; + more_set_headers "X-Permitted-Cross-Domain-Policies: none"; + more_set_headers "X-Robots-Tag: none"; + more_set_headers "X-XSS-Protection: 1; mode=block"; # Set max upload size client_max_body_size 10G; fastcgi_buffers 64 4K; - # Extend timeouts - client_body_timeout 60m; - proxy_read_timeout 60m; - fastcgi_read_timeout 60m; + # Enable gzip but do not remove ETag headers + gzip on; + gzip_vary on; + gzip_comp_level 4; + gzip_min_length 256; + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; + gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; - # Disable gzip to avoid the removal of the ETag header - gzip off; + # Pagespeed is not supported by Nextcloud, so if your server is built + # with the `ngx_pagespeed` module, uncomment this line to disable it. + #pagespeed off; - # Errors pages - error_page 403 __PATH__/core/templates/403.php; - # Don't set custom 404 error page, as nextcloud uses 404 codes with meaningful payload. - # Setting custom 404 page clears the payload and creates UI bugs - # error_page 404 __PATH__/core/templates/404.php; + # Remove X-Powered-By, which is an information leak + fastcgi_hide_header X-Powered-By; - location __PATH__/ { - rewrite ^ __PATH__/index.php; + # Specify how to handle directories -- specifying `/nextcloud/index.php$request_uri` + # here as the fallback means that Nginx always exhibits the desired behaviour + # when a client requests a path that corresponds to a directory that exists + # on the server. In particular, if that directory contains an index.php file, + # that file is correctly served; if it doesn't, then the request is passed to + # the front-end controller. This consistent behaviour means that we don't need + # to specify custom rules for certain paths (e.g. images and other assets, + # `/updater`, `/ocm-provider`, `/ocs-provider`), and thus + # `try_files $uri $uri/ /nextcloud/index.php$request_uri` + # always provides the desired behaviour. + index index.php index.html __PATH__/index.php$request_uri; + + # Default Cache-Control policy + expires 1m; + + # Rule borrowed from `.htaccess` to handle Microsoft DAV clients + location = __PATH__/ { + if ( $http_user_agent ~ ^DavClnt ) { + return 302 __PATH__/remote.php/webdav/$is_args$args; + } } location = __PATH__/robots.txt { @@ -71,15 +84,16 @@ location ^~ __PATH__/ { access_log off; } - location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)\/ { - deny all; - } - location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { - deny all; - } + # Rules borrowed from `.htaccess` to hide certain paths from clients + location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } + location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } - location ~ ^__PATH__/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { - fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; + # Ensure this block, which passes PHP files to the PHP process, is above the blocks + # which handle static assets (as seen below). If this block is not declared first, + # then Nginx will encounter an infinite rewriting loop when it prepends + # `/nextcloud/index.php` to the URI, resulting in a HTTP 500 error response. + location ~ \.php(?:$|/) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; include fastcgi_params; @@ -87,66 +101,27 @@ location ^~ __PATH__/ { fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param PATH_INFO $path_info; fastcgi_param HTTPS on; - # Avoid sending the security headers twice - fastcgi_param modHeadersAvailable true; - # Enable pretty urls - fastcgi_param front_controller_active true; + fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice + fastcgi_param front_controller_active true; # Enable pretty urls fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; } - location ~ ^__PATH__/(?:updater|oc[ms]-provider)(?:$|\/) { - try_files $uri/ =404; - index index.php; + location ~ \.(?:css|js|svg|gif)$ { + try_files $uri / __PATH__/index.php$request_uri; + expires 6M; # Cache-Control policy borrowed from `.htaccess` + access_log off; # Optional: Don't log access to assets } - location = __PATH__/core/js/oc.js { - rewrite ^ __PATH__/index.php$request_uri; + location ~ \.woff2?$ { + try_files $uri / __PATH__/index.php$request_uri; + expires 7d; # Cache-Control policy borrowed from `.htaccess` + access_log off; # Optional: Don't log access to assets } - location = __PATH__/core/preview.png { - rewrite ^ __PATH__/index.php$request_uri; - } - - location ~* ^__PATH__/(?:css|js)/ { - rewrite ^ __PATH__/index.php$request_uri; - } - - location ~* ^__PATH__/apps/theming/img/core/filetypes/ { - rewrite ^ __PATH__/index.php$request_uri; - } - - location ~* ^__PATH__/apps/documentserver_community/ { - rewrite ^ __PATH__/index.php$request_uri; - } - - location ~* ^__PATH__/apps/riotchat/riot/ { - rewrite ^ __PATH__/index.php$request_uri; - } - - # Adding the cache control header for js, css and map files - location ~ ^__PATH__/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { - try_files $uri __PATH__/index.php$request_uri; - more_set_headers "Cache-Control: public, max-age=15778463"; - # Add headers to serve security related headers - more_set_headers "Strict-Transport-Security: max-age=15768000"; - more_set_headers "X-Content-Type-Options: nosniff"; - more_set_headers "X-XSS-Protection: 1; mode=block"; - more_set_headers "X-Robots-Tag: none"; - more_set_headers "X-Download-Options: noopen"; - more_set_headers "X-Permitted-Cross-Domain-Policies: none"; - more_set_headers "X-Frame-Options: SAMEORIGIN"; - more_set_headers "Referrer-Policy: no-referrer"; - - # Optional: Don't log access to assets - access_log off; - } - - location ~ ^__PATH__/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ { - try_files $uri __PATH__/index.php$request_uri; - # Optional: Don't log access to other assets - access_log off; + location ~ / { + try_files $uri / __PATH__/index.php$request_uri; } # show YunoHost panel access From 50ece34da7f88d78452e0ba6326b544e4a5da85b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 12:48:15 +0100 Subject: [PATCH 82/96] Fix linter --- check_process | 2 -- scripts/install | 2 +- scripts/upgrade | 7 ------- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/check_process b/check_process index 0ee0bab..440eb43 100644 --- a/check_process +++ b/check_process @@ -18,8 +18,6 @@ incorrect_path=1 port_already_use=0 change_url=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=none diff --git a/scripts/install b/scripts/install index 70e89f4..59e590f 100755 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." --weight=50 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=medium --footprint=high --package="$extra_php_dependencies" # Used by ynh_add_nginx_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) diff --git a/scripts/upgrade b/scripts/upgrade index a88a455..fc701c9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -125,13 +125,6 @@ then ynh_replace_string "\('datadirectory' =>.*\)$old_app" "\1$app" "$final_path/config/config.php" fi -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # UPGRADE DEPENDENCIES #================================================= From 6c6199d48d596834907597bd03d0f361d90ea154 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 12:51:57 +0100 Subject: [PATCH 83/96] Upgrade to 20.0.3 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 4 ++-- scripts/upgrade.d/upgrade.last.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a1eeaef..43a565c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Nextcloud](https://nextcloud.com) gives you freedom and control over your own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 20.0.2 +**Shipped version:** 20.0.3 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 37b5691..d6665be 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 20.0.2 +**Version incluse :** 20.0.3 ## Captures d'écran diff --git a/manifest.json b/manifest.json index f96496f..01b529b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.2~ynh1", + "version": "20.0.3~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { @@ -14,7 +14,7 @@ "email": "apps@yunohost.org" }, "requirements": { - "yunohost": ">= 3.8.0" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 682e66e..433d812 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash # Last available nextcloud version -next_version="20.0.2" +next_version="20.0.3" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="be84c2ac7fba066ddc0637a4672b39628bbbd200dad8c00a0437a4765007dd21" +nextcloud_source_sha256="e0f64504d338f64d3c677357f0012cf8b0ed0dc42ec08f958b6dc4ff70edf175" From 00b04039ea802e73a191fbacbd10bde114f255e8 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 14 Dec 2020 12:28:30 +0100 Subject: [PATCH 84/96] fix 405 error --- conf/nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index d4581c2..e9f864a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -121,6 +121,12 @@ location ^~ __PATH__/ { } location ~ / { + if ($request_method ~ ^PUT$) { + rewrite ^ __PATH__/index.php$request_uri last; + } + if ($request_method ~ ^DELETE$) { + rewrite ^ __PATH__/index.php$request_uri last; + } try_files $uri / __PATH__/index.php$request_uri; } From ff7c25c12556f445c85a8a153b917657e749c627 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 14 Dec 2020 21:41:44 +0100 Subject: [PATCH 85/96] Upgrade to version 20.0.4 --- README.md | 2 +- README_fr.md | 2 +- manifest.json | 2 +- scripts/upgrade.d/upgrade.last.sh | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 43a565c..6758018 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to [Nextcloud](https://nextcloud.com) gives you freedom and control over your own data. A personal cloud which runs on your own server. With Nextcloud you can synchronize your files over your devices. -**Shipped version:** 20.0.3 +**Shipped version:** 20.0.4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index d6665be..82c5b08 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Nextcloud](https://nextcloud.com) vous donne la liberté et le contrôle sur vos données. Un nuage personnel qui tourne sur votre serveur. Avec NextCloud vous pouvez synchroniser vos fichiers sur vos appareils. -**Version incluse :** 20.0.3 +**Version incluse :** 20.0.4 ## Captures d'écran diff --git a/manifest.json b/manifest.json index 01b529b..5e3ec17 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online storage, file sharing platform and various other applications", "fr": "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications" }, - "version": "20.0.3~ynh1", + "version": "20.0.4~ynh1", "url": "https://nextcloud.com", "license": "AGPL-3.0", "maintainer": { diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 433d812..3515c1b 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,7 +1,7 @@ #!/bin/bash -# Last available nextcloud version -next_version="20.0.3" +# Last available Nextcloud version +next_version="20.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="e0f64504d338f64d3c677357f0012cf8b0ed0dc42ec08f958b6dc4ff70edf175" +nextcloud_source_sha256="4c2857d328b64d12fe283ec2f7030131ebe6e467dd4a033cf602fd07984a28a3" From 70e7030a37b32e37965472def2ac7e88e3ce225d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 16 Dec 2020 11:16:00 +0100 Subject: [PATCH 86/96] Add $phpversion --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 59e590f..70e89f4 100755 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." --weight=50 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=medium --footprint=high --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=medium --footprint=high --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" # Used by ynh_add_nginx_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) diff --git a/scripts/restore b/scripts/restore index 3cc1584..48fe654 100755 --- a/scripts/restore +++ b/scripts/restore @@ -102,7 +102,7 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=50 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 --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion --package="$extra_php_dependencies" #================================================= # RESTORE THE CRON FILE diff --git a/scripts/upgrade b/scripts/upgrade index fc701c9..057b9f1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -148,7 +148,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" +ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then From dc3590aa78a07d0aa3f776f516d037564e9273d9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 16 Dec 2020 13:13:57 +0100 Subject: [PATCH 87/96] Fix shasum ... :/ --- scripts/upgrade.d/upgrade.last.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 3515c1b..f4b01b4 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -4,4 +4,4 @@ next_version="20.0.4" # Nextcloud tarball checksum sha256 -nextcloud_source_sha256="4c2857d328b64d12fe283ec2f7030131ebe6e467dd4a033cf602fd07984a28a3" +nextcloud_source_sha256="269f1622e326f5d11e387d3861aad4e2b0e79334ae97eed5a7b3352ba7661420" From f1a848900f23807132efde9749af19f504225598 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 13:56:15 +0100 Subject: [PATCH 88/96] fix config --- scripts/config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 85769fc..0c14bca 100644 --- a/scripts/config +++ b/scripts/config @@ -15,6 +15,8 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + #================================================= # LOAD VALUES #================================================= @@ -77,7 +79,7 @@ apply_config() { if [ "$fpm_footprint" != "0" ] then - ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint + ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" else ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." fi From c835aea17826b0debdbb586cb159a2ddad0b9a95 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 13:59:58 +0100 Subject: [PATCH 89/96] allow Symlinks --- scripts/install | 3 +++ scripts/upgrade | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index 70e89f4..d9a539a 100755 --- a/scripts/install +++ b/scripts/install @@ -84,6 +84,9 @@ cp -a ../sources/patches_last_version/* ../sources/patches # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +# Allow Symlinks for multimedia folder +ynh_replace_string --match_string="protected \$allowSymlinks = false;" --replace_string="protected \$allowSymlinks = true;" --target_file="$final_path/lib/private/Files/Storage/Local.php" + #================================================= # CREATE DEDICATED USER #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 057b9f1..84cbebf 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -270,6 +270,9 @@ then # Install the next nextcloud version in $tmpdir ynh_setup_source --dest_dir="$tmpdir" + # Allow Symlinks for multimedia folder + ynh_replace_string --match_string="protected \$allowSymlinks = false;" --replace_string="protected \$allowSymlinks = true;" --target_file="$tmpdir/lib/private/Files/Storage/Local.php" + # Enable maintenance mode exec_occ maintenance:mode --on From f12db573bfb9a849c2afc63700c70166fd781698 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 14:08:35 +0100 Subject: [PATCH 90/96] add missing primary keys --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 84cbebf..cf4cfd8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -314,8 +314,9 @@ then exec_occ -V done - exec_occ db:add-missing-indices - exec_occ db:add-missing-columns + exec_occ db:add-missing-indices -n + exec_occ db:add-missing-columns -n + exec_occ db:add-missing-primary-keys -n exec_occ db:convert-filecache-bigint -n #================================================= From d01cb9826ab6efd8ba4bd882f58eb40b7b299afe Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 15:38:07 +0100 Subject: [PATCH 91/96] Upgrade php version --- scripts/upgrade | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index cf4cfd8..c85d5fe 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,12 +147,23 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 +# If php has changed, remove the old fpm config file +if [ "$phpversion" != $YNH_PHP_VERSION ] +then + ynh_backup_if_checksum_is_different --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" + ynh_secure_remove --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" + ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload + ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini" + + phpversion="$YNH_PHP_VERSION" +fi + # Recreate a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then - ynh_secure_remove --file=/etc/php/$phpversion/fpm/conf.d/20-$app.ini + ynh_secure_remove --file=/etc/php/$phpversion/fpm/conf.d/20-$app.ini fi #================================================= From 001a2b6a1a15eddc98346de48f8c10228d0ba122 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 16 Dec 2020 16:16:34 +0100 Subject: [PATCH 92/96] reload php-fpm --- scripts/upgrade | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c85d5fe..a1aeb06 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -153,7 +153,9 @@ then ynh_backup_if_checksum_is_different --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_secure_remove --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload - ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini" + if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then + ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini" + fi phpversion="$YNH_PHP_VERSION" fi @@ -478,9 +480,10 @@ ynh_app_setting_set --app=$app --key=skipped_regex \ #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload #================================================= # FINISH MIGRATION PROCESS From 9f056198d512447502acdf94ea20d8721cf0fbb1 Mon Sep 17 00:00:00 2001 From: Kayou Date: Thu, 17 Dec 2020 12:00:56 +0100 Subject: [PATCH 93/96] Apply suggestions from code review --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a1aeb06..8c07855 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -152,11 +152,11 @@ if [ "$phpversion" != $YNH_PHP_VERSION ] then ynh_backup_if_checksum_is_different --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_secure_remove --file="/etc/php/$phpversion/fpm/pool.d/$app.conf" - ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini" fi - + ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload + phpversion="$YNH_PHP_VERSION" fi From 85cffbbe6506150b0a38a7cbf83b54d73a2239d8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 17 Dec 2020 23:30:34 +0100 Subject: [PATCH 94/96] Set badge Install-Nextcloud-with-YunoHost to use SVG --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6758018..3c528e5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Nextcloud for YunoHost [![Integration level](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) -[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) +[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index 82c5b08..baf3cdd 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # Nextcloud pour YunoHost [![Niveau d'integration](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg) -[![Installer Nextcloud avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud) +[![Installer Nextcloud avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud) *[Read this readme in english.](./README.md)* From d0552650f1acb3210d9ea7b9b50e571c6e98c634 Mon Sep 17 00:00:00 2001 From: Kayou Date: Fri, 18 Dec 2020 11:39:00 +0100 Subject: [PATCH 95/96] Fix the caldav regex --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8c07855..12c9b11 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -188,7 +188,7 @@ then ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" + sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "../conf/nginx.conf" fi # Create a dedicated NGINX config From e9e7015ed7667352c1c191fc632a9f6f382dd9d2 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 18 Dec 2020 12:32:24 +0100 Subject: [PATCH 96/96] Fix the caldav regex --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c779071..5cb1cb9 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -105,7 +105,7 @@ then ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "/etc/nginx/conf.d/$new_domain.d/$app.conf" + sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi fi diff --git a/scripts/install b/scripts/install index d9a539a..1e1621d 100755 --- a/scripts/install +++ b/scripts/install @@ -116,7 +116,7 @@ then ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "../conf/nginx.conf" + sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "../conf/nginx.conf" fi # Create a dedicated NGINX config diff --git a/scripts/restore b/scripts/restore index 48fe654..44f8384 100755 --- a/scripts/restore +++ b/scripts/restore @@ -56,7 +56,7 @@ then ynh_print_warn --message="Another app already uses the domain $domain to serve a caldav/carddav feature. You may encounter issues when dealing with your calendar or address book." # Remove lines about .well-known/carddav and caldav with sed. - sed --in-place --regexp-extended '/^location = \/\.well\-known\/(caldav|carddav) \{/,/\}/d' "/etc/nginx/conf.d/$domain.d/$app.conf" + sed --in-place --regexp-extended '/location = \/\.well\-known\/(caldav|carddav)/d' "/etc/nginx/conf.d/$domain.d/$app.conf" fi #=================================================