Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change x to X, add --recursive, add a default acl for new elements #722

Open
wants to merge 78 commits into
base: testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
06a9c07
Update manifest.toml
ericgaspar Apr 23, 2024
e5d224a
Auto-update READMEs
yunohost-bot Apr 23, 2024
89f4373
Merge branch 'testing' into 29.0.0
ericgaspar Apr 25, 2024
ded5039
Merge branch 'testing' into 29.0.0
ericgaspar Apr 26, 2024
3503f0e
add pre upgrade warning for NC 29
OniriCorpe Apr 26, 2024
6d0c2ce
update to PHP8.3
ericgaspar May 22, 2024
2b1d579
Auto-update READMEs
yunohost-bot May 22, 2024
7c9f968
Merge pull request #684 from YunoHost-Apps/29.0.0
ericgaspar May 23, 2024
cc263ec
Update manifest.toml
ericgaspar May 23, 2024
0d05a77
Auto-update READMEs
yunohost-bot May 23, 2024
1b66d7f
Fix space splitting in phpflags on install (#690)
lyynd Jun 1, 2024
c3ec387
Merge branch 'master' into testing
ericgaspar Jun 1, 2024
f6a8dc8
Auto-update READMEs
yunohost-bot Jun 1, 2024
652d6de
Update upgrade
ericgaspar Jun 2, 2024
253357a
Update manifest.toml
ericgaspar Jun 6, 2024
cc45b8e
Auto-update READMEs
yunohost-bot Jun 6, 2024
38c2ecc
Fix phpflags (#691)
tituspijean Jun 8, 2024
1ab6c01
Fix upgrade: php version is 8.3 starting from 29.x ? (#692)
alexAubin Jun 20, 2024
ef6d230
Update manifest.toml
ericgaspar Jun 20, 2024
6aa7821
Auto-update READMEs
yunohost-bot Jun 20, 2024
6870be0
Update tests.toml
ericgaspar Jun 20, 2024
336bc29
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar Jun 20, 2024
25b828b
Merge branch 'master' into testing
ericgaspar Jun 20, 2024
89899fd
[autopatch] Do not delete logs on app removal (#697)
yunohost-bot Jun 23, 2024
2f0cfe5
[autopatch] Do not delete logs on app removal (#698)
yunohost-bot Jun 23, 2024
d848e73
29.0.3
ericgaspar Jun 25, 2024
e584e31
Auto-update READMEs
yunohost-bot Jun 25, 2024
26bfa59
Update remove
ericgaspar Jun 25, 2024
0a4b38f
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar Jun 25, 2024
88fbb73
Indent
alexAubin Jun 27, 2024
f7c21e4
Fix again upgrade ending with Nextcloud being in PHP 8.2 ?
alexAubin Jun 27, 2024
b96736a
Auto-update READMEs
yunohost-bot Jun 27, 2024
42ae252
Update nginx.conf
ericgaspar Jul 1, 2024
9fcb43a
Update manifest.toml
ericgaspar Jul 18, 2024
49e88d8
Auto-update READMEs
yunohost-bot Jul 18, 2024
70e9e72
Rework DESCRIPTION.md (#707)
alexAubin Jul 18, 2024
c0a58b2
bump all old versions
kay0u Jul 25, 2024
9d44878
oupsie
kay0u Jul 25, 2024
9bb5bee
Auto-update READMEs
yunohost-bot Jul 25, 2024
1cb2448
system_addressbook_exposed is a boolean
kay0u Jul 29, 2024
0c4ab48
Auto-update READMEs
yunohost-bot Jul 29, 2024
a3173b7
Merge pull request #703 from YunoHost-Apps/NGINX-upstream-setting
kay0u Jul 29, 2024
7f40b5a
migrate system_addressbook_exposed to boolean, fix upgrade test
kay0u Jul 29, 2024
4fa1f99
another fix for system_addressbook_exposed, update the dav conf accor…
kay0u Jul 29, 2024
ae91654
zblerg, do not modify system_addressbook_exposed config value in the …
kay0u Jul 29, 2024
4b9224f
add redis-server as deps
kay0u Jul 30, 2024
bc59bba
Merge pull request #710 from YunoHost-Apps/trying-to-fix-the-upgrade-…
kay0u Jul 30, 2024
12024a6
Merge branch 'master' into testing
ericgaspar Jul 30, 2024
e215d9c
find files before chown them
kay0u Jul 30, 2024
5dc5e8b
chown the root folder too
kay0u Jul 30, 2024
8d682cb
fix find condition
kay0u Jul 31, 2024
706d507
find ... chmod is not faster, at least avoid to chown -R the data_dir…
kay0u Jul 31, 2024
d240d55
add a button in the config panel to run chown/chmod on data_dir
kay0u Jul 31, 2024
30b2d81
we can avoid this chmod too i guess?
kay0u Jul 31, 2024
55b5c79
only nextcloud is allowed to read the config file
kay0u Jul 31, 2024
07f90a8
zblerg, the config file doesn't exist before install
kay0u Aug 1, 2024
5556fb6
wait until nginx has actually remove the nextcloud conf during upgrad…
kay0u Aug 1, 2024
d7f9b2c
create a function for that
kay0u Aug 1, 2024
49ec72b
fix change-url dav detection
kay0u Aug 1, 2024
73a3498
only if domain has changed...
kay0u Aug 1, 2024
fa5da4f
Update scripts/_common.sh
kay0u Aug 1, 2024
79c87b1
Merge pull request #712 from YunoHost-Apps/fix-dav-detection
kay0u Aug 1, 2024
4372e3d
Merge pull request #711 from YunoHost-Apps/speedup-chown
kay0u Aug 1, 2024
8a7f99d
moar sleep
kay0u Aug 1, 2024
5e498de
oups
kay0u Aug 1, 2024
e83c680
minor typos
ericgaspar Aug 3, 2024
a86e321
Update backup
ericgaspar Aug 3, 2024
31fd6a5
minor typos
ericgaspar Aug 3, 2024
bf5ef59
Merge branch 'master' into testing
ericgaspar Aug 8, 2024
1c8a1ba
Fix removing ACL permissions on uninstall
x3rAx Aug 13, 2024
aae9736
Fix: Add missing `file` argument to `setfacl`
x3rAx Aug 13, 2024
abfb04d
Fix: Use absolute path for removing ACL permissions
x3rAx Aug 13, 2024
79ef249
Update manifest.toml
ericgaspar Aug 20, 2024
2794d04
Auto-update READMEs
yunohost-bot Aug 20, 2024
d7d2403
Add notify push option (#417)
kay0u Aug 27, 2024
9da7de2
Merge pull request #717 from x3rAx/patch-1
kay0u Aug 27, 2024
8b3220e
change x to X, add --recursive, add a default acl for new elements
kay0u Aug 27, 2024
11a8872
Merge branch 'testing' into fix-acl
ericgaspar Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ALL_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
- [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md)
- [Baca README dalam bahasa bahasa Indonesia](README_id.md)
- [Прочитать README на русский](README_ru.md)
- [阅读中文(简体)的 README](README_zh_Hans.md)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In the context of YunoHost, Nextcloud integrates with the SSO / user portal (Yun
The `/.well-known` address will be automatically configured for CalDAV and CardDAV synchronization if no other service such as Baïkal is already using it.


**Shipped version:** 29.0.4~ynh1
**Shipped version:** 29.0.5~ynh1

**Demo:** <https://demo.nextcloud.com/>

Expand Down
2 changes: 1 addition & 1 deletion README_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In the context of YunoHost, Nextcloud integrates with the SSO / user portal (Yun
The `/.well-known` address will be automatically configured for CalDAV and CardDAV synchronization if no other service such as Baïkal is already using it.


**Versión actual:** 29.0.4~ynh1
**Versión actual:** 29.0.5~ynh1

**Demo:** <https://demo.nextcloud.com/>

Expand Down
2 changes: 1 addition & 1 deletion README_eu.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In the context of YunoHost, Nextcloud integrates with the SSO / user portal (Yun
The `/.well-known` address will be automatically configured for CalDAV and CardDAV synchronization if no other service such as Baïkal is already using it.


**Paketatutako bertsioa:** 29.0.4~ynh1
**Paketatutako bertsioa:** 29.0.5~ynh1

**Demoa:** <https://demo.nextcloud.com/>

Expand Down
2 changes: 1 addition & 1 deletion README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Dans le cadre de YunoHost, Nextcloud s'intègre avec le SSO / portail utilisateu
L'adresse `/.well-known` sera automatiquement configuré pour la synchronisation CalDAV et CardDAV si aucun autre service tel que Baïkal ne l'utilise déjà.


**Version incluse :** 29.0.4~ynh1
**Version incluse :** 29.0.5~ynh1

**Démo :** <https://demo.nextcloud.com/>

Expand Down
2 changes: 1 addition & 1 deletion README_gl.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In the context of YunoHost, Nextcloud integrates with the SSO / user portal (Yun
The `/.well-known` address will be automatically configured for CalDAV and CardDAV synchronization if no other service such as Baïkal is already using it.


**Versión proporcionada:** 29.0.4~ynh1
**Versión proporcionada:** 29.0.5~ynh1

**Demo:** <https://demo.nextcloud.com/>

Expand Down
2 changes: 1 addition & 1 deletion README_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In the context of YunoHost, Nextcloud integrates with the SSO / user portal (Yun
The `/.well-known` address will be automatically configured for CalDAV and CardDAV synchronization if no other service such as Baïkal is already using it.


**Versi terkirim:** 29.0.4~ynh1
**Versi terkirim:** 29.0.5~ynh1

**Demo:** <https://demo.nextcloud.com/>

Expand Down
55 changes: 55 additions & 0 deletions README_ru.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!--
Важно: этот README был автоматически сгенерирован <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Он НЕ ДОЛЖЕН редактироваться вручную.
-->

# Nextcloud для YunoHost

[![Уровень интеграции](https://dash.yunohost.org/integration/nextcloud.svg)](https://ci-apps.yunohost.org/ci/apps/nextcloud/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/nextcloud.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/nextcloud.maintain.svg)

[![Установите Nextcloud с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=nextcloud)

*[Прочтите этот README на других языках.](./ALL_README.md)*

> *Этот пакет позволяет Вам установить Nextcloud быстро и просто на YunoHost-сервер.*
> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.*

## Обзор

Nextcloud lets you access and synchronize data, files, contacts and calendars between different devices (PCs or mobiles), or share them with other people (with or without accounts), and also offers advanced communication and collaborative working features. Nextcloud features its own application mechanism (see also [Nextcloud's app store](https://apps.nextcloud.com/)) for specific functionalities.

In the context of YunoHost, Nextcloud integrates with the SSO / user portal (YunoHost accounts are automatically connected to Nextcloud).

The `/.well-known` address will be automatically configured for CalDAV and CardDAV synchronization if no other service such as Baïkal is already using it.


**Поставляемая версия:** 29.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>
- Сообщите об ошибке: <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>
2 changes: 1 addition & 1 deletion README_zh_Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In the context of YunoHost, Nextcloud integrates with the SSO / user portal (Yun
The `/.well-known` address will be automatically configured for CalDAV and CardDAV synchronization if no other service such as Baïkal is already using it.


**分发版本:** 29.0.4~ynh1
**分发版本:** 29.0.5~ynh1

**演示:** <https://demo.nextcloud.com/>

Expand Down
3 changes: 2 additions & 1 deletion conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"verify_peer": false,
"verify_peer_name": false
}
}
},
"trusted_proxies": [ "127.0.0.1", "::1" ]
},
"apps": {
"user_ldap": {
Expand Down
2 changes: 2 additions & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ location ^~ __PATH__/ {
try_files $uri / __PATH__/index.php$request_uri;
}

include conf.d/__DOMAIN__.d/__APP__.d/*.conf;

# show YunoHost panel access
include conf.d/yunohost_panel.conf.inc;
}
8 changes: 8 additions & 0 deletions conf/notify_push.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
location ^~ __PATH__/push/ {
proxy_pass http://unix:/var/run/__APP__/notify-push.sock:/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
13 changes: 13 additions & 0 deletions conf/systemd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description = Push daemon for Nextcloud clients

[Service]
Environment=SOCKET_PATH=/var/run/__APP__/notify-push.sock
Environment=ALLOW_SELF_SIGNED=true
ExecStart=__INSTALL_DIR__/apps/notify_push/bin/__ARCH__/notify_push __INSTALL_DIR__/config/config.php
Type=notify
User=__APP__
Group=__APP__

[Install]
WantedBy = multi-user.target
11 changes: 11 additions & 0 deletions conf/watcher.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Restart Push daemon for Nextcloud clients when it receives updates
Documentation=https://github.com/nextcloud/notify_push
PartOf=__APP__-notify-push-watcher.service

[Path]
PathModified=/var/www/nextcloud/apps/notify_push/bin/__ARCH__/notify_push
Unit=__APP__-notify-push-watcher.service

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions conf/watcher.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Restart Push daemon for Nextcloud clients when it receives updates
Documentation=https://github.com/nextcloud/notify_push
#Requires=__APP__-notify-push.service
After=__APP__-notify-push.service
StartLimitIntervalSec=10
StartLimitBurst=5

[Service]
Type=oneshot
ExecStartPre=/usr/bin/chmod u+x __INSTALL_DIR__/apps/notify_push/bin/__ARCH__/notify_push
ExecStart=/usr/bin/systemctl restart __APP__-notify-push.service

[Install]
WantedBy=multi-user.target
12 changes: 9 additions & 3 deletions config_panel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "Nextcloud configuration"
[main.maintenance.maintenance_mode]
ask = "Enable maintenance mode"
type = "boolean"
default = "0"
default = false

[main.maintenance.set_permissions_button]
ask.en = "Set permissions for all data (Can take up to several hours if users have a lot of data)"
Expand All @@ -22,8 +22,14 @@ name = "Nextcloud 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.notify_push]
name = "Notify Push configuration"

[main.notify_push.enable_notify_push]
ask.en = "Configure the High Performance Backend?"
ask.fr = "Configurer le Backend Hautes Performances ?"
type = "boolean"

[main.php_fpm_config]
name = "PHP-FPM configuration"
Expand Down
4 changes: 4 additions & 0 deletions doc/ADMIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Alternatively, you may open a 'Nextcloud shell' with `sudo yunohost app shell __

ONLYOFFICE is an online rich text document editor which can be integrated in Nextcloud

#### High Performance Backend

High Performance Backend is an application on Nextcloud that should speed up the instance, more information here: https://github.com/nextcloud/notify_push#about

#### With YunoHost App (ARM64 support, better performance)

For better performance and ARM64 support (Raspberry Pi, OLinuXino...), install the [OnlyOffice YunoHost app](https://apps.yunohost.org/app/onlyoffice) and connect it to Nextcloud, see the tutorial in the [doc of onlyoffice_ynh package](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)
Expand Down
4 changes: 4 additions & 0 deletions doc/ADMIN_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Ou bien, vous pouvez ouvrir un "shell Nextcloud" avec `sudo yunohost app shell _

ONLYOFFICE est un éditeur de texte enrichi en ligne qui peut s'intégrer dans Nextcloud

#### Backend Hautes Performances

Le backend Hautes Performances est une application sur Nextcloud qui devrait accélérer l'instance, plus d'informations ici : https://github.com/nextcloud/notify_push#about

#### Avec l'application YunoHost (support ARM64, meilleures performances)

Pour de meilleures performances et le support de ARM64 (Raspberry Pi, OLinuXino...), installez l'[app YunoHost OnlyOffice](https://apps.yunohost.org/app/onlyoffice), puis connectez-la à Nextcloud : voir le tutoriel dans la [doc du paquet onlyoffice_ynh](https://github.com/YunoHost-Apps/onlyoffice_ynh/blob/master/README_fr.md#configuration-de-onlyoffice-server)
Expand Down
2 changes: 1 addition & 1 deletion hooks/post_user_create
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
user="$1"
app="$(basename $0 | cut -d- -f 2-)" # Extract the app name from the script name, which is supposed to be something like "50-app_id"

setfacl --modify g:$app:rwx /home/$user
setfacl --recursive --modify g:$app:rwX,d:g:$app:rwX /home/$user
14 changes: 10 additions & 4 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "29.0.4~ynh2"
version = "29.0.5~ynh1"

maintainers = ["kay0u"]

Expand All @@ -19,7 +19,7 @@ code = "https://github.com/nextcloud/server"
cpe = "cpe:2.3:a:nextcloud:nextcloud"

[integration]
yunohost = ">= 11.2"
yunohost = ">= 11.2.27"
architectures = ["amd64", "arm64", "armhf"]
multi_instance = true

Expand Down Expand Up @@ -60,13 +60,19 @@ ram.runtime = "512M"
type = "boolean"
default = true

[install.enable_notify_push]
ask.en = "Configure the High Performance Backend?"
ask.fr = "Configurer le Backend Hautes Performances ?"
type = "boolean"
default = false

[resources]

[resources.sources]

[resources.sources.main]
url = 'https://download.nextcloud.com/server/releases/nextcloud-29.0.4.tar.bz2'
sha256 = '19c469e264b31ee80400f8396460854546569e88db4c15fc0854e192f96027eb'
url = 'https://download.nextcloud.com/server/releases/nextcloud-29.0.5.tar.bz2'
sha256 = 'c7fe9c61e5ec30a5e599e8f152a1825df684d30e899db0caa8868c8d67b53a2c'

[resources.sources.28]
url = 'https://download.nextcloud.com/server/releases/nextcloud-28.0.8.tar.bz2'
Expand Down
20 changes: 19 additions & 1 deletion scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ ynh_backup --src_path="$install_dir"
ynh_backup --src_path="$data_dir" --is_big

#=================================================
# SYSTEM CONFIGURATION
# BACKUP THE NGINX CONFIGURATION
#=================================================

ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d"

#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================

# Backup the PHP-FPM configuration
Expand Down Expand Up @@ -59,6 +66,17 @@ ynh_print_info --message="Backing up the MySQL database..."

ynh_mysql_dump_db --database="$db_name" --default_character_set="utf8mb4" > db.sql

#=================================================
# BACKUP THE NOTIFY_PUSH APP
#=================================================

if [ $enable_notify_push -eq 1 ]
then
ynh_backup --src_path="/etc/systemd/system/${app}-notify-push.service"
ynh_backup --src_path="/etc/systemd/system/${app}-notify-push-watcher.service"
ynh_backup --src_path="/etc/systemd/system/${app}-notify-push-watcher.path"
fi

#=================================================
# END OF SCRIPT
#=================================================
Expand Down
50 changes: 48 additions & 2 deletions scripts/change_url
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,62 @@ then

# Reload PHP-FPM, necessary for force Nextcloud to re-read config.php, cf opcache.revalidate_freq
ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload

mv /etc/nginx/conf.d/$old_domain.d/$app.d /etc/nginx/conf.d/$new_domain.d/$app.d
fi

#=================================================
# CONFIGURE NOTIFY_PUSH APP
#=================================================

if [ $enable_notify_push -eq 1 ]
then
domain="$new_domain"
path_url="$new_path"

ynh_add_config --template="notify_push.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.d/notify_push.conf"

ynh_systemd_action --service_name=nginx --action=reload

case $YNH_ARCH in
amd64) arch="x86_64";;
arm64) arch="aarch64";;
armel|armhf) arch="armv7";;
esac

ynh_add_config --template="watcher.path" --destination="/etc/systemd/system/${app}-notify-push-watcher.path"
ynh_add_systemd_config --service="${app}-notify-push-watcher" --template="watcher.service"
systemctl enable --now ${app}-notify-push-watcher.path
ynh_add_systemd_config --service="${app}-notify-push"

count=0
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
sleep 1
count=$((count + 1))
done

ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" --action=restart

exec_occ config:app:set notify_push base_endpoint --value https://$domain${path_url%/}/push

if ! exec_occ notify_push:self-test; then
ynh_print_warn --message="The High Performance Backend service is still not working properly. Please log in with a user to your NextCloud instance, restart the High Performance Backend service with \"systemctl restart ${app}-notify-push.service\", and run \"sudo -u $app php${phpversion} $install_dir/occ notify_push:self-test\" to verify that everything is green."
fi
fi

#=================================================
# SETUP SSOWAT
# GENERIC FINALISATION
#=================================================
ynh_script_progression --message="Configuring permissions..."
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."

# Temporary fix for the API permission (workaround for https://github.com/YunoHost/issues/issues/2294 )
ynh_permission_url --permission="api" --url="re:$new_domain\/.well-known\/.*" --auth_header="false" --clear_urls

ynh_systemd_action --service_name=nginx --action=reload

#=================================================
# END OF SCRIPT
#=================================================
Expand Down
Loading