1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Merge branch 'testing' into add-language-choice

This commit is contained in:
CodeShakingSheep 2024-05-03 17:52:44 -05:00 committed by GitHub
commit 4dc15d2dbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 395 additions and 102 deletions

7
ALL_README.md Normal file
View file

@ -0,0 +1,7 @@
# All available README files by language
- [Read the README in English](README.md)
- [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md)
- [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -1,5 +1,5 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
N.B.: This README was automatically generated by <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
It shall NOT be edited by hand.
-->
@ -9,10 +9,10 @@ It shall NOT be edited by hand.
[![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)*
*[Read this README in other languages.](./ALL_README.md)*
> *This package allows you to install Nextcloud quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
> *This package allows you to install Nextcloud quickly and simply on a YunoHost server.*
> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*
## Overview
@ -29,9 +29,9 @@ In addition to Nextcloud core features, the following are made available with th
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal
**Shipped version:** 28.0.2~ynh1
**Shipped version:** 28.0.5~ynh1
**Demo:** https://demo.nextcloud.com/
**Demo:** <https://demo.nextcloud.com/>
## Screenshots
@ -39,20 +39,20 @@ In addition to Nextcloud core features, the following are made available with th
## Documentation and resources
* Official app website: <https://nextcloud.com>
* 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 Store: <https://apps.yunohost.org/app/nextcloud>
* Report a bug: <https://github.com/YunoHost-Apps/nextcloud_ynh/issues>
- Official app website: <https://nextcloud.com>
- 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 Store: <https://apps.yunohost.org/app/nextcloud>
- Report a bug: <https://github.com/YunoHost-Apps/nextcloud_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing).
Please send 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.
To try the `testing` branch, please proceed like that:
``` bash
```bash
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

61
README_eu.md Normal file
View file

@ -0,0 +1,61 @@
<!--
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
EZ editatu eskuz.
-->
# Nextcloud YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg)
[![Instalatu Nextcloud YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud)
*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
> *Pakete honek Nextcloud YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
## Aurreikuspena
Nextcloud Hub is a fully open-source on-premises content collaboration platform. Teams access, share and edit their documents, chat and participate in video calls and manage their mail and calendar and projects across mobile, desktop and web interfaces.
### YunoHost-specific features
In addition to Nextcloud core features, the following are made available with 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
**Paketatutako bertsioa:** 28.0.5~ynh1
**Demoa:** <https://demo.nextcloud.com/>
## Pantaila-argazkiak
![Nextcloud(r)en pantaila-argazkia](./doc/screenshots/screenshot.png)
## Dokumentazioa eta baliabideak
- Aplikazioaren webgune ofiziala: <https://nextcloud.com>
- Erabiltzaileen dokumentazio ofiziala: <https://docs.nextcloud.com/server/latest/user_manual/en/>
- Administratzaileen dokumentazio ofiziala: <https://docs.nextcloud.com/server/stable/admin_manual/>
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/nextcloud/server>
- YunoHost Denda: <https://apps.yunohost.org/app/nextcloud>
- Eman errore baten berri: <https://github.com/YunoHost-Apps/nextcloud_ynh/issues>
## Garatzaileentzako informazioa
Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing).
`testing` abarra probatzeko, ondorengoa egin:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
edo
sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
```
**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>

View file

@ -1,6 +1,6 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
Nota bene: ce README est automatiquement généré par <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Il NE doit PAS être modifié à la main.
-->
# Nextcloud pour YunoHost
@ -9,10 +9,10 @@ It shall NOT be edited by hand.
[![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)*
*[Lire le README dans d'autres langues.](./ALL_README.md)*
> *Ce package vous permet dinstaller Nextcloud rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
> *Ce package vous permet dinstaller Nextcloud rapidement et simplement sur un serveur YunoHost.*
> *Si vous navez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment linstaller et en profiter.*
## Vue densemble
@ -29,9 +29,9 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv
* Utilise l'adresse `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - par exemple, Baïkal
**Version incluse :** 28.0.2~ynh1
**Version incluse:** 28.0.5~ynh1
**Démo :** https://demo.nextcloud.com/
**Démo:** <https://demo.nextcloud.com/>
## Captures décran
@ -39,23 +39,23 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv
## Documentations et ressources
* Site officiel de lapp : <https://nextcloud.com>
* Documentation officielle utilisateur : <https://docs.nextcloud.com/server/latest/user_manual/en/>
* Documentation officielle de ladmin : <https://docs.nextcloud.com/server/stable/admin_manual/>
* Dépôt de code officiel de lapp : <https://github.com/nextcloud/server>
* YunoHost Store: <https://apps.yunohost.org/app/nextcloud>
* Signaler un bug : <https://github.com/YunoHost-Apps/nextcloud_ynh/issues>
- Site officiel de lapp: <https://nextcloud.com>
- Documentation officielle utilisateur: <https://docs.nextcloud.com/server/latest/user_manual/en/>
- Documentation officielle de ladmin: <https://docs.nextcloud.com/server/stable/admin_manual/>
- Dépôt de code officiel de lapp: <https://github.com/nextcloud/server>
- YunoHost Store: <https://apps.yunohost.org/app/nextcloud>
- Signaler un bug: <https://github.com/YunoHost-Apps/nextcloud_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing).
Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
Pour essayer la branche `testing`, procédez comme suit:
``` bash
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
ou
sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
```
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>
**Plus dinfos sur le packaging dapplications:** <https://yunohost.org/packaging_apps>

61
README_gl.md Normal file
View file

@ -0,0 +1,61 @@
<!--
NOTA: Este README foi creado automáticamente por <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
NON debe editarse manualmente.
-->
# Nextcloud para YunoHost
[![Nivel de integración](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg)
[![Instalar Nextcloud con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud)
*[Le este README en outros idiomas.](./ALL_README.md)*
> *Este paquete permíteche instalar Nextcloud de xeito rápido e doado nun servidor YunoHost.*
> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.*
## Vista xeral
Nextcloud Hub is a fully open-source on-premises content collaboration platform. Teams access, share and edit their documents, chat and participate in video calls and manage their mail and calendar and projects across mobile, desktop and web interfaces.
### YunoHost-specific features
In addition to Nextcloud core features, the following are made available with 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
**Versión proporcionada:** 28.0.5~ynh1
**Demo:** <https://demo.nextcloud.com/>
## Capturas de pantalla
![Captura de pantalla de Nextcloud](./doc/screenshots/screenshot.png)
## Documentación e recursos
- Web oficial da app: <https://nextcloud.com>
- Documentación oficial para usuarias: <https://docs.nextcloud.com/server/latest/user_manual/en/>
- Documentación oficial para admin: <https://docs.nextcloud.com/server/stable/admin_manual/>
- Repositorio de orixe do código: <https://github.com/nextcloud/server>
- Tenda YunoHost: <https://apps.yunohost.org/app/nextcloud>
- Informar dun problema: <https://github.com/YunoHost-Apps/nextcloud_ynh/issues>
## Info de desenvolvemento
Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing).
Para probar a rama `testing`, procede deste xeito:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
ou
sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
```
**Máis info sobre o empaquetado da app:** <https://yunohost.org/packaging_apps>

61
README_it.md Normal file
View file

@ -0,0 +1,61 @@
<!--
N.B.: Questo README è stato automaticamente generato da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
NON DEVE essere modificato manualmente.
-->
# Nextcloud per YunoHost
[![Livello di integrazione](https://dash.yunohost.org/integration/nextcloud.svg)](https://dash.yunohost.org/appci/app/nextcloud) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg)
[![Installa Nextcloud con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud)
*[Leggi questo README in altre lingue.](./ALL_README.md)*
> *Questo pacchetto ti permette di installare Nextcloud su un server YunoHost in modo semplice e veloce.*
> *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.*
## Panoramica
Nextcloud Hub is a fully open-source on-premises content collaboration platform. Teams access, share and edit their documents, chat and participate in video calls and manage their mail and calendar and projects across mobile, desktop and web interfaces.
### YunoHost-specific features
In addition to Nextcloud core features, the following are made available with 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
**Versione pubblicata:** 28.0.4~ynh1
**Prova:** <https://demo.nextcloud.com/>
## Screenshot
![Screenshot di Nextcloud](./doc/screenshots/screenshot.png)
## Documentazione e risorse
- Sito web ufficiale dellapp: <https://nextcloud.com>
- Documentazione ufficiale per gli utenti: <https://docs.nextcloud.com/server/latest/user_manual/en/>
- Documentazione ufficiale per gli amministratori: <https://docs.nextcloud.com/server/stable/admin_manual/>
- Repository upstream del codice dellapp: <https://github.com/nextcloud/server>
- Store di YunoHost: <https://apps.yunohost.org/app/nextcloud>
- Segnala un problema: <https://github.com/YunoHost-Apps/nextcloud_ynh/issues>
## Informazioni per sviluppatori
Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing).
Per provare la branch di `testing`, si prega di procedere in questo modo:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
o
sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
```
**Maggiori informazioni riguardo il pacchetto di questapp:** <https://yunohost.org/packaging_apps>

61
README_zh_Hans.md Normal file
View file

@ -0,0 +1,61 @@
<!--
注意:此 README 由 <https://github.com/YunoHost/apps/tree/master/tools/readme_generator> 自动生成
请勿手动编辑。
-->
# YunoHost 的 Nextcloud
[![集成程度](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)
[![使用 YunoHost 安装 Nextcloud](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud)
*[阅读此 README 的其它语言版本。](./ALL_README.md)*
> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Nextcloud。*
> *如果您还没有 YunoHost请参阅[指南](https://yunohost.org/install)了解如何安装它。*
## 概况
Nextcloud Hub is a fully open-source on-premises content collaboration platform. Teams access, share and edit their documents, chat and participate in video calls and manage their mail and calendar and projects across mobile, desktop and web interfaces.
### YunoHost-specific features
In addition to Nextcloud core features, the following are made available with 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
**分发版本:** 28.0.5~ynh1
**演示:** <https://demo.nextcloud.com/>
## 截图
![Nextcloud 的截图](./doc/screenshots/screenshot.png)
## 文档与资源
- 官方应用网站: <https://nextcloud.com>
- 官方用户文档: <https://docs.nextcloud.com/server/latest/user_manual/en/>
- 官方管理文档: <https://docs.nextcloud.com/server/stable/admin_manual/>
- 上游应用代码库: <https://github.com/nextcloud/server>
- YunoHost 商店: <https://apps.yunohost.org/app/nextcloud>
- 报告 bug <https://github.com/YunoHost-Apps/nextcloud_ynh/issues>
## 开发者信息
请向 [`testing` 分支](https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing) 发送拉取请求。
如要尝试 `testing` 分支,请这样操作:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
```
**有关应用打包的更多信息:** <https://yunohost.org/packaging_apps>

View file

@ -14,6 +14,7 @@
"hashing_default_password": true,
"localstorage.allowsymlinks": true,
"simpleSignUpLink.shown": false,
"maintenance_window_start": 1,
"mail_smtpmode": "smtp",
"mail_smtpport": "25",
"mail_smtpauth": 1,

View file

@ -19,7 +19,7 @@ location ^~ /.well-known {
location = /.well-known/caldav { return 301 __PATH__/remote.php/dav/; }
location = /.well-known/webfinger { return 301 __PATH__/index.php$request_uri; }
location = /.well-known/nodeinfo { return 301 __PATH__/index.php$uri; }
location = /.well-known/nodeinfo { return 301 __PATH__/index.php$request_uri; }
# Let Nextcloud's API for `/.well-known` URIs handle all other
# requests by passing them to the front-end controller.
@ -55,7 +55,7 @@ location ^~ __PATH__/ {
client_body_buffer_size 512k;
# HTTP response headers borrowed from Nextcloud `.htaccess`
more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;";
#more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;";
more_set_headers "Referrer-Policy: no-referrer";
more_set_headers "X-Content-Type-Options: nosniff";
more_set_headers "X-Download-Options: noopen";

View file

@ -11,6 +11,15 @@ name = "Nextcloud configuration"
type = "boolean"
default = "0"
[main.addressbook]
name = "Address book configuration"
[main.addressbook.system_addressbook_exposed]
ask = "Should there be a system address book listing all users, accessible by all users?"
type = "boolean"
yes = "yes"
no = "no"
[main.php_fpm_config]
name = "PHP-FPM configuration"

View file

@ -5,7 +5,7 @@ name = "Nextcloud"
description.en = "Online storage, file sharing platform and various other applications"
description.fr = "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications"
version = "28.0.2~ynh1"
version = "28.0.5~ynh1"
maintainers = ["kay0u"]
@ -61,13 +61,20 @@ ram.runtime = "512M"
type = "boolean"
default = false
[install.system_addressbook_exposed]
ask.en = "Should there be a system address book listing all users, accessible by all users?"
ask.fr = "Devrait-il y avoir un carnet d'adresses système listant tous les comptes, accessible par tous les comptes ?"
type = "select"
choices = ["yes", "no"]
default = "yes"
[resources]
[resources.sources]
[resources.sources.main]
url = 'https://download.nextcloud.com/server/releases/nextcloud-28.0.2.tar.bz2'
sha256 = 'de34d6baf3ecceacfdd138e85520cd85e1d2ce6798d9ffa478ac17eb1efa1d08'
url = 'https://download.nextcloud.com/server/releases/nextcloud-28.0.5.tar.bz2'
sha256 = 'dca1100f95b864bade113477723c71ac897193352c317e39cd286d87635706eb'
[resources.sources.27]
url = 'https://download.nextcloud.com/server/releases/nextcloud-27.0.0.tar.bz2'

View file

@ -40,45 +40,6 @@ is_url_handled() {
fi
}
#=================================================
# Check available space before creating a temp directory.
#
# usage: ynh_smart_mktemp --min_size="Min size"
#
# | arg: -s, --min_size= - Minimal size needed for the temporary directory, in Mb
ynh_smart_mktemp () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [s]=min_size= )
local min_size
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
min_size="${min_size:-300}"
# Transform the minimum size from megabytes to kilobytes
min_size=$(( $min_size * 1024 ))
# Check if there's enough free space in a directory
is_there_enough_space () {
local free_space=$(df --output=avail "$1" | sed 1d)
test $free_space -ge $min_size
}
if is_there_enough_space /tmp; then
local tmpdir=/tmp
elif is_there_enough_space /var; then
local tmpdir=/var
elif is_there_enough_space /; then
local tmpdir=/
elif is_there_enough_space /home; then
local tmpdir=/home
else
ynh_die "Insufficient free space to continue..."
fi
echo "$(mktemp --directory --tmpdir="$tmpdir")"
}
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -60,6 +60,12 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
ynh_backup --src_path="/etc/cron.d/$app"
#=================================================
# BACKUP LOGS
#=================================================
ynh_backup --src_path="/var/log/$app"
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================

View file

@ -38,6 +38,11 @@ get__maintenance_mode() {
fi
}
get__system_addressbook_exposed() {
echo $(cd "$install_dir" && ynh_exec_as "$app" \
php${phpversion} --define apc.enable_cli=1 occ config:app:get dav system_addressbook_exposed)
}
get__fpm_footprint() {
# Free footprint value for php-fpm
# Check if current_fpm_footprint is an integer
@ -80,6 +85,12 @@ set__maintenance_mode() {
ynh_app_setting_set --app=$app --key=maintenance_mode --value="$maintenance_mode"
}
set__system_addressbook_exposed() {
(cd "$install_dir" && ynh_exec_as "$app" \
php${phpversion} --define apc.enable_cli=1 occ config:app:set dav system_addressbook_exposed --value="$system_addressbook_exposed")
ynh_print_info "System addressbook is exposed: $system_addressbook_exposed"
}
set__fpm_footprint() {
if [ "$fpm_footprint" != "specific" ]
then

View file

@ -98,6 +98,9 @@ exec_occ config:system:set default_locale --value="$language"
country=$(echo "$language" | awk -F'_' '{print $2}')
exec_occ config:system:set default_phone_region --value="$country"
# Move the logs from the data_dir to the standard /var/log
exec_occ config:system:set logfile --value="/var/log/$app/nextcloud.log"
# Ensure that UpdateNotification app is disabled
exec_occ app:disable updatenotification
@ -163,12 +166,13 @@ fi
#=================================================
# Add dynamic logout URL to the config
url_base64="$(echo -n "https://$domain$path" | base64)"
exec_occ config:system:get logout_url >/dev/null 2>&1 \
|| echo "
//-YunoHost-
// set logout_url according to main domain
\$main_domain = exec('cat /etc/yunohost/current_host');
\$CONFIG['logout_url'] = 'https://'.\$main_domain.'/yunohost/sso/?action=logout';
\$CONFIG['logout_url'] = 'https://'.\$main_domain.'/yunohost/sso/?action=logout&r=${url_base64}';
//-YunoHost-
" >> "$install_dir/config/config.php"
@ -188,6 +192,12 @@ ynh_mysql_connect_as --user=$db_name --password="$db_pwd" --database=$db_name --
# And delete admin user
exec_occ user:delete admin
#=================================================
# ENABLE OR DISABLE SYSTEM ADDRESS BOOK
#=================================================
exec_occ config:app:set dav system_addressbook_exposed --value="$system_addressbook_exposed"
#=================================================
# STORE THE CHECKSUM OF THE CONFIG FILE
#=================================================
@ -251,7 +261,7 @@ chmod 750 $install_dir
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s)
ynh_use_logrotate --logfile="$data_dir/data/nextcloud.log"
ynh_use_logrotate
#=================================================
# SETUP FAIL2BAN
@ -259,7 +269,7 @@ ynh_use_logrotate --logfile="$data_dir/data/nextcloud.log"
ynh_script_progression --message="Configuring Fail2Ban..." --weight=8
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="$data_dir/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
#=================================================
# END OF SCRIPT

View file

@ -16,6 +16,9 @@ ynh_remove_nginx_config
# Remove the dedicated PHP-FPM config
ynh_remove_fpm_config
# remove logs
ynh_secure_remove --file="/var/log/$app"
# Remove the app-specific logrotate config
ynh_remove_logrotate

View file

@ -53,6 +53,12 @@ ynh_script_progression --message="Restoring cron job..." --weight=1
ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================
# RESTORE LOGS
#=================================================
ynh_restore_file --origin_path="/var/log/$app"
#=================================================
# BACKUP THE LOGROTATE CONFIGURATION
#=================================================
@ -109,10 +115,10 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
# Make sure a log file exists (mostly for CI tests)
logfile="$data_dir/data/nextcloud.log"
logfile="/var/log/$app/nextcloud.log"
if [ ! -f "$logfile" ]; then
touch "$logfile"
chown $app: "$logfile"
chown "$app:" "$logfile"
fi
ynh_systemd_action --action=restart --service_name=fail2ban

View file

@ -24,7 +24,6 @@ then
ynh_die --message="Upgrading from Nextcloud < 22.2 is not supported anymore. You should first upgrade to 22.2 using: yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/41f5f902e7c7cd3c30a6793020562ba98b9bf3e9"
fi
#=================================================
# SPECIFIC UPGRADE
#=================================================
@ -165,7 +164,7 @@ then
fi
# Create a temporary directory
tmpdir="$(ynh_smart_mktemp min_size=300)"
tmpdir="${install_dir}__tmp_upgrade"
ynh_setup_source --dest_dir="$tmpdir" --source_id="$source_id"
@ -239,6 +238,17 @@ then
# Update all installed apps
exec_occ app:update --all
# move the logs from the data_dir to the standard /var/log
# it would be better in the ENSURE DOWNWARD COMPATIBILITY section
# but it must be after the exec_occ() definition, so it's here
if [ -f "$data_dir/data/nextcloud.log" ]; then
mkdir -p "/var/log/$app"
chmod 750 "/var/log/$app"
mv "$data_dir"/data/nextcloud.log* "/var/log/$app"
# adapt the nextcloud config
exec_occ config:system:set logfile --value="/var/log/$app/nextcloud.log"
fi
# Load the config file in nextcloud
exec_occ config:import "$nc_conf"
@ -250,14 +260,19 @@ then
#=================================================
# Add dynamic logout URL to the config
exec_occ config:system:get logout_url >/dev/null 2>&1 \
|| echo "
url_base64="$(echo -n "https://$domain$path" | base64)"
old_logout_url="https://$(cat /etc/yunohost/current_host)/yunohost/sso/?action=logout"
current_logout_url="$(exec_occ config:system:get logout_url 2> /dev/null)"
if [[ "$current_logout_url" == "${old_logout_url}" ]] || [[ "$current_logout_url" == "" ]]
then
echo "
//-YunoHost-
// set logout_url according to main domain
\$main_domain = exec('cat /etc/yunohost/current_host');
\$CONFIG['logout_url'] = 'https://'.\$main_domain.'/yunohost/sso/?action=logout';
\$main_domain = file_get_contents('/etc/yunohost/current_host');
\$CONFIG['logout_url'] = 'https://'.\$main_domain.'/yunohost/sso/?action=logout&r=${url_base64}';
//-YunoHost-
" >> "$install_dir/config/config.php"
" >> "$install_dir/config/config.php"
fi
#=================================================
# CHANGE HOSTNAME FOR ACTIVITY NOTIFICATIONS
@ -340,9 +355,10 @@ fi
# Create a dedicated NGINX config
ynh_add_nginx_config
#-------------------------------------------------
#=================================================
# CRON JOB
#-------------------------------------------------
#=================================================
cron_path="/etc/cron.d/$app"
ynh_add_config --template="nextcloud.cron" --destination="$cron_path"
chown root: "$cron_path"
@ -350,17 +366,18 @@ chmod 644 "$cron_path"
exec_occ background:cron
#-------------------------------------------------
#=================================================
# LOGROTATE
#-------------------------------------------------
#=================================================
ynh_use_logrotate --non-append
#-------------------------------------------------
#=================================================
# FAIL2BAN
#-------------------------------------------------
#=================================================
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="$data_dir/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
#=================================================
# END OF SCRIPT

View file

@ -1,20 +1,31 @@
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index 13aef8f67a..55d8dbf9d1 100644
index aa6617c..eb47b80 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -97,11 +97,12 @@ class LoginController extends Controller {
@@ -111,16 +111,20 @@ class LoginController extends Controller {
#[UseSession]
public function logout() {
$loginToken = $this->request->getCookie('nc_token');
+ $uuidUser = $this->userSession->getUser()->getUID();
+ $isLdapUser = $this->config->getUserValue($uuidUser, 'user_ldap', 'uid');
if (!is_null($loginToken)) {
- $this->config->deleteUserValue($this->userSession->getUser()->getUID(), 'login_token', $loginToken);
+ $this->config->deleteUserValue($uuidUser, 'login_token', $loginToken);
}
$this->userSession->logout();
-
- $response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute(
- 'core.login.showLoginForm',
- ['clear' => true] // this param the code in login.js may be removed when the "Clear-Site-Data" is working in the browsers
+ $redirectUrl = $this->config->getSystemValue('logout_url',
+ $this->urlGenerator->linkToRouteAbsolute(
- ));
-
+ $redirectUrl = $this->urlGenerator->linkToRouteAbsolute(
+ 'core.login.showLoginForm',
+ ['clear' => true] // this param the code in login.js may be removed when the "Clear-Site-Data" is working in the browsers)
));
-
+ );
+ if (!is_null($isLdapUser)) {
+ $redirectUrl = $this->config->getSystemValue('logout_url', $redirectUrl);
+ }
+ $response = new RedirectResponse($redirectUrl);
$this->session->set('clearingExecutionContexts', '1');
$this->session->close();