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 diff --git a/check_process b/check_process index 925817e..7ac5c52 100644 --- a/check_process +++ b/check_process @@ -3,14 +3,15 @@ domain="domain.tld" path="/path" admin="homer" + is_public=1 user_home="1" ; Checks pkg_linter=1 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 diff --git a/manifest.json b/manifest.json index fc8be17..f72ef15 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/_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 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/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/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 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 #=================================================