From 38eaef440e49f7525c482aba7533359d171abc22 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 9 Aug 2021 14:24:20 +0200 Subject: [PATCH 1/9] Add is public in manifest --- manifest.json | 9 +++++++++ scripts/install | 9 ++++++++- scripts/upgrade | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 2d7a9d7..e159690 100644 --- a/manifest.json +++ b/manifest.json @@ -48,6 +48,15 @@ "type": "user", "example": "homer" }, + { + "name": "is_public", + "type": "boolean", + "help": { + "en": "If enabled, Nextcloud will be accessible by Nextcloud Desktop and by users without a YunoHost account. This can be changed later in the webadmin.", + "fr": "Si cette case est cochée, Nextcloud sera accessible par Nextcloud Desktop et par les utilisateurs n’ayant pas de compte YunoHost. Vous pourrez changer dans la webadmin." + }, + "default": true + }, { "name": "user_home", "type": "boolean", diff --git a/scripts/install b/scripts/install index 1ca2fc6..c36b120 100755 --- a/scripts/install +++ b/scripts/install @@ -24,6 +24,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN user_home=$YNH_APP_ARG_USER_HOME +is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME @@ -331,7 +332,13 @@ ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" - #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." + +# Make app public if necessary +if [ $is_public -eq 1 ] +then + ynh_permission_update --permission="main" --add="visitors" +fi ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" diff --git a/scripts/upgrade b/scripts/upgrade index 175c4ee..8968143 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,13 @@ if [ -z "$phpversion" ]; then phpversion="$YNH_PHP_VERSION" fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From 30fe6d14afe31fe837f2bbdc7eb44e384993c5b4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 9 Aug 2021 14:25:00 +0200 Subject: [PATCH 2/9] Update check_process --- check_process | 1 + 1 file changed, 1 insertion(+) diff --git a/check_process b/check_process index 925817e..2a99068 100644 --- a/check_process +++ b/check_process @@ -3,6 +3,7 @@ domain="domain.tld" path="/path" admin="homer" + is_public=1 user_home="1" ; Checks pkg_linter=1 From bf3b68041819d07b9904aa19a3773366aff79db9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 9 Aug 2021 14:31:32 +0200 Subject: [PATCH 3/9] Update check_process --- check_process | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 2a99068..7ac5c52 100644 --- a/check_process +++ b/check_process @@ -10,8 +10,8 @@ setup_sub_dir=1 setup_root=1 setup_nourl=0 - setup_private=0 - setup_public=0 + setup_private=1 + setup_public=1 upgrade=1 #19.0.3 upgrade=1 from_commit=a03e25fac417e2e03e53ed3a7b7ed05185637360 From 7fafb515d11c5276d511427efdcd156863837c44 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 9 Aug 2021 14:40:55 +0200 Subject: [PATCH 4/9] Add rights --- scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index c36b120..c9e824a 100755 --- a/scripts/install +++ b/scripts/install @@ -306,6 +306,7 @@ ynh_multimedia_addaccess $app # Fix app ownerships & permissions chown -R $app: "$final_path" "$datadir" +chmod -R o-rwx "$final_path" find $final_path/ -type f -print0 | xargs -0 chmod 0644 find $final_path/ -type d -print0 | xargs -0 chmod 0755 find $datadir/ -type f -print0 | xargs -0 chmod 0640 diff --git a/scripts/restore b/scripts/restore index 44f8384..72a5e47 100755 --- a/scripts/restore +++ b/scripts/restore @@ -134,6 +134,7 @@ mkdir -p "$datadir" # Fix app ownerships & permissions chown -R $app: "$final_path" "$datadir" +chmod -R o-rwx "$final_path" chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app diff --git a/scripts/upgrade b/scripts/upgrade index 8968143..a53ffce 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -425,6 +425,7 @@ exec_occ background:cron # Fix app ownerships & permissions chown -R $app: "$final_path" "$datadir" +chmod -R o-rwx "$final_path" find $final_path/ -type f -print0 | xargs -0 chmod 0644 find $final_path/ -type d -print0 | xargs -0 chmod 0755 find $datadir/ -type f -print0 | xargs -0 chmod 0640 From a56a1ffae2049d459789241c197ae75176b16605 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 9 Aug 2021 14:41:32 +0200 Subject: [PATCH 5/9] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index e159690..317ae19 100644 --- a/manifest.json +++ b/manifest.json @@ -12,8 +12,8 @@ "license": "AGPL-3.0", "website": "https://nextcloud.com", "demo": "https://demo.nextcloud.com/", - "admindoc": "https://docs.nextcloud.com/server/21/user_manual/en/", - "userdoc": "https://yunohost.org/en/app_nextcloud", + "admindoc": "https://docs.nextcloud.com/server/stable/admin_manual/", + "userdoc": "https://docs.nextcloud.com/server/latest/user_manual/en/", "code": "https://github.com/nextcloud/server" }, "license": "AGPL-3.0", From 99037c5a639345a2e9e2f139c0819db4b78547df Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 9 Aug 2021 12:41:40 +0000 Subject: [PATCH 6/9] Auto-update README --- README.md | 4 ++-- README_fr.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3370d99..0d6dc8c 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,8 @@ this package: ## Documentation and resources * Official app website: https://nextcloud.com -* Official user documentation: https://yunohost.org/en/app_nextcloud -* Official admin documentation: https://docs.nextcloud.com/server/21/user_manual/en/ +* Official user documentation: https://docs.nextcloud.com/server/latest/user_manual/en/ +* Official admin documentation: https://docs.nextcloud.com/server/stable/admin_manual/ * Upstream app code repository: https://github.com/nextcloud/server * YunoHost documentation for this app: https://yunohost.org/app_nextcloud * Report a bug: https://github.com/YunoHost-Apps/nextcloud_ynh/issues diff --git a/README_fr.md b/README_fr.md index b338094..085295a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -49,8 +49,8 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv ## Documentations et ressources * Site officiel de l'app : https://nextcloud.com -* Documentation officielle utilisateur : https://yunohost.org/en/app_nextcloud -* Documentation officielle de l'admin : https://docs.nextcloud.com/server/21/user_manual/en/ +* Documentation officielle utilisateur : https://docs.nextcloud.com/server/latest/user_manual/en/ +* Documentation officielle de l'admin : https://docs.nextcloud.com/server/stable/admin_manual/ * Dépôt de code officiel de l'app : https://github.com/nextcloud/server * Documentation YunoHost pour cette app : https://yunohost.org/app_nextcloud * Signaler un bug : https://github.com/YunoHost-Apps/nextcloud_ynh/issues From 9f7badfdd0d5e43b50d2c54a0c8d72441c909683 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 9 Aug 2021 15:08:09 +0200 Subject: [PATCH 7/9] Revert "Add rights" This reverts commit 7fafb515d11c5276d511427efdcd156863837c44. --- scripts/install | 1 - scripts/restore | 1 - scripts/upgrade | 1 - 3 files changed, 3 deletions(-) diff --git a/scripts/install b/scripts/install index c9e824a..c36b120 100755 --- a/scripts/install +++ b/scripts/install @@ -306,7 +306,6 @@ ynh_multimedia_addaccess $app # Fix app ownerships & permissions chown -R $app: "$final_path" "$datadir" -chmod -R o-rwx "$final_path" find $final_path/ -type f -print0 | xargs -0 chmod 0644 find $final_path/ -type d -print0 | xargs -0 chmod 0755 find $datadir/ -type f -print0 | xargs -0 chmod 0640 diff --git a/scripts/restore b/scripts/restore index 72a5e47..44f8384 100755 --- a/scripts/restore +++ b/scripts/restore @@ -134,7 +134,6 @@ mkdir -p "$datadir" # Fix app ownerships & permissions chown -R $app: "$final_path" "$datadir" -chmod -R o-rwx "$final_path" chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app diff --git a/scripts/upgrade b/scripts/upgrade index a53ffce..8968143 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -425,7 +425,6 @@ exec_occ background:cron # Fix app ownerships & permissions chown -R $app: "$final_path" "$datadir" -chmod -R o-rwx "$final_path" find $final_path/ -type f -print0 | xargs -0 chmod 0644 find $final_path/ -type d -print0 | xargs -0 chmod 0755 find $datadir/ -type f -print0 | xargs -0 chmod 0640 From 414c17193fe4d3016a7ccf412368e892aa56ca51 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 9 Aug 2021 23:25:12 +0200 Subject: [PATCH 8/9] Fix --- scripts/backup | 2 +- scripts/restore | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index 7ed3c7f..1a1944a 100755 --- a/scripts/backup +++ b/scripts/backup @@ -64,7 +64,7 @@ ynh_mysql_dump_db --database="$db_name" > db.sql # BACKUP LOGROTATE #================================================= -ynh_backup "/etc/logrotate.d/$app" +ynh_backup --src_path="/etc/logrotate.d/$app" #================================================= # BACKUP FAIL2BAN CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 44f8384..2888599 100755 --- a/scripts/restore +++ b/scripts/restore @@ -134,6 +134,10 @@ mkdir -p "$datadir" # Fix app ownerships & permissions chown -R $app: "$final_path" "$datadir" +find $final_path/ -type f -print0 | xargs -0 chmod 0644 +find $final_path/ -type d -print0 | xargs -0 chmod 0755 +find $datadir/ -type f -print0 | xargs -0 chmod 0640 +find $datadir/ -type d -print0 | xargs -0 chmod 0750 chmod 640 "$final_path/config/config.php" chmod 755 /home/yunohost.app From 2132d1fa01f410ec08c8697cec79ca1fb5f78a5a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 1 Sep 2021 20:43:49 +0200 Subject: [PATCH 9/9] Remove php-smbclient Fix #414 --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 98be903..a028c31 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ pkg_dependencies="imagemagick libmagickcore-6.q16-6-extra acl tar smbclient at" YNH_PHP_VERSION="7.3" -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" +extra_php_dependencies="php${YNH_PHP_VERSION}-bz2 php${YNH_PHP_VERSION}-imap 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